mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-26 13:38:06 +03:00
Fixes
This commit is contained in:
parent
fe7f5a7630
commit
44abc1ce20
@ -28,7 +28,7 @@ namespace Facepunch.Steamworks.Test
|
|||||||
for ( int i = 0; i < 1000; i++ )
|
for ( int i = 0; i < 1000; i++ )
|
||||||
{
|
{
|
||||||
client.Update();
|
client.Update();
|
||||||
System.Threading.Thread.Sleep( 10 );
|
System.Threading.Thread.Sleep( 5 );
|
||||||
|
|
||||||
foreach ( var s in query.Responded )
|
foreach ( var s in query.Responded )
|
||||||
{
|
{
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -24,14 +24,14 @@ namespace Generator
|
|||||||
int defaultPack = 8;
|
int defaultPack = 8;
|
||||||
|
|
||||||
if ( c.Fields.Any( x => x.Type.Contains( "class CSteamID" ) ) )
|
if ( c.Fields.Any( x => x.Type.Contains( "class CSteamID" ) ) )
|
||||||
defaultPack = 1;
|
defaultPack = 4;
|
||||||
|
|
||||||
WriteLine( $"[StructLayout( LayoutKind.Sequential, Pack = {defaultPack} )]" );
|
WriteLine( $"[StructLayout( LayoutKind.Sequential, Pack = {defaultPack} )]" );
|
||||||
StartBlock( $"public struct {c.Name}" );
|
StartBlock( $"public struct {c.Name}" );
|
||||||
|
|
||||||
StructFields( c.Fields );
|
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 )
|
if ( defaultPack == 8 )
|
||||||
@ -73,6 +73,11 @@ namespace Generator
|
|||||||
t = TypeDefs[t].ManagedType;
|
t = TypeDefs[t].ManagedType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( t == "bool" )
|
||||||
|
{
|
||||||
|
WriteLine( "[MarshalAs(UnmanagedType.I1)]" );
|
||||||
|
}
|
||||||
|
|
||||||
if ( t.StartsWith( "char " ) && t.Contains( "[" ) )
|
if ( t.StartsWith( "char " ) && t.Contains( "[" ) )
|
||||||
{
|
{
|
||||||
var num = t.Replace( "char", "" ).Trim( '[', ']', ' ' );
|
var num = t.Replace( "char", "" ).Trim( '[', ']', ' ' );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user