Added missing callbacks

This commit is contained in:
Garry Newman 2018-03-21 10:42:55 +00:00
parent 99c77f1997
commit a40334551b
6 changed files with 2144 additions and 233 deletions

View File

@ -41,6 +41,7 @@ namespace SteamNative
public const int ClientRemoteClientManager = 3300; public const int ClientRemoteClientManager = 3300;
public const int ClientUGC = 3400; public const int ClientUGC = 3400;
public const int SteamStreamClient = 3500; public const int SteamStreamClient = 3500;
public const int ClientProductBuilder = 3600;
public const int ClientShortcuts = 3700; public const int ClientShortcuts = 3700;
public const int ClientRemoteControlManager = 3800; public const int ClientRemoteControlManager = 3800;
public const int SteamAppList = 3900; public const int SteamAppList = 3900;
@ -54,6 +55,7 @@ namespace SteamNative
public const int ClientInventory = 4700; public const int ClientInventory = 4700;
public const int ClientBluetoothManager = 4800; public const int ClientBluetoothManager = 4800;
public const int ClientSharedConnection = 4900; public const int ClientSharedConnection = 4900;
public const int SteamParentalSettings = 5000;
public const int ClientShader = 5100; public const int ClientShader = 5100;
} }
internal static class Defines internal static class Defines

File diff suppressed because it is too large Load Diff

View File

@ -29,12 +29,12 @@ namespace Generator
// //
def.CallbackIds = new Dictionary<string, int>(); def.CallbackIds = new Dictionary<string, int>();
{ {
var r = new Regex( @"enum { (k_i(?:.+)) = ([0-9]+) };" ); var r = new Regex( @"enum { (k_[i|I](?:.+)) = ([0-9]+) };" );
var ma = r.Matches( Content ); var ma = r.Matches( Content );
foreach ( Match m in ma ) foreach ( Match m in ma )
{ {
def.CallbackIds.Add( m.Groups[1].Value.Replace( "k_i", "" ).Replace( "Callbacks", "" ), int.Parse( m.Groups[2].Value ) ); def.CallbackIds.Add( m.Groups[1].Value.Substring( 3 ).Replace( "Callbacks", "" ), int.Parse( m.Groups[2].Value ) );
} }
} }
@ -62,7 +62,7 @@ namespace Generator
num = "0"; num = "0";
} }
kName = kName.Replace( "k_i", "CallbackIdentifiers." ).Replace( "Callbacks", "" ); kName = "CallbackIdentifiers." + kName.Substring( 3 ).Replace( "Callbacks", "" );
t.CallbackId = $"{kName} + {num}"; t.CallbackId = $"{kName} + {num}";
} }
@ -77,7 +77,8 @@ namespace Generator
var kName = m.Groups[1].Value; var kName = m.Groups[1].Value;
var num = m.Groups[2].Value; var num = m.Groups[2].Value;
kName = kName.Replace( "k_i", "CallbackIdentifiers." ).Replace( "Callbacks", "" ); //kName = kName.Replace( "k_i", "CallbackIdentifiers." ).Replace( "Callbacks", "" );
kName = "CallbackIdentifiers." + kName.Substring( 3 ).Replace( "Callbacks", "" );
t.CallbackId = $"{kName} + {num}"; t.CallbackId = $"{kName} + {num}";
} }
@ -119,6 +120,25 @@ namespace Generator
} }
} }
//
// Find missing structs
//
{
var r = new Regex( @"struct ([a-zA-Z]+_t)" );
var ma = r.Matches( Content );
foreach ( Match m in ma )
{
var s = def.structs.SingleOrDefault( x => x.Name == m.Groups[1].Value );
if ( s == null )
{
Console.WriteLine( "Missing Struct: " + m.Groups[1].Value );
}
}
//Console.ReadKey();
}
} }
} }
} }

View File

@ -49,7 +49,7 @@ namespace Generator
int defaultPack = 8; int defaultPack = 8;
if ( c.Fields.Any( x => x.Type.Contains( "class CSteamID" ) ) && !ForceLargePackStructs.Contains( c.Name ) ) if ( c.Fields.Any( x => x.Type.Contains( "class CSteamID" ) ) && !ForceLargePackStructs.Contains( c.Name ) )
defaultPack = 4; defaultPack = 4;
// //
@ -60,7 +60,7 @@ namespace Generator
{ {
if ( !string.IsNullOrEmpty( c.CallbackId ) ) if ( !string.IsNullOrEmpty( c.CallbackId ) )
{ {
WriteLine( "internal const int CallbackId = " + c.CallbackId + ";" ); WriteLine( "internal const int CallbackId = " + c.CallbackId + ";" );
} }
// //

View File

@ -32,6 +32,11 @@ namespace Generator
output.structs.AddRange( missing.structs ); output.structs.AddRange( missing.structs );
output.methods.AddRange( missing.methods ); output.methods.AddRange( missing.methods );
foreach ( var s in output.structs )
{
if ( s.Fields == null ) s.Fields = new SteamApiDefinition.StructDef.StructFields[0];
}
} }
} }
} }

View File

@ -1,229 +1,281 @@
{ {
structs: "structs":
[ [
{ {
struct: "ItemInstalled_t", "struct": "ItemInstalled_t",
fields: "fields":
[ [
{ {
fieldname: "m_unAppID", "fieldname": "m_unAppID",
fieldtype: "AppId_t" "fieldtype": "AppId_t"
}, },
{ {
fieldname: "m_nPublishedFileId", "fieldname": "m_nPublishedFileId",
fieldtype: "PublishedFileId_t" "fieldtype": "PublishedFileId_t"
} }
] ]
} },
],
methods:
[
{
classname: "SteamApi",
methodname: "SteamAPI_Init",
returntype: "bool",
NeedsSelfPointer: false
},
{
classname: "SteamApi",
methodname: "SteamAPI_RunCallbacks",
returntype: "void",
NeedsSelfPointer: false
},
{ {
classname: "SteamApi", "struct": "SteamInventoryDefinitionUpdate_t"
methodname: "SteamGameServer_RunCallbacks", },
returntype: "void",
NeedsSelfPointer: false {
}, "struct": "SteamParentalSettingsChanged_t"
},
{
"struct": "SteamServersConnected_t"
},
{
"struct": "NewLaunchQueryParameters_t"
},
{
"struct": "GCMessageAvailable_t",
"fields":
[
{
"fieldname": "m_nMessageSize",
"fieldtype": "uint32"
}
]
},
{
"struct": "GCMessageFailed_t"
},
{
"struct": "ScreenshotRequested_t"
},
{
"struct": "LicensesUpdated_t"
},
{
"struct": "SteamShutdown_t"
},
{
"struct": "IPCountry_t"
},
{
"struct": "IPCFailure_t",
"fields":
[
{
"fieldname": "m_eFailureType",
"fieldtype": "uint8"
}
]
}
],
"methods":
[
{
"classname": "SteamApi",
"methodname": "SteamAPI_Init",
"returntype": "bool",
"NeedsSelfPointer": false
},
{
"classname": "SteamApi",
"methodname": "SteamAPI_RunCallbacks",
"returntype": "void",
"NeedsSelfPointer": false
},
{ {
classname: "SteamApi", "classname": "SteamApi",
methodname: "SteamAPI_RegisterCallback", "methodname": "SteamGameServer_RunCallbacks",
returntype: "void", "returntype": "void",
NeedsSelfPointer: false, "NeedsSelfPointer": false
params: },
[
{
paramname: "pCallback",
paramtype: "void *"
},
{
paramname: "callback",
paramtype: "int"
},
]
},
{ {
classname: "SteamApi", "classname": "SteamApi",
methodname: "SteamAPI_UnregisterCallback", "methodname": "SteamAPI_RegisterCallback",
returntype: "void", "returntype": "void",
NeedsSelfPointer: false, "NeedsSelfPointer": false,
params: "params":
[ [
{ {
paramname: "pCallback", "paramname": "pCallback",
paramtype: "void *" "paramtype": "void *"
} },
]
}, {
"paramname": "callback",
"paramtype": "int"
}
]
},
{ {
NeedsSelfPointer: false, "classname": "SteamApi",
classname: "SteamApi", "methodname": "SteamAPI_UnregisterCallback",
methodname: "SteamAPI_RegisterCallResult", "returntype": "void",
returntype: "void", "NeedsSelfPointer": false,
params: "params":
[ [
{ {
paramname: "pCallback", "paramname": "pCallback",
paramtype: "void *" "paramtype": "void *"
}, }
{ ]
paramname: "callback", },
paramtype: "SteamAPICall_t"
}
],
},
{ {
NeedsSelfPointer: false, "NeedsSelfPointer": false,
classname: "SteamApi", "classname": "SteamApi",
methodname: "SteamAPI_UnregisterCallResult", "methodname": "SteamAPI_RegisterCallResult",
returntype: "void", "returntype": "void",
params: "params":
[ [
{ {
paramname: "pCallback", "paramname": "pCallback",
paramtype: "void *" "paramtype": "void *"
}, },
{ {
paramname: "callback", "paramname": "callback",
paramtype: "SteamAPICall_t" "paramtype": "SteamAPICall_t"
} }
] ]
}, },
{ {
NeedsSelfPointer: false, "NeedsSelfPointer": false,
classname: "SteamApi", "classname": "SteamApi",
methodname: "SteamInternal_GameServer_Init", "methodname": "SteamAPI_UnregisterCallResult",
returntype: "bool", "returntype": "void",
params: "params":
[ [
{ {
paramname: "unIP", "paramname": "pCallback",
paramtype: "uint32" "paramtype": "void *"
}, },
{ {
paramname: "usPort", "paramname": "callback",
paramtype: "uint16" "paramtype": "SteamAPICall_t"
}, }
{ ]
paramname: "usGamePort", },
paramtype: "uint16"
},
{
paramname: "usQueryPort",
paramtype: "uint16"
},
{
paramname: "eServerMode",
paramtype: "int"
},
{
paramname: "pchVersionString",
paramtype: "const char *"
}
],
},
{ {
NeedsSelfPointer: false, "NeedsSelfPointer": false,
classname: "SteamApi", "classname": "SteamApi",
methodname: "SteamAPI_Shutdown", "methodname": "SteamInternal_GameServer_Init",
returntype: "void", "returntype": "bool",
}, "params":
[
{
"paramname": "unIP",
"paramtype": "uint32"
},
{
"paramname": "usPort",
"paramtype": "uint16"
},
{
"paramname": "usGamePort",
"paramtype": "uint16"
},
{
"paramname": "usQueryPort",
"paramtype": "uint16"
},
{
"paramname": "eServerMode",
"paramtype": "int"
},
{
"paramname": "pchVersionString",
"paramtype": "const char *"
}
]
},
{ {
NeedsSelfPointer: false, "NeedsSelfPointer": false,
classname: "SteamApi", "classname": "SteamApi",
methodname: "SteamGameServer_Shutdown", "methodname": "SteamAPI_Shutdown",
returntype: "void", "returntype": "void"
}, },
{ {
NeedsSelfPointer: false, "NeedsSelfPointer": false,
classname: "SteamApi", "classname": "SteamApi",
methodname: "SteamAPI_GetHSteamUser", "methodname": "SteamGameServer_Shutdown",
returntype: "HSteamUser", "returntype": "void"
}, },
{ {
NeedsSelfPointer: false, "NeedsSelfPointer": false,
classname: "SteamApi", "classname": "SteamApi",
methodname: "SteamAPI_GetHSteamPipe", "methodname": "SteamAPI_GetHSteamUser",
returntype: "HSteamPipe", "returntype": "HSteamUser"
}, },
{ {
NeedsSelfPointer: false, "NeedsSelfPointer": false,
classname: "SteamApi", "classname": "SteamApi",
methodname: "SteamGameServer_GetHSteamUser", "methodname": "SteamAPI_GetHSteamPipe",
returntype: "HSteamUser", "returntype": "HSteamPipe"
}, },
{ {
NeedsSelfPointer: false, "NeedsSelfPointer": false,
classname: "SteamApi", "classname": "SteamApi",
methodname: "SteamGameServer_GetHSteamPipe", "methodname": "SteamGameServer_GetHSteamUser",
returntype: "HSteamPipe", "returntype": "HSteamUser"
}, },
{ {
NeedsSelfPointer: false, "NeedsSelfPointer": false,
classname: "SteamApi", "classname": "SteamApi",
methodname: "SteamInternal_CreateInterface", "methodname": "SteamGameServer_GetHSteamPipe",
returntype: "void *", "returntype": "HSteamPipe"
params: },
[
{
paramname: "version",
paramtype: "const char *"
}
],
},
{
NeedsSelfPointer: false, {
classname: "SteamApi", "NeedsSelfPointer": false,
methodname: "SteamAPI_RestartAppIfNecessary", "classname": "SteamApi",
returntype: "bool", "methodname": "SteamInternal_CreateInterface",
params: "returntype": "void *",
[ "params":
{ [
paramname: "unOwnAppID", {
paramtype: "uint32" "paramname": "version",
} "paramtype": "const char *"
], }
}, ]
] },
{
"NeedsSelfPointer": false,
"classname": "SteamApi",
"methodname": "SteamAPI_RestartAppIfNecessary",
"returntype": "bool",
"params":
[
{
"paramname": "unOwnAppID",
"paramtype": "uint32"
}
]
}
]
} }