Skip to content

Commit

Permalink
fix Gameloop.Vdf index out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
AigioL committed Feb 28, 2022
1 parent fba8dca commit c68ff50
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
<!--<PackageVersion Include="Nito.Disposables" Version="2.2.1" />-->

<!-- Valve Data File -->
<PackageVersion Include="Gameloop.Vdf" Version="0.6.1" />
<!--<PackageVersion Include="Gameloop.Vdf" Version="0.6.1" />-->

<!-- WebSocket -->
<PackageVersion Include="Fleck" Version="1.2.0" />
Expand Down
35 changes: 33 additions & 2 deletions SteamToolsV2+.sln
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Skia.Internals", "
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Bindings", "Bindings", "{80EBD601-28AC-4840-B9B8-E6064816A443}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ST.Client.Android.V2Ray", "src\ST.Client.Android.V2Ray\ST.Client.Android.V2Ray.csproj", "{4A79264D-5BF5-4F89-8066-44E154BF557F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ST.Client.Android.V2Ray", "src\ST.Client.Android.V2Ray\ST.Client.Android.V2Ray.csproj", "{4A79264D-5BF5-4F89-8066-44E154BF557F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gameloop.Vdf", "references\Gameloop.Vdf\Gameloop.Vdf\Gameloop.Vdf.csproj", "{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -1856,6 +1858,34 @@ Global
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|x64.Build.0 = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|x86.ActiveCfg = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|x86.Build.0 = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|ARM.ActiveCfg = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|ARM.Build.0 = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|ARM64.Build.0 = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|iPhone.Build.0 = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|x64.ActiveCfg = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|x64.Build.0 = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|x86.ActiveCfg = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Debug|x86.Build.0 = Debug|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|Any CPU.Build.0 = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|ARM.ActiveCfg = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|ARM.Build.0 = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|ARM64.ActiveCfg = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|ARM64.Build.0 = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|iPhone.ActiveCfg = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|iPhone.Build.0 = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|x64.ActiveCfg = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|x64.Build.0 = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|x86.ActiveCfg = Release|Any CPU
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1922,9 +1952,10 @@ Global
{47C151DA-D2B1-43F4-A04E-B454E2134852} = {910D6A0F-42AB-4B65-B532-852E864EC006}
{80EBD601-28AC-4840-B9B8-E6064816A443} = {327FDEE7-C4C8-4AA4-A7B0-8BCE3D75346F}
{4A79264D-5BF5-4F89-8066-44E154BF557F} = {80EBD601-28AC-4840-B9B8-E6064816A443}
{DFC341E8-5290-428C-8D2B-6DE2AA163FFE} = {673FF8CD-9E85-4FA1-ABFC-D1149675E138}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9313F2B4-10DA-43AA-A481-CAA7571C740C}
RESX_NeutralResourcesLanguage = zh-Hans
SolutionGuid = {9313F2B4-10DA-43AA-A481-CAA7571C740C}
EndGlobalSection
EndGlobal
3 changes: 2 additions & 1 deletion src/ST.Client.Desktop.Linux/ST.Client.Linux.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<ItemGroup>
<PackageReference Include="DnsClient" />
<PackageReference Include="Gameloop.Vdf" />
<!--<PackageReference Include="Gameloop.Vdf" />-->
</ItemGroup>

<ItemGroup>
Expand All @@ -49,6 +49,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\references\Gameloop.Vdf\Gameloop.Vdf\Gameloop.Vdf.csproj" />
<ProjectReference Include="..\ST.Client\ST.Client.csproj" />
</ItemGroup>

Expand Down
3 changes: 2 additions & 1 deletion src/ST.Client.Desktop.Mac/ST.Client.Mac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<ItemGroup>
<PackageReference Include="DnsClient" />
<PackageReference Include="Gameloop.Vdf" />
<!--<PackageReference Include="Gameloop.Vdf" />-->
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.Mac20')) OR $(TargetFramework.Contains('-mac')) ">
Expand All @@ -69,6 +69,7 @@
<EmbeddedResource Include="..\..\appcenter-secret-mac-release.pfx" Link="Resources\93850BFE" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\references\Gameloop.Vdf\Gameloop.Vdf\Gameloop.Vdf.csproj" />
<ProjectReference Include="..\ST.Client\ST.Client.csproj" />
</ItemGroup>
</Project>
3 changes: 2 additions & 1 deletion src/ST.Client.Desktop.Windows/ST.Client.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<ItemGroup>
<PackageReference Include="DnsClient" />
<PackageReference Include="Gameloop.Vdf" />
<!--<PackageReference Include="Gameloop.Vdf" />-->
<PackageReference Include="Aigio.Avalonia.AppCenter" />
<PackageReference Include="Aigio.Avalonia.AppCenter.Analytics" />
<PackageReference Include="Aigio.Avalonia.AppCenter.Crashes" />
Expand All @@ -63,6 +63,7 @@

<ItemGroup>
<!--<ProjectReference Include="..\..\references\Steam4NET\Steam4NET\Steam4NET.csproj" />-->
<ProjectReference Include="..\..\references\Gameloop.Vdf\Gameloop.Vdf\Gameloop.Vdf.csproj" />
<ProjectReference Include="..\..\references\SteamAchievementManager\SAM.API\SAM.API.csproj" />
<ProjectReference Include="..\ST.Client\ST.Client.csproj" />
</ItemGroup>
Expand Down
32 changes: 31 additions & 1 deletion src/ST.Tools.AndroidResourceLink/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
using System.Linq;
using System.Text;

var s = new CharBuffer();

s[2] = 'd';


const string Mark = "<!--ST.Tools.AndroidResourceLink-->";
var resPath = ProjectPathUtil.projPath + Path.DirectorySeparatorChar + "src" + Path.DirectorySeparatorChar + string.Join(Path.DirectorySeparatorChar, new[] { "ST.Client.Mobile.Droid.Design", "ui", "src", "main", "res" });
var androidProjPath = ProjectPathUtil.projPath + Path.DirectorySeparatorChar + "src" + Path.DirectorySeparatorChar + "ST.Client.Android";
Expand Down Expand Up @@ -41,4 +46,29 @@
csprojContent = sb.ToString().Trim();
File.WriteAllText(androidProjFilePath, csprojContent);

Console.WriteLine("OK");
Console.WriteLine("OK");

internal sealed class CharBuffer
{
readonly StringBuilder thiz;

public CharBuffer() => thiz = new StringBuilder();

public char this[int index]
{
get => thiz[index];
set
{
var t = index - thiz.Length;
for (int i = 0; i <= t; i++)
{
thiz.Append((char)default);
}
thiz[index] = value;
}
}

public string ToString(int startIndex, int length) => thiz.ToString(startIndex, length);

public override string ToString() => thiz.ToString();
}

0 comments on commit c68ff50

Please sign in to comment.