This commit is contained in:
Garry Newman 2021-09-24 13:55:08 +01:00
commit 821975435c
33 changed files with 187 additions and 414 deletions

View File

@ -6,12 +6,14 @@ jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1
- name: Setup dotnet 6.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
include-prerelease: true
- name: Restore Win64
run: dotnet restore Facepunch.Steamworks\Facepunch.Steamworks.Win64.csproj
@ -21,13 +23,13 @@ jobs:
run: dotnet restore Facepunch.Steamworks\Facepunch.Steamworks.Posix.csproj
- name: Build Win64
run: msbuild Facepunch.Steamworks\Facepunch.Steamworks.Win64.csproj
run: dotnet build Facepunch.Steamworks\Facepunch.Steamworks.Win64.csproj
- name: Build Win32
run: msbuild Facepunch.Steamworks\Facepunch.Steamworks.Win32.csproj
run: dotnet build Facepunch.Steamworks\Facepunch.Steamworks.Win32.csproj
- name: Build Posix
run: msbuild Facepunch.Steamworks\Facepunch.Steamworks.Posix.csproj
run: dotnet build Facepunch.Steamworks\Facepunch.Steamworks.Posix.csproj
- uses: actions/upload-artifact@v1
with:
name: Compiled Files
path: Facepunch.Steamworks/bin
path: Facepunch.Steamworks/bin

View File

@ -1,156 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3F6183AD-D966-44F2-A6EB-42E61E591B49}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Facepunch.Steamworks.TestWin32</RootNamespace>
<AssemblyName>Facepunch.Steamworks.TestWin32</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;TEST_WIN32</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;TEST_WIN32</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.2.0.0-beta4\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.2.0.0-beta4\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.2-beta1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="FriendsTest.cs" />
<Compile Include="GameServerStatsTest.cs" />
<Compile Include="InputTest.cs" />
<Compile Include="NetworkingSockets.cs" />
<Compile Include="NetworkingSocketsTest.TestConnectionInterface.cs" />
<Compile Include="NetworkingSocketsTest.TestSocketInterface.cs" />
<Compile Include="SteamMatchmakingTest.cs" />
<Compile Include="RemoteStorageTest.cs" />
<Compile Include="InventoryTest.cs" />
<Compile Include="SteamNetworkingTest.cs" />
<Compile Include="UgcTest.cs" />
<Compile Include="UgcEditor.cs" />
<Compile Include="RemotePlayTest.cs" />
<Compile Include="UserTest.cs" />
<Compile Include="UserStatsTest.cs" />
<Compile Include="UgcQuery.cs" />
<Compile Include="NetworkingUtils.cs" />
<Compile Include="UtilsTest.cs" />
<Compile Include="AppTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="GameServerTest.cs" />
<Compile Include="Client\Server\StatsTest.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="ServerlistTest.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Facepunch.Steamworks\Facepunch.Steamworks.Win32.csproj">
<Project>{2d6247f6-8ab2-405f-a00e-3a364b808a55}</Project>
<Name>Facepunch.Steamworks.Win32</Name>
</ProjectReference>
<ProjectReference Include="..\Facepunch.Steamworks\Facepunch.Steamworks.Win32.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="steam_api.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.targets'))" />
</Target>
<Import Project="..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.*" />
<PackageReference Include="MSTest.TestAdapter" Version="2.0.0-beta4" />
<PackageReference Include="MSTest.TestFramework" Version="2.0.0-beta4" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.2-beta1" />
</ItemGroup>
<ItemGroup>
<Compile Remove="ClanTest.cs" />
</ItemGroup>
</Project>

View File

@ -1,156 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{165081E3-BD96-404B-B83E-A635F1AF7CDE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Facepunch.Steamworks.TestWin64</RootNamespace>
<AssemblyName>Facepunch.Steamworks.TestWin64</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;TEST_WIN64</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.2.0.0-beta4\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.2.0.0-beta4\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.2-beta1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="FriendsTest.cs" />
<Compile Include="InputTest.cs" />
<Compile Include="NetworkingSockets.cs" />
<Compile Include="NetworkingSocketsTest.TestConnectionInterface.cs" />
<Compile Include="NetworkingSocketsTest.TestSocketInterface.cs" />
<Compile Include="RemotePlayTest.cs" />
<Compile Include="SteamMatchmakingTest.cs" />
<Compile Include="RemoteStorageTest.cs" />
<Compile Include="InventoryTest.cs" />
<Compile Include="SteamNetworkingTest.cs" />
<Compile Include="UgcTest.cs" />
<Compile Include="UgcEditor.cs" />
<Compile Include="GameServerStatsTest.cs" />
<Compile Include="UserTest.cs" />
<Compile Include="UserStatsTest.cs" />
<Compile Include="UgcQuery.cs" />
<Compile Include="NetworkingUtils.cs" />
<Compile Include="UtilsTest.cs" />
<Compile Include="AppTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="GameServerTest.cs" />
<Compile Include="Client\Server\StatsTest.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="ServerlistTest.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Facepunch.Steamworks\Facepunch.Steamworks.Win64.csproj">
<Project>{8c73da93-73ad-4445-9a2c-15d4a44337d3}</Project>
<Name>Facepunch.Steamworks.Win64</Name>
</ProjectReference>
<ProjectReference Include="..\Facepunch.Steamworks\Facepunch.Steamworks.Win64.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="steam_api64.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.targets'))" />
</Target>
<Import Project="..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.0.0-beta4\build\net45\MSTest.TestAdapter.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.*" />
<PackageReference Include="MSTest.TestAdapter" Version="2.0.0-beta4" />
<PackageReference Include="MSTest.TestFramework" Version="2.0.0-beta4" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.2-beta1" />
</ItemGroup>
<ItemGroup>
<Compile Remove="ClanTest.cs" />
</ItemGroup>
</Project>

View File

@ -3,9 +3,9 @@
<PropertyGroup>
<AssemblyName>Facepunch.Steamworks.Posix</AssemblyName>
<DefineConstants>$(DefineConstants);PLATFORM_POSIX</DefineConstants>
<TargetFrameworks>netstandard2.0;net46</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net6.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>7.1</LangVersion>
<LangVersion>10</LangVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RootNamespace>Steamworks</RootNamespace>

View File

@ -3,9 +3,8 @@
<PropertyGroup>
<AssemblyName>Facepunch.Steamworks.Win32</AssemblyName>
<DefineConstants>$(DefineConstants);PLATFORM_WIN32;PLATFORM_WIN</DefineConstants>
<TargetFrameworks>netstandard2.0;net46</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>7.1</LangVersion>
<TargetFrameworks>netstandard2.1;net6.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<RootNamespace>Steamworks</RootNamespace>
@ -19,19 +18,25 @@
<PackageProjectUrl>https://github.com/Facepunch/Facepunch.Steamworks</PackageProjectUrl>
<PackageIcon>Facepunch.Steamworks.jpg</PackageIcon>
<PackageTags>facepunch;steam;unity;steamworks;valve</PackageTags>
<LangVersion>latest</LangVersion>
<LangVersion>10</LangVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/Facepunch/Facepunch.Steamworks.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<Content Update="steam_api.dll" PackagePath="\content\" Pack="true" PackageCopyToOutput="true">
<None Include="Facepunch.Steamworks.jpg">
<Pack>true</Pack>
<PackagePath>/</PackagePath>
</None>
<None Include="steam_api.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="Facepunch.Steamworks.jpg" Pack="true" PackagePath="\" />
<Pack>true</Pack>
<PackagePath>content</PackagePath>
</None>
</ItemGroup>
<Import Project="Facepunch.Steamworks.targets" />
</Project>
</Project>

View File

@ -3,9 +3,8 @@
<PropertyGroup>
<AssemblyName>Facepunch.Steamworks.Win64</AssemblyName>
<DefineConstants>$(DefineConstants);PLATFORM_WIN64;PLATFORM_WIN;PLATFORM_64</DefineConstants>
<TargetFrameworks>netstandard2.0;net46</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>7.1</LangVersion>
<TargetFrameworks>netstandard2.1;net6.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<RootNamespace>Steamworks</RootNamespace>
@ -19,23 +18,23 @@
<PackageProjectUrl>https://github.com/Facepunch/Facepunch.Steamworks</PackageProjectUrl>
<PackageIcon>Facepunch.Steamworks.jpg</PackageIcon>
<PackageTags>facepunch;steam;unity;steamworks;valve</PackageTags>
<LangVersion>latest</LangVersion>
<LangVersion>10</LangVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/Facepunch/Facepunch.Steamworks.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<Content Include="steam_api64.dll" PackagePath="\content\" Pack="true" PackageCopyToOutput="true">
<CopyToOutputDirectory></CopyToOutputDirectory>
</Content>
<None Include="Facepunch.Steamworks.jpg" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<None Update="steam_api.dll">
<CopyToOutputDirectory></CopyToOutputDirectory>
</None>
<None Include="Facepunch.Steamworks.jpg">
<Pack>true</Pack>
<PackagePath>/</PackagePath>
</None>
<None Include="steam_api64.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Pack>true</Pack>
<PackagePath>content</PackagePath>
</None>
</ItemGroup>
<Import Project="Facepunch.Steamworks.targets" />

View File

@ -49,7 +49,7 @@ namespace Steamworks
#endregion
internal int GetAppName( AppId nAppID, out string pchName )
{
IntPtr mempchName = Helpers.TakeMemory();
using var mempchName = Helpers.TakeMemory();
var returnValue = _GetAppName( Self, nAppID, mempchName, (1024 * 32) );
pchName = Helpers.MemoryToString( mempchName );
return returnValue;
@ -62,7 +62,7 @@ namespace Steamworks
#endregion
internal int GetAppInstallDir( AppId nAppID, out string pchDirectory )
{
IntPtr mempchDirectory = Helpers.TakeMemory();
using var mempchDirectory = Helpers.TakeMemory();
var returnValue = _GetAppInstallDir( Self, nAppID, mempchDirectory, (1024 * 32) );
pchDirectory = Helpers.MemoryToString( mempchDirectory );
return returnValue;

View File

@ -159,7 +159,7 @@ namespace Steamworks
#endregion
internal bool BGetDLCDataByIndex( int iDLC, ref AppId pAppID, [MarshalAs( UnmanagedType.U1 )] ref bool pbAvailable, out string pchName )
{
IntPtr mempchName = Helpers.TakeMemory();
using var mempchName = Helpers.TakeMemory();
var returnValue = _BGetDLCDataByIndex( Self, iDLC, ref pAppID, ref pbAvailable, mempchName, (1024 * 32) );
pchName = Helpers.MemoryToString( mempchName );
return returnValue;
@ -203,7 +203,7 @@ namespace Steamworks
#endregion
internal bool GetCurrentBetaName( out string pchName )
{
IntPtr mempchName = Helpers.TakeMemory();
using var mempchName = Helpers.TakeMemory();
var returnValue = _GetCurrentBetaName( Self, mempchName, (1024 * 32) );
pchName = Helpers.MemoryToString( mempchName );
return returnValue;
@ -239,7 +239,7 @@ namespace Steamworks
#endregion
internal uint GetAppInstallDir( AppId appID, out string pchFolder )
{
IntPtr mempchFolder = Helpers.TakeMemory();
using var mempchFolder = Helpers.TakeMemory();
var returnValue = _GetAppInstallDir( Self, appID, mempchFolder, (1024 * 32) );
pchFolder = Helpers.MemoryToString( mempchFolder );
return returnValue;
@ -330,7 +330,7 @@ namespace Steamworks
#endregion
internal int GetLaunchCommandLine( out string pszCommandLine )
{
IntPtr mempszCommandLine = Helpers.TakeMemory();
using var mempszCommandLine = Helpers.TakeMemory();
var returnValue = _GetLaunchCommandLine( Self, mempszCommandLine, (1024 * 32) );
pszCommandLine = Helpers.MemoryToString( mempszCommandLine );
return returnValue;

View File

@ -82,7 +82,7 @@ namespace Steamworks
#endregion
internal GameSearchErrorCode_t RetrieveConnectionDetails( SteamId steamIDHost, out string pchConnectionDetails )
{
IntPtr mempchConnectionDetails = Helpers.TakeMemory();
using var mempchConnectionDetails = Helpers.TakeMemory();
var returnValue = _RetrieveConnectionDetails( Self, steamIDHost, mempchConnectionDetails, (1024 * 32) );
pchConnectionDetails = Helpers.MemoryToString( mempchConnectionDetails );
return returnValue;

View File

@ -60,7 +60,7 @@ namespace Steamworks
#endregion
internal bool GetResultItemProperty( SteamInventoryResult_t resultHandle, uint unItemIndex, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut )
{
IntPtr mempchValueBuffer = Helpers.TakeMemory();
using var mempchValueBuffer = Helpers.TakeMemory();
var returnValue = _GetResultItemProperty( Self, resultHandle, unItemIndex, pchPropertyName, mempchValueBuffer, ref punValueBufferSizeOut );
pchValueBuffer = Helpers.MemoryToString( mempchValueBuffer );
return returnValue;
@ -327,7 +327,7 @@ namespace Steamworks
#endregion
internal bool GetItemDefinitionProperty( InventoryDefId iDefinition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut )
{
IntPtr mempchValueBuffer = Helpers.TakeMemory();
using var mempchValueBuffer = Helpers.TakeMemory();
var returnValue = _GetItemDefinitionProperty( Self, iDefinition, pchPropertyName, mempchValueBuffer, ref punValueBufferSizeOut );
pchValueBuffer = Helpers.MemoryToString( mempchValueBuffer );
return returnValue;

View File

@ -266,8 +266,8 @@ namespace Steamworks
#endregion
internal bool GetLobbyDataByIndex( SteamId steamIDLobby, int iLobbyData, out string pchKey, out string pchValue )
{
IntPtr mempchKey = Helpers.TakeMemory();
IntPtr mempchValue = Helpers.TakeMemory();
using var mempchKey = Helpers.TakeMemory();
using var mempchValue = Helpers.TakeMemory();
var returnValue = _GetLobbyDataByIndex( Self, steamIDLobby, iLobbyData, mempchKey, (1024 * 32), mempchValue, (1024 * 32) );
pchKey = Helpers.MemoryToString( mempchKey );
pchValue = Helpers.MemoryToString( mempchValue );

View File

@ -143,7 +143,7 @@ namespace Steamworks
#endregion
internal bool GetConnectionName( Connection hPeer, out string pszName )
{
IntPtr mempszName = Helpers.TakeMemory();
using var mempszName = Helpers.TakeMemory();
var returnValue = _GetConnectionName( Self, hPeer, mempszName, (1024 * 32) );
pszName = Helpers.MemoryToString( mempszName );
return returnValue;
@ -223,7 +223,7 @@ namespace Steamworks
#endregion
internal int GetDetailedConnectionStatus( Connection hConn, out string pszBuf )
{
IntPtr mempszBuf = Helpers.TakeMemory();
using var mempszBuf = Helpers.TakeMemory();
var returnValue = _GetDetailedConnectionStatus( Self, hConn, mempszBuf, (1024 * 32) );
pszBuf = Helpers.MemoryToString( mempszBuf );
return returnValue;

View File

@ -92,7 +92,7 @@ namespace Steamworks
#endregion
internal void ConvertPingLocationToString( ref NetPingLocation location, out string pszBuf )
{
IntPtr mempszBuf = Helpers.TakeMemory();
using var mempszBuf = Helpers.TakeMemory();
_ConvertPingLocationToString( Self, ref location, mempszBuf, (1024 * 32) );
pszBuf = Helpers.MemoryToString( mempszBuf );
}
@ -395,7 +395,7 @@ namespace Steamworks
#endregion
internal void SteamNetworkingIPAddr_ToString( ref NetAddress addr, out string buf, [MarshalAs( UnmanagedType.U1 )] bool bWithPort )
{
IntPtr membuf = Helpers.TakeMemory();
using var membuf = Helpers.TakeMemory();
_SteamNetworkingIPAddr_ToString( Self, ref addr, membuf, (1024 * 32), bWithPort );
buf = Helpers.MemoryToString( membuf );
}
@ -419,7 +419,7 @@ namespace Steamworks
#endregion
internal void SteamNetworkingIdentity_ToString( ref NetIdentity identity, out string buf )
{
IntPtr membuf = Helpers.TakeMemory();
using var membuf = Helpers.TakeMemory();
_SteamNetworkingIdentity_ToString( Self, ref identity, membuf, (1024 * 32) );
buf = Helpers.MemoryToString( membuf );
}

View File

@ -50,7 +50,7 @@ namespace Steamworks
#endregion
internal bool GetBeaconDetails( PartyBeaconID_t ulBeaconID, ref SteamId pSteamIDBeaconOwner, ref SteamPartyBeaconLocation_t pLocation, out string pchMetadata )
{
IntPtr mempchMetadata = Helpers.TakeMemory();
using var mempchMetadata = Helpers.TakeMemory();
var returnValue = _GetBeaconDetails( Self, ulBeaconID, ref pSteamIDBeaconOwner, ref pLocation, mempchMetadata, (1024 * 32) );
pchMetadata = Helpers.MemoryToString( mempchMetadata );
return returnValue;
@ -153,7 +153,7 @@ namespace Steamworks
#endregion
internal bool GetBeaconLocationData( SteamPartyBeaconLocation_t BeaconLocation, SteamPartyBeaconLocationData eData, out string pchDataStringOut )
{
IntPtr mempchDataStringOut = Helpers.TakeMemory();
using var mempchDataStringOut = Helpers.TakeMemory();
var returnValue = _GetBeaconLocationData( Self, BeaconLocation, eData, mempchDataStringOut, (1024 * 32) );
pchDataStringOut = Helpers.MemoryToString( mempchDataStringOut );
return returnValue;

View File

@ -109,7 +109,7 @@ namespace Steamworks
#endregion
internal bool GetQueryUGCTag( UGCQueryHandle_t handle, uint index, uint indexTag, out string pchValue )
{
IntPtr mempchValue = Helpers.TakeMemory();
using var mempchValue = Helpers.TakeMemory();
var returnValue = _GetQueryUGCTag( Self, handle, index, indexTag, mempchValue, (1024 * 32) );
pchValue = Helpers.MemoryToString( mempchValue );
return returnValue;
@ -123,7 +123,7 @@ namespace Steamworks
#endregion
internal bool GetQueryUGCTagDisplayName( UGCQueryHandle_t handle, uint index, uint indexTag, out string pchValue )
{
IntPtr mempchValue = Helpers.TakeMemory();
using var mempchValue = Helpers.TakeMemory();
var returnValue = _GetQueryUGCTagDisplayName( Self, handle, index, indexTag, mempchValue, (1024 * 32) );
pchValue = Helpers.MemoryToString( mempchValue );
return returnValue;
@ -137,7 +137,7 @@ namespace Steamworks
#endregion
internal bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint index, out string pchURL )
{
IntPtr mempchURL = Helpers.TakeMemory();
using var mempchURL = Helpers.TakeMemory();
var returnValue = _GetQueryUGCPreviewURL( Self, handle, index, mempchURL, (1024 * 32) );
pchURL = Helpers.MemoryToString( mempchURL );
return returnValue;
@ -151,7 +151,7 @@ namespace Steamworks
#endregion
internal bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint index, out string pchMetadata )
{
IntPtr mempchMetadata = Helpers.TakeMemory();
using var mempchMetadata = Helpers.TakeMemory();
var returnValue = _GetQueryUGCMetadata( Self, handle, index, mempchMetadata, (1024 * 32) );
pchMetadata = Helpers.MemoryToString( mempchMetadata );
return returnValue;
@ -200,8 +200,8 @@ namespace Steamworks
#endregion
internal bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint index, uint previewIndex, out string pchURLOrVideoID, out string pchOriginalFileName, ref ItemPreviewType pPreviewType )
{
IntPtr mempchURLOrVideoID = Helpers.TakeMemory();
IntPtr mempchOriginalFileName = Helpers.TakeMemory();
using var mempchURLOrVideoID = Helpers.TakeMemory();
using var mempchOriginalFileName = Helpers.TakeMemory();
var returnValue = _GetQueryUGCAdditionalPreview( Self, handle, index, previewIndex, mempchURLOrVideoID, (1024 * 32), mempchOriginalFileName, (1024 * 32), ref pPreviewType );
pchURLOrVideoID = Helpers.MemoryToString( mempchURLOrVideoID );
pchOriginalFileName = Helpers.MemoryToString( mempchOriginalFileName );
@ -227,8 +227,8 @@ namespace Steamworks
#endregion
internal bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, out string pchKey, out string pchValue )
{
IntPtr mempchKey = Helpers.TakeMemory();
IntPtr mempchValue = Helpers.TakeMemory();
using var mempchKey = Helpers.TakeMemory();
using var mempchValue = Helpers.TakeMemory();
var returnValue = _GetQueryUGCKeyValueTag( Self, handle, index, keyValueTagIndex, mempchKey, (1024 * 32), mempchValue, (1024 * 32) );
pchKey = Helpers.MemoryToString( mempchKey );
pchValue = Helpers.MemoryToString( mempchValue );
@ -243,7 +243,7 @@ namespace Steamworks
#endregion
internal bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, out string pchValue )
{
IntPtr mempchValue = Helpers.TakeMemory();
using var mempchValue = Helpers.TakeMemory();
var returnValue = _GetQueryUGCKeyValueTag( Self, handle, index, pchKey, mempchValue, (1024 * 32) );
pchValue = Helpers.MemoryToString( mempchValue );
return returnValue;
@ -832,7 +832,7 @@ namespace Steamworks
#endregion
internal bool GetItemInstallInfo( PublishedFileId nPublishedFileID, ref ulong punSizeOnDisk, out string pchFolder, ref uint punTimeStamp )
{
IntPtr mempchFolder = Helpers.TakeMemory();
using var mempchFolder = Helpers.TakeMemory();
var returnValue = _GetItemInstallInfo( Self, nPublishedFileID, ref punSizeOnDisk, mempchFolder, (1024 * 32), ref punTimeStamp );
pchFolder = Helpers.MemoryToString( mempchFolder );
return returnValue;

View File

@ -93,7 +93,7 @@ namespace Steamworks
#endregion
internal bool GetUserDataFolder( out string pchBuffer )
{
IntPtr mempchBuffer = Helpers.TakeMemory();
using var mempchBuffer = Helpers.TakeMemory();
var returnValue = _GetUserDataFolder( Self, mempchBuffer, (1024 * 32) );
pchBuffer = Helpers.MemoryToString( mempchBuffer );
return returnValue;

View File

@ -433,7 +433,7 @@ namespace Steamworks
#endregion
internal int GetMostAchievedAchievementInfo( out string pchName, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved )
{
IntPtr mempchName = Helpers.TakeMemory();
using var mempchName = Helpers.TakeMemory();
var returnValue = _GetMostAchievedAchievementInfo( Self, mempchName, (1024 * 32), ref pflPercent, ref pbAchieved );
pchName = Helpers.MemoryToString( mempchName );
return returnValue;
@ -446,7 +446,7 @@ namespace Steamworks
#endregion
internal int GetNextMostAchievedAchievementInfo( int iIteratorPrevious, out string pchName, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved )
{
IntPtr mempchName = Helpers.TakeMemory();
using var mempchName = Helpers.TakeMemory();
var returnValue = _GetNextMostAchievedAchievementInfo( Self, iIteratorPrevious, mempchName, (1024 * 32), ref pflPercent, ref pbAchieved );
pchName = Helpers.MemoryToString( mempchName );
return returnValue;

View File

@ -256,7 +256,7 @@ namespace Steamworks
#endregion
internal bool GetEnteredGamepadTextInput( out string pchText )
{
IntPtr mempchText = Helpers.TakeMemory();
using var mempchText = Helpers.TakeMemory();
var returnValue = _GetEnteredGamepadTextInput( Self, mempchText, (1024 * 32) );
pchText = Helpers.MemoryToString( mempchText );
return returnValue;
@ -370,7 +370,7 @@ namespace Steamworks
#endregion
internal int FilterText( TextFilteringContext eContext, SteamId sourceSteamID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchInputMessage, out string pchOutFilteredText )
{
IntPtr mempchOutFilteredText = Helpers.TakeMemory();
using var mempchOutFilteredText = Helpers.TakeMemory();
var returnValue = _FilterText( Self, eContext, sourceSteamID, pchInputMessage, mempchOutFilteredText, (1024 * 32) );
pchOutFilteredText = Helpers.MemoryToString( mempchOutFilteredText );
return returnValue;

View File

@ -60,7 +60,7 @@ namespace Steamworks
#endregion
internal bool GetOPFStringForApp( AppId unVideoAppID, out string pchBuffer, ref int pnBufferSize )
{
IntPtr mempchBuffer = Helpers.TakeMemory();
using var mempchBuffer = Helpers.TakeMemory();
var returnValue = _GetOPFStringForApp( Self, unVideoAppID, mempchBuffer, ref pnBufferSize );
pchBuffer = Helpers.MemoryToString( mempchBuffer );
return returnValue;

View File

@ -756,7 +756,7 @@ namespace Steamworks
//
// ETextFilteringContext
//
internal enum TextFilteringContext : int
public enum TextFilteringContext : int
{
Unknown = 0,
GameContent = 1,

View File

@ -60,7 +60,9 @@ namespace Steamworks
private static readonly Dictionary<IntPtr, ReferenceCounter> ReferenceCounters =
new Dictionary<IntPtr, ReferenceCounter>( 1024 );
public static readonly IntPtr FreeFunctionPointer = Marshal.GetFunctionPointerForDelegate<FreeFn>( Free );
private static readonly FreeFn FreeFunctionPin = new FreeFn( Free );
public static readonly IntPtr FreeFunctionPointer = Marshal.GetFunctionPointerForDelegate( FreeFunctionPin );
public static IntPtr Get( int size, int referenceCount )
{

View File

@ -147,7 +147,7 @@ namespace Steamworks.Data
public override string ToString()
{
var ptr = Helpers.TakeMemory();
using var ptr = Helpers.TakeMemory();
var self = this;
InternalToString( ref self, ptr, Helpers.MemoryBufferSize, true );
return Helpers.MemoryToString( ptr );

View File

@ -97,7 +97,7 @@ namespace Steamworks
var friend = new Friend( data.SteamIDUser );
var buffer = Helpers.TakeMemory();
using var buffer = Helpers.TakeMemory();
var type = ChatEntryType.ChatMsg;
var len = Internal.GetFriendMessage( data.SteamIDUser, data.MessageID, buffer, Helpers.MemoryBufferSize, ref type );
@ -117,7 +117,7 @@ namespace Steamworks
var friend = new Friend( data.SteamIDUser );
var buffer = Helpers.TakeMemory();
using var buffer = Helpers.TakeMemory();
var type = ChatEntryType.ChatMsg;
SteamId chatter = data.SteamIDUser;

View File

@ -72,7 +72,7 @@ namespace Steamworks
{
SteamId steamid = default;
ChatEntryType chatEntryType = default;
var buffer = Helpers.TakeMemory();
using var buffer = Helpers.TakeMemory();
var readData = Internal.GetLobbyChatEntry( callback.SteamIDLobby, (int)callback.ChatID, ref steamid, buffer, Helpers.MemoryBufferSize, ref chatEntryType );

View File

@ -26,12 +26,22 @@ namespace Steamworks
internal static void InstallEvents( bool server )
{
Dispatch.Install<DownloadItemResult_t>( x => OnDownloadItemResult?.Invoke( x.Result ), server );
Dispatch.Install<RemoteStoragePublishedFileSubscribed_t>( x => OnItemSubscribed?.Invoke( x.AppID.Value, x.PublishedFileId ), server );
Dispatch.Install<RemoteStoragePublishedFileUnsubscribed_t>( x => OnItemUnsubscribed?.Invoke( x.AppID.Value, x.PublishedFileId ), server );
Dispatch.Install<ItemInstalled_t>( x => OnItemInstalled?.Invoke( x.AppID.Value, x.PublishedFileId ), server );
}
/// <summary>
/// Posted after Download call
/// </summary>
public static event Action<Result> OnDownloadItemResult;
/// <summary>
/// Posted when new item is subscribed
/// </summary>
public static event Action<AppId, PublishedFileId> OnItemSubscribed;
public static event Action<AppId, PublishedFileId> OnItemUnsubscribed;
public static event Action<AppId, PublishedFileId> OnItemInstalled;
public static async Task<bool> DeleteFileAsync( PublishedFileId fileId )
{

View File

@ -261,5 +261,21 @@ namespace Steamworks
/// Returns whether this steam client is a Steam China specific client, vs the global client
/// </summary>
public static bool IsSteamChinaLauncher => Internal.IsSteamChinaLauncher();
/// <summary>
/// Initializes text filtering, loading dictionaries for the language the game is running in.
/// Users can customize the text filter behavior in their Steam Account preferences
/// </summary>
public static bool InitFilterText() => Internal.InitFilterText( 0 );
/// <summary>
/// Filters the provided input message and places the filtered result into pchOutFilteredText,
/// using legally required filtering and additional filtering based on the context and user settings.
/// </summary>
public string FilterText( TextFilteringContext context, SteamId sourceSteamID, string inputMessage )
{
Internal.FilterText( context, sourceSteamID, inputMessage, out var filteredString );
return filteredString;
}
}
}

View File

@ -246,7 +246,7 @@ namespace Steamworks.Ugc
case ItemUpdateStatus.UploadingContent:
{
var uploaded = total > 0 ? ((float)processed / (float)total) : 0.0f;
progress?.Report( 0.2f + uploaded * 0.7f );
progress?.Report( 0.2f + uploaded * 0.6f );
break;
}
case ItemUpdateStatus.UploadingPreviewFile:

View File

@ -9,30 +9,50 @@ namespace Steamworks
{
public const int MemoryBufferSize = 1024 * 32;
private static IntPtr[] MemoryPool = new IntPtr[]
internal struct Memory : IDisposable
{
Marshal.AllocHGlobal( MemoryBufferSize ),
Marshal.AllocHGlobal( MemoryBufferSize ),
Marshal.AllocHGlobal( MemoryBufferSize ),
Marshal.AllocHGlobal( MemoryBufferSize )
};
private static int MemoryPoolIndex;
private const int MaxBagSize = 4;
private static readonly Queue<IntPtr> BufferBag = new Queue<IntPtr>();
public static unsafe IntPtr TakeMemory()
{
lock ( MemoryPool )
public IntPtr Ptr { get; private set; }
public static implicit operator IntPtr(in Memory m) => m.Ptr;
internal static unsafe Memory Take()
{
MemoryPoolIndex++;
if ( MemoryPoolIndex >= MemoryPool.Length )
MemoryPoolIndex = 0;
var take = MemoryPool[MemoryPoolIndex];
((byte*)take)[0] = 0;
return take;
IntPtr ptr;
lock (BufferBag)
{
ptr = BufferBag.Count > 0 ? BufferBag.Dequeue() : Marshal.AllocHGlobal(MemoryBufferSize);
}
((byte*)ptr)[0] = 0;
return new Memory
{
Ptr = ptr
};
}
public void Dispose()
{
if (Ptr == IntPtr.Zero) { return; }
lock (BufferBag)
{
if (BufferBag.Count < MaxBagSize)
{
BufferBag.Enqueue(Ptr);
}
else
{
Marshal.FreeHGlobal(Ptr);
}
}
Ptr = IntPtr.Zero;
}
}
public static Memory TakeMemory()
{
return Memory.Take();
}

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>

View File

@ -144,6 +144,7 @@ public static class Cleanup
if ( name == "NetDebugOutput" ) return "public";
if ( name == "ItemPreviewType" ) return "public";
if ( name == "OverlayToStoreFlag" ) return "public";
if ( name == "TextFilteringContext " ) return "public";
return "internal";
}

View File

@ -152,7 +152,7 @@ namespace Generator
{
if ( arg is FetchStringType sb )
{
WriteLine( $"IntPtr mem{sb.VarName} = Helpers.TakeMemory();" );
WriteLine( $"using var mem{sb.VarName} = Helpers.TakeMemory();" );
}
}

View File

@ -1,86 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B7225D11-2AAA-49D6-AE93-A73696EA35FE}</ProjectGuid>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Generator</RootNamespace>
<AssemblyName>Generator</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<LangVersion>10</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<Compile Include="CodeWriter\Interface.cs" />
<Compile Include="CodeWriter\Constants.cs" />
<Compile Include="CodeWriter\CustomEnums.cs" />
<Compile Include="CodeWriter\Callbacks.cs" />
<Compile Include="CodeWriter\StructFunctions.cs" />
<Compile Include="Types\FetchStringType.cs" />
<Compile Include="Types\ConstCharType.cs" />
<Compile Include="Types\LiteralType.cs" />
<Compile Include="Types\StructType.cs" />
<Compile Include="Types\BoolType.cs" />
<Compile Include="Types\VoidType.cs" />
<Compile Include="Types\SteamApiCallType.cs" />
<Compile Include="Types\BaseType.cs" />
<Compile Include="CodeWriter\Writing.cs" />
<Compile Include="CodeWriter\CodeWriter.cs" />
<Compile Include="CodeWriter\Enums.cs" />
<Compile Include="CodeWriter\Struct.cs" />
<Compile Include="CodeWriter\Types.cs" />
<Compile Include="CodeWriter\Utility.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Cleanup.cs" />
<Compile Include="SteamApiDefinition.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -2,7 +2,7 @@
[Another fucking c# Steamworks implementation](https://wiki.facepunch.com/steamworks/)
![Build All](https://github.com/Facepunch/Facepunch.Steamworks/workflows/Build%20All/badge.svg)
![Build All](https://github.com/Crytilis/Facepunch.Steamworks/workflows/Build%20All/badge.svg)
## Features