This commit is contained in:
Garry Newman 2016-10-25 11:51:24 +01:00
parent fe7f5a7630
commit 44abc1ce20
3 changed files with 347 additions and 232 deletions

View File

@ -28,7 +28,7 @@ namespace Facepunch.Steamworks.Test
for ( int i = 0; i < 1000; i++ )
{
client.Update();
System.Threading.Thread.Sleep( 10 );
System.Threading.Thread.Sleep( 5 );
foreach ( var s in query.Responded )
{

File diff suppressed because it is too large Load Diff

View File

@ -24,14 +24,14 @@ namespace Generator
int defaultPack = 8;
if ( c.Fields.Any( x => x.Type.Contains( "class CSteamID" ) ) )
defaultPack = 1;
defaultPack = 4;
WriteLine( $"[StructLayout( LayoutKind.Sequential, Pack = {defaultPack} )]" );
StartBlock( $"public struct {c.Name}" );
StructFields( c.Fields );
WriteLine( $"public static {c.Name} FromPointer( IntPtr p ) {{ return new {c.Name}(); }}" );
WriteLine( $"public static {c.Name} FromPointer( IntPtr p ) {{ return ({c.Name}) Marshal.PtrToStructure( p, typeof({c.Name}) ); }}" );
if ( defaultPack == 8 )
@ -73,6 +73,11 @@ namespace Generator
t = TypeDefs[t].ManagedType;
}
if ( t == "bool" )
{
WriteLine( "[MarshalAs(UnmanagedType.I1)]" );
}
if ( t.StartsWith( "char " ) && t.Contains( "[" ) )
{
var num = t.Replace( "char", "" ).Trim( '[', ']', ' ' );