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

File diff suppressed because it is too large Load Diff

View File

@ -29,12 +29,12 @@ internal void ExtendDefinition( SteamApiDefinition def )
//
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 );
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 @@ internal void ExtendDefinition( SteamApiDefinition def )
num = "0";
}
kName = kName.Replace( "k_i", "CallbackIdentifiers." ).Replace( "Callbacks", "" );
kName = "CallbackIdentifiers." + kName.Substring( 3 ).Replace( "Callbacks", "" );
t.CallbackId = $"{kName} + {num}";
}
@ -77,7 +77,8 @@ internal void ExtendDefinition( SteamApiDefinition def )
var kName = m.Groups[1].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}";
}
@ -119,6 +120,25 @@ internal void ExtendDefinition( SteamApiDefinition def )
}
}
//
// 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 @@ void Structs()
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;
//
@ -60,7 +60,7 @@ void Structs()
{
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 @@ private static void AddMissing( SteamApiDefinition output )
output.structs.AddRange( missing.structs );
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:
[
{
struct: "ItemInstalled_t",
fields:
[
{
fieldname: "m_unAppID",
fieldtype: "AppId_t"
},
{
fieldname: "m_nPublishedFileId",
fieldtype: "PublishedFileId_t"
}
]
}
],
methods:
[
{
classname: "SteamApi",
methodname: "SteamAPI_Init",
returntype: "bool",
NeedsSelfPointer: false
},
{
classname: "SteamApi",
methodname: "SteamAPI_RunCallbacks",
returntype: "void",
NeedsSelfPointer: false
},
{
classname: "SteamApi",
methodname: "SteamGameServer_RunCallbacks",
returntype: "void",
NeedsSelfPointer: false
},
{
classname: "SteamApi",
methodname: "SteamAPI_RegisterCallback",
returntype: "void",
NeedsSelfPointer: false,
params:
[
{
paramname: "pCallback",
paramtype: "void *"
},
{
paramname: "callback",
paramtype: "int"
},
]
},
{
classname: "SteamApi",
methodname: "SteamAPI_UnregisterCallback",
returntype: "void",
NeedsSelfPointer: false,
params:
[
{
paramname: "pCallback",
paramtype: "void *"
}
]
},
{
NeedsSelfPointer: false,
classname: "SteamApi",
methodname: "SteamAPI_RegisterCallResult",
returntype: "void",
params:
[
{
paramname: "pCallback",
paramtype: "void *"
},
{
paramname: "callback",
paramtype: "SteamAPICall_t"
}
],
},
{
NeedsSelfPointer: false,
classname: "SteamApi",
methodname: "SteamAPI_UnregisterCallResult",
returntype: "void",
params:
[
{
paramname: "pCallback",
paramtype: "void *"
},
{
paramname: "callback",
paramtype: "SteamAPICall_t"
}
]
},
{
NeedsSelfPointer: false,
classname: "SteamApi",
methodname: "SteamInternal_GameServer_Init",
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,
classname: "SteamApi",
methodname: "SteamAPI_Shutdown",
returntype: "void",
},
{
NeedsSelfPointer: false,
classname: "SteamApi",
methodname: "SteamGameServer_Shutdown",
returntype: "void",
},
{
NeedsSelfPointer: false,
classname: "SteamApi",
methodname: "SteamAPI_GetHSteamUser",
returntype: "HSteamUser",
},
{
NeedsSelfPointer: false,
classname: "SteamApi",
methodname: "SteamAPI_GetHSteamPipe",
returntype: "HSteamPipe",
},
{
NeedsSelfPointer: false,
classname: "SteamApi",
methodname: "SteamGameServer_GetHSteamUser",
returntype: "HSteamUser",
},
{
NeedsSelfPointer: false,
classname: "SteamApi",
methodname: "SteamGameServer_GetHSteamPipe",
returntype: "HSteamPipe",
},
{
NeedsSelfPointer: false,
classname: "SteamApi",
methodname: "SteamInternal_CreateInterface",
returntype: "void *",
params:
[
{
paramname: "version",
paramtype: "const char *"
}
],
},
{
NeedsSelfPointer: false,
classname: "SteamApi",
methodname: "SteamAPI_RestartAppIfNecessary",
returntype: "bool",
params:
[
{
paramname: "unOwnAppID",
paramtype: "uint32"
}
],
},
]
"structs":
[
{
"struct": "ItemInstalled_t",
"fields":
[
{
"fieldname": "m_unAppID",
"fieldtype": "AppId_t"
},
{
"fieldname": "m_nPublishedFileId",
"fieldtype": "PublishedFileId_t"
}
]
},
{
"struct": "SteamInventoryDefinitionUpdate_t"
},
{
"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",
"methodname": "SteamGameServer_RunCallbacks",
"returntype": "void",
"NeedsSelfPointer": false
},
{
"classname": "SteamApi",
"methodname": "SteamAPI_RegisterCallback",
"returntype": "void",
"NeedsSelfPointer": false,
"params":
[
{
"paramname": "pCallback",
"paramtype": "void *"
},
{
"paramname": "callback",
"paramtype": "int"
}
]
},
{
"classname": "SteamApi",
"methodname": "SteamAPI_UnregisterCallback",
"returntype": "void",
"NeedsSelfPointer": false,
"params":
[
{
"paramname": "pCallback",
"paramtype": "void *"
}
]
},
{
"NeedsSelfPointer": false,
"classname": "SteamApi",
"methodname": "SteamAPI_RegisterCallResult",
"returntype": "void",
"params":
[
{
"paramname": "pCallback",
"paramtype": "void *"
},
{
"paramname": "callback",
"paramtype": "SteamAPICall_t"
}
]
},
{
"NeedsSelfPointer": false,
"classname": "SteamApi",
"methodname": "SteamAPI_UnregisterCallResult",
"returntype": "void",
"params":
[
{
"paramname": "pCallback",
"paramtype": "void *"
},
{
"paramname": "callback",
"paramtype": "SteamAPICall_t"
}
]
},
{
"NeedsSelfPointer": false,
"classname": "SteamApi",
"methodname": "SteamInternal_GameServer_Init",
"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,
"classname": "SteamApi",
"methodname": "SteamAPI_Shutdown",
"returntype": "void"
},
{
"NeedsSelfPointer": false,
"classname": "SteamApi",
"methodname": "SteamGameServer_Shutdown",
"returntype": "void"
},
{
"NeedsSelfPointer": false,
"classname": "SteamApi",
"methodname": "SteamAPI_GetHSteamUser",
"returntype": "HSteamUser"
},
{
"NeedsSelfPointer": false,
"classname": "SteamApi",
"methodname": "SteamAPI_GetHSteamPipe",
"returntype": "HSteamPipe"
},
{
"NeedsSelfPointer": false,
"classname": "SteamApi",
"methodname": "SteamGameServer_GetHSteamUser",
"returntype": "HSteamUser"
},
{
"NeedsSelfPointer": false,
"classname": "SteamApi",
"methodname": "SteamGameServer_GetHSteamPipe",
"returntype": "HSteamPipe"
},
{
"NeedsSelfPointer": false,
"classname": "SteamApi",
"methodname": "SteamInternal_CreateInterface",
"returntype": "void *",
"params":
[
{
"paramname": "version",
"paramtype": "const char *"
}
]
},
{
"NeedsSelfPointer": false,
"classname": "SteamApi",
"methodname": "SteamAPI_RestartAppIfNecessary",
"returntype": "bool",
"params":
[
{
"paramname": "unOwnAppID",
"paramtype": "uint32"
}
]
}
]
}