Skip to content

Commit

Permalink
Move webui protos to SteamKit2.WebUI.Internal
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Mar 19, 2024
1 parent 59f8dc5 commit 3b526e8
Show file tree
Hide file tree
Showing 11 changed files with 786 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public static MethodInfo FindMethodInfo(string serviceMethodName)
{
("SteamKit2", "SteamKit2.Internal"),
("SteamKit2", "SteamKit2.Internal.Steamworks"),
("SteamKit2", "SteamKit2.WebUI.Internal"),
("NetHookAnalyzer2", "NetHookAnalyzer2.Protobufs"),
};

Expand Down
12 changes: 12 additions & 0 deletions Resources/ProtobufGen/ProtobufGen/SteamKitCSharpCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,17 @@ protected override void WriteServiceMethod( GeneratorContext ctx, MethodDescript

ctx.WriteLine( $"{Escape( outputType )} {Escape( method.Name )}({Escape( inputType )} request);" );
}

protected override void WriteNamespaceHeader( GeneratorContext ctx, string @namespace )
{
// WebUI may use common things like CMsgIPAddress and NoResponse, assume they exist in normal Steam protos
// instead of generating full common webui protos
if ( @namespace == "SteamKit2.WebUI.Internal" )
{
ctx.WriteLine( "using SteamKit2.Internal;" );
}

base.WriteNamespaceHeader( ctx, @namespace );
}
}
}
13 changes: 8 additions & 5 deletions Resources/ProtobufGen/protos.csv
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,13 @@ underlords,gcsystemmsgs.proto,GC\Underlords\SteamMsgGCSystem.cs,SteamKit2.GC.Und
underlords,network_connection.proto,GC\Underlords\NetworkConnection.cs,SteamKit2.GC.Underlords.Internal
underlords,networkbasetypes.proto,GC\Underlords\NetworkBaseTypes.cs,SteamKit2.GC.Underlords.Internal
underlords,usermessages.proto,GC\Underlords\UserMessages.cs,SteamKit2.GC.Underlords.Internal
webui,service_accountprivateapps.proto,WebUI\SteamMsgAccountPrivateApps.cs,SteamKit2.WebUI.Internal
webui,service_cloudconfigstore.proto,WebUI\SteamMsgCloudConfigStore.cs,SteamKit2.WebUI.Internal
webui,service_community.proto,WebUI\SteamMsgCommunity.cs,SteamKit2.WebUI.Internal
webui,service_friendslist.proto,WebUI\SteamMsgFriendsList.cs,SteamKit2.WebUI.Internal
webui,service_usergameactivity.proto,WebUI\SteamMsgUserGameActivity.cs,SteamKit2.WebUI.Internal
webui,service_usergamenotes.proto,WebUI\SteamMsgUserGameNotes.cs,SteamKit2.WebUI.Internal
webui,service_usernews.proto,WebUI\SteamMsgUserNews.cs,SteamKit2.WebUI.Internal
webui,service_userreviews.proto,WebUI\SteamMsgUserReviews.cs,SteamKit2.WebUI.Internal
webui,common_base.proto,..\..\..\..\Resources\NetHookAnalyzer2\NetHookAnalyzer2\Generated\SteamMsgCommonBase.cs,NetHookAnalyzer2.Protobufs
webui,common.proto,..\..\..\..\Resources\NetHookAnalyzer2\NetHookAnalyzer2\Generated\SteamMsgCommon.cs,NetHookAnalyzer2.Protobufs
webui,service_community.proto,..\..\..\..\Resources\NetHookAnalyzer2\NetHookAnalyzer2\Generated\SteamMsgCommunity.cs,NetHookAnalyzer2.Protobufs
webui,service_friendslist.proto,..\..\..\..\Resources\NetHookAnalyzer2\NetHookAnalyzer2\Generated\SteamMsgFriendsList.cs,NetHookAnalyzer2.Protobufs
webui,service_usergameactivity.proto,..\..\..\..\Resources\NetHookAnalyzer2\NetHookAnalyzer2\Generated\SteamMsgUserGameActivity.cs,NetHookAnalyzer2.Protobufs
webui,service_usernews.proto,..\..\..\..\Resources\NetHookAnalyzer2\NetHookAnalyzer2\Generated\SteamMsgUserNews.cs,NetHookAnalyzer2.Protobufs
webui,service_userreviews.proto,..\..\..\..\Resources\NetHookAnalyzer2\NetHookAnalyzer2\Generated\SteamMsgUserReviews.cs,NetHookAnalyzer2.Protobufs
103 changes: 103 additions & 0 deletions SteamKit2/SteamKit2/Base/Generated/WebUI/SteamMsgAccountPrivateApps.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
// <auto-generated>
// This file was generated by a tool; you should avoid making direct changes.
// Consider using 'partial classes' to extend these types
// Input: service_accountprivateapps.proto
// </auto-generated>

#region Designer generated code
#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
using SteamKit2.Internal;
namespace SteamKit2.WebUI.Internal
{

[global::ProtoBuf.ProtoContract()]
public partial class CAccountPrivateAppList : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

[global::ProtoBuf.ProtoMember(1)]
public global::System.Collections.Generic.List<int> appids { get; } = new global::System.Collections.Generic.List<int>();

}

[global::ProtoBuf.ProtoContract()]
public partial class CAccountPrivateApps_GetPrivateAppList_Request : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

}

[global::ProtoBuf.ProtoContract()]
public partial class CAccountPrivateApps_GetPrivateAppList_Response : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

[global::ProtoBuf.ProtoMember(1)]
public CAccountPrivateAppList private_apps { get; set; }

}

[global::ProtoBuf.ProtoContract()]
public partial class CAccountPrivateApps_ToggleAppPrivacy_Request : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

[global::ProtoBuf.ProtoMember(1)]
public global::System.Collections.Generic.List<int> appids { get; } = new global::System.Collections.Generic.List<int>();

[global::ProtoBuf.ProtoMember(2)]
public bool @private
{
get => __pbn__private.GetValueOrDefault();
set => __pbn__private = value;
}
public bool ShouldSerializeprivate() => __pbn__private != null;
public void Resetprivate() => __pbn__private = null;
private bool? __pbn__private;

}

[global::ProtoBuf.ProtoContract()]
public partial class CAccountPrivateApps_ToggleAppPrivacy_Response : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

}

[global::ProtoBuf.ProtoContract()]
public partial class CAccountPrivateApsClient_NotifyPrivateAppListChanged_Notification : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

[global::ProtoBuf.ProtoMember(1)]
public CAccountPrivateAppList private_apps { get; set; }

}

public interface IAccountPrivateApps
{
CAccountPrivateApps_GetPrivateAppList_Response GetPrivateAppList(CAccountPrivateApps_GetPrivateAppList_Request request);
CAccountPrivateApps_ToggleAppPrivacy_Response ToggleAppPrivacy(CAccountPrivateApps_ToggleAppPrivacy_Request request);
}

public interface IAccountPrivateAppsClient
{
NoResponse NotifyPrivateAppListChanged(CAccountPrivateApsClient_NotifyPrivateAppListChanged_Notification request);
}

}

#pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
#endregion
219 changes: 219 additions & 0 deletions SteamKit2/SteamKit2/Base/Generated/WebUI/SteamMsgCloudConfigStore.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
// <auto-generated>
// This file was generated by a tool; you should avoid making direct changes.
// Consider using 'partial classes' to extend these types
// Input: service_cloudconfigstore.proto
// </auto-generated>

#region Designer generated code
#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
using SteamKit2.Internal;
namespace SteamKit2.WebUI.Internal
{

[global::ProtoBuf.ProtoContract()]
public partial class CCloudConfigStore_Change_Notification : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

[global::ProtoBuf.ProtoMember(2)]
public global::System.Collections.Generic.List<CCloudConfigStore_NamespaceVersion> versions { get; } = new global::System.Collections.Generic.List<CCloudConfigStore_NamespaceVersion>();

}

[global::ProtoBuf.ProtoContract()]
public partial class CCloudConfigStore_Download_Request : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

[global::ProtoBuf.ProtoMember(1)]
public global::System.Collections.Generic.List<CCloudConfigStore_NamespaceVersion> versions { get; } = new global::System.Collections.Generic.List<CCloudConfigStore_NamespaceVersion>();

}

[global::ProtoBuf.ProtoContract()]
public partial class CCloudConfigStore_Download_Response : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

[global::ProtoBuf.ProtoMember(1)]
public global::System.Collections.Generic.List<CCloudConfigStore_NamespaceData> data { get; } = new global::System.Collections.Generic.List<CCloudConfigStore_NamespaceData>();

}

[global::ProtoBuf.ProtoContract()]
public partial class CCloudConfigStore_Entry : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

[global::ProtoBuf.ProtoMember(1)]
[global::System.ComponentModel.DefaultValue("")]
public string key
{
get => __pbn__key ?? "";
set => __pbn__key = value;
}
public bool ShouldSerializekey() => __pbn__key != null;
public void Resetkey() => __pbn__key = null;
private string __pbn__key;

[global::ProtoBuf.ProtoMember(2)]
public bool is_deleted
{
get => __pbn__is_deleted.GetValueOrDefault();
set => __pbn__is_deleted = value;
}
public bool ShouldSerializeis_deleted() => __pbn__is_deleted != null;
public void Resetis_deleted() => __pbn__is_deleted = null;
private bool? __pbn__is_deleted;

[global::ProtoBuf.ProtoMember(3)]
[global::System.ComponentModel.DefaultValue("")]
public string value
{
get => __pbn__value ?? "";
set => __pbn__value = value;
}
public bool ShouldSerializevalue() => __pbn__value != null;
public void Resetvalue() => __pbn__value = null;
private string __pbn__value;

[global::ProtoBuf.ProtoMember(4, DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
public uint timestamp
{
get => __pbn__timestamp.GetValueOrDefault();
set => __pbn__timestamp = value;
}
public bool ShouldSerializetimestamp() => __pbn__timestamp != null;
public void Resettimestamp() => __pbn__timestamp = null;
private uint? __pbn__timestamp;

[global::ProtoBuf.ProtoMember(5)]
public ulong version
{
get => __pbn__version.GetValueOrDefault();
set => __pbn__version = value;
}
public bool ShouldSerializeversion() => __pbn__version != null;
public void Resetversion() => __pbn__version = null;
private ulong? __pbn__version;

}

[global::ProtoBuf.ProtoContract()]
public partial class CCloudConfigStore_NamespaceData : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

[global::ProtoBuf.ProtoMember(1)]
public uint enamespace
{
get => __pbn__enamespace.GetValueOrDefault();
set => __pbn__enamespace = value;
}
public bool ShouldSerializeenamespace() => __pbn__enamespace != null;
public void Resetenamespace() => __pbn__enamespace = null;
private uint? __pbn__enamespace;

[global::ProtoBuf.ProtoMember(2)]
public ulong version
{
get => __pbn__version.GetValueOrDefault();
set => __pbn__version = value;
}
public bool ShouldSerializeversion() => __pbn__version != null;
public void Resetversion() => __pbn__version = null;
private ulong? __pbn__version;

[global::ProtoBuf.ProtoMember(3)]
public global::System.Collections.Generic.List<CCloudConfigStore_Entry> entries { get; } = new global::System.Collections.Generic.List<CCloudConfigStore_Entry>();

[global::ProtoBuf.ProtoMember(4)]
public ulong horizon
{
get => __pbn__horizon.GetValueOrDefault();
set => __pbn__horizon = value;
}
public bool ShouldSerializehorizon() => __pbn__horizon != null;
public void Resethorizon() => __pbn__horizon = null;
private ulong? __pbn__horizon;

}

[global::ProtoBuf.ProtoContract()]
public partial class CCloudConfigStore_NamespaceVersion : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

[global::ProtoBuf.ProtoMember(1)]
public uint enamespace
{
get => __pbn__enamespace.GetValueOrDefault();
set => __pbn__enamespace = value;
}
public bool ShouldSerializeenamespace() => __pbn__enamespace != null;
public void Resetenamespace() => __pbn__enamespace = null;
private uint? __pbn__enamespace;

[global::ProtoBuf.ProtoMember(2)]
public ulong version
{
get => __pbn__version.GetValueOrDefault();
set => __pbn__version = value;
}
public bool ShouldSerializeversion() => __pbn__version != null;
public void Resetversion() => __pbn__version = null;
private ulong? __pbn__version;

}

[global::ProtoBuf.ProtoContract()]
public partial class CCloudConfigStore_Upload_Request : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

[global::ProtoBuf.ProtoMember(1)]
public global::System.Collections.Generic.List<CCloudConfigStore_NamespaceData> data { get; } = new global::System.Collections.Generic.List<CCloudConfigStore_NamespaceData>();

}

[global::ProtoBuf.ProtoContract()]
public partial class CCloudConfigStore_Upload_Response : global::ProtoBuf.IExtensible
{
private global::ProtoBuf.IExtension __pbn__extensionData;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
=> global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);

[global::ProtoBuf.ProtoMember(1)]
public global::System.Collections.Generic.List<CCloudConfigStore_NamespaceVersion> versions { get; } = new global::System.Collections.Generic.List<CCloudConfigStore_NamespaceVersion>();

}

public interface ICloudConfigStore
{
CCloudConfigStore_Download_Response Download(CCloudConfigStore_Download_Request request);
CCloudConfigStore_Upload_Response Upload(CCloudConfigStore_Upload_Request request);
}

public interface ICloudConfigStoreClient
{
NoResponse NotifyChange(CCloudConfigStore_Change_Notification request);
}

}

#pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
#endregion
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

#region Designer generated code
#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
namespace NetHookAnalyzer2.Protobufs
using SteamKit2.Internal;
namespace SteamKit2.WebUI.Internal
{

[global::ProtoBuf.ProtoContract()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

#region Designer generated code
#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
namespace NetHookAnalyzer2.Protobufs
using SteamKit2.Internal;
namespace SteamKit2.WebUI.Internal
{

[global::ProtoBuf.ProtoContract()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

#region Designer generated code
#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
namespace NetHookAnalyzer2.Protobufs
using SteamKit2.Internal;
namespace SteamKit2.WebUI.Internal
{

[global::ProtoBuf.ProtoContract()]
Expand Down
Loading

0 comments on commit 3b526e8

Please sign in to comment.