(bcb06cc5c) Unstable v0.9.9.0

This commit is contained in:
Juan Pablo Arce
2020-03-27 15:22:59 -03:00
parent c81486a993
commit b143329701
326 changed files with 9692 additions and 4364 deletions
@@ -31,6 +31,22 @@
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.1|x64'">
<NoWarn>1701;1702;1591;1587</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.1|x64'">
<NoWarn>1701;1702;1591;1587</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.1|AnyCPU'">
<NoWarn>1701;1702;1591;1587</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.1|AnyCPU'">
<NoWarn>1701;1702;1591;1587</NoWarn>
</PropertyGroup>
<Import Project="Facepunch.Steamworks.targets" />
</Project>
@@ -39,6 +39,7 @@ namespace Steamworks
ItemInstalled_t.Install(x => {
if (x.AppID == SteamClient.AppId)
{
GlobalOnItemInstalled?.Invoke(x.PublishedFileId);
if (onItemInstalled?.ContainsKey(x.PublishedFileId) ?? false)
{
onItemInstalled[x.PublishedFileId]?.Invoke();
@@ -92,5 +93,9 @@ namespace Steamworks
}
private static Dictionary<PublishedFileId, Action> onItemInstalled;
public static event Action<ulong> GlobalOnItemInstalled;
public static uint NumSubscribedItems { get { return Internal.GetNumSubscribedItems(); } }
}
}
@@ -91,6 +91,13 @@ namespace Steamworks.Ugc
return this;
}
public Editor WithoutTag( string tag )
{
if (Tags != null && Tags.Contains(tag)) Tags.Remove(tag);
return this;
}
public async Task<PublishResult> SubmitAsync( IProgress<float> progress = null )
{
var result = default( PublishResult );
@@ -9,31 +9,36 @@ namespace Steamworks
{
public const int MaxStringSize = 1024 * 32;
private static object mutex = new object();
private static IntPtr[] MemoryPool;
private static int MemoryPoolIndex;
public static unsafe IntPtr TakeMemory()
{
if ( MemoryPool == null )
IntPtr take = IntPtr.Zero;
lock (mutex)
{
//
// The pool has 5 items. This should be safe because we shouldn't really
// ever be using more than 2 memory pools
//
MemoryPool = new IntPtr[5];
if (MemoryPool == null)
{
//
// The pool has 5 items. This should be safe because we shouldn't really
// ever be using more than 2 memory pools
//
MemoryPool = new IntPtr[5];
for ( int i = 0; i < MemoryPool.Length; i++ )
MemoryPool[i] = Marshal.AllocHGlobal( MaxStringSize );
for (int i = 0; i < MemoryPool.Length; i++)
MemoryPool[i] = Marshal.AllocHGlobal(MaxStringSize);
}
MemoryPoolIndex++;
if (MemoryPoolIndex >= MemoryPool.Length)
MemoryPoolIndex = 0;
take = MemoryPool[MemoryPoolIndex];
((byte*)take)[0] = 0;
}
MemoryPoolIndex++;
if ( MemoryPoolIndex >= MemoryPool.Length )
MemoryPoolIndex = 0;
var take = MemoryPool[MemoryPoolIndex];
((byte*)take)[0] = 0;
return take;
}