From c0c4e3553b549d86be5750764d29e5478643c487 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Thu, 25 Jun 2015 07:48:03 -0600 Subject: [PATCH 01/82] Import steamworksparser.py --- __init__.py | 0 steamworksparser.py | 796 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 796 insertions(+) create mode 100644 __init__.py create mode 100644 steamworksparser.py diff --git a/__init__.py b/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/steamworksparser.py b/steamworksparser.py new file mode 100644 index 00000000..23a4bd15 --- /dev/null +++ b/steamworksparser.py @@ -0,0 +1,796 @@ +import os +import codecs +import copy +import re + +g_SkippedFiles = ( + "isteammasterserverupdater.h", # Empty + "steam_api_flat.h", # Their autogen + + # PS3-only Headers not currently supported + "isteamps3overlayrenderer.h", + "steamps3params.h", +) + +g_SkippedLines = ( + "#pragma diag_suppress", + "#pragma warning", + "CLANG_ATTR", + "END_CALLBACK_INTERNAL_END()", + "public:", + "SteamCallback_t", +) + +g_ArgAttribs = ( + "ARRAY_COUNT", + "ARRAY_COUNT_D", + "BUFFER_COUNT", + "DESC", + "OUT_ARRAY_CALL", + "OUT_ARRAY_COUNT", + "OUT_BUFFER_COUNT", + "OUT_STRING_COUNT", + "OUT_STRUCT", +) + +g_GameServerInterfaces = ( + 'isteamhttp.h', + 'isteaminventory.h', + 'isteamnetworking.h', + 'isteamutils.h', +) + + +class Settings: + warn_utf8bom = False + warn_includeguardname = False + warn_spacing = False + print_unuseddefines = False + print_skippedtypedefs = False + fake_gameserver_interfaces = False + +class BlankLine(object): + pass # linenum? + +class Comment: + def __init__(self, rawcomments, comments, rawlinecomment, linecomment): + self.rawprecomments = rawcomments + self.precomments = comments + self.rawlinecomment = rawlinecomment + self.linecomment = linecomment + +class Arg: + def __init__(self): + self.name = "" + self.type = "" + self.default = None + self.attribute = None + + +class Function: + def __init__(self): + self.name = "" + self.returntype = "" + self.args = [] # Arg + self.ifstatements = [] + self.comments = [] + self.linecomment = "" + + +class Interface: + def __init__(self): + self.name = "" + self.functions = [] # Function + self.c = None # Comment + +class Define: + def __init__(self, name, value, spacing, comments): + self.name = name + self.value = value + self.spacing = spacing + self.c = comments + +class Constant: + def __init__(self, name, value, type_, comments): + self.name = name + self.value = value + self.type = type_ + self.c = comments # Comment + +class EnumField: + def __init__(self): + self.name = "" + self.value = "" + self.prespacing = " " + self.postspacing = " " + self.c = None # Comment + +class Enum: + def __init__(self, name, comments): + self.name = name + self.fields = [] # EnumField + self.c = comments + self.endcomments = None # Comment + +class Struct: + def __init__(self, name, packsize, comments): + self.name = name + self.packsize = packsize + self.c = comments # Comment + self.fields = [] # StructField + self.callbackid = None + self.endcomments = None # Comment + +class StructField: + def __init__(self, name, typee, arraysize, comments): + self.name = name + self.type = typee + self.arraysize = arraysize + self.c = comments # Comment + +class Typedef: + def __init__(self): + self.name = "" + self.type = "" + self.filename = "" + # TODO: Comments + +class SteamFile: + def __init__(self, name): + self.name = name + self.header = [] + self.includes = [] + self.defines = [] # Define + self.constants = [] # Constant + self.enums = [] # Enum + self.structs = [] # Struct + self.callbacks = [] # Struct + self.interfaces = [] # Interface + +class ParserState: + def __init__(self, file): + self.f = file # SteamFile + self.lines = [] + self.line = "" + self.originalline = "" + self.linesplit = [] + self.linenum = 0 + self.rawcomments = [] + self.comments = [] + self.rawlinecomment = None + self.linecomment = None + self.ifstatements = [] + self.packsize = None + self.funcState = 0 + self.scopeDepth = 0 + + self.interface = None + self.function = None + self.enum = None + self.struct = None + self.callbackmacro = None + + self.bInHeader = True + self.bInMultilineComment = False + self.bInMultilineMacro = False + self.callbackid = None + + +class Parser: + files = None + typedefs = [] + + def __init__(self, folder): + self.files = [SteamFile(f) for f in os.listdir(folder) if os.path.isfile(os.path.join(folder, f)) and f.endswith(".h") and f not in g_SkippedFiles] + self.files + self.files.sort(key=lambda f: f.name) + + self.typedefs = [] + + for f in self.files: + s = ParserState(f) + filepath = os.path.join(folder, f.name) + with open(filepath, 'r') as infile: + s.lines = infile.readlines() + + if s.lines[0][:3] == codecs.BOM_UTF8: + s.lines[0] = s.lines[0][3:] + if Settings.warn_utf8bom: + printWarning("File contains a UTF8 BOM.", s) + + self.parse(s) + + # Hack to give us the GameServer interfaces. + # We want this for autogen but probably don't want it for anything else. + if Settings.fake_gameserver_interfaces: + for f in [f for f in self.files if f.name in g_GameServerInterfaces]: + gs_f = SteamFile(f.name.replace("isteam", "isteamgameserver", 1)) + gs_f.interfaces = copy.deepcopy(f.interfaces) + for i in gs_f.interfaces: + i.name = i.name.replace("ISteam", "ISteamGameServer", 1) + self.files.append(gs_f) + + def parse(self, s): + for linenum, line in enumerate(s.lines): + s.line = line + s.originalline = line + s.linenum = linenum + + s.line = s.line.rstrip() + + self.parse_comments(s) + + # Comments get removed from the line, often leaving blank lines, thus we do this after parsing comments + if not s.line: + continue + + s.linesplit = s.line.split() + + if s.bInHeader: + self.parse_header(s) + + if self.parse_skippedlines(s): + self.consume_comments(s) + continue + + self.parse_preprocessor(s) + self.parse_typedefs(s) + self.parse_constants(s) + self.parse_enums(s) + self.parse_structs(s) + self.parse_callbackmacros(s) + self.parse_interfaces(s) + self.parse_classes(s) + self.parse_scope(s) + + def parse_comments(self, s): + self.parse_comments_multiline(s) + self.parse_comments_singleline(s) + s.line = s.line.strip() + + def parse_comments_multiline(self, s): + strComment = None + multilineOpenerPos = s.line.find("/*") + bHasOpening = (multilineOpenerPos != -1) + multilineCloserPos = s.line.find("*/") + bHasClosing = (multilineCloserPos != -1) + + if s.line.count("/*") > 1 or s.line.count("*/") > 1: + printUnhandled("More than 1 of the same type of multiline comment operator on a single line.", s) + + # TODO - Ugly Code that works well + if bHasOpening: + if bHasClosing: + strComment = s.line[multilineOpenerPos+2:multilineCloserPos] + s.line = s.line[:multilineOpenerPos] + s.line[multilineCloserPos+2:] + s.bInMultilineComment = False + else: + strComment = s.line[multilineOpenerPos+2:] + s.line = s.line[:multilineOpenerPos] + s.bInMultilineComment = True + elif s.bInMultilineComment: + if bHasClosing: + strComment = s.line[:multilineCloserPos] + s.line = s.line[multilineCloserPos+2:] + s.bInMultilineComment = False + else: + strComment = s.line + s.line = "" + + if strComment is not None: + s.comments.append(strComment.rstrip()) + + def parse_comments_singleline(self, s): + if s.linecomment is not None: + s.comments.append(s.linecomment) + s.rawcomments.append(s.rawlinecomment) + s.rawlinecomment = None + s.linecomment = None + + if not s.line: + s.rawcomments.append(BlankLine()) + return + + commentPos = s.line.find("//") + + if commentPos != -1: + s.linecomment = s.line[commentPos+2:] + s.line = s.line[:commentPos] + + commentPos = s.originalline.index("//") + whitespace = len(s.originalline[:commentPos]) - len(s.originalline[:commentPos].rstrip()) + startpos = commentPos - whitespace + s.rawlinecomment = s.originalline[startpos:].rstrip() + + def parse_header(self, s): + if s.line: + s.f.header.extend(s.comments) + s.comments = [] + s.bInHeader = False + + def parse_skippedlines(self, s): + if s.line.endswith("\\"): + s.bInMultilineMacro = True + return True + + if s.bInMultilineMacro: + s.bInMultilineMacro = False + return True + + for skip in g_SkippedLines: + if skip in s.line: + return True + + return False + + def parse_preprocessor(self, s): + if not s.line.startswith("#"): + return + + if s.line == "#pragma once": + pass + elif s.line.startswith("#error"): + pass + elif s.line.startswith("#warning"): + pass + elif s.line.startswith("#elif"): + pass + elif s.line.startswith("#else"): + previf = s.ifstatements[-1] + s.ifstatements.pop() + s.ifstatements.append("!(" + previf + ") // #else") + elif s.line.startswith("#include"): + self.consume_comments(s) + includefile = s.linesplit[1] + includefile = includefile[1:-1] # Trim the "" or <> + s.f.includes.append(includefile) + elif s.line.startswith("#ifdef"): + token = s.linesplit[1] + s.ifstatements.append("defined(" + token + ")") + elif s.line.startswith("#ifndef"): + token = s.linesplit[1] + s.ifstatements.append("!defined(" + token + ")") + elif s.line.startswith("#if"): + s.ifstatements.append(s.line[3:].strip()) + elif s.line.startswith("#endif"): + s.ifstatements.pop() + elif s.line.startswith("#define"): + comments = self.consume_comments(s) + if Settings.warn_includeguardname: + if not s.ifstatements: + if s.linesplit[1] != s.f.name.upper().replace(".", "_"): + printWarning("Include guard does not match the file name.", s) + + if len(s.linesplit) > 2: + spacing = s.line[s.line.index(s.linesplit[1]) + len(s.linesplit[1]):s.line.index(s.linesplit[2])] + s.f.defines.append(Define(s.linesplit[1], s.linesplit[2], spacing, comments)) + elif Settings.print_unuseddefines: + print("Unused Define: " + s.line) + elif s.line.startswith("#pragma pack"): + if s.linesplit[2] == "push,": + s.packsize = int(s.linesplit[3]) + elif s.linesplit[2] == "pop": + s.packsize = None + else: + printUnhandled("Preprocessor", s) + + + def parse_typedefs(self, s): + if s.linesplit[0] != "typedef": + return + + self.consume_comments(s) + + # Skips typedefs in the Callback/CallResult classes + if s.scopeDepth > 0: + if Settings.print_skippedtypedefs: + print("Skipped typedef because it's in a class or struct: " + s.line) + return + + # Skips typedefs that we don't currently support, So far they are all function pointers. + if "(" in s.line or "[" in s.line: + if Settings.print_skippedtypedefs: + print("Skipped typedef because it contains '(' or '[': " + s.line) + return + + # Currently skips typedef struct ValvePackingSentinel_t + if not s.line.endswith(";"): + if Settings.print_skippedtypedefs: + print("Skipped typedef because it does not end with ';': " + s.line) + return + + typedef = Typedef() + typedef.name = s.linesplit[-1].rstrip(";") + typedef.type = " ".join(s.linesplit[1:-1]) + if typedef.name.startswith("*"): + typedef.type += " *" + typedef.name = typedef.name[1:] + + self.typedefs.append(typedef) + + + def parse_constants(self, s): + if s.linesplit[0] != "const" and not s.line.startswith("static const"): + return + + if s.scopeDepth != 0: + return + + comments = self.consume_comments(s) + + # Currently skips one unfortunate function definition where the first arg on the new line starts with const + if "=" not in s.linesplit: + return + + result = re.match(".*const\s+(.*)\s+(\w+)\s+=\s+(.*);$", s.line) + + constant = Constant(result.group(2), result.group(3), result.group(1), comments); + s.f.constants.append(constant) + + def parse_enums(self, s): + if s.enum: + if s.line == "{": + return + + if s.line.endswith("};"): + # Hack to get comments between the last field and }; :( + s.enum.endcomments = self.consume_comments(s) + s.f.enums.append(s.enum) + s.enum = None + return + + self.parse_enumfields(s) + return + + if s.linesplit[0] != "enum": + return + + comments = self.consume_comments(s) + + # Actually a constant like: enum { k_name = value }; + if "};" in s.linesplit: + # Skips lines like: "enum { k_name1 = value, k_name2 = value };" + # Currently only skips one enum in CCallbackBase + if "," in s.line: + return + + # Skips lines in macros + # Currently only skips one enum in DEFINE_CALLBACK + if s.linesplit[-1] == "\\": + return + + if s.struct: + result = re.match("^enum { k_iCallback = (.*) };", s.line) + s.callbackid = result.group(1) + return + + constant = Constant(s.linesplit[2], s.linesplit[4], "int", comments); + s.f.constants.append(constant) + return + + if len(s.linesplit) == 1: + # TODO unnamed Constants like: + ''' + enum { + k_name1 = value, + k_name2 = value, + }; + ''' + return + + s.enum = Enum(s.linesplit[1], comments) + + def parse_enumfields(self, s): + result = re.match("^(\w+,?)([ \t]*)=?([ \t]*)(.*)$", s.line) + + field = EnumField() + field.name = result.group(1) + + if result.group(4): + field.prespacing = result.group(2) + field.postspacing = result.group(3) + field.value = result.group(4) + + # HACK: This is a hack for multiline fields :( + if s.line.endswith("="): + field.value = "=" + + field.c = self.consume_comments(s) + s.enum.fields.append(field) + + def parse_structs(self, s): + if s.enum: + return + + if s.struct: + if s.line == "};": + if s.scopeDepth != 1: + return + + s.struct.endcomments = self.consume_comments(s) + + if s.callbackid: + s.struct.callbackid = s.callbackid + s.f.callbacks.append(s.struct) + s.callbackid = None + else: + s.f.structs.append(s.struct) + + s.struct = None + else: + self.parse_struct_fields(s) + + return + + if s.linesplit[0] != "struct": + return + + comments = self.consume_comments(s) + + # Skip SteamIDComponent_t and GameID_t which are a part of CSteamID/CGameID + if s.scopeDepth != 0: + return + + s.struct = Struct(s.linesplit[1], s.packsize, comments) + + def parse_struct_fields(self, s): + comments = self.consume_comments(s) + + if s.line.startswith("enum"): + return + + if s.line == "{": + return + + fieldarraysize = None + result = re.match("^(.*\s\**)(\w+);$", s.line) + if result is None: + result = re.match("^(.*\s\*?)(\w+)\[\s*(\w+)?\s*\];$", s.line) + if result is None: + return + + fieldarraysize = result.group(3) + + fieldtype = result.group(1).rstrip() + fieldname = result.group(2) + + s.struct.fields.append(StructField(fieldname, fieldtype, fieldarraysize, comments)) + + def parse_callbackmacros(self, s): + if s.callbackmacro: + comments = self.consume_comments(s) + if s.line.startswith("END_DEFINE_CALLBACK_"): + s.f.callbacks.append(s.callbackmacro) + s.callbackmacro = None + elif s.line.startswith("CALLBACK_MEMBER"): + result = re.match("^CALLBACK_MEMBER\(.*,\s+(.*?)\s*,\s*(\w*)\[?(\d+)?\]?\s*\)", s.line) + + fieldtype = result.group(1) + fieldname = result.group(2) + fieldarraysize = result.group(3) + + s.callbackmacro.fields.append(StructField(fieldname, fieldtype, fieldarraysize, comments)) + else: + printWarning("Unexpected line in Callback Macro") + + return + + if not s.line.startswith("DEFINE_CALLBACK"): + return + + comments = self.consume_comments(s) + + result = re.match("^DEFINE_CALLBACK\(\s?(\w+),\s?(.*?)\s*\)", s.line) + + s.callbackmacro = Struct(result.group(1), s.packsize, comments) + s.callbackmacro.callbackid = result.group(2) + + def parse_interfaces(self, s): + if s.line.startswith("class ISteam"): + comments = self.consume_comments(s) + if s.linesplit[1].endswith(';') or s.linesplit[1].endswith("Response"): # Ignore Forward Declares and Matchmaking Responses + return + + s.interface = Interface() + s.interface.name = s.linesplit[1] + s.interface.c = comments + + if s.interface: + self.parse_interface_functions(s) + + def parse_interface_functions(self, s): + if s.line.startswith("virtual") or s.function: + if '~' in s.line: # Skip destructor + return + + args = "" + attr = None + if s.function == None: + s.function = Function() + if len(s.ifstatements) > 1: + s.function.ifstatements = s.ifstatements[-1] + s.function.comments = s.comments + s.function.linecomment = s.linecomment + self.consume_comments(s) + + linesplit_iter = iter(enumerate(s.linesplit)) + for i, token in linesplit_iter: + if s.funcState == 0: # Return Value + if token == "virtual": + continue + + if token.startswith("*"): + s.function.returntype += "*" + token = token[1:] + s.funcState = 1 + elif "(" in token: + s.function.returntype = s.function.returntype.strip() + s.funcState = 1 + else: + s.function.returntype += token + " " + continue + + if s.funcState == 1: # Method Name + s.function.name = token.split("(", 1)[0] + + if token[-1] == ")": + s.funcState = 3 + elif token[-1] != "(": # Like f(void arg ) + if Settings.warn_spacing: + printWarning("Function is missing whitespace between the opening parentheses and first arg.", s) + token = token.split("(")[1] + s.funcState = 2 + else: + s.funcState = 2 + continue + + if s.funcState == 2: # Args + # Strip clang attributes, we really should be doing this with them in a list and looping over them. + bIsAttrib = False + for a in g_ArgAttribs: + if token.startswith(a): + bIsAttrib = True + break + if bIsAttrib: + attr = token[:token.index("(")] + if token.endswith(")"): + continue + s.funcState = 4 + continue + + if token.startswith("**"): + args += token[:2] + token = token[2:] + elif token.startswith("*") or token.startswith("&"): + args += token[0] + token = token[1:] + + if token.startswith(")"): # Like f( void arg ")" + if args: + TEST = 1 + TEST2 = 0 # TODO: Cleanup, I don't even know what the fuck is going on here anymore. + if "**" in s.linesplit[i-1]: + TEST -= 2 + TEST2 += 2 + elif "*" in s.linesplit[i-1] or "&" in s.linesplit[i-1]: + TEST -= 1 + TEST2 += 1 + + arg = Arg() + arg.type = args[:-len(s.linesplit[i-1]) - TEST].strip() + arg.name = s.linesplit[i-1][TEST2:] + arg.attribute = attr + s.function.args.append(arg) + args = "" + attr = None + s.funcState = 3 + elif token.endswith(")"): # Like f( void "arg)" + if Settings.warn_spacing: + printWarning("Function is missing whitespace between the closing parentheses and first arg.", s) + + arg = Arg() + arg.type = args.strip() + arg.name = token[:-1] + arg.attribute = attr + s.function.args.append(arg) + args = "" + attr = None + s.funcState = 3 + elif token[-1] == ",": # Like f( void "arg," void arg2 ) + TEST2 = 0 + if "*" in token[:-1] or "&" in token[:-1]: + TEST2 += 1 + + arg = Arg() + arg.type = args.strip() + arg.name = token[:-1][TEST2:] + arg.attribute = attr + s.function.args.append(arg) + args = "" + attr = None + elif token == "=": + # Copied from ")" above + TEST = 1 + TEST2 = 0 # TODO: Cleanup, I don't even know what the fuck is going on here anymore. + if "*" in s.linesplit[i-1] or "&" in s.linesplit[i-1]: + TEST -= 1 + TEST2 += 1 + + arg = Arg() + arg.type = args[:-len(s.linesplit[i-1]) - TEST].strip() + arg.name = s.linesplit[i-1][TEST2:] + arg.default = s.linesplit[i+1].rstrip(",") + arg.attribute = attr + s.function.args.append(arg) + args = "" + attr = None + next(linesplit_iter, None) + else: + args += token + " " + + continue + + if s.funcState == 3: # = 0; or line + if token.endswith(";"): + s.funcState = 0 + s.interface.functions.append(s.function) + s.function = None + break + continue + + if s.funcState == 4: # ATTRIBS + if token.endswith(")"): + s.funcState = 2 + continue + + def parse_classes(self, s): + if s.linesplit[0] != "class": + return + + if s.line.startswith("class ISteam"): + return + + self.consume_comments(s) + + #print("Skipped class: " + s.line) + + def parse_scope(self, s): + if "{" in s.line: + s.scopeDepth += 1 + + if s.line.count("{") > 1: + printWarning("Multiple occurences of '{'", s) + + if "}" in s.line: + s.scopeDepth -= 1 + + if s.interface and s.scopeDepth == 0: + s.f.interfaces.append(s.interface) + s.interface = None + + if s.scopeDepth < 0: + printWarning("scopeDepth is less than 0!", s) + + if s.line.count("}") > 1: + printWarning("Multiple occurences of '}'", s) + + def consume_comments(self, s): + c = Comment(s.rawcomments, s.comments, s.rawlinecomment, s.linecomment) + s.rawcomments = [] + s.comments = [] + s.rawlinecomment = None + s.linecomment = None + return c + + +def printWarning(string, s): + print("[WARNING] " + string + " - In File: " + s.f.name + " - On Line " + str(s.linenum) + " - " + s.line) + + +def printUnhandled(string, s): + print("[UNHANDLED] " + string + " - In File: " + s.f.name + " - On Line " + str(s.linenum) + " - " + s.line) + + +def parse(folder): + """Parses the Steamworks headers contained in a folder""" + return Parser(folder) From 1282ca5bd51da4cfd8a15f6b50e2a931ae88840b Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Fri, 26 Jun 2015 12:12:52 -0600 Subject: [PATCH 02/82] Added support for unnamed enums (enum constants) --- steamworksparser.py | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 23a4bd15..aad6097e 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -418,7 +418,9 @@ def parse_constants(self, s): comments = self.consume_comments(s) - # Currently skips one unfortunate function definition where the first arg on the new line starts with const + # Currently skips one unfortunate function definition where the first arg on the new line starts with const. Like so: + # void func(void arg1, + # const arg2) = 0; if "=" not in s.linesplit: return @@ -435,7 +437,10 @@ def parse_enums(self, s): if s.line.endswith("};"): # Hack to get comments between the last field and }; :( s.enum.endcomments = self.consume_comments(s) - s.f.enums.append(s.enum) + # Don't append unnamed (constant) enums + if s.enum.name is not None: + s.f.enums.append(s.enum) + s.enum = None return @@ -469,33 +474,44 @@ def parse_enums(self, s): return if len(s.linesplit) == 1: - # TODO unnamed Constants like: - ''' - enum { + s.enum = Enum(None, comments) + # unnamed Constants like: + '''enum { k_name1 = value, k_name2 = value, - }; - ''' + };''' return s.enum = Enum(s.linesplit[1], comments) def parse_enumfields(self, s): result = re.match("^(\w+,?)([ \t]*)=?([ \t]*)(.*)$", s.line) + comments = self.consume_comments(s) + + # HACK: This is a hack for multiline fields :( + if s.line.endswith("="): + value = "=" + else: + value = result.group(4) + + # Nameless Enums are actually just constants + if s.enum.name is None: + if s.enum.c: + comments.precomments = s.enum.c.precomments + s.enum.c = None + constant = Constant(result.group(1), value.rstrip(","), "int", comments) + s.f.constants.append(constant) + return field = EnumField() field.name = result.group(1) - if result.group(4): + if value: field.prespacing = result.group(2) field.postspacing = result.group(3) - field.value = result.group(4) - - # HACK: This is a hack for multiline fields :( - if s.line.endswith("="): - field.value = "=" + field.value = value - field.c = self.consume_comments(s) + field.c = comments s.enum.fields.append(field) def parse_structs(self, s): From 6a1ee8790d8d4e5bdd498909689826c5c55624da Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Fri, 26 Jun 2015 12:26:23 -0600 Subject: [PATCH 03/82] Added .gitignore for *.pyc files --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..0d20b648 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc From ac61d19e23aa554bf7dc0832a3a891bf550f46ac Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Tue, 4 Aug 2015 05:49:53 -0600 Subject: [PATCH 04/82] The GameServer APIContext now has a UGC accessor --- steamworksparser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/steamworksparser.py b/steamworksparser.py index aad6097e..119b3f99 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -37,6 +37,7 @@ 'isteamhttp.h', 'isteaminventory.h', 'isteamnetworking.h', + 'isteamugc.h', 'isteamutils.h', ) From 375419a2a17081c307cf0a6682302087c52d47d6 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sat, 29 Aug 2015 12:28:18 -0600 Subject: [PATCH 05/82] Fixed typedef.filename always being blank --- steamworksparser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/steamworksparser.py b/steamworksparser.py index 119b3f99..5cabdee4 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -406,6 +406,7 @@ def parse_typedefs(self, s): if typedef.name.startswith("*"): typedef.type += " *" typedef.name = typedef.name[1:] + typedef.filename = s.f.name self.typedefs.append(typedef) From d70b656553aa057bd8054f4d38af5312ddee0fcd Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Tue, 20 Oct 2015 14:35:33 -0600 Subject: [PATCH 06/82] Enable recursive parsing for multiple /**/ comment blocks on one line --- steamworksparser.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/steamworksparser.py b/steamworksparser.py index 5cabdee4..2c10bea0 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -18,6 +18,8 @@ "CLANG_ATTR", "END_CALLBACK_INTERNAL_END()", "public:", + "private:", + "protected:", "SteamCallback_t", ) @@ -256,8 +258,9 @@ def parse_comments_multiline(self, s): multilineCloserPos = s.line.find("*/") bHasClosing = (multilineCloserPos != -1) + multipleQuoteblocks = False if s.line.count("/*") > 1 or s.line.count("*/") > 1: - printUnhandled("More than 1 of the same type of multiline comment operator on a single line.", s) + multipleQuoteblocks = True # TODO - Ugly Code that works well if bHasOpening: @@ -281,6 +284,9 @@ def parse_comments_multiline(self, s): if strComment is not None: s.comments.append(strComment.rstrip()) + if multipleQuoteblocks: + self.parse_comments_multiline(s) + def parse_comments_singleline(self, s): if s.linecomment is not None: s.comments.append(s.linecomment) From 4b47e62d8273dffc7d97d499f7651029d5f8d22e Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Wed, 21 Oct 2015 03:04:55 -0600 Subject: [PATCH 07/82] Skip _STEAM_CALLBACK_ Macros --- steamworksparser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/steamworksparser.py b/steamworksparser.py index 2c10bea0..6af54504 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -21,6 +21,7 @@ "private:", "protected:", "SteamCallback_t", + "_STEAM_CALLBACK_", ) g_ArgAttribs = ( From 7058416be79e52f4c583b063e7345ff7e30e08d1 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Mon, 4 Jan 2016 13:41:42 -0600 Subject: [PATCH 08/82] Added README --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..2396c632 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +SteamworksParser +======= + +This is a simple parser for the [Steamworks](https://partner.steamgames.com/) header files that I hacked together. You might be wondering why not just use something like libclang to parse the C++. The primary reason was that I wanted to retain comments and formating information. + +SteamworksParser is used to generate the [CSteamworks](https://github.com/rlabrecque/CSteamworks) and [Steamworks.NET](https://github.com/rlabrecque/Steamworks.NET) bindings. + +Usage Example: + +Pull this package into your project folder. + + import sys + from SteamworksParser import steamworksparser + + def main(): + if len(sys.argv) != 2: + print('Usage: test.py ') + return + + steamworksparser.Settings.warn_utf8bom = True + steamworksparser.Settings.warn_includeguardname = True + steamworksparser.Settings.warn_spacing = True + parser = steamworksparser.parse(sys.argv[1]) + + with open('test.json', 'w') as out: + out.write('{\n') + + out.write(' "typedefs":[\n') + for typedef in parser.typedefs: + out.write(' {\n') + out.write(' "typedef":"' + typedef.name + '",\n') + out.write(' "type":"' + typedef.type + '"\n') + out.write(' },\n') + + + if __name__ == '__main__': + main() From a1aa3fc934d4eea1b7be9940b7c77dabfffeb678 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Mon, 4 Jan 2016 13:42:27 -0600 Subject: [PATCH 09/82] Added MIT license --- LICENSE.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 00000000..ceb4e1e3 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016 Riley Labrecque + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. From 04e1053c364d20afc187dabaf8a9829fc9943d41 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sat, 13 Feb 2016 19:12:08 -0600 Subject: [PATCH 10/82] ArgAttribute improvements --- steamworksparser.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 6af54504..f1e9789f 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -32,6 +32,7 @@ "OUT_ARRAY_CALL", "OUT_ARRAY_COUNT", "OUT_BUFFER_COUNT", + "OUT_STRING", "OUT_STRING_COUNT", "OUT_STRUCT", ) @@ -63,12 +64,17 @@ def __init__(self, rawcomments, comments, rawlinecomment, linecomment): self.rawlinecomment = rawlinecomment self.linecomment = linecomment +class ArgAttribute: + def __init__(self): + self.name = "" + self.value = "" + class Arg: def __init__(self): self.name = "" self.type = "" self.default = None - self.attribute = None + self.attribute = None # ArgAttribute class Function: @@ -670,15 +676,17 @@ def parse_interface_functions(self, s): continue if s.funcState == 2: # Args - # Strip clang attributes, we really should be doing this with them in a list and looping over them. + # Strip clang attributes bIsAttrib = False for a in g_ArgAttribs: if token.startswith(a): + attr = ArgAttribute() bIsAttrib = True break if bIsAttrib: - attr = token[:token.index("(")] + attr.name = token[:token.index("(")] if token.endswith(")"): + attr.value = token[token.index("(")+1:token.index(")")] continue s.funcState = 4 continue @@ -764,6 +772,7 @@ def parse_interface_functions(self, s): continue if s.funcState == 4: # ATTRIBS + attr.value += token.rstrip(")") if token.endswith(")"): s.funcState = 2 continue From 64a8694f86af0ad2999f96e2835fae5f4b95e838 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sat, 13 Feb 2016 19:14:59 -0600 Subject: [PATCH 11/82] Added parsing FunctionAttributes --- steamworksparser.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index f1e9789f..4230f999 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -24,6 +24,13 @@ "_STEAM_CALLBACK_", ) +g_FuncAttribs = ( + "METHOD_DESC", + "IGNOREATTR", + "CALL_RESULT", + "CALL_BACK", +) + g_ArgAttribs = ( "ARRAY_COUNT", "ARRAY_COUNT_D", @@ -76,6 +83,10 @@ def __init__(self): self.default = None self.attribute = None # ArgAttribute +class FunctionAttribute: + def __init__(self): + self.name = "" + self.value = "" class Function: def __init__(self): @@ -85,7 +96,7 @@ def __init__(self): self.ifstatements = [] self.comments = [] self.linecomment = "" - + self.attributes = [] # FunctionAttribute class Interface: def __init__(self): @@ -184,7 +195,7 @@ def __init__(self, file): self.bInMultilineComment = False self.bInMultilineMacro = False self.callbackid = None - + self.functionAttributes = [] # FunctionAttribute class Parser: files = None @@ -629,7 +640,16 @@ def parse_interfaces(self, s): if s.interface: self.parse_interface_functions(s) + def parse_interface_function_atrributes(self, s): + for a in g_FuncAttribs: + if s.line.startswith(a): + attr = FunctionAttribute() + attr.name = s.line[:s.line.index("(")] + attr.value = s.line[s.line.index("(")+1:s.line.rindex(")")].strip() + s.functionAttributes.append(attr) + def parse_interface_functions(self, s): + self.parse_interface_function_atrributes(s) if s.line.startswith("virtual") or s.function: if '~' in s.line: # Skip destructor return @@ -642,6 +662,8 @@ def parse_interface_functions(self, s): s.function.ifstatements = s.ifstatements[-1] s.function.comments = s.comments s.function.linecomment = s.linecomment + s.function.attributes = s.functionAttributes + s.functionAttributes = [] self.consume_comments(s) linesplit_iter = iter(enumerate(s.linesplit)) From 607f2d213610a971d2068cced3c53e3e562532a7 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sat, 13 Feb 2016 19:15:21 -0600 Subject: [PATCH 12/82] Parse STEAM_PRIVATE_API() --- steamworksparser.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/steamworksparser.py b/steamworksparser.py index 4230f999..8ebaf3e6 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -97,6 +97,7 @@ def __init__(self): self.comments = [] self.linecomment = "" self.attributes = [] # FunctionAttribute + self.private = False; class Interface: def __init__(self): @@ -650,6 +651,13 @@ def parse_interface_function_atrributes(self, s): def parse_interface_functions(self, s): self.parse_interface_function_atrributes(s) + + private = False + if s.line.startswith("STEAM_PRIVATE_API"): + s.line = s.line[s.line.index("(")+1:s.line.rindex(")")].strip() + s.linesplit = s.linesplit[1:-1] + private = True + if s.line.startswith("virtual") or s.function: if '~' in s.line: # Skip destructor return @@ -662,6 +670,7 @@ def parse_interface_functions(self, s): s.function.ifstatements = s.ifstatements[-1] s.function.comments = s.comments s.function.linecomment = s.linecomment + s.function.private = private s.function.attributes = s.functionAttributes s.functionAttributes = [] self.consume_comments(s) From ed2714caee548b22454c085ae69c8949f3c96cfa Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sun, 5 Jun 2016 16:51:52 -0600 Subject: [PATCH 13/82] Skip parsing #pragma and #undef And sorted Skippedlines --- steamworksparser.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 8ebaf3e6..da58ee1c 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -13,14 +13,18 @@ ) g_SkippedLines = ( - "#pragma diag_suppress", - "#pragma warning", + #isteamclient.h + "#define END_CALLBACK_INTERNAL_END()", + "#define END_DEFINE_CALLBACK_0()", + "SteamCallback_t", + + # steamtypes.h "CLANG_ATTR", - "END_CALLBACK_INTERNAL_END()", + + # Multiple "public:", "private:", "protected:", - "SteamCallback_t", "_STEAM_CALLBACK_", ) @@ -353,14 +357,6 @@ def parse_preprocessor(self, s): if not s.line.startswith("#"): return - if s.line == "#pragma once": - pass - elif s.line.startswith("#error"): - pass - elif s.line.startswith("#warning"): - pass - elif s.line.startswith("#elif"): - pass elif s.line.startswith("#else"): previf = s.ifstatements[-1] s.ifstatements.pop() @@ -397,6 +393,16 @@ def parse_preprocessor(self, s): s.packsize = int(s.linesplit[3]) elif s.linesplit[2] == "pop": s.packsize = None + elif s.line.startswith("#pragma"): + pass + elif s.line.startswith("#error"): + pass + elif s.line.startswith("#warning"): + pass + elif s.line.startswith("#elif"): + pass + elif s.line.startswith("#undef"): + pass else: printUnhandled("Preprocessor", s) From d4409017985823f4dd982e70a2de6b4917261357 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sun, 5 Jun 2016 16:52:33 -0600 Subject: [PATCH 14/82] Allow setting ArgAttribute upon creation --- steamworksparser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index da58ee1c..63e308cc 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -76,9 +76,9 @@ def __init__(self, rawcomments, comments, rawlinecomment, linecomment): self.linecomment = linecomment class ArgAttribute: - def __init__(self): - self.name = "" - self.value = "" + def __init__(self, name="", value=""): + self.name = name + self.value = value class Arg: def __init__(self): From bad3b10843697d11acd1632dfd8e4e90520f3798 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Wed, 7 Sep 2016 15:47:18 -0600 Subject: [PATCH 15/82] Fixed loading CP-1252 files on linux... --- steamworksparser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/steamworksparser.py b/steamworksparser.py index 63e308cc..1bfad4d9 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -216,7 +216,7 @@ def __init__(self, folder): for f in self.files: s = ParserState(f) filepath = os.path.join(folder, f.name) - with open(filepath, 'r') as infile: + with open(filepath, 'r', encoding="latin-1") as infile: s.lines = infile.readlines() if s.lines[0][:3] == codecs.BOM_UTF8: From 10ad883a672c5ae6af2e20d310862a8dc6662eaa Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sat, 11 Mar 2017 03:06:18 -0600 Subject: [PATCH 16/82] Added typedefs to comments and made typedefs exist per file. --- steamworksparser.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 1bfad4d9..6bee2148 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -28,7 +28,7 @@ "_STEAM_CALLBACK_", ) -g_FuncAttribs = ( +g_FuncAttribs = ( "METHOD_DESC", "IGNOREATTR", "CALL_RESULT", @@ -155,11 +155,11 @@ def __init__(self, name, typee, arraysize, comments): self.c = comments # Comment class Typedef: - def __init__(self): - self.name = "" - self.type = "" - self.filename = "" - # TODO: Comments + def __init__(self, name, typee, filename, comments): + self.name = name + self.type = typee + self.filename = filename + self.c = comments class SteamFile: def __init__(self, name): @@ -172,6 +172,7 @@ def __init__(self, name): self.structs = [] # Struct self.callbacks = [] # Struct self.interfaces = [] # Interface + self.typedefs = [] # Typedef class ParserState: def __init__(self, file): @@ -189,7 +190,7 @@ def __init__(self, file): self.packsize = None self.funcState = 0 self.scopeDepth = 0 - + self.interface = None self.function = None self.enum = None @@ -411,7 +412,7 @@ def parse_typedefs(self, s): if s.linesplit[0] != "typedef": return - self.consume_comments(s) + comments = self.consume_comments(s) # Skips typedefs in the Callback/CallResult classes if s.scopeDepth > 0: @@ -431,15 +432,16 @@ def parse_typedefs(self, s): print("Skipped typedef because it does not end with ';': " + s.line) return - typedef = Typedef() - typedef.name = s.linesplit[-1].rstrip(";") - typedef.type = " ".join(s.linesplit[1:-1]) - if typedef.name.startswith("*"): - typedef.type += " *" - typedef.name = typedef.name[1:] - typedef.filename = s.f.name + name = s.linesplit[-1].rstrip(";") + typee = " ".join(s.linesplit[1:-1]) + if name.startswith("*"): + typee += " *" + name = name[1:] + + typedef = Typedef(name, typee, s.f.name, comments) self.typedefs.append(typedef) + s.f.typedefs.append(typedef) def parse_constants(self, s): From 4750a2dcd0006a6aacbdcee98b57eb2ebed9e0c8 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Mon, 14 Aug 2017 16:11:18 -0600 Subject: [PATCH 17/82] Updated GameServerInterfaces --- steamworksparser.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 6bee2148..7c3f4fe2 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -49,11 +49,15 @@ ) g_GameServerInterfaces = ( - 'isteamhttp.h', - 'isteaminventory.h', + 'isteamclient.h', + #'isteamgameserver.h', + 'isteamutils.h', 'isteamnetworking.h', + #'isteamgameserverstats.h', + 'isteaminventory.h', + 'isteamhttp.h', 'isteamugc.h', - 'isteamutils.h', + 'isteamapps.h', ) @@ -81,11 +85,11 @@ def __init__(self, name="", value=""): self.value = value class Arg: - def __init__(self): - self.name = "" - self.type = "" - self.default = None - self.attribute = None # ArgAttribute + def __init__(self, name="", type_="", default=None, attribute=None): + self.name = name + self.type = type_ + self.default = default + self.attribute = attribute # ArgAttribute class FunctionAttribute: def __init__(self): From 1371f0b02870b88199ca3ba6dffab383c12c5d55 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sat, 6 Jan 2018 18:23:16 -0600 Subject: [PATCH 18/82] Updated for Steamworks 1.42 --- steamworksparser.py | 257 ++++++++++++++++++++++---------------------- 1 file changed, 131 insertions(+), 126 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 7c3f4fe2..f148a232 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -60,7 +60,6 @@ 'isteamapps.h', ) - class Settings: warn_utf8bom = False warn_includeguardname = False @@ -670,155 +669,161 @@ def parse_interface_functions(self, s): s.linesplit = s.linesplit[1:-1] private = True - if s.line.startswith("virtual") or s.function: - if '~' in s.line: # Skip destructor - return + # Skip lines that don't start with virtual, except when we're currently parsing a function + if not s.line.startswith("virtual") and not s.function: + return - args = "" - attr = None - if s.function == None: - s.function = Function() - if len(s.ifstatements) > 1: - s.function.ifstatements = s.ifstatements[-1] - s.function.comments = s.comments - s.function.linecomment = s.linecomment - s.function.private = private - s.function.attributes = s.functionAttributes - s.functionAttributes = [] - self.consume_comments(s) + if '~' in s.line: # Skip destructor + return - linesplit_iter = iter(enumerate(s.linesplit)) - for i, token in linesplit_iter: - if s.funcState == 0: # Return Value - if token == "virtual": - continue + args = "" + attr = None + if s.function == None: + s.function = Function() + if len(s.ifstatements) > 1: + s.function.ifstatements = s.ifstatements[-1] + s.function.comments = s.comments + s.function.linecomment = s.linecomment + s.function.private = private + s.function.attributes = s.functionAttributes + s.functionAttributes = [] + self.consume_comments(s) - if token.startswith("*"): - s.function.returntype += "*" - token = token[1:] - s.funcState = 1 - elif "(" in token: - s.function.returntype = s.function.returntype.strip() - s.funcState = 1 - else: - s.function.returntype += token + " " - continue + linesplit_iter = iter(enumerate(s.linesplit)) + for i, token in linesplit_iter: + if s.funcState == 0: # Return Value + if token == "virtual": + continue - if s.funcState == 1: # Method Name - s.function.name = token.split("(", 1)[0] - - if token[-1] == ")": - s.funcState = 3 - elif token[-1] != "(": # Like f(void arg ) - if Settings.warn_spacing: - printWarning("Function is missing whitespace between the opening parentheses and first arg.", s) - token = token.split("(")[1] - s.funcState = 2 - else: - s.funcState = 2 - continue + if token.startswith("*"): + s.function.returntype += "*" + token = token[1:] + s.funcState = 1 + elif "(" in token: + s.function.returntype = s.function.returntype.strip() + s.funcState = 1 + else: + s.function.returntype += token + " " + continue + + if s.funcState == 1: # Method Name + s.function.name = token.split("(", 1)[0] + + if token[-1] == ")": + s.funcState = 3 + elif token[-1] != "(": # Like f(void arg ) + if Settings.warn_spacing: + printWarning("Function is missing whitespace between the opening parentheses and first arg.", s) + token = token.split("(")[1] + s.funcState = 2 + else: + s.funcState = 2 + continue - if s.funcState == 2: # Args - # Strip clang attributes - bIsAttrib = False - for a in g_ArgAttribs: - if token.startswith(a): - attr = ArgAttribute() - bIsAttrib = True - break - if bIsAttrib: - attr.name = token[:token.index("(")] - if token.endswith(")"): - attr.value = token[token.index("(")+1:token.index(")")] - continue - s.funcState = 4 + if s.funcState == 2: # Args + # Strip clang attributes + bIsAttrib = False + for a in g_ArgAttribs: + if token.startswith(a): + attr = ArgAttribute() + bIsAttrib = True + break + if bIsAttrib: + attr.name = token[:token.index("(")] + if token.endswith(")"): + attr.value = token[token.index("(")+1:token.index(")")] continue + s.funcState = 4 + continue - if token.startswith("**"): - args += token[:2] - token = token[2:] - elif token.startswith("*") or token.startswith("&"): - args += token[0] - token = token[1:] - - if token.startswith(")"): # Like f( void arg ")" - if args: - TEST = 1 - TEST2 = 0 # TODO: Cleanup, I don't even know what the fuck is going on here anymore. - if "**" in s.linesplit[i-1]: - TEST -= 2 - TEST2 += 2 - elif "*" in s.linesplit[i-1] or "&" in s.linesplit[i-1]: - TEST -= 1 - TEST2 += 1 - - arg = Arg() - arg.type = args[:-len(s.linesplit[i-1]) - TEST].strip() - arg.name = s.linesplit[i-1][TEST2:] - arg.attribute = attr - s.function.args.append(arg) - args = "" - attr = None - s.funcState = 3 - elif token.endswith(")"): # Like f( void "arg)" - if Settings.warn_spacing: - printWarning("Function is missing whitespace between the closing parentheses and first arg.", s) + if token.startswith("**"): + args += token[:2] + token = token[2:] + elif token.startswith("*") or token.startswith("&"): + args += token[0] + token = token[1:] - arg = Arg() - arg.type = args.strip() - arg.name = token[:-1] - arg.attribute = attr - s.function.args.append(arg) - args = "" - attr = None - s.funcState = 3 - elif token[-1] == ",": # Like f( void "arg," void arg2 ) - TEST2 = 0 - if "*" in token[:-1] or "&" in token[:-1]: - TEST2 += 1 + if len(token) == 0: + continue - arg = Arg() - arg.type = args.strip() - arg.name = token[:-1][TEST2:] - arg.attribute = attr - s.function.args.append(arg) - args = "" - attr = None - elif token == "=": - # Copied from ")" above + if token.startswith(")"): # Like f( void arg ")" + if args: TEST = 1 TEST2 = 0 # TODO: Cleanup, I don't even know what the fuck is going on here anymore. - if "*" in s.linesplit[i-1] or "&" in s.linesplit[i-1]: + if "**" in s.linesplit[i-1]: + TEST -= 2 + TEST2 += 2 + elif "*" in s.linesplit[i-1] or "&" in s.linesplit[i-1]: TEST -= 1 TEST2 += 1 arg = Arg() arg.type = args[:-len(s.linesplit[i-1]) - TEST].strip() arg.name = s.linesplit[i-1][TEST2:] - arg.default = s.linesplit[i+1].rstrip(",") arg.attribute = attr s.function.args.append(arg) args = "" attr = None - next(linesplit_iter, None) - else: - args += token + " " + s.funcState = 3 + elif token.endswith(")"): # Like f( void "arg)" + if Settings.warn_spacing: + printWarning("Function is missing whitespace between the closing parentheses and first arg.", s) + + arg = Arg() + arg.type = args.strip() + arg.name = token[:-1] + arg.attribute = attr + s.function.args.append(arg) + args = "" + attr = None + s.funcState = 3 + elif token[-1] == ",": # Like f( void "arg," void arg2 ) + TEST2 = 0 + if "*" in token[:-1] or "&" in token[:-1]: + TEST2 += 1 + + arg = Arg() + arg.type = args.strip() + arg.name = token[:-1][TEST2:] + arg.attribute = attr + s.function.args.append(arg) + args = "" + attr = None + elif token == "=": + # Copied from ")" above + TEST = 1 + TEST2 = 0 # TODO: Cleanup, I don't even know what the fuck is going on here anymore. + if "*" in s.linesplit[i-1] or "&" in s.linesplit[i-1]: + TEST -= 1 + TEST2 += 1 + + arg = Arg() + arg.type = args[:-len(s.linesplit[i-1]) - TEST].strip() + arg.name = s.linesplit[i-1][TEST2:] + arg.default = s.linesplit[i+1].rstrip(",") + arg.attribute = attr + s.function.args.append(arg) + args = "" + attr = None + next(linesplit_iter, None) + else: + args += token + " " - continue + continue - if s.funcState == 3: # = 0; or line - if token.endswith(";"): - s.funcState = 0 - s.interface.functions.append(s.function) - s.function = None - break - continue + if s.funcState == 3: # = 0; or line + if token.endswith(";"): + s.funcState = 0 + s.interface.functions.append(s.function) + s.function = None + break + continue - if s.funcState == 4: # ATTRIBS - attr.value += token.rstrip(")") - if token.endswith(")"): - s.funcState = 2 - continue + if s.funcState == 4: # ATTRIBS + attr.value += token.rstrip(")") + if token.endswith(")"): + s.funcState = 2 + continue def parse_classes(self, s): if s.linesplit[0] != "class": From 0103d471baa1bd95631e9a29a53aaf4ef5b3f4b7 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sat, 2 Mar 2019 21:51:53 -0500 Subject: [PATCH 19/82] Updated for Steamworks 1.43 --- LICENSE.txt | 2 +- steamworksparser.py | 56 +++++++++++++++++++++++++-------------------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index ceb4e1e3..df6fa3b7 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2016 Riley Labrecque +Copyright (c) 2015-2019 Riley Labrecque Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/steamworksparser.py b/steamworksparser.py index f148a232..0d363740 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -13,39 +13,45 @@ ) g_SkippedLines = ( - #isteamclient.h - "#define END_CALLBACK_INTERNAL_END()", - "#define END_DEFINE_CALLBACK_0()", - "SteamCallback_t", - # steamtypes.h - "CLANG_ATTR", + "STEAM_CLANG_ATTR", + + # steamclientpublic.h + "BIsOculusHMD", + "BIsWindowsMRHeadset", + "BIsHuaweiHeadset", + "BIsViveHMD", # Multiple "public:", "private:", "protected:", "_STEAM_CALLBACK_", + "#define STEAM_CALLBACK_BEGIN", + "#define STEAM_CALLBACK_END", + "#define STEAM_CALLBACK_MEMBER", + "STEAM_DEFINE_INTERFACE_ACCESSOR", + "inline" ) g_FuncAttribs = ( - "METHOD_DESC", - "IGNOREATTR", - "CALL_RESULT", - "CALL_BACK", + "STEAM_METHOD_DESC", + "STEAM_IGNOREATTR", + "STEAM_CALL_RESULT", + "STEAM_CALL_BACK", ) g_ArgAttribs = ( - "ARRAY_COUNT", - "ARRAY_COUNT_D", - "BUFFER_COUNT", - "DESC", - "OUT_ARRAY_CALL", - "OUT_ARRAY_COUNT", - "OUT_BUFFER_COUNT", - "OUT_STRING", - "OUT_STRING_COUNT", - "OUT_STRUCT", + "STEAM_ARRAY_COUNT", + "STEAM_ARRAY_COUNT_D", + "STEAM_BUFFER_COUNT", + "STEAM_DESC", + "STEAM_OUT_ARRAY_CALL", + "STEAM_OUT_ARRAY_COUNT", + "STEAM_OUT_BUFFER_COUNT", + "STEAM_OUT_STRING", + "STEAM_OUT_STRING_COUNT", + "STEAM_OUT_STRUCT", ) g_GameServerInterfaces = ( @@ -613,11 +619,11 @@ def parse_struct_fields(self, s): def parse_callbackmacros(self, s): if s.callbackmacro: comments = self.consume_comments(s) - if s.line.startswith("END_DEFINE_CALLBACK_"): + if s.line.startswith("STEAM_CALLBACK_END("): s.f.callbacks.append(s.callbackmacro) s.callbackmacro = None - elif s.line.startswith("CALLBACK_MEMBER"): - result = re.match("^CALLBACK_MEMBER\(.*,\s+(.*?)\s*,\s*(\w*)\[?(\d+)?\]?\s*\)", s.line) + elif s.line.startswith("STEAM_CALLBACK_MEMBER"): + result = re.match("^STEAM_CALLBACK_MEMBER\(.*,\s+(.*?)\s*,\s*(\w*)\[?(\d+)?\]?\s*\)", s.line) fieldtype = result.group(1) fieldname = result.group(2) @@ -629,12 +635,12 @@ def parse_callbackmacros(self, s): return - if not s.line.startswith("DEFINE_CALLBACK"): + if not s.line.startswith("STEAM_CALLBACK_BEGIN"): return comments = self.consume_comments(s) - result = re.match("^DEFINE_CALLBACK\(\s?(\w+),\s?(.*?)\s*\)", s.line) + result = re.match("^STEAM_CALLBACK_BEGIN\(\s?(\w+),\s?(.*?)\s*\)", s.line) s.callbackmacro = Struct(result.group(1), s.packsize, comments) s.callbackmacro.callbackid = result.group(2) From c3dbdb8a1b881832399a44528166f6a17fe8f5f7 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sun, 25 Aug 2019 14:56:10 -0700 Subject: [PATCH 20/82] Update for 1.44, skipping SteamNetworkingSockets for now --- steamworksparser.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/steamworksparser.py b/steamworksparser.py index 0d363740..150935d2 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -5,11 +5,18 @@ g_SkippedFiles = ( "isteammasterserverupdater.h", # Empty - "steam_api_flat.h", # Their autogen + "steam_api_flat.h", # Valve's C API # PS3-only Headers not currently supported "isteamps3overlayrenderer.h", "steamps3params.h", + + # SteamNetworkingSockets is currently unsupported. + "steamnetworkingtypes.h", + "isteamnetworkingsockets.h", + "isteamnetworkingutils.h", + "steamdatagram_ticketgen.h", + "steamdatagram_tickets.h", ) g_SkippedLines = ( From 006f8e54825da695b3238b5ad9cde77ca555e1af Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sat, 7 Sep 2019 18:40:51 -0700 Subject: [PATCH 21/82] Fix attribute value parsing --- steamworksparser.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 150935d2..40e7e9e4 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -742,10 +742,14 @@ def parse_interface_functions(self, s): bIsAttrib = True break if bIsAttrib: - attr.name = token[:token.index("(")] - if token.endswith(")"): - attr.value = token[token.index("(")+1:token.index(")")] - continue + openparen_index = token.index("(") + attr.name = token[:openparen_index] + if len(token) > openparen_index+1: + if token.endswith(")"): + attr.value = token[openparen_index+1:-1] + continue + else: + attr.value = token[openparen_index+1:] s.funcState = 4 continue @@ -833,9 +837,11 @@ def parse_interface_functions(self, s): continue if s.funcState == 4: # ATTRIBS - attr.value += token.rstrip(")") if token.endswith(")"): + attr.value += token[:-1] s.funcState = 2 + else: + attr.value += token continue def parse_classes(self, s): From c53c863b00d5784842a67e9a6ed0c749fa6dfffb Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Fri, 6 Dec 2019 15:53:54 -0800 Subject: [PATCH 22/82] Ignore steamnetworkingsockets.h --- steamworksparser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/steamworksparser.py b/steamworksparser.py index 40e7e9e4..d97f6c3b 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -13,6 +13,7 @@ # SteamNetworkingSockets is currently unsupported. "steamnetworkingtypes.h", + "steamnetworkingsockets.h", "isteamnetworkingsockets.h", "isteamnetworkingutils.h", "steamdatagram_ticketgen.h", From 86d4a413e0b565ead77ca262c52511e5dc5d339a Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sun, 23 Feb 2020 15:05:19 -0800 Subject: [PATCH 23/82] Update for Steamworks SDK 1.48 --- steamworksparser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/steamworksparser.py b/steamworksparser.py index d97f6c3b..299b2c2c 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -13,7 +13,6 @@ # SteamNetworkingSockets is currently unsupported. "steamnetworkingtypes.h", - "steamnetworkingsockets.h", "isteamnetworkingsockets.h", "isteamnetworkingutils.h", "steamdatagram_ticketgen.h", @@ -47,6 +46,7 @@ "STEAM_IGNOREATTR", "STEAM_CALL_RESULT", "STEAM_CALL_BACK", + "STEAM_FLAT_NAME", ) g_ArgAttribs = ( From e728bbd74c664630ca91c73687808434befb6970 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sun, 5 Apr 2020 14:52:54 -0700 Subject: [PATCH 24/82] Add some support for steamnetworkingtypes.h --- steamworksparser.py | 49 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 299b2c2c..d410f59f 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -11,8 +11,6 @@ "isteamps3overlayrenderer.h", "steamps3params.h", - # SteamNetworkingSockets is currently unsupported. - "steamnetworkingtypes.h", "isteamnetworkingsockets.h", "isteamnetworkingutils.h", "steamdatagram_ticketgen.h", @@ -38,7 +36,23 @@ "#define STEAM_CALLBACK_END", "#define STEAM_CALLBACK_MEMBER", "STEAM_DEFINE_INTERFACE_ACCESSOR", - "inline" + "inline", + + # steamnetworkingtypes.h + "STEAMNETWORKINGSOCKETS_STEAM", + "STEAMNETWORKINGSOCKETS_INTERFACE", + #"STEAMNETWORKINGSOCKETS_STATIC_LINK", + "STEAMNETWORKINGSOCKETS_STEAMCLIENT", + "STEAMNETWORKINGSOCKETS_ENABLE_SDR", + "STEAMNETWORKINGSOCKETS_ENABLE_P2P", +) + +g_SkippedStructs = ( + # steamnetworkingtypes.h + "SteamNetworkingIPAddr", + "SteamNetworkingIdentity", + "SteamNetworkingMessage_t", + "SteamNetworkingConfigValue_t", ) g_FuncAttribs = ( @@ -204,7 +218,7 @@ def __init__(self, file): self.rawlinecomment = None self.linecomment = None self.ifstatements = [] - self.packsize = None + self.packsize = [] self.funcState = 0 self.scopeDepth = 0 @@ -357,6 +371,20 @@ def parse_header(self, s): s.bInHeader = False def parse_skippedlines(self, s): + if s.struct and s.struct.name in g_SkippedStructs: + self.parse_scope(s) + if s.line == "};": + if s.scopeDepth == 0: + s.struct = None + return True + + if "!defined(API_GEN)" in s.ifstatements: + if s.line.startswith("#if"): + s.ifstatements.append("ugh") + elif s.line.startswith("#endif"): + s.ifstatements.pop() + return True + if s.line.endswith("\\"): s.bInMultilineMacro = True return True @@ -407,10 +435,11 @@ def parse_preprocessor(self, s): elif Settings.print_unuseddefines: print("Unused Define: " + s.line) elif s.line.startswith("#pragma pack"): - if s.linesplit[2] == "push,": - s.packsize = int(s.linesplit[3]) - elif s.linesplit[2] == "pop": - s.packsize = None + if "push" in s.line: + tmpline = s.line[s.line.index(",")+1:-1].strip() + s.packsize.append(int(tmpline)) + elif "pop" in s.line: + s.packsize.pop elif s.line.startswith("#pragma"): pass elif s.line.startswith("#error"): @@ -593,6 +622,10 @@ def parse_structs(self, s): if s.linesplit[0] != "struct": return + # Skip Forward Declares + if s.linesplit[1].endswith(";"): + return + comments = self.consume_comments(s) # Skip SteamIDComponent_t and GameID_t which are a part of CSteamID/CGameID From 4c196e10a93f61e900fa0ce6a284721ff2b81462 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sun, 5 Apr 2020 17:03:21 -0700 Subject: [PATCH 25/82] Add support for isteamnetworkingutils.h --- steamworksparser.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index d410f59f..fe5c3971 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -12,8 +12,6 @@ "steamps3params.h", "isteamnetworkingsockets.h", - "isteamnetworkingutils.h", - "steamdatagram_ticketgen.h", "steamdatagram_tickets.h", ) @@ -39,12 +37,7 @@ "inline", # steamnetworkingtypes.h - "STEAMNETWORKINGSOCKETS_STEAM", "STEAMNETWORKINGSOCKETS_INTERFACE", - #"STEAMNETWORKINGSOCKETS_STATIC_LINK", - "STEAMNETWORKINGSOCKETS_STEAMCLIENT", - "STEAMNETWORKINGSOCKETS_ENABLE_SDR", - "STEAMNETWORKINGSOCKETS_ENABLE_P2P", ) g_SkippedStructs = ( From a70afd95a05e1308655a44b37c99586747e37362 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sat, 11 Apr 2020 16:17:35 -0700 Subject: [PATCH 26/82] Add support for steamnetworkingsockets.h and steamdatagram_tickets.h --- steamworksparser.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index fe5c3971..57295922 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -10,9 +10,6 @@ # PS3-only Headers not currently supported "isteamps3overlayrenderer.h", "steamps3params.h", - - "isteamnetworkingsockets.h", - "steamdatagram_tickets.h", ) g_SkippedLines = ( @@ -35,9 +32,6 @@ "#define STEAM_CALLBACK_MEMBER", "STEAM_DEFINE_INTERFACE_ACCESSOR", "inline", - - # steamnetworkingtypes.h - "STEAMNETWORKINGSOCKETS_INTERFACE", ) g_SkippedStructs = ( @@ -46,6 +40,10 @@ "SteamNetworkingIdentity", "SteamNetworkingMessage_t", "SteamNetworkingConfigValue_t", + + # steamdatagram_tickets.h + "SteamDatagramHostedAddress", + "SteamDatagramRelayAuthTicket", ) g_FuncAttribs = ( From 9c9c6d306d52e8c64f4e54c4cf659489e3992265 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sat, 11 Apr 2020 16:39:18 -0700 Subject: [PATCH 27/82] Add game server versions of isteamnetworkingutils and isteamnetworkingsockets --- steamworksparser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/steamworksparser.py b/steamworksparser.py index 57295922..45e633d1 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -77,6 +77,8 @@ 'isteamhttp.h', 'isteamugc.h', 'isteamapps.h', + 'isteamnetworkingutils.h', + 'isteamnetworkingsockets.h', ) class Settings: From 9db207db07e252523756fc51704bd984be47e931 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sat, 20 Mar 2021 15:19:38 -0700 Subject: [PATCH 28/82] Stop parsing isteamcontroller.h --- steamworksparser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/steamworksparser.py b/steamworksparser.py index 45e633d1..b040e650 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -10,6 +10,9 @@ # PS3-only Headers not currently supported "isteamps3overlayrenderer.h", "steamps3params.h", + + # Deprecated, moved to isteaminput.h + "isteamcontroller.h", ) g_SkippedLines = ( From 596ce6dba470a6434f09e4a609829c6987284dbc Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sat, 20 Mar 2021 15:24:31 -0700 Subject: [PATCH 29/82] Update README and LICENSE --- LICENSE.txt | 2 +- README.md | 65 ++++++++++++++++++++++++++++------------------------- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index df6fa3b7..338a2e47 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2019 Riley Labrecque +Copyright (c) 2015-2021 Riley Labrecque Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 2396c632..563cc5ea 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,40 @@ -SteamworksParser -======= +# SteamworksParser -This is a simple parser for the [Steamworks](https://partner.steamgames.com/) header files that I hacked together. You might be wondering why not just use something like libclang to parse the C++. The primary reason was that I wanted to retain comments and formating information. +This is a simple parser for the [Steamworks](https://partner.steamgames.com/) header files. -SteamworksParser is used to generate the [CSteamworks](https://github.com/rlabrecque/CSteamworks) and [Steamworks.NET](https://github.com/rlabrecque/Steamworks.NET) bindings. +SteamworksParser is used to generate the [Steamworks.NET](https://github.com/rlabrecque/Steamworks.NET) bindings via [Steamworks.NET-CodeGen](https://github.com/rlabrecque/Steamworks.NET-CodeGen). -Usage Example: +You might be wondering why not just use something like libclang to parse the C++. The primary reason was that I wanted to retain comments and formating information. + +## Usage Example Pull this package into your project folder. - import sys - from SteamworksParser import steamworksparser - - def main(): - if len(sys.argv) != 2: - print('Usage: test.py ') - return - - steamworksparser.Settings.warn_utf8bom = True - steamworksparser.Settings.warn_includeguardname = True - steamworksparser.Settings.warn_spacing = True - parser = steamworksparser.parse(sys.argv[1]) - - with open('test.json', 'w') as out: - out.write('{\n') - - out.write(' "typedefs":[\n') - for typedef in parser.typedefs: - out.write(' {\n') - out.write(' "typedef":"' + typedef.name + '",\n') - out.write(' "type":"' + typedef.type + '"\n') - out.write(' },\n') - - - if __name__ == '__main__': - main() +```python + import sys + from SteamworksParser import steamworksparser + + def main(): + if len(sys.argv) != 2: + print('Usage: test.py ') + return + + steamworksparser.Settings.warn_utf8bom = True + steamworksparser.Settings.warn_includeguardname = True + steamworksparser.Settings.warn_spacing = True + parser = steamworksparser.parse(sys.argv[1]) + + with open('test.json', 'w') as out: + out.write('{\n') + + out.write(' "typedefs":[\n') + for typedef in parser.typedefs: + out.write(' {\n') + out.write(' "typedef":"' + typedef.name + '",\n') + out.write(' "type":"' + typedef.type + '"\n') + out.write(' },\n') + + + if __name__ == '__main__': + main() +``` From 948f95fc42ba72669271049759e1f0796cdad3d7 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sat, 20 Mar 2021 18:48:30 -0700 Subject: [PATCH 30/82] Correctly parse inline function definitions inside interfaces --- steamworksparser.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index b040e650..0b54ba76 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -34,7 +34,6 @@ "#define STEAM_CALLBACK_END", "#define STEAM_CALLBACK_MEMBER", "STEAM_DEFINE_INTERFACE_ACCESSOR", - "inline", ) g_SkippedStructs = ( @@ -393,6 +392,9 @@ def parse_skippedlines(self, s): if skip in s.line: return True + if not s.interface and 'inline' in s.line: + return True + return False def parse_preprocessor(self, s): @@ -713,7 +715,7 @@ def parse_interface_functions(self, s): private = True # Skip lines that don't start with virtual, except when we're currently parsing a function - if not s.line.startswith("virtual") and not s.function: + if not s.function and not (s.line.startswith("virtual") or s.line.startswith("inline")): return if '~' in s.line: # Skip destructor @@ -735,7 +737,7 @@ def parse_interface_functions(self, s): linesplit_iter = iter(enumerate(s.linesplit)) for i, token in linesplit_iter: if s.funcState == 0: # Return Value - if token == "virtual": + if token == "virtual" or token == "inline": continue if token.startswith("*"): @@ -754,6 +756,11 @@ def parse_interface_functions(self, s): if token[-1] == ")": s.funcState = 3 + elif token[-1] == ";": + s.funcState = 0 + s.interface.functions.append(s.function) + s.function = None + break elif token[-1] != "(": # Like f(void arg ) if Settings.warn_spacing: printWarning("Function is missing whitespace between the opening parentheses and first arg.", s) From 59e460e330800f3e5bc756c655b9dd1857b00430 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Thu, 7 Oct 2021 22:03:30 -0700 Subject: [PATCH 31/82] Update for Steamworks SDK 1.52 --- steamworksparser.py | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 0b54ba76..4f6c3254 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -4,7 +4,6 @@ import re g_SkippedFiles = ( - "isteammasterserverupdater.h", # Empty "steam_api_flat.h", # Valve's C API # PS3-only Headers not currently supported @@ -18,12 +17,7 @@ g_SkippedLines = ( # steamtypes.h "STEAM_CLANG_ATTR", - - # steamclientpublic.h - "BIsOculusHMD", - "BIsWindowsMRHeadset", - "BIsHuaweiHeadset", - "BIsViveHMD", + "#define VALVE_BIG_ENDIAN", # Multiple "public:", @@ -78,7 +72,6 @@ 'isteaminventory.h', 'isteamhttp.h', 'isteamugc.h', - 'isteamapps.h', 'isteamnetworkingutils.h', 'isteamnetworkingsockets.h', ) @@ -127,7 +120,7 @@ def __init__(self): self.comments = [] self.linecomment = "" self.attributes = [] # FunctionAttribute - self.private = False; + self.private = False class Interface: def __init__(self): @@ -226,6 +219,7 @@ def __init__(self, file): self.bInHeader = True self.bInMultilineComment = False self.bInMultilineMacro = False + self.bInPrivate = False self.callbackid = None self.functionAttributes = [] # FunctionAttribute @@ -293,6 +287,9 @@ def parse(self, s): self.parse_structs(s) self.parse_callbackmacros(s) self.parse_interfaces(s) + if not s.line: + continue + self.parse_classes(s) self.parse_scope(s) @@ -708,11 +705,18 @@ def parse_interface_function_atrributes(self, s): def parse_interface_functions(self, s): self.parse_interface_function_atrributes(s) - private = False if s.line.startswith("STEAM_PRIVATE_API"): - s.line = s.line[s.line.index("(")+1:s.line.rindex(")")].strip() - s.linesplit = s.linesplit[1:-1] - private = True + s.bInPrivate = True + s.line = s.line[s.line.index("(")+1:].strip() + s.linesplit = s.linesplit[1:] + + bInPrivate = s.bInPrivate + if s.bInPrivate: + if s.line.endswith(")"): + s.bInPrivate = False + s.line = s.line[:-1].strip() + s.linesplit = s.linesplit[:-1] + # Skip lines that don't start with virtual, except when we're currently parsing a function if not s.function and not (s.line.startswith("virtual") or s.line.startswith("inline")): @@ -729,7 +733,7 @@ def parse_interface_functions(self, s): s.function.ifstatements = s.ifstatements[-1] s.function.comments = s.comments s.function.linecomment = s.linecomment - s.function.private = private + s.function.private = bInPrivate s.function.attributes = s.functionAttributes s.functionAttributes = [] self.consume_comments(s) From 270105244015cce1030ca094026466c58e69dbf3 Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sun, 12 Dec 2021 18:15:46 -0800 Subject: [PATCH 32/82] Update for Steamworks SDK 1.52 - sort-of handle non-callback enum constants inside a struct --- steamworksparser.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 4f6c3254..ce135df5 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -541,9 +541,12 @@ def parse_enums(self, s): return if s.struct: - result = re.match("^enum { k_iCallback = (.*) };", s.line) - s.callbackid = result.group(1) - return + result = re.match("^enum { (.*) = (.*) };", s.line) + name = result.group(1) + + if name == "k_iCallback": + s.callbackid = result.group(2) + return constant = Constant(s.linesplit[2], s.linesplit[4], "int", comments); s.f.constants.append(constant) From 3f97c62b4c4e0a72d23ee9fa97e4ee7077ea3a4d Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Sun, 20 Nov 2022 18:00:42 -0800 Subject: [PATCH 33/82] Update for Steamworks SDK 1.55 - skip isteamdualsense.h --- steamworksparser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/steamworksparser.py b/steamworksparser.py index ce135df5..2ccc038a 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -12,6 +12,9 @@ # Deprecated, moved to isteaminput.h "isteamcontroller.h", + + # Non-steam code + "isteamdualsense.h", ) g_SkippedLines = ( From d1556c677d8a9014aedb6c97d3b4ced566f7a043 Mon Sep 17 00:00:00 2001 From: Andrew Chappell Date: Tue, 16 May 2023 13:14:02 +0100 Subject: [PATCH 34/82] Add support for the new STEAM_CALLBACK_MEMBER_ARRAY macro --- steamworksparser.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/steamworksparser.py b/steamworksparser.py index 2ccc038a..38a310dc 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -664,6 +664,14 @@ def parse_callbackmacros(self, s): if s.line.startswith("STEAM_CALLBACK_END("): s.f.callbacks.append(s.callbackmacro) s.callbackmacro = None + elif s.line.startswith("STEAM_CALLBACK_MEMBER_ARRAY"): + result = re.match("^STEAM_CALLBACK_MEMBER_ARRAY\(.*,\s+(.*?)\s*,\s*(\w*)\s*,\s*(\d*)\s*\)", s.line) + + fieldtype = result.group(1) + fieldname = result.group(2) + fieldarraysize = result.group(3) + + s.callbackmacro.fields.append(StructField(fieldname, fieldtype, fieldarraysize, comments)) elif s.line.startswith("STEAM_CALLBACK_MEMBER"): result = re.match("^STEAM_CALLBACK_MEMBER\(.*,\s+(.*?)\s*,\s*(\w*)\[?(\d+)?\]?\s*\)", s.line) @@ -672,6 +680,7 @@ def parse_callbackmacros(self, s): fieldarraysize = result.group(3) s.callbackmacro.fields.append(StructField(fieldname, fieldtype, fieldarraysize, comments)) + else: printWarning("Unexpected line in Callback Macro") From a7d2cc853d6baffcfe251f685e3f1987b87d4375 Mon Sep 17 00:00:00 2001 From: Andrew Chappell Date: Tue, 16 May 2023 16:38:54 +0100 Subject: [PATCH 35/82] Handle the static const int value within GetTicketForWebApiResponse_t correctly as a constant. Scan things at scope depth 1 as well as 0 now to catch it, and also exclude field names in structs that contain an =. Means the field is no longer added to the struct and is instead added correctly to constants. --- steamworksparser.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 38a310dc..f8139276 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -492,7 +492,7 @@ def parse_constants(self, s): if s.linesplit[0] != "const" and not s.line.startswith("static const"): return - if s.scopeDepth != 0: + if s.scopeDepth > 1: return comments = self.consume_comments(s) @@ -505,6 +505,9 @@ def parse_constants(self, s): result = re.match(".*const\s+(.*)\s+(\w+)\s+=\s+(.*);$", s.line) + if not result: + return + constant = Constant(result.group(2), result.group(3), result.group(1), comments); s.f.constants.append(constant) @@ -645,7 +648,7 @@ def parse_struct_fields(self, s): return fieldarraysize = None - result = re.match("^(.*\s\**)(\w+);$", s.line) + result = re.match("^([^=.]*\s\**)(\w+);$", s.line) if result is None: result = re.match("^(.*\s\*?)(\w+)\[\s*(\w+)?\s*\];$", s.line) if result is None: From 6f70e9cb638b240f39a77063f6160673014e094b Mon Sep 17 00:00:00 2001 From: Riley Labrecque Date: Fri, 5 Jul 2024 13:59:24 -0700 Subject: [PATCH 36/82] Add SteamNetworkingMessages as a GameServer Interface --- steamworksparser.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index f8139276..e87a770a 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -69,14 +69,15 @@ g_GameServerInterfaces = ( 'isteamclient.h', #'isteamgameserver.h', - 'isteamutils.h', - 'isteamnetworking.h', #'isteamgameserverstats.h', - 'isteaminventory.h', 'isteamhttp.h', - 'isteamugc.h', - 'isteamnetworkingutils.h', + 'isteaminventory.h', + 'isteamnetworking.h', + 'isteamnetworkingmessages.h', 'isteamnetworkingsockets.h', + 'isteamnetworkingutils.h', + 'isteamugc.h', + 'isteamutils.h', ) class Settings: From f774554e538ea084cfb46b70e6c6c2ba7622c4f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Wed, 15 Oct 2025 21:42:23 +0800 Subject: [PATCH 37/82] Handle UTF-8 encoded headers better --- steamworksparser.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index e87a770a..e7313b46 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -232,11 +232,12 @@ class Parser: typedefs = [] def __init__(self, folder): - self.files = [SteamFile(f) for f in os.listdir(folder) if os.path.isfile(os.path.join(folder, f)) and f.endswith(".h") and f not in g_SkippedFiles] + self.files: list[SteamFile] = [SteamFile(f) for f in os.listdir(folder) if os.path.isfile(os.path.join(folder, f)) and f.endswith(".h") and f not in g_SkippedFiles] self.files self.files.sort(key=lambda f: f.name) - self.typedefs = [] + self.typedefs:list[Typedef] = [] + for f in self.files: s = ParserState(f) @@ -245,7 +246,12 @@ def __init__(self, folder): s.lines = infile.readlines() if s.lines[0][:3] == codecs.BOM_UTF8: + # Reload file with UTF-8 encoding + infile.close() + infile = open(filepath, 'r', encoding="utf-8") + s.lines = infile.readlines() s.lines[0] = s.lines[0][3:] + if Settings.warn_utf8bom: printWarning("File contains a UTF8 BOM.", s) From 6094d28d3fe531ebca86265c5b8d37b94f13b3e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Fri, 17 Oct 2025 05:51:40 +0800 Subject: [PATCH 38/82] Try add struct layout analysis, add type annotations --- .editorconfig | 5 + .gitignore | 2 + .vscode/launch.json | 14 ++ debug_entrypoint.py | 3 + steamworksparser.py | 329 ++++++++++++++++++++++++++++++++++++++++---- 5 files changed, 325 insertions(+), 28 deletions(-) create mode 100644 .editorconfig create mode 100644 .vscode/launch.json create mode 100644 debug_entrypoint.py diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..b3c5df63 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +root = true +charset = utf-8 +indent_size = 4 +indent_style = space +tab_width = 4 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0d20b648..4f033b9c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ *.pyc +__pycache__ +steamtest/ \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..e74fea69 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Debug parser", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/debug_entrypoint.py", + "console": "integratedTerminal", + "cwd": "${workspaceFolder}", + "justMyCode": true + } + ] +} \ No newline at end of file diff --git a/debug_entrypoint.py b/debug_entrypoint.py new file mode 100644 index 00000000..3a0c77a4 --- /dev/null +++ b/debug_entrypoint.py @@ -0,0 +1,3 @@ +from steamworksparser import parse + +parse("./steamtest") # put steam headers inside diff --git a/steamworksparser.py b/steamworksparser.py index e7313b46..36bdeca1 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -2,6 +2,9 @@ import codecs import copy import re +from typing import Literal, Optional +from functools import reduce +import operator g_SkippedFiles = ( "steam_api_flat.h", # Valve's C API @@ -80,6 +83,49 @@ 'isteamutils.h', ) +class PrimitiveType: + def __init__(self, name: str, size: int, pack: int): + self.name = name + self.size = size + self.pack = pack + +g_PrimitiveTypesLayout: dict[str, PrimitiveType] = { + "char": PrimitiveType("char", 1, 1), + "bool": PrimitiveType("bool", 1, 1), + "unsigned char": PrimitiveType("unsigned char", 1, 1), + "signed char": PrimitiveType("signed char", 1, 1), + "short": PrimitiveType("short", 2, 2), + "unsigned short": PrimitiveType("unsigned short", 2, 2), + "int": PrimitiveType("int", 4, 4), + "unsigned int": PrimitiveType("unsigned int", 4, 4), + "long long": PrimitiveType("long long", 8, 8), + "unsigned long long": PrimitiveType("unsigned long long", 8, 8), + "float": PrimitiveType("float", 4, 4), + "double": PrimitiveType("double", 8, 8), + + # Add them here since we don't use the definiation in steamtypes.h + "uint8": PrimitiveType("unsigned char", 1, 1), + "sint8": PrimitiveType("signed char", 1, 1), + "int16": PrimitiveType("short", 2, 2), + "uint16": PrimitiveType("unsigned short", 2, 2), + "int32": PrimitiveType("int", 4, 4), + "uint32": PrimitiveType("unsigned int", 4, 4), + "int64": PrimitiveType("long long", 8, 8), + "uint64": PrimitiveType("unsigned long long", 8, 8), + + "intptr": PrimitiveType("intptr", "intptr", "intptr"), + + "CSteamID": PrimitiveType("CSteamID", 8, 8), + "CGameID": PrimitiveType("CGameID", 8, 8), + "SteamIPAddress_t": PrimitiveType("SteamIPAddress_t", 16 + 4, 1), + "steamnetworkingidentity ": PrimitiveType( + "SteamIPAddress_t", 16 + 4, None), +} + + +g_SpecialStucts = { +} + class Settings: warn_utf8bom = False warn_includeguardname = False @@ -160,15 +206,61 @@ def __init__(self, name, comments): self.fields = [] # EnumField self.c = comments self.endcomments = None # Comment + # enums' size is always 4(an int) + self.size = 4 + self.pack = 4 class Struct: - def __init__(self, name, packsize, comments): + def __init__(self, name, packsize: int | None, comments): self.name = name - self.packsize = packsize + # keep it to remain compatibility + self.packsize = packsize + # use this property for packsize is preferred + self.pack = packsize self.c = comments # Comment - self.fields = [] # StructField + self.fields: list[StructField] = [] # StructField + self.nested_struct: list[Struct] = [] # StructField + self.parent_struct: Struct | None = [] self.callbackid = None self.endcomments = None # Comment + self.size: int | None = None + self.packsize_aware = False + + def calculate_offsets(self, packOverride): + if not self.fields: + return [] + + effective_struct_pack = packOverride if packOverride is not None else self.packsize + + result = [] + current_offset = 0 + + for field in self.fields: + effective_pack = field.pack + if effective_struct_pack > 0: + effective_pack = min(field.pack, effective_struct_pack) + + if effective_pack > 0: + padding = (effective_pack - (current_offset % effective_pack)) % effective_pack + current_offset += padding + + + field_total_size = field.size * field.arraysize or 1 + + # store offset and total size into layout info + result.append(FieldOffset(field.name, current_offset, field_total_size)) + + current_offset += field.size + + total_size = current_offset + if effective_struct_pack > 0: + padding = (effective_struct_pack - (total_size % effective_struct_pack)) % effective_struct_pack + total_size += padding + + self.size = total_size + + return result + class StructField: def __init__(self, name, typee, arraysize, comments): @@ -176,13 +268,40 @@ def __init__(self, name, typee, arraysize, comments): self.type = typee self.arraysize = arraysize self.c = comments # Comment + self.size: int = None # Popluated after parsed, before generate + self.pack: int = None + +class FieldOffset: + def __init__(self, name: str, offset: int): + self.name = name + self.offset = offset + + def __eq__(self, value): + return self.name == value.name and self.value == value.value + +#init special struct + +def init_special_structs(): + SteamIPAddress_t = g_SpecialStucts["SteamIPAddress_t"] = Struct("SteamIPAddress_t", None, """An abstract way to represent the identity of a network host. All identities can + be represented as simple string. Furthermore, this string representation is actually + used on the wire in several places, even though it is less efficient, in order to + facilitate forward compatibility. (Old client code can handle an identity type that + it doesn't understand.)""") + SteamIPAddress_t.fields.extend([ + # StructField(m_eType) + ]) + + +init_special_structs() class Typedef: - def __init__(self, name, typee, filename, comments): + def __init__(self, name, typee, filename, comments, size, pack): self.name = name self.type = typee self.filename = filename self.c = comments + self.size: int | Literal['intptr'] = size + self.pack: int | Literal['intptr'] = pack class SteamFile: def __init__(self, name): @@ -201,7 +320,7 @@ class ParserState: def __init__(self, file): self.f = file # SteamFile self.lines = [] - self.line = "" + self.line: str = "" self.originalline = "" self.linesplit = [] self.linenum = 0 @@ -214,10 +333,10 @@ def __init__(self, file): self.funcState = 0 self.scopeDepth = 0 - self.interface = None - self.function = None - self.enum = None - self.struct = None + self.interface: Interface = None + self.function: Function = None + self.enum: Enum = None + self.struct: Struct = None self.callbackmacro = None self.bInHeader = True @@ -225,7 +344,7 @@ def __init__(self, file): self.bInMultilineMacro = False self.bInPrivate = False self.callbackid = None - self.functionAttributes = [] # FunctionAttribute + self.functionAttributes: list[FunctionAttribute] = [] # FunctionAttribute class Parser: files = None @@ -256,6 +375,12 @@ def __init__(self, folder): printWarning("File contains a UTF8 BOM.", s) self.parse(s) + + + self.populate_typedef_layouts() + self.populate_struct_field_layout() + self.findout_platform_aware_structs() + # Hack to give us the GameServer interfaces. # We want this for autogen but probably don't want it for anything else. @@ -267,7 +392,7 @@ def __init__(self, folder): i.name = i.name.replace("ISteam", "ISteamGameServer", 1) self.files.append(gs_f) - def parse(self, s): + def parse(self, s: ParserState): for linenum, line in enumerate(s.lines): s.line = line s.originalline = line @@ -487,13 +612,55 @@ def parse_typedefs(self, s): typee = " ".join(s.linesplit[1:-1]) if name.startswith("*"): typee += " *" - name = name[1:] + name = name[1:] - typedef = Typedef(name, typee, s.f.name, comments) + typedef = Typedef(name, typee, s.f.name, comments, None, None) self.typedefs.append(typedef) s.f.typedefs.append(typedef) + def populate_typedef_layouts(self): + for typedef in self.typedefs: + typee = typedef.type + + if typee in g_PrimitiveTypesLayout.keys(): + primitive_def = g_PrimitiveTypesLayout[typee] + typedef.pack = primitive_def.pack + typedef.size = primitive_def.size + return + + def resolveFinalType(typee): + underlying_type: PrimitiveType | Typedef | None = g_PrimitiveTypesLayout.get(typee) + + if '*' in typee: + return g_PrimitiveTypesLayout["intptr"] + + if underlying_type == None: + underlying_type = next((typedef for typedef in self.typedefs if typedef.name == typee), None) + + if underlying_type == None: + # scan in steam interface files + underlying_type = next([typedef for file in self.files for typedef in file["typedefs"]], None) + + if underlying_type.name not in g_PrimitiveTypesLayout.keys(): + return resolveFinalType(underlying_type) + else: + return underlying_type + + underlying_type = resolveFinalType(typee) + + if underlying_type == None and '*' not in typee: + print(f"[WARNING] typedef \"{typedef.name}\"'s underlying type \"{typee}\" is not in primitive list") + # is pointer + elif '*' in typee: + size = 'intptr' + pack = 'intptr' + else: + size = underlying_type.size + pack = underlying_type.pack + + typedef.size = size + typedef.pack = pack def parse_constants(self, s): if s.linesplit[0] != "const" and not s.line.startswith("static const"): @@ -606,15 +773,12 @@ def parse_enumfields(self, s): field.c = comments s.enum.fields.append(field) - def parse_structs(self, s): + def parse_structs(self, s: ParserState): if s.enum: return if s.struct: if s.line == "};": - if s.scopeDepth != 1: - return - s.struct.endcomments = self.consume_comments(s) if s.callbackid: @@ -623,7 +787,12 @@ def parse_structs(self, s): s.callbackid = None else: s.f.structs.append(s.struct) - + + # restore current struct in parser state to outer struct + if s.scopeDepth != 1: + currentStruct: Struct = s.struct + s.struct = currentStruct.outerStruct + s.struct = None else: self.parse_struct_fields(s) @@ -639,11 +808,13 @@ def parse_structs(self, s): comments = self.consume_comments(s) - # Skip SteamIDComponent_t and GameID_t which are a part of CSteamID/CGameID + # ~~Skip SteamIDComponent_t and GameID_t which are a part of CSteamID/CGameID~~ + # No, keep nested structs for layout analysis if s.scopeDepth != 0: return - s.struct = Struct(s.linesplit[1], s.packsize, comments) + if s.struct. + s.struct = Struct(s.linesplit[1], s.packsize, comments) def parse_struct_fields(self, s): comments = self.consume_comments(s) @@ -654,19 +825,41 @@ def parse_struct_fields(self, s): if s.line == "{": return - fieldarraysize = None - result = re.match("^([^=.]*\s\**)(\w+);$", s.line) - if result is None: - result = re.match("^(.*\s\*?)(\w+)\[\s*(\w+)?\s*\];$", s.line) + def try_match(line): + fieldarraysize = None + + result = re.match(r"^([^=.]*\s\**)(\w+);$", line) if result is None: + result = re.match(r"^(.*\s\*?)(\w+)\[\s*(\w+)?\s*\];$", line) + if result is not None: + fieldarraysize = result.group(3) + else: + return + + fieldtype = result.group(1).rstrip() + fieldname = result.group(2) + + # ignore wrongly parsed result + # for example {type 'void' name: '(int a0, int a1)' + if '(' in fieldname or '(' in fieldtype\ + or ')' in fieldname or ')' in fieldtype\ + or '*' in fieldname or '*' in fieldtype: return - fieldarraysize = result.group(3) + s.struct.fields.append(StructField(fieldname, fieldtype, fieldarraysize, comments)) + + if ',' in s.line: + result = re.match(r"^(\s*\w+)\s*([\w,\s\[$*\d]*);$", s.line) + if not result: return - fieldtype = result.group(1).rstrip() - fieldname = result.group(2) + + mainType = result.group(1).strip() + varNames = result.group(2).split(',') - s.struct.fields.append(StructField(fieldname, fieldtype, fieldarraysize, comments)) + for varName in varNames: + try_match(f"{mainType} {varName};") + else: + try_match(s.line) def parse_callbackmacros(self, s): if s.callbackmacro: @@ -948,6 +1141,86 @@ def consume_comments(self, s): s.rawlinecomment = None s.linecomment = None return c + + def resolveTypeInfo(self, typeName): + # search order: primitive, pointer, enum, typedef, struct. no callbacks + result = g_PrimitiveTypesLayout.get(typeName) + + if not result and '*' in typeName: + return g_PrimitiveTypesLayout["intptr"] + + if not result: + result = next((typedef for typedef in self.typedefs if typedef.name == typeName), None) + + if not result: + # see structs + allenums = reduce(operator.concat, [f.enums for f in self.files ]) + result = next((enum for enum in allenums if enum.name == typeName), None) + + if not result: + # see structs + allenums = reduce(operator.concat, [f.structs for f in self.files ]) + result = next((struct for struct in allenums if struct.name == typeName), None) + + + if not result: + print(f"[WARNING] typename {typeName} not found across primitive,\ + struct and typedef, maybe it is a nested type.") + + return result + + def populate_struct_field_layout(self, defaultPack = 8): + for file in self.files: + structs: list[Struct] = [] + structs.extend(file.callbacks) + structs.extend(file.structs) + + def populate_struct(struct: Struct, defaultPack:Optional[int] = None): + for field in struct.fields: + typeinfo = self.resolveTypeInfo(field.type) + # check if we facing a struct which may not populated yet + if isinstance(typeinfo, Struct): + struct = typeinfo + + if not struct.packsize: + struct.packsize = defaultPack + + # we assume there will no circular references across structs + populate_struct(typeinfo) + + field.size = typeinfo.size + field.pack = typeinfo.pack or defaultPack + + for struct in structs: + populate_struct(struct, defaultPack) + + + def findout_platform_aware_structs(self): + self.packSizeAwareStructs: list[str] = [] + + for file in self.files: + structs: list[Struct] = [] + structs.extend(file.callbacks) + structs.extend(file.structs) + + for struct in structs: + if struct.packsize: + continue + + structSmall = copy.deepcopy(struct) + + offsetsLargePack: list[FieldOffset] = struct.calculate_offsets(8) + offsetsLargePack.sort(lambda item: item.name) + + offsetsSmallPack: list[FieldOffset] = structSmall.calculate_offsets(4) + offsetsSmallPack.sort(lambda item: item.name) + + if offsetsLargePack != offsetsSmallPack or struct.size != structSmall.size: + print(f"Found packsize aware struct '{struct.name}'") + struct.packsize_aware = True + self.packSizeAwareStructs.append(struct.name) + + pass def printWarning(string, s): From ae64db403c09b1b2581994c46fe019a72247507c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:51:16 +0800 Subject: [PATCH 39/82] Attempt to make parser smarter Adding support for nested types and unions, these work are in progress. --- .gitignore | 3 +- debug_entrypoint.py | 6 +- steamworksparser.py | 151 ++++++++++++++++++++++++++++++-------------- 3 files changed, 109 insertions(+), 51 deletions(-) diff --git a/.gitignore b/.gitignore index 4f033b9c..74cd7124 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.pyc __pycache__ -steamtest/ \ No newline at end of file +steamtest/ +bin \ No newline at end of file diff --git a/debug_entrypoint.py b/debug_entrypoint.py index 3a0c77a4..1179b522 100644 --- a/debug_entrypoint.py +++ b/debug_entrypoint.py @@ -1,3 +1,7 @@ -from steamworksparser import parse +from steamworksparser import parse, Settings + +Settings.print_skippedtypedefs = True +Settings.print_unuseddefines = True +Settings.warn_spacing = True parse("./steamtest") # put steam headers inside diff --git a/steamworksparser.py b/steamworksparser.py index 36bdeca1..4ac493e3 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -114,18 +114,17 @@ def __init__(self, name: str, size: int, pack: int): "uint64": PrimitiveType("unsigned long long", 8, 8), "intptr": PrimitiveType("intptr", "intptr", "intptr"), - + "void*": PrimitiveType("void*", "intptr", "intptr"), +} + +g_SpecialStructs = { "CSteamID": PrimitiveType("CSteamID", 8, 8), "CGameID": PrimitiveType("CGameID", 8, 8), "SteamIPAddress_t": PrimitiveType("SteamIPAddress_t", 16 + 4, 1), - "steamnetworkingidentity ": PrimitiveType( - "SteamIPAddress_t", 16 + 4, None), + "steamnetworkingidentity ": PrimitiveType("SteamIPAddress_t", 16 + 4, None), } -g_SpecialStucts = { -} - class Settings: warn_utf8bom = False warn_includeguardname = False @@ -211,7 +210,7 @@ def __init__(self, name, comments): self.pack = 4 class Struct: - def __init__(self, name, packsize: int | None, comments): + def __init__(self, name, packsize: int | None, comments, scopePath): self.name = name # keep it to remain compatibility self.packsize = packsize @@ -219,8 +218,9 @@ def __init__(self, name, packsize: int | None, comments): self.pack = packsize self.c = comments # Comment self.fields: list[StructField] = [] # StructField - self.nested_struct: list[Struct] = [] # StructField - self.parent_struct: Struct | None = [] + self.nested_struct: list[Struct] = [] # nested structs + self.parent_struct: Struct | None = None + self.scopeDepth: int = scopePath self.callbackid = None self.endcomments = None # Comment self.size: int | None = None @@ -261,6 +261,35 @@ def calculate_offsets(self, packOverride): return result +class Union: + def __init__(self, name, isUnnamed, pack): + self.name: str = name + self.isUnnamed: bool = isUnnamed + self.pack: int = pack + self.size: int | None = None + self.fields: list[StructField] = [] + pass + + def calculate_size(self, packOverride: Optional[int] = None): + if not self.fields: + self.size = 1 + + # prepare for calculation + max_field_size = max(field.size for field in self.fields) + max_field_packsize = max(field.pack for field in self.fields if field.name in g_PrimitiveTypesLayout.keys()) + + # check if packsize overriden + packsize = self.pack + packsize = packOverride if packOverride else packsize + + packsize = max_field_packsize if max_field_packsize > packsize else packsize + + if self.pack > 0: + # 计算需要填充的字节数 + remainder = max_field_size % self.pack + if remainder != 0: + return max_field_size + (self.pack - remainder) + class StructField: def __init__(self, name, typee, arraysize, comments): @@ -269,7 +298,7 @@ def __init__(self, name, typee, arraysize, comments): self.arraysize = arraysize self.c = comments # Comment self.size: int = None # Popluated after parsed, before generate - self.pack: int = None + self.pack: int = None # Also populated lazily class FieldOffset: def __init__(self, name: str, offset: int): @@ -286,10 +315,10 @@ def init_special_structs(): be represented as simple string. Furthermore, this string representation is actually used on the wire in several places, even though it is less efficient, in order to facilitate forward compatibility. (Old client code can handle an identity type that - it doesn't understand.)""") + it doesn't understand.)""", 1) SteamIPAddress_t.fields.extend([ # StructField(m_eType) - ]) + ]) init_special_structs() @@ -318,11 +347,14 @@ def __init__(self, name): class ParserState: def __init__(self, file): - self.f = file # SteamFile + self.f: SteamFile = file # SteamFile self.lines = [] self.line: str = "" self.originalline = "" self.linesplit = [] + """ + linenum is Zero based + """ self.linenum = 0 self.rawcomments = [] self.comments = [] @@ -333,10 +365,12 @@ def __init__(self, file): self.funcState = 0 self.scopeDepth = 0 - self.interface: Interface = None - self.function: Function = None - self.enum: Enum = None - self.struct: Struct = None + self.interface: Interface | None = None + self.function: Function | None = None + self.enum: Enum | None = None + self.struct: Struct | None = None + self.union: Union | None = None + # self.nestedStructStack: list[Struct] = [] self.callbackmacro = None self.bInHeader = True @@ -777,8 +811,9 @@ def parse_structs(self, s: ParserState): if s.enum: return - if s.struct: + if s.struct and s.linesplit[0] != "struct" and s.linesplit[0] != 'union': if s.line == "};": + s.struct.endcomments = self.consume_comments(s) if s.callbackid: @@ -788,33 +823,31 @@ def parse_structs(self, s: ParserState): else: s.f.structs.append(s.struct) - # restore current struct in parser state to outer struct + # restore current struct in parser state to outer struct if s.scopeDepth != 1: currentStruct: Struct = s.struct - s.struct = currentStruct.outerStruct - - s.struct = None + currentStruct.parent_struct.nested_struct.append(currentStruct) + s.struct = currentStruct.parent_struct + else: + s.struct = None else: self.parse_struct_fields(s) + elif s.linesplit[0] == 'union': + return # let union visitor handle this + else: + if s.linesplit[0] != "struct": + return - return - - if s.linesplit[0] != "struct": - return - - # Skip Forward Declares - if s.linesplit[1].endswith(";"): - return - - comments = self.consume_comments(s) + # Skip Forward Declares + if s.linesplit[1].endswith(";"): + return - # ~~Skip SteamIDComponent_t and GameID_t which are a part of CSteamID/CGameID~~ - # No, keep nested structs for layout analysis - if s.scopeDepth != 0: - return + comments = self.consume_comments(s) - if s.struct. - s.struct = Struct(s.linesplit[1], s.packsize, comments) + oldStruct = s.struct + s.struct = Struct(s.linesplit[1].strip(), s.packsize,\ + comments, s.scopeDepth) + s.struct.parent_struct = oldStruct def parse_struct_fields(self, s): comments = self.consume_comments(s) @@ -839,10 +872,10 @@ def try_match(line): fieldtype = result.group(1).rstrip() fieldname = result.group(2) - # ignore wrongly parsed result + # ignore wrongly parsed result # for example {type 'void' name: '(int a0, int a1)' if '(' in fieldname or '(' in fieldtype\ - or ')' in fieldname or ')' in fieldtype\ + or ')' in fieldname or ')' in fieldtype\ or '*' in fieldname or '*' in fieldtype: return @@ -861,6 +894,23 @@ def try_match(line): else: try_match(s.line) + def parse_union(self, s: ParserState): + + if s.union == None: + typeName = None + # varName = None + isUnnamed = True + if s.linesplit[0] == 'union': + if len(s.linesplit) > 2: + typeName = s.linesplit[1] + isUnnamed = False + else: + typename = f"union__<{s.f.name[:-2]}>{s.line + 1}" + + s.union = Union() + + pass + def parse_callbackmacros(self, s): if s.callbackmacro: comments = self.consume_comments(s) @@ -896,7 +946,7 @@ def parse_callbackmacros(self, s): result = re.match("^STEAM_CALLBACK_BEGIN\(\s?(\w+),\s?(.*?)\s*\)", s.line) - s.callbackmacro = Struct(result.group(1), s.packsize, comments) + s.callbackmacro = Struct(result.group(1), s.packsize, comments, s.scopeDepth) s.callbackmacro.callbackid = result.group(2) def parse_interfaces(self, s): @@ -1148,20 +1198,23 @@ def resolveTypeInfo(self, typeName): if not result and '*' in typeName: return g_PrimitiveTypesLayout["intptr"] - + + if not result: + result = g_SpecialStructs[typeName] + if not result: result = next((typedef for typedef in self.typedefs if typedef.name == typeName), None) if not result: - # see structs - allenums = reduce(operator.concat, [f.enums for f in self.files ]) - result = next((enum for enum in allenums if enum.name == typeName), None) - + # see enums + allstructs = reduce(operator.concat, [f.enums for f in self.files ]) + result = next((enum for enum in allstructs if enum.name == typeName), None) if not result: # see structs - allenums = reduce(operator.concat, [f.structs for f in self.files ]) - result = next((struct for struct in allenums if struct.name == typeName), None) - + allstructs = reduce(operator.concat, [f.structs for f in self.files ]) + # include nested structs + allstructs_withnested = reduce(operator.concat, [s.nested_struct for s in allstructs]) + result = next((struct for struct in allstructs if struct.name == typeName), None) if not result: print(f"[WARNING] typename {typeName} not found across primitive,\ From 838227cf53e24cdfa216e555439a244590408ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Fri, 17 Oct 2025 18:43:32 +0800 Subject: [PATCH 40/82] Attempt to calculate total size of structs, part 3 Currently I still have to debug unions, they caused nested type stack corrupt I think... I need help --- steamworksparser.py | 165 ++++++++++++++++++++++++++++---------------- 1 file changed, 105 insertions(+), 60 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 4ac493e3..8f8b3c92 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -121,7 +121,7 @@ def __init__(self, name: str, size: int, pack: int): "CSteamID": PrimitiveType("CSteamID", 8, 8), "CGameID": PrimitiveType("CGameID", 8, 8), "SteamIPAddress_t": PrimitiveType("SteamIPAddress_t", 16 + 4, 1), - "steamnetworkingidentity ": PrimitiveType("SteamIPAddress_t", 16 + 4, None), + "SteamNetworkingIdentity ": PrimitiveType("SteamNetworkingIdentity", 4 + 128, 1), } @@ -219,18 +219,18 @@ def __init__(self, name, packsize: int | None, comments, scopePath): self.c = comments # Comment self.fields: list[StructField] = [] # StructField self.nested_struct: list[Struct] = [] # nested structs - self.parent_struct: Struct | None = None + self.outer_type: Struct | Union | None = None self.scopeDepth: int = scopePath self.callbackid = None self.endcomments = None # Comment self.size: int | None = None self.packsize_aware = False - def calculate_offsets(self, packOverride): + def calculate_offsets(self, defaultAlign): if not self.fields: return [] - effective_struct_pack = packOverride if packOverride is not None else self.packsize + effective_struct_pack = defaultAlign if defaultAlign is not None else self.packsize result = [] current_offset = 0 @@ -268,28 +268,31 @@ def __init__(self, name, isUnnamed, pack): self.pack: int = pack self.size: int | None = None self.fields: list[StructField] = [] + self.outer_type: Struct | Union | None = None + self.endcomments = None # Comment pass - def calculate_size(self, packOverride: Optional[int] = None): + def calculate_offsets(self, defaultAlign: int): if not self.fields: self.size = 1 - - # prepare for calculation - max_field_size = max(field.size for field in self.fields) - max_field_packsize = max(field.pack for field in self.fields if field.name in g_PrimitiveTypesLayout.keys()) - - # check if packsize overriden - packsize = self.pack - packsize = packOverride if packOverride else packsize - - packsize = max_field_packsize if max_field_packsize > packsize else packsize - - if self.pack > 0: - # 计算需要填充的字节数 - remainder = max_field_size % self.pack + return self.size + + # find out the largest pack and it's size + max_field = max(self.fields, key=lambda f: f.size) + max_size = max_field.size + max_pack = max_field.pack if max_field.pack != None else defaultAlign + + # align with largest field's packsize + if max_pack: + remainder = max_size % max_pack if remainder != 0: - return max_field_size + (self.pack - remainder) - + self.size = max_size + (max_pack - remainder) + else: + self.size = max_size + else: + self.size = max_size + + return self.size class StructField: def __init__(self, name, typee, arraysize, comments): @@ -308,21 +311,6 @@ def __init__(self, name: str, offset: int): def __eq__(self, value): return self.name == value.name and self.value == value.value -#init special struct - -def init_special_structs(): - SteamIPAddress_t = g_SpecialStucts["SteamIPAddress_t"] = Struct("SteamIPAddress_t", None, """An abstract way to represent the identity of a network host. All identities can - be represented as simple string. Furthermore, this string representation is actually - used on the wire in several places, even though it is less efficient, in order to - facilitate forward compatibility. (Old client code can handle an identity type that - it doesn't understand.)""", 1) - SteamIPAddress_t.fields.extend([ - # StructField(m_eType) - ]) - - -init_special_structs() - class Typedef: def __init__(self, name, typee, filename, comments, size, pack): self.name = name @@ -344,6 +332,7 @@ def __init__(self, name): self.callbacks = [] # Struct self.interfaces = [] # Interface self.typedefs = [] # Typedef + self.unions: list[Union] = [] class ParserState: def __init__(self, file): @@ -364,13 +353,13 @@ def __init__(self, file): self.packsize = [] self.funcState = 0 self.scopeDepth = 0 + self.complexTypeStack: list[Literal['union', 'struct']] = [] self.interface: Interface | None = None self.function: Function | None = None self.enum: Enum | None = None self.struct: Struct | None = None self.union: Union | None = None - # self.nestedStructStack: list[Struct] = [] self.callbackmacro = None self.bInHeader = True @@ -379,6 +368,19 @@ def __init__(self, file): self.bInPrivate = False self.callbackid = None self.functionAttributes: list[FunctionAttribute] = [] # FunctionAttribute + + def beginUnion(self): + self.complexTypeStack.append('union') + + def beginStruct(self): + self.complexTypeStack.append('struct') + + def endComplexType(self): + self.complexTypeStack.pop() + + def getCurrentPack(self) -> int | None: + return self.packsize[-1] if len(self.packsize) > 0 else None + class Parser: files = None @@ -432,8 +434,7 @@ def parse(self, s: ParserState): s.originalline = line s.linenum = linenum - s.line = s.line.rstrip() - + s.line = s.line.rstrip() self.parse_comments(s) # Comments get removed from the line, often leaving blank lines, thus we do this after parsing comments @@ -453,6 +454,7 @@ def parse(self, s: ParserState): self.parse_typedefs(s) self.parse_constants(s) self.parse_enums(s) + self.visit_union(s) self.parse_structs(s) self.parse_callbackmacros(s) self.parse_interfaces(s) @@ -811,9 +813,9 @@ def parse_structs(self, s: ParserState): if s.enum: return - if s.struct and s.linesplit[0] != "struct" and s.linesplit[0] != 'union': + if s.struct and s.linesplit[0] != "struct": if s.line == "};": - + s.struct.endcomments = self.consume_comments(s) if s.callbackid: @@ -822,14 +824,19 @@ def parse_structs(self, s: ParserState): s.callbackid = None else: s.f.structs.append(s.struct) - + + s.endComplexType() + # restore current struct in parser state to outer struct - if s.scopeDepth != 1: + if len(s.complexTypeStack) >= 2 and s.complexTypeStack[-2] == 'struct': currentStruct: Struct = s.struct - currentStruct.parent_struct.nested_struct.append(currentStruct) - s.struct = currentStruct.parent_struct + currentStruct.outer_type.nested_struct.append(currentStruct) + s.struct = currentStruct.outer_type + # elif len(s.complexTypeStack) > 0 and s.complexTypeStack[-1] == 'union': + # # let union visitor handle it + # return else: - s.struct = None + s.struct = None else: self.parse_struct_fields(s) elif s.linesplit[0] == 'union': @@ -842,12 +849,13 @@ def parse_structs(self, s: ParserState): if s.linesplit[1].endswith(";"): return + s.beginStruct() comments = self.consume_comments(s) oldStruct = s.struct - s.struct = Struct(s.linesplit[1].strip(), s.packsize,\ + s.struct = Struct(s.linesplit[1].strip(), s.getCurrentPack(),\ comments, s.scopeDepth) - s.struct.parent_struct = oldStruct + s.struct.outer_type = oldStruct def parse_struct_fields(self, s): comments = self.consume_comments(s) @@ -858,7 +866,9 @@ def parse_struct_fields(self, s): if s.line == "{": return - def try_match(line): + def try_match(line, s: ParserState): + typeinfo = s.struct if s.struct else s.union + fieldarraysize = None result = re.match(r"^([^=.]*\s\**)(\w+);$", line) @@ -879,7 +889,7 @@ def try_match(line): or '*' in fieldname or '*' in fieldtype: return - s.struct.fields.append(StructField(fieldname, fieldtype, fieldarraysize, comments)) + typeinfo.fields.append(StructField(fieldname, fieldtype, fieldarraysize, comments)) if ',' in s.line: result = re.match(r"^(\s*\w+)\s*([\w,\s\[$*\d]*);$", s.line) @@ -890,25 +900,53 @@ def try_match(line): varNames = result.group(2).split(',') for varName in varNames: - try_match(f"{mainType} {varName};") + try_match(f"{mainType} {varName};", s) else: - try_match(s.line) + try_match(s.line, s) - def parse_union(self, s: ParserState): + def visit_union(self, s: ParserState): + if s.enum: + return - if s.union == None: + if s.union and s.linesplit[0] != "union": + if s.line == "{": + # some unions put open brace at next line + return + + if s.line == "};": + s.union.endcomments = self.consume_comments(s) + s.f.unions.append(s.union) + s.endComplexType() + s.union = None + else: + self.parse_struct_fields(s) + pass + elif s.union == None: + if s.linesplit[0] != "union": + return + + # Skip Forward Declares + if len(s.linesplit) >= 2 and s.linesplit[1].endswith(";"): + return + + s.beginUnion() typeName = None # varName = None isUnnamed = True + if s.linesplit[0] == 'union': if len(s.linesplit) > 2: typeName = s.linesplit[1] isUnnamed = False else: - typename = f"union__<{s.f.name[:-2]}>{s.line + 1}" + typeName = f"union__{s.f.name[:-2]}_{s.linenum + 1}" + + s.union = Union(typeName, isUnnamed, s.packsize) + if s.union.outer_type: + # just ignore it's name, generate one for it + s.union.outer_type.fields.append(StructField(f"unnamed_field_{typeName}", typeName, None, "")) + - s.union = Union() - pass def parse_callbackmacros(self, s): @@ -946,7 +984,7 @@ def parse_callbackmacros(self, s): result = re.match("^STEAM_CALLBACK_BEGIN\(\s?(\w+),\s?(.*?)\s*\)", s.line) - s.callbackmacro = Struct(result.group(1), s.packsize, comments, s.scopeDepth) + s.callbackmacro = Struct(result.group(1), s.getCurrentPack(), comments, s.scopeDepth) s.callbackmacro.callbackid = result.group(2) def parse_interfaces(self, s): @@ -1200,7 +1238,7 @@ def resolveTypeInfo(self, typeName): return g_PrimitiveTypesLayout["intptr"] if not result: - result = g_SpecialStructs[typeName] + result = g_SpecialStructs.get(typeName) if not result: result = next((typedef for typedef in self.typedefs if typedef.name == typeName), None) @@ -1222,6 +1260,12 @@ def resolveTypeInfo(self, typeName): return result + def populate_union_sizes(self, defaultPack = 8): + for file in self.files: + unions = file.unions + + + def populate_struct_field_layout(self, defaultPack = 8): for file in self.files: structs: list[Struct] = [] @@ -1239,7 +1283,8 @@ def populate_struct(struct: Struct, defaultPack:Optional[int] = None): struct.packsize = defaultPack # we assume there will no circular references across structs - populate_struct(typeinfo) + if not typeinfo.size: + populate_struct(typeinfo) field.size = typeinfo.size field.pack = typeinfo.pack or defaultPack From ecedecc67413f5093f1fac2b29822ff1d3849200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sat, 18 Oct 2025 00:05:34 +0800 Subject: [PATCH 41/82] Attempt to calculate total size of structs, part 4 Nested type parsing and some special structs are ok I think. Next i will work on calculation. --- steamworksparser.py | 121 +++++++++++++++++++++++++++++--------------- 1 file changed, 81 insertions(+), 40 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 8f8b3c92..914cd0f3 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -38,14 +38,16 @@ g_SkippedStructs = ( # steamnetworkingtypes.h - "SteamNetworkingIPAddr", - "SteamNetworkingIdentity", - "SteamNetworkingMessage_t", - "SteamNetworkingConfigValue_t", + #"SteamNetworkingIPAddr", + #"SteamNetworkingIdentity", + #"SteamNetworkingMessage_t", + #"SteamNetworkingConfigValue_t", # steamdatagram_tickets.h - "SteamDatagramHostedAddress", - "SteamDatagramRelayAuthTicket", + #"SteamDatagramHostedAddress", + #"SteamDatagramRelayAuthTicket", + + # sync with g_SpecialStructsLP and g_SpecialStructsSP ) g_FuncAttribs = ( @@ -112,6 +114,15 @@ def __init__(self, name: str, size: int, pack: int): "uint32": PrimitiveType("unsigned int", 4, 4), "int64": PrimitiveType("long long", 8, 8), "uint64": PrimitiveType("unsigned long long", 8, 8), + + "uint8_t": PrimitiveType("unsigned char", 1, 1), + "sint8_t": PrimitiveType("signed char", 1, 1), + "int16_t": PrimitiveType("short", 2, 2), + "uint16_t": PrimitiveType("unsigned short", 2, 2), + "int32_t": PrimitiveType("int", 4, 4), + "uint32_t": PrimitiveType("unsigned int", 4, 4), + "int64_t": PrimitiveType("long long", 8, 8), + "uint64_t": PrimitiveType("unsigned long long", 8, 8), "intptr": PrimitiveType("intptr", "intptr", "intptr"), "void*": PrimitiveType("void*", "intptr", "intptr"), @@ -122,6 +133,7 @@ def __init__(self, name: str, size: int, pack: int): "CGameID": PrimitiveType("CGameID", 8, 8), "SteamIPAddress_t": PrimitiveType("SteamIPAddress_t", 16 + 4, 1), "SteamNetworkingIdentity ": PrimitiveType("SteamNetworkingIdentity", 4 + 128, 1), + "SteamIDComponent_t": PrimitiveType("SteamIDComponent_t", 8, 8) # Contains bit fields that size can't be represented } @@ -230,7 +242,7 @@ def calculate_offsets(self, defaultAlign): if not self.fields: return [] - effective_struct_pack = defaultAlign if defaultAlign is not None else self.packsize + effective_struct_pack = self.packsize if self.packsize is not None else defaultAlign result = [] current_offset = 0 @@ -245,7 +257,7 @@ def calculate_offsets(self, defaultAlign): current_offset += padding - field_total_size = field.size * field.arraysize or 1 + field_total_size = field.size * (field.arraysize or 1) # store offset and total size into layout info result.append(FieldOffset(field.name, current_offset, field_total_size)) @@ -353,7 +365,7 @@ def __init__(self, file): self.packsize = [] self.funcState = 0 self.scopeDepth = 0 - self.complexTypeStack: list[Literal['union', 'struct']] = [] + self.complexTypeStack: list[Literal['union', 'struct', 'enum']] = [] self.interface: Interface | None = None self.function: Function | None = None @@ -369,18 +381,25 @@ def __init__(self, file): self.callbackid = None self.functionAttributes: list[FunctionAttribute] = [] # FunctionAttribute + self.currentSpecialStruct: PrimitiveType = None + def beginUnion(self): self.complexTypeStack.append('union') def beginStruct(self): self.complexTypeStack.append('struct') + def beginEnum(self): + self.complexTypeStack.append('enum') + def endComplexType(self): self.complexTypeStack.pop() def getCurrentPack(self) -> int | None: return self.packsize[-1] if len(self.packsize) > 0 else None - + + def getCurrentComplexType(self) -> Literal['struct', 'union', 'enum'] | None: + return self.complexTypeStack[-1] if len(self.complexTypeStack) > 0 else None class Parser: files = None @@ -534,13 +553,6 @@ def parse_header(self, s): s.bInHeader = False def parse_skippedlines(self, s): - if s.struct and s.struct.name in g_SkippedStructs: - self.parse_scope(s) - if s.line == "};": - if s.scopeDepth == 0: - s.struct = None - return True - if "!defined(API_GEN)" in s.ifstatements: if s.line.startswith("#if"): s.ifstatements.append("ugh") @@ -721,7 +733,7 @@ def parse_constants(self, s): constant = Constant(result.group(2), result.group(3), result.group(1), comments); s.f.constants.append(constant) - def parse_enums(self, s): + def parse_enums(self, s: ParserState): if s.enum: if s.line == "{": return @@ -733,6 +745,7 @@ def parse_enums(self, s): if s.enum.name is not None: s.f.enums.append(s.enum) + s.endComplexType() s.enum = None return @@ -757,6 +770,7 @@ def parse_enums(self, s): return if s.struct: + # not to push complex type stack here, since it's single line only result = re.match("^enum { (.*) = (.*) };", s.line) name = result.group(1) @@ -768,7 +782,8 @@ def parse_enums(self, s): s.f.constants.append(constant) return - if len(s.linesplit) == 1: + if len(s.linesplit) == 1 or (len(s.linesplit) >= 2 and '{' == s.linesplit[1]): + s.beginEnum() s.enum = Enum(None, comments) # unnamed Constants like: '''enum { @@ -777,6 +792,7 @@ def parse_enums(self, s): };''' return + s.beginEnum() s.enum = Enum(s.linesplit[1], comments) def parse_enumfields(self, s): @@ -815,7 +831,6 @@ def parse_structs(self, s: ParserState): if s.struct and s.linesplit[0] != "struct": if s.line == "};": - s.struct.endcomments = self.consume_comments(s) if s.callbackid: @@ -827,20 +842,15 @@ def parse_structs(self, s: ParserState): s.endComplexType() + currentStruct: Struct = s.struct + # restore current struct in parser state to outer struct if len(s.complexTypeStack) >= 2 and s.complexTypeStack[-2] == 'struct': - currentStruct: Struct = s.struct currentStruct.outer_type.nested_struct.append(currentStruct) - s.struct = currentStruct.outer_type - # elif len(s.complexTypeStack) > 0 and s.complexTypeStack[-1] == 'union': - # # let union visitor handle it - # return - else: - s.struct = None + + s.struct = currentStruct.outer_type else: self.parse_struct_fields(s) - elif s.linesplit[0] == 'union': - return # let union visitor handle this else: if s.linesplit[0] != "struct": return @@ -848,6 +858,20 @@ def parse_structs(self, s: ParserState): # Skip Forward Declares if s.linesplit[1].endswith(";"): return + + # special structs + typeNameCandidate = s.linesplit[1] + if typeNameCandidate in g_SpecialStructs.keys(): + if s.linesplit[0] == 'struct': + s.currentSpecialStruct = g_SpecialStructs[typeNameCandidate] + + self.parse_scope(s) + + if s.line.startswith('}'): + varNameMatchResult = re.match(r"^}\s*(\w*);$", s.line) + if varNameMatchResult != None: + s.struct.outer_type.fields.append(StructField(varNameMatchResult.group(1), typeNameCandidate, None, "")) + return s.beginStruct() comments = self.consume_comments(s) @@ -867,17 +891,25 @@ def parse_struct_fields(self, s): return def try_match(line, s: ParserState): + if ':' in line: + # Contains bitfield that can't be represented + printWarning(f"{s.struct.name} contains bitfield, skipping", s) + self.parse_scope(s) + return + typeinfo = s.struct if s.struct else s.union fieldarraysize = None result = re.match(r"^([^=.]*\s\**)(\w+);$", line) if result is None: - result = re.match(r"^(.*\s\*?)(\w+)\[\s*(\w+)?\s*\];$", line) - if result is not None: - fieldarraysize = result.group(3) - else: - return + result = re.match(r"^([^=.]*\s\**)(\w+);$", line) + if result is None: + result = re.match(r"^(.*\s\*?)(\w+)\[\s*(\w+)?\s*\];$", line) + if result is not None: + fieldarraysize = result.group(3) + else: + return fieldtype = result.group(1).rstrip() fieldname = result.group(2) @@ -886,7 +918,9 @@ def try_match(line, s: ParserState): # for example {type 'void' name: '(int a0, int a1)' if '(' in fieldname or '(' in fieldtype\ or ')' in fieldname or ')' in fieldtype\ - or '*' in fieldname or '*' in fieldtype: + or '*' in fieldname or '*' in fieldtype\ + or '{' in fieldtype or '}' in fieldtype\ + or '{' in fieldname or '}' in fieldname: return typeinfo.fields.append(StructField(fieldname, fieldtype, fieldarraysize, comments)) @@ -912,7 +946,7 @@ def visit_union(self, s: ParserState): if s.line == "{": # some unions put open brace at next line return - + if s.line == "};": s.union.endcomments = self.consume_comments(s) s.f.unions.append(s.union) @@ -1245,13 +1279,18 @@ def resolveTypeInfo(self, typeName): if not result: # see enums - allstructs = reduce(operator.concat, [f.enums for f in self.files ]) - result = next((enum for enum in allstructs if enum.name == typeName), None) + allEnums = reduce(operator.concat, [f.enums for f in self.files ]) + result = next((enum for enum in allEnums if enum.name == typeName), None) if not result: - # see structs + # see structs or callback structs allstructs = reduce(operator.concat, [f.structs for f in self.files ]) + allcallbacks = reduce(operator.concat, [f.callbacks for f in self.files]) + + allstructs = allstructs + allcallbacks + # include nested structs - allstructs_withnested = reduce(operator.concat, [s.nested_struct for s in allstructs]) + #allstructs_withnested = reduce(operator.concat, [s.nested_struct for s in allstructs], allstructs) + result = next((struct for struct in allstructs if struct.name == typeName), None) if not result: @@ -1263,6 +1302,8 @@ def resolveTypeInfo(self, typeName): def populate_union_sizes(self, defaultPack = 8): for file in self.files: unions = file.unions + for union in unions: + union.calculate_offsets(defaultPack) From b886410f05598bd596f5835bb6d4b998b6726ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sat, 18 Oct 2025 00:08:49 +0800 Subject: [PATCH 42/82] Attempt to calculate total size of structs, attempt 5 Is it work? --- steamworksparser.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/steamworksparser.py b/steamworksparser.py index 914cd0f3..3b6ebd68 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -260,7 +260,7 @@ def calculate_offsets(self, defaultAlign): field_total_size = field.size * (field.arraysize or 1) # store offset and total size into layout info - result.append(FieldOffset(field.name, current_offset, field_total_size)) + result.append(FieldOffset(field.name, current_offset)) current_offset += field.size @@ -321,7 +321,7 @@ def __init__(self, name: str, offset: int): self.offset = offset def __eq__(self, value): - return self.name == value.name and self.value == value.value + return self.name == value.name and self.offset == value.offset class Typedef: def __init__(self, name, typee, filename, comments, size, pack): @@ -1349,10 +1349,10 @@ def findout_platform_aware_structs(self): structSmall = copy.deepcopy(struct) offsetsLargePack: list[FieldOffset] = struct.calculate_offsets(8) - offsetsLargePack.sort(lambda item: item.name) + offsetsLargePack.sort(key = lambda item: item.name) offsetsSmallPack: list[FieldOffset] = structSmall.calculate_offsets(4) - offsetsSmallPack.sort(lambda item: item.name) + offsetsSmallPack.sort(key = lambda item: item.name) if offsetsLargePack != offsetsSmallPack or struct.size != structSmall.size: print(f"Found packsize aware struct '{struct.name}'") From 665fb115a9182883457a6bb565d1c3b7c07a8c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sat, 18 Oct 2025 03:43:14 +0800 Subject: [PATCH 43/82] [Feature] Implement struct field offset analysis. This feature can be used to generate helper structs that need to generate large and small pack variant. This problem is caused by default pack-size make the struct have different layout on different platforms. Generate these struct with both variant is very important to building a unified Any CPU Steamworks.NET assembly. After this commit --- .vscode/launch.json | 2 +- debug_entrypoint.py | 6 +- steamworksparser.py | 162 ++++++++++++++++++++++++++++++-------------- 3 files changed, 117 insertions(+), 53 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index e74fea69..80560674 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -3,7 +3,7 @@ "configurations": [ { "name": "Debug parser", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/debug_entrypoint.py", "console": "integratedTerminal", diff --git a/debug_entrypoint.py b/debug_entrypoint.py index 1179b522..4eb1901a 100644 --- a/debug_entrypoint.py +++ b/debug_entrypoint.py @@ -1,7 +1,7 @@ from steamworksparser import parse, Settings -Settings.print_skippedtypedefs = True -Settings.print_unuseddefines = True -Settings.warn_spacing = True +# Settings.print_skippedtypedefs = True +# Settings.print_unuseddefines = True +# Settings.warn_spacing = True parse("./steamtest") # put steam headers inside diff --git a/steamworksparser.py b/steamworksparser.py index 3b6ebd68..08cbe09d 100644 --- a/steamworksparser.py +++ b/steamworksparser.py @@ -107,7 +107,7 @@ def __init__(self, name: str, size: int, pack: int): # Add them here since we don't use the definiation in steamtypes.h "uint8": PrimitiveType("unsigned char", 1, 1), - "sint8": PrimitiveType("signed char", 1, 1), + "int8": PrimitiveType("signed char", 1, 1), "int16": PrimitiveType("short", 2, 2), "uint16": PrimitiveType("unsigned short", 2, 2), "int32": PrimitiveType("int", 4, 4), @@ -115,6 +115,15 @@ def __init__(self, name: str, size: int, pack: int): "int64": PrimitiveType("long long", 8, 8), "uint64": PrimitiveType("unsigned long long", 8, 8), + "unsigned __int8": PrimitiveType("unsigned char", 1, 1), + "__sint8": PrimitiveType("signed char", 1, 1), + "__int16": PrimitiveType("short", 2, 2), + "unsigned __int16": PrimitiveType("unsigned short", 2, 2), + "__int32": PrimitiveType("int", 4, 4), + "unsigned __int32": PrimitiveType("unsigned int", 4, 4), + "__int64": PrimitiveType("long long", 8, 8), + "unsigned __int64": PrimitiveType("unsigned long long", 8, 8), + "uint8_t": PrimitiveType("unsigned char", 1, 1), "sint8_t": PrimitiveType("signed char", 1, 1), "int16_t": PrimitiveType("short", 2, 2), @@ -125,7 +134,12 @@ def __init__(self, name: str, size: int, pack: int): "uint64_t": PrimitiveType("unsigned long long", 8, 8), "intptr": PrimitiveType("intptr", "intptr", "intptr"), + "intp": PrimitiveType("intp", "intptr", "intptr"), + "uintp": PrimitiveType("uintp", "intptr", "intptr"), "void*": PrimitiveType("void*", "intptr", "intptr"), + + "long int": PrimitiveType("long int", 8, 8), + "unsigned long int": PrimitiveType("unsigned long int", 8, 8), } g_SpecialStructs = { @@ -238,8 +252,15 @@ def __init__(self, name, packsize: int | None, comments, scopePath): self.size: int | None = None self.packsize_aware = False - def calculate_offsets(self, defaultAlign): + def calculate_offsets(self, defaultAlign: int): + def calcRealSize(sizelike: int | Literal['intptr']) -> int: + if sizelike == 'intptr': + return 8 + else: + return sizelike + if not self.fields: + self.size = 1 return [] effective_struct_pack = self.packsize if self.packsize is not None else defaultAlign @@ -248,27 +269,33 @@ def calculate_offsets(self, defaultAlign): current_offset = 0 for field in self.fields: - effective_pack = field.pack + pack = field.pack or defaultAlign + effective_field_pack = calcRealSize(pack) + if effective_struct_pack > 0: - effective_pack = min(field.pack, effective_struct_pack) + effective_field_pack = min(effective_field_pack, effective_struct_pack) - if effective_pack > 0: - padding = (effective_pack - (current_offset % effective_pack)) % effective_pack + if effective_field_pack > 0: + padding = (effective_field_pack - (current_offset % effective_field_pack)) % effective_field_pack current_offset += padding - field_total_size = field.size * (field.arraysize or 1) + field_total_size = calcRealSize(field.size) * (field.arraysize or 1) # store offset and total size into layout info result.append(FieldOffset(field.name, current_offset)) - current_offset += field.size + current_offset += field_total_size total_size = current_offset if effective_struct_pack > 0: padding = (effective_struct_pack - (total_size % effective_struct_pack)) % effective_struct_pack total_size += padding - + + self.pack = min( + calcRealSize(max(self.fields, key=lambda x: calcRealSize(x.size)).size), + effective_struct_pack + ) self.size = total_size return result @@ -307,13 +334,14 @@ def calculate_offsets(self, defaultAlign: int): return self.size class StructField: - def __init__(self, name, typee, arraysize, comments): + def __init__(self, name, typee, arraysize: str | None, comments): self.name = name self.type = typee - self.arraysize = arraysize + self.arraysizeStr = arraysize + self.arraysize: int | None = None self.c = comments # Comment - self.size: int = None # Popluated after parsed, before generate - self.pack: int = None # Also populated lazily + self.size: int | Literal['intptr'] = None # Popluated after parsed, before generate + self.pack: int | Literal['intptr'] = None # Also populated lazily class FieldOffset: def __init__(self, name: str, offset: int): @@ -324,7 +352,7 @@ def __eq__(self, value): return self.name == value.name and self.offset == value.offset class Typedef: - def __init__(self, name, typee, filename, comments, size, pack): + def __init__(self, name, typee, filename, comments, size: int, pack: Optional[int] | None = None): self.name = name self.type = typee self.filename = filename @@ -337,13 +365,13 @@ def __init__(self, name): self.name = name self.header = [] self.includes = [] - self.defines = [] # Define - self.constants = [] # Constant - self.enums = [] # Enum - self.structs = [] # Struct - self.callbacks = [] # Struct - self.interfaces = [] # Interface - self.typedefs = [] # Typedef + self.defines: list[Define] = [] # Define + self.constants: list[Constant] = [] # Constant + self.enums: list[Enum] = [] # Enum + self.structs: list[Struct] = [] # Struct + self.callbacks: list[Struct] = [] # Struct + self.interfaces: list[Interface] = [] # Interface + self.typedefs:list[Typedef] = [] # Typedef self.unions: list[Union] = [] class ParserState: @@ -362,6 +390,7 @@ def __init__(self, file): self.rawlinecomment = None self.linecomment = None self.ifstatements = [] + # packsize stack self.packsize = [] self.funcState = 0 self.scopeDepth = 0 @@ -396,7 +425,14 @@ def endComplexType(self): self.complexTypeStack.pop() def getCurrentPack(self) -> int | None: - return self.packsize[-1] if len(self.packsize) > 0 else None + # pack size is default value + # our parser can't evaluate #ifdefs, so in the situlation of + # using default pack, the self.packsize will be [4, 8] + if self.packsize != [4, 8]: + return self.packsize[-1] if len(self.packsize) > 0 else None + else: + # default pack + return None def getCurrentComplexType(self) -> Literal['struct', 'union', 'enum'] | None: return self.complexTypeStack[-1] if len(self.complexTypeStack) > 0 else None @@ -433,9 +469,7 @@ def __init__(self, folder): self.populate_typedef_layouts() - self.populate_struct_field_layout() - self.findout_platform_aware_structs() - + # self.populate_struct_field_sizes() # Hack to give us the GameServer interfaces. # We want this for autogen but probably don't want it for anything else. @@ -447,6 +481,8 @@ def __init__(self, folder): i.name = i.name.replace("ISteam", "ISteamGameServer", 1) self.files.append(gs_f) + self.findout_platform_aware_structs() + def parse(self, s: ParserState): for linenum, line in enumerate(s.lines): s.line = line @@ -577,7 +613,7 @@ def parse_skippedlines(self, s): return False - def parse_preprocessor(self, s): + def parse_preprocessor(self, s: ParserState): if not s.line.startswith("#"): return @@ -615,9 +651,16 @@ def parse_preprocessor(self, s): elif s.line.startswith("#pragma pack"): if "push" in s.line: tmpline = s.line[s.line.index(",")+1:-1].strip() - s.packsize.append(int(tmpline)) + + packsize = None + try: + packsize = int(tmpline) + except ValueError: + pass + + s.packsize.append(packsize) elif "pop" in s.line: - s.packsize.pop + s.packsize.pop() elif s.line.startswith("#pragma"): pass elif s.line.startswith("#error"): @@ -632,7 +675,7 @@ def parse_preprocessor(self, s): printUnhandled("Preprocessor", s) - def parse_typedefs(self, s): + def parse_typedefs(self, s: ParserState): if s.linesplit[0] != "typedef": return @@ -662,7 +705,8 @@ def parse_typedefs(self, s): typee += " *" name = name[1:] - typedef = Typedef(name, typee, s.f.name, comments, None, None) + typedef = Typedef(name, typee, s.f.name, comments,\ + self.resolveTypeInfo(typee).size, s.getCurrentPack()) self.typedefs.append(typedef) s.f.typedefs.append(typedef) @@ -899,7 +943,7 @@ def try_match(line, s: ParserState): typeinfo = s.struct if s.struct else s.union - fieldarraysize = None + fieldarraysizeText = None result = re.match(r"^([^=.]*\s\**)(\w+);$", line) if result is None: @@ -907,7 +951,7 @@ def try_match(line, s: ParserState): if result is None: result = re.match(r"^(.*\s\*?)(\w+)\[\s*(\w+)?\s*\];$", line) if result is not None: - fieldarraysize = result.group(3) + fieldarraysizeText = result.group(3) else: return @@ -923,7 +967,9 @@ def try_match(line, s: ParserState): or '{' in fieldname or '}' in fieldname: return - typeinfo.fields.append(StructField(fieldname, fieldtype, fieldarraysize, comments)) + + newField = StructField(fieldname, fieldtype, fieldarraysizeText, comments) + typeinfo.fields.append(newField) if ',' in s.line: result = re.match(r"^(\s*\w+)\s*([\w,\s\[$*\d]*);$", s.line) @@ -978,12 +1024,12 @@ def visit_union(self, s: ParserState): s.union = Union(typeName, isUnnamed, s.packsize) if s.union.outer_type: # just ignore it's name, generate one for it - s.union.outer_type.fields.append(StructField(f"unnamed_field_{typeName}", typeName, None, "")) + s.union.outer_type.fields.append(StructField(f"unnamed_field_{typeName}", typeName, 1, "")) pass - def parse_callbackmacros(self, s): + def parse_callbackmacros(self, s: ParserState): if s.callbackmacro: comments = self.consume_comments(s) if s.line.startswith("STEAM_CALLBACK_END("): @@ -1287,9 +1333,6 @@ def resolveTypeInfo(self, typeName): allcallbacks = reduce(operator.concat, [f.callbacks for f in self.files]) allstructs = allstructs + allcallbacks - - # include nested structs - #allstructs_withnested = reduce(operator.concat, [s.nested_struct for s in allstructs], allstructs) result = next((struct for struct in allstructs if struct.name == typeName), None) @@ -1299,36 +1342,54 @@ def resolveTypeInfo(self, typeName): return result + def resolveConstValue(self, name) -> Constant: + for f in self.files: + result = next((constant for constant in f.constants if constant.name == name), None) + if result is not None: + return result + + return None + + def populate_union_sizes(self, defaultPack = 8): for file in self.files: unions = file.unions for union in unions: union.calculate_offsets(defaultPack) + def populate_struct_field_sizes(self, defaultPack = 8): + allstructs = reduce(operator.concat, [f.structs for f in self.files]) + allfields = reduce(operator.concat, [s.structs for s in allstructs]) + + for field in allfields: + typeinfo = self.resolveTypeInfo(field.type) + field.size = typeinfo.size + field.pack = typeinfo.pack - + pass + def populate_struct_field_layout(self, defaultPack = 8): for file in self.files: structs: list[Struct] = [] structs.extend(file.callbacks) structs.extend(file.structs) - def populate_struct(struct: Struct, defaultPack:Optional[int] = None): + def populate_struct(struct: Struct, defaultPack): for field in struct.fields: typeinfo = self.resolveTypeInfo(field.type) # check if we facing a struct which may not populated yet if isinstance(typeinfo, Struct): struct = typeinfo - if not struct.packsize: - struct.packsize = defaultPack - # we assume there will no circular references across structs if not typeinfo.size: - populate_struct(typeinfo) - + populate_struct(typeinfo, defaultPack) + typeinfo.calculate_offsets(defaultPack) + field.size = typeinfo.size field.pack = typeinfo.pack or defaultPack + + struct.calculate_offsets(defaultPack) for struct in structs: populate_struct(struct, defaultPack) @@ -1336,6 +1397,7 @@ def populate_struct(struct: Struct, defaultPack:Optional[int] = None): def findout_platform_aware_structs(self): self.packSizeAwareStructs: list[str] = [] + self.populate_typedef_layouts() for file in self.files: structs: list[Struct] = [] @@ -1346,15 +1408,17 @@ def findout_platform_aware_structs(self): if struct.packsize: continue - structSmall = copy.deepcopy(struct) - + self.populate_struct_field_layout(8) offsetsLargePack: list[FieldOffset] = struct.calculate_offsets(8) offsetsLargePack.sort(key = lambda item: item.name) + sizeLarge = struct.size - offsetsSmallPack: list[FieldOffset] = structSmall.calculate_offsets(4) + self.populate_struct_field_layout(4) + offsetsSmallPack: list[FieldOffset] = struct.calculate_offsets(4) offsetsSmallPack.sort(key = lambda item: item.name) + sizeSmall = struct.size - if offsetsLargePack != offsetsSmallPack or struct.size != structSmall.size: + if offsetsLargePack != offsetsSmallPack or sizeLarge != sizeSmall: print(f"Found packsize aware struct '{struct.name}'") struct.packsize_aware = True self.packSizeAwareStructs.append(struct.name) From cffcf0484ed3d73872d6bd577be081dd36eed5e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sat, 18 Oct 2025 10:21:26 +0800 Subject: [PATCH 44/82] Preparing use subtree instead of submodule --- .gitmodules | 3 --- CodeGen/SteamworksParser | 1 - 2 files changed, 4 deletions(-) delete mode 100644 .gitmodules delete mode 160000 CodeGen/SteamworksParser diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 988b58c3..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "CodeGen/SteamworksParser"] - path = CodeGen/SteamworksParser - url = https://github.com/rlabrecque/SteamworksParser.git diff --git a/CodeGen/SteamworksParser b/CodeGen/SteamworksParser deleted file mode 160000 index 6f70e9cb..00000000 --- a/CodeGen/SteamworksParser +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6f70e9cb638b240f39a77063f6160673014e094b From 940962508af4a8ec3b50dca097e03621e3e54de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sat, 18 Oct 2025 22:48:42 +0800 Subject: [PATCH 45/82] Make struct layout analysis work --- CodeGen/SteamworksParser/steamworksparser.py | 79 ++++++++------------ 1 file changed, 30 insertions(+), 49 deletions(-) diff --git a/CodeGen/SteamworksParser/steamworksparser.py b/CodeGen/SteamworksParser/steamworksparser.py index 08cbe09d..26ecc9d1 100644 --- a/CodeGen/SteamworksParser/steamworksparser.py +++ b/CodeGen/SteamworksParser/steamworksparser.py @@ -267,19 +267,18 @@ def calcRealSize(sizelike: int | Literal['intptr']) -> int: result = [] current_offset = 0 - + for field in self.fields: pack = field.pack or defaultAlign - effective_field_pack = calcRealSize(pack) - - if effective_struct_pack > 0: - effective_field_pack = min(effective_field_pack, effective_struct_pack) - + effective_field_pack = calcRealSize(pack) + effective_field_pack = min(effective_field_pack, defaultAlign) + padding = 0 if effective_field_pack > 0: padding = (effective_field_pack - (current_offset % effective_field_pack)) % effective_field_pack current_offset += padding + effective_struct_pack = max(effective_struct_pack, effective_field_pack) field_total_size = calcRealSize(field.size) * (field.arraysize or 1) # store offset and total size into layout info @@ -288,16 +287,15 @@ def calcRealSize(sizelike: int | Literal['intptr']) -> int: current_offset += field_total_size total_size = current_offset - if effective_struct_pack > 0: - padding = (effective_struct_pack - (total_size % effective_struct_pack)) % effective_struct_pack - total_size += padding + # if effective_struct_pack > 0: + # padding = (effective_struct_pack - (total_size % effective_struct_pack)) % effective_struct_pack + # total_size += padding self.pack = min( calcRealSize(max(self.fields, key=lambda x: calcRealSize(x.size)).size), effective_struct_pack ) self.size = total_size - return result class Union: @@ -705,8 +703,11 @@ def parse_typedefs(self, s: ParserState): typee += " *" name = name[1:] - typedef = Typedef(name, typee, s.f.name, comments,\ - self.resolveTypeInfo(typee).size, s.getCurrentPack()) + aliasedType = self.resolveTypeInfo(typee) + size = aliasedType.size + pack = aliasedType.pack + + typedef = Typedef(name, typee, s.f.name, comments, size, pack) self.typedefs.append(typedef) s.f.typedefs.append(typedef) @@ -1356,43 +1357,23 @@ def populate_union_sizes(self, defaultPack = 8): unions = file.unions for union in unions: union.calculate_offsets(defaultPack) - - def populate_struct_field_sizes(self, defaultPack = 8): - allstructs = reduce(operator.concat, [f.structs for f in self.files]) - allfields = reduce(operator.concat, [s.structs for s in allstructs]) - - for field in allfields: - typeinfo = self.resolveTypeInfo(field.type) - field.size = typeinfo.size - field.pack = typeinfo.pack - - pass - def populate_struct_field_layout(self, defaultPack = 8): - for file in self.files: - structs: list[Struct] = [] - structs.extend(file.callbacks) - structs.extend(file.structs) - - def populate_struct(struct: Struct, defaultPack): - for field in struct.fields: - typeinfo = self.resolveTypeInfo(field.type) - # check if we facing a struct which may not populated yet - if isinstance(typeinfo, Struct): - struct = typeinfo - - # we assume there will no circular references across structs - if not typeinfo.size: - populate_struct(typeinfo, defaultPack) - typeinfo.calculate_offsets(defaultPack) - - field.size = typeinfo.size - field.pack = typeinfo.pack or defaultPack + def populate_struct_field_layout(self, struct, defaultPack = 8): + for field in struct.fields: + typeinfo = self.resolveTypeInfo(field.type) + # check if we facing a struct which may not populated yet + if isinstance(typeinfo, Struct): + struct = typeinfo - struct.calculate_offsets(defaultPack) - - for struct in structs: - populate_struct(struct, defaultPack) + # we assume there will no circular references across structs + if not typeinfo.size: + self.populate_struct_field_layout(typeinfo, defaultPack) + typeinfo.calculate_offsets(defaultPack) + + field.size = typeinfo.size + field.pack = typeinfo.pack or defaultPack + + struct.calculate_offsets(defaultPack) def findout_platform_aware_structs(self): @@ -1408,12 +1389,12 @@ def findout_platform_aware_structs(self): if struct.packsize: continue - self.populate_struct_field_layout(8) + self.populate_struct_field_layout(struct, 8) offsetsLargePack: list[FieldOffset] = struct.calculate_offsets(8) offsetsLargePack.sort(key = lambda item: item.name) sizeLarge = struct.size - self.populate_struct_field_layout(4) + self.populate_struct_field_layout(struct, 4) offsetsSmallPack: list[FieldOffset] = struct.calculate_offsets(4) offsetsSmallPack.sort(key = lambda item: item.name) sizeSmall = struct.size From 463c103db1cdb3857dbbbc96ad8c39e52449f28d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sat, 18 Oct 2025 22:54:04 +0800 Subject: [PATCH 46/82] Add support to hack marshalling on demand This commit contains only codegen --- .vscode/launch.json | 17 +++ CodeGen/src/structs.py | 109 ++++++++++-------- .../anycpu/ConditionalMarshallerTable.head.cs | 5 +- .../anycpu/ConditionalMarshallerTable.tail.cs | 2 +- 4 files changed, 82 insertions(+), 51 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..4d82f020 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Debug generator", + "type": "debugpy", + "request": "launch", + "program": "${workspaceFolder}/CodeGen/Steamworks.NET_CodeGen.py", + "cwd": "${workspaceFolder}/CodeGen/", + "console": "integratedTerminal", + "justMyCode": true + } + ] +} \ No newline at end of file diff --git a/CodeGen/src/structs.py b/CodeGen/src/structs.py index 0ab200d0..25cd45b8 100644 --- a/CodeGen/src/structs.py +++ b/CodeGen/src/structs.py @@ -1,7 +1,7 @@ import os import sys from copy import deepcopy -from SteamworksParser import steamworksparser +from SteamworksParser.steamworksparser import BlankLine, Parser, Settings g_TypeConversionDict = { "uint8": "byte", @@ -95,12 +95,14 @@ } } -def main(parser): +def main(parser: Parser): try: os.makedirs("../com.rlabrecque.steamworks.net/Runtime/autogen/") except OSError: pass + packsizeAwareStructNames = parser.packSizeAwareStructs + lines = [] callbacklines = [] @@ -108,9 +110,9 @@ def main(parser): for f in parser.files: for struct in f.structs: - lines.extend(parse(struct, True, anyCpuConditionalMarshallerLines)) + lines.extend(parse(struct, True, anyCpuConditionalMarshallerLines, packsizeAwareStructNames)) for callback in f.callbacks: - callbacklines.extend(parse(callback, True, anyCpuConditionalMarshallerLines)) + callbacklines.extend(parse(callback, True, anyCpuConditionalMarshallerLines, packsizeAwareStructNames)) with open("../com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs", "wb") as out: with open("templates/header.txt", "r") as f: @@ -145,24 +147,27 @@ def main(parser): out.write(bytes("#endif // !DISABLESTEAMWORKS\n", "utf-8")) -def parse(struct, isMainStruct, marshalTableLines: list[str]): +def parse(struct, isMainStruct, marshalTableLines: list[str], packsizeAwareStructNames: list[str]) -> list[str]: if struct.name in g_SkippedStructs: return [] lines = [] for comment in struct.c.rawprecomments: - if type(comment) is steamworksparser.BlankLine: + if type(comment) is BlankLine: continue lines.append("\t" + comment) structname: str = struct.name - + # We have analyzed this struct and stored the value of its packsize, + # it's stored in Struct.pack, None for default packsize + # If the struct is packsize-aware, we generate large variants of it. packsize = g_CustomPackSize.get(structname, "Packsize.value") isExplicitStruct = False if g_ExplicitStructs.get(structname, False): lines.append("\t[StructLayout(LayoutKind.Explicit, Pack = " + packsize + ")]") isExplicitStruct = True - elif struct.packsize: + elif struct.packsize != "Packsize.value": + packsize = packsize if struct.packsize is None else str(struct.packsize) customsize = "" if len(struct.fields) == 0: customsize = ", Size = 1" @@ -177,73 +182,81 @@ def parse(struct, isMainStruct, marshalTableLines: list[str]): break if isMainStruct: - lines.append("\tpublic struct " + structname + " {") + lines.append("\tpublic struct " + structname ) + lines.append("\t#if STEAMWORKS_ANYCPU") + lines.append("\t\t: ICallbackIdentity") + lines.append("\t#endif") + lines.append("\t{") else: lines.append("\tinternal struct " + structname + " {") lines.extend(insert_constructors(structname)) - if struct.callbackid: + if struct.callbackid and not isMainStruct: lines.append("\t\tpublic const int k_iCallback = Constants." + struct.callbackid + ";") + lines.append("\t\tpublic static int CallbackIdentity { get; } = Constants." + struct.callbackid + ";") + fieldHandlingStructName = structname for field in struct.fields: - fieldHandlingStructName = structname - - if "_LargePack" in structname or "_SmallPack" in structname: + if not isMainStruct: fieldHandlingStructName = fieldHandlingStructName[:structname.rindex("_")] lines.extend(parse_field(field, fieldHandlingStructName)) + + if fieldHandlingStructName in packsizeAwareStructNames and not isMainStruct: + mainStructName = structname[:structname.rindex("_")] + packKind = structname[structname.rindex("_") + 1:] + + lines.append("") + lines.append(f"\t\tpublic static implicit operator {mainStructName}({mainStructName}_{packKind} value) {{") + lines.append(f"\t\t\t{mainStructName} result = default;") + + for field in struct.fields: + gen_fieldcopycode(field, structname, lines) + + lines.append(f"\t\t\treturn result;") + lines.append("\t\t}") + + lines.append("") + lines.append(f"\t\tpublic static implicit operator {mainStructName}_{packKind}({mainStructName} value) {{") + lines.append(f"\t\t\t{mainStructName}_{packKind} result = default;") + + for field in struct.fields: + gen_fieldcopycode(field, structname, lines) + + lines.append(f"\t\t\treturn result;") + lines.append("\t\t}") + pass if struct.endcomments: for comment in struct.endcomments.rawprecomments: - if type(comment) is steamworksparser.BlankLine: + if type(comment) is BlankLine: lines.append("\t\t") else: lines.append("\t" + comment) # Generate Any CPU marshal helper - if isMainStruct and packsize == "Packsize.value" and not isExplicitStruct: - marshalTableLines.append(f"marshallers.Add(typeof({structname}), (unmanaged) => {{") - marshalTableLines.append(f"\t{structname} result = default;") + if isMainStruct and struct.name in packsizeAwareStructNames and not isExplicitStruct: + marshalTableLines.append(f"if (typeof(T) == typeof({structname}) && Packsize.IsLargePack)") + marshalTableLines.append(f"\tImpl<{structname}>.Marshaller = (unmanaged) =>") + marshalTableLines.append(f"\t\tSystem.Runtime.InteropServices.Marshal.PtrToStructure<{structname}_LargePack>(unmanaged);") marshalTableLines.append("") - marshalTableLines.append("\tif (Packsize.IsLargePack) {") - marshalTableLines.append(f"\t\tvar value = System.Runtime.InteropServices.Marshal.PtrToStructure<{structname}_LargePack>(unmanaged);") - for field in struct.fields: - gen_fieldcopycode(field, structname, marshalTableLines) - marshalTableLines.append("\t} else {") - marshalTableLines.append(f"\t\tvar value = System.Runtime.InteropServices.Marshal.PtrToStructure<{structname}_SmallPack>(unmanaged);") - - for field in struct.fields: - gen_fieldcopycode(field, structname, marshalTableLines) - - marshalTableLines.append("\t}") - marshalTableLines.append("") - marshalTableLines.append("\treturn result;") - marshalTableLines.append("});") - - pass + # pass lines.append("\t}") lines.append("") # Generate Any CPU struct variant for default pack-sized structs - if isMainStruct and packsize == "Packsize.value" and not isExplicitStruct: + if isMainStruct and not isExplicitStruct and struct.name in packsizeAwareStructNames: lines.append("\t#if STEAMWORKS_ANYCPU") - largePackStruct = struct + largePackStruct = deepcopy(struct) largePackStruct.name = structname + "_LargePack" largePackStruct.packsize = 8 - lines.extend(parse(largePackStruct, False, marshalTableLines)) - - lines.append("") - - smallPackStruct = struct - smallPackStruct.name = structname + "_SmallPack" - smallPackStruct.packsize = 4 - lines.extend(parse(smallPackStruct, False, marshalTableLines)) + lines.extend(parse(largePackStruct, False, marshalTableLines, packsizeAwareStructNames)) lines.append("\t#endif") @@ -254,14 +267,14 @@ def gen_fieldcopycode(field, structname, marshalTableLines): fieldtype = g_SpecialFieldTypes.get(structname, dict()).get(field.name, fieldtype) if field.arraysize and fieldtype == "string": - marshalTableLines.append(f"\t\tresult.{field.name}_ = value.{field.name}_;") + marshalTableLines.append(f"\t\t\tresult.{field.name}_ = value.{field.name}_;") else: - marshalTableLines.append(f"\t\tresult.{field.name} = value.{field.name};") + marshalTableLines.append(f"\t\t\tresult.{field.name} = value.{field.name};") def parse_field(field, structname): lines = [] for comment in field.c.rawprecomments: - if type(comment) is steamworksparser.BlankLine: + if type(comment) is BlankLine: lines.append("\t\t") else: lines.append("\t" + comment) @@ -321,5 +334,5 @@ def insert_constructors(name): print("TODO: Usage Instructions") exit() - steamworksparser.Settings.fake_gameserver_interfaces = True - main(steamworksparser.parse(sys.argv[1])) \ No newline at end of file + Settings.fake_gameserver_interfaces = True + main(parse(sys.argv[1])) \ No newline at end of file diff --git a/CodeGen/templates/anycpu/ConditionalMarshallerTable.head.cs b/CodeGen/templates/anycpu/ConditionalMarshallerTable.head.cs index 9688f02e..a2100581 100644 --- a/CodeGen/templates/anycpu/ConditionalMarshallerTable.head.cs +++ b/CodeGen/templates/anycpu/ConditionalMarshallerTable.head.cs @@ -14,6 +14,7 @@ namespace Steamworks { internal static partial class ConditionalMarshallerTable { - static ConditionalMarshallerTable() { - Dictionary> marshallers = new(); + private static partial class Impl { + static Impl() { + diff --git a/CodeGen/templates/anycpu/ConditionalMarshallerTable.tail.cs b/CodeGen/templates/anycpu/ConditionalMarshallerTable.tail.cs index 702da47f..44036b84 100644 --- a/CodeGen/templates/anycpu/ConditionalMarshallerTable.tail.cs +++ b/CodeGen/templates/anycpu/ConditionalMarshallerTable.tail.cs @@ -1,4 +1,4 @@ - s_marshallerLookupTable = FrozenDictionary.ToFrozenDictionary(marshallers); + } } } } From 58d170e2426f0b1b5d89431a44c71f171a2bad7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sat, 18 Oct 2025 22:56:08 +0800 Subject: [PATCH 47/82] Hide const packsize, expose it by static readonly field instead --- Standalone3.0/ConditionalMarshallerTable.cs | 15 +- Standalone3.0/ConditionalMarshallerTable.g.cs | 3796 +------- Standalone3.0/ICallbackIdentity.cs | 12 + .../Runtime/Packsize.cs | 9 +- .../Runtime/autogen/SteamCallbacks.cs | 7945 +++++------------ .../Runtime/autogen/SteamConstants.cs | 8 + .../Runtime/autogen/SteamStructs.cs | 1202 +-- 7 files changed, 2653 insertions(+), 10334 deletions(-) create mode 100644 Standalone3.0/ICallbackIdentity.cs diff --git a/Standalone3.0/ConditionalMarshallerTable.cs b/Standalone3.0/ConditionalMarshallerTable.cs index f0e31161..7a883a65 100644 --- a/Standalone3.0/ConditionalMarshallerTable.cs +++ b/Standalone3.0/ConditionalMarshallerTable.cs @@ -1,19 +1,24 @@ using System; -using System.Collections.Frozen; -using System.Collections.Generic; +using System.Runtime.InteropServices; namespace Steamworks { internal static partial class ConditionalMarshallerTable { - private static readonly FrozenDictionary> s_marshallerLookupTable; + // private static readonly FrozenDictionary> s_marshallerLookupTable; + + private static partial class Impl + { + public static readonly Func Marshaller = + unmanaged => System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + } // partial, in generated file // static ConditionalMarshallerTable(); public static T Marshal(IntPtr unmanagetype) { - return (T)s_marshallerLookupTable[typeof(T)](unmanagetype); - } + return Impl.Marshaller(unmanagetype); + } } } diff --git a/Standalone3.0/ConditionalMarshallerTable.g.cs b/Standalone3.0/ConditionalMarshallerTable.g.cs index 7871a183..ed1536d6 100644 --- a/Standalone3.0/ConditionalMarshallerTable.g.cs +++ b/Standalone3.0/ConditionalMarshallerTable.g.cs @@ -30,3695 +30,219 @@ namespace Steamworks { internal static partial class ConditionalMarshallerTable { - static ConditionalMarshallerTable() { - Dictionary> marshallers = new(); - - marshallers.Add(typeof(DlcInstalled_t), (unmanaged) => { - DlcInstalled_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nAppID = value.m_nAppID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nAppID = value.m_nAppID; - } - - return result; - }); - marshallers.Add(typeof(NewUrlLaunchParameters_t), (unmanaged) => { - NewUrlLaunchParameters_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(AppProofOfPurchaseKeyResponse_t), (unmanaged) => { - AppProofOfPurchaseKeyResponse_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nAppID = value.m_nAppID; - result.m_cchKeyLength = value.m_cchKeyLength; - result.m_rgchKey_ = value.m_rgchKey_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nAppID = value.m_nAppID; - result.m_cchKeyLength = value.m_cchKeyLength; - result.m_rgchKey_ = value.m_rgchKey_; - } - - return result; - }); - marshallers.Add(typeof(FileDetailsResult_t), (unmanaged) => { - FileDetailsResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ulFileSize = value.m_ulFileSize; - result.m_FileSHA = value.m_FileSHA; - result.m_unFlags = value.m_unFlags; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ulFileSize = value.m_ulFileSize; - result.m_FileSHA = value.m_FileSHA; - result.m_unFlags = value.m_unFlags; - } - - return result; - }); - marshallers.Add(typeof(TimedTrialStatus_t), (unmanaged) => { - TimedTrialStatus_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unAppID = value.m_unAppID; - result.m_bIsOffline = value.m_bIsOffline; - result.m_unSecondsAllowed = value.m_unSecondsAllowed; - result.m_unSecondsPlayed = value.m_unSecondsPlayed; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unAppID = value.m_unAppID; - result.m_bIsOffline = value.m_bIsOffline; - result.m_unSecondsAllowed = value.m_unSecondsAllowed; - result.m_unSecondsPlayed = value.m_unSecondsPlayed; - } - - return result; - }); - marshallers.Add(typeof(FriendGameInfo_t), (unmanaged) => { - FriendGameInfo_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_gameID = value.m_gameID; - result.m_unGameIP = value.m_unGameIP; - result.m_usGamePort = value.m_usGamePort; - result.m_usQueryPort = value.m_usQueryPort; - result.m_steamIDLobby = value.m_steamIDLobby; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_gameID = value.m_gameID; - result.m_unGameIP = value.m_unGameIP; - result.m_usGamePort = value.m_usGamePort; - result.m_usQueryPort = value.m_usQueryPort; - result.m_steamIDLobby = value.m_steamIDLobby; - } - - return result; - }); - marshallers.Add(typeof(PersonaStateChange_t), (unmanaged) => { - PersonaStateChange_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamID = value.m_ulSteamID; - result.m_nChangeFlags = value.m_nChangeFlags; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamID = value.m_ulSteamID; - result.m_nChangeFlags = value.m_nChangeFlags; - } - - return result; - }); - marshallers.Add(typeof(GameOverlayActivated_t), (unmanaged) => { - GameOverlayActivated_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bActive = value.m_bActive; - result.m_bUserInitiated = value.m_bUserInitiated; - result.m_nAppID = value.m_nAppID; - result.m_dwOverlayPID = value.m_dwOverlayPID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bActive = value.m_bActive; - result.m_bUserInitiated = value.m_bUserInitiated; - result.m_nAppID = value.m_nAppID; - result.m_dwOverlayPID = value.m_dwOverlayPID; - } - - return result; - }); - marshallers.Add(typeof(GameServerChangeRequested_t), (unmanaged) => { - GameServerChangeRequested_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_rgchServer_ = value.m_rgchServer_; - result.m_rgchPassword_ = value.m_rgchPassword_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_rgchServer_ = value.m_rgchServer_; - result.m_rgchPassword_ = value.m_rgchPassword_; - } - - return result; - }); - marshallers.Add(typeof(GameLobbyJoinRequested_t), (unmanaged) => { - GameLobbyJoinRequested_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDLobby = value.m_steamIDLobby; - result.m_steamIDFriend = value.m_steamIDFriend; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDLobby = value.m_steamIDLobby; - result.m_steamIDFriend = value.m_steamIDFriend; - } - - return result; - }); - marshallers.Add(typeof(ClanOfficerListResponse_t), (unmanaged) => { - ClanOfficerListResponse_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDClan = value.m_steamIDClan; - result.m_cOfficers = value.m_cOfficers; - result.m_bSuccess = value.m_bSuccess; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDClan = value.m_steamIDClan; - result.m_cOfficers = value.m_cOfficers; - result.m_bSuccess = value.m_bSuccess; - } - - return result; - }); - marshallers.Add(typeof(GameRichPresenceJoinRequested_t), (unmanaged) => { - GameRichPresenceJoinRequested_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDFriend = value.m_steamIDFriend; - result.m_rgchConnect_ = value.m_rgchConnect_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDFriend = value.m_steamIDFriend; - result.m_rgchConnect_ = value.m_rgchConnect_; - } - - return result; - }); - marshallers.Add(typeof(GameConnectedChatJoin_t), (unmanaged) => { - GameConnectedChatJoin_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDClanChat = value.m_steamIDClanChat; - result.m_steamIDUser = value.m_steamIDUser; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDClanChat = value.m_steamIDClanChat; - result.m_steamIDUser = value.m_steamIDUser; - } - - return result; - }); - marshallers.Add(typeof(DownloadClanActivityCountsResult_t), (unmanaged) => { - DownloadClanActivityCountsResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bSuccess = value.m_bSuccess; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bSuccess = value.m_bSuccess; - } - - return result; - }); - marshallers.Add(typeof(UnreadChatMessagesChanged_t), (unmanaged) => { - UnreadChatMessagesChanged_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(OverlayBrowserProtocolNavigation_t), (unmanaged) => { - OverlayBrowserProtocolNavigation_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.rgchURI_ = value.rgchURI_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.rgchURI_ = value.rgchURI_; - } - - return result; - }); - marshallers.Add(typeof(EquippedProfileItemsChanged_t), (unmanaged) => { - EquippedProfileItemsChanged_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamID = value.m_steamID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamID = value.m_steamID; - } - - return result; - }); - marshallers.Add(typeof(EquippedProfileItems_t), (unmanaged) => { - EquippedProfileItems_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_steamID = value.m_steamID; - result.m_bHasAnimatedAvatar = value.m_bHasAnimatedAvatar; - result.m_bHasAvatarFrame = value.m_bHasAvatarFrame; - result.m_bHasProfileModifier = value.m_bHasProfileModifier; - result.m_bHasProfileBackground = value.m_bHasProfileBackground; - result.m_bHasMiniProfileBackground = value.m_bHasMiniProfileBackground; - result.m_bFromCache = value.m_bFromCache; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_steamID = value.m_steamID; - result.m_bHasAnimatedAvatar = value.m_bHasAnimatedAvatar; - result.m_bHasAvatarFrame = value.m_bHasAvatarFrame; - result.m_bHasProfileModifier = value.m_bHasProfileModifier; - result.m_bHasProfileBackground = value.m_bHasProfileBackground; - result.m_bHasMiniProfileBackground = value.m_bHasMiniProfileBackground; - result.m_bFromCache = value.m_bFromCache; - } - - return result; - }); - marshallers.Add(typeof(GCMessageAvailable_t), (unmanaged) => { - GCMessageAvailable_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nMessageSize = value.m_nMessageSize; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nMessageSize = value.m_nMessageSize; - } - - return result; - }); - marshallers.Add(typeof(GCMessageFailed_t), (unmanaged) => { - GCMessageFailed_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(GSClientApprove_t), (unmanaged) => { - GSClientApprove_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_SteamID = value.m_SteamID; - result.m_OwnerSteamID = value.m_OwnerSteamID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_SteamID = value.m_SteamID; - result.m_OwnerSteamID = value.m_OwnerSteamID; - } - - return result; - }); - marshallers.Add(typeof(GSClientAchievementStatus_t), (unmanaged) => { - GSClientAchievementStatus_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_SteamID = value.m_SteamID; - result.m_pchAchievement_ = value.m_pchAchievement_; - result.m_bUnlocked = value.m_bUnlocked; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_SteamID = value.m_SteamID; - result.m_pchAchievement_ = value.m_pchAchievement_; - result.m_bUnlocked = value.m_bUnlocked; - } - - return result; - }); - marshallers.Add(typeof(GSPolicyResponse_t), (unmanaged) => { - GSPolicyResponse_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bSecure = value.m_bSecure; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bSecure = value.m_bSecure; - } - - return result; - }); - marshallers.Add(typeof(GSGameplayStats_t), (unmanaged) => { - GSGameplayStats_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nRank = value.m_nRank; - result.m_unTotalConnects = value.m_unTotalConnects; - result.m_unTotalMinutesPlayed = value.m_unTotalMinutesPlayed; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nRank = value.m_nRank; - result.m_unTotalConnects = value.m_unTotalConnects; - result.m_unTotalMinutesPlayed = value.m_unTotalMinutesPlayed; - } - - return result; - }); - marshallers.Add(typeof(GSReputation_t), (unmanaged) => { - GSReputation_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_unReputationScore = value.m_unReputationScore; - result.m_bBanned = value.m_bBanned; - result.m_unBannedIP = value.m_unBannedIP; - result.m_usBannedPort = value.m_usBannedPort; - result.m_ulBannedGameID = value.m_ulBannedGameID; - result.m_unBanExpires = value.m_unBanExpires; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_unReputationScore = value.m_unReputationScore; - result.m_bBanned = value.m_bBanned; - result.m_unBannedIP = value.m_unBannedIP; - result.m_usBannedPort = value.m_usBannedPort; - result.m_ulBannedGameID = value.m_ulBannedGameID; - result.m_unBanExpires = value.m_unBanExpires; - } - - return result; - }); - marshallers.Add(typeof(AssociateWithClanResult_t), (unmanaged) => { - AssociateWithClanResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } - - return result; - }); - marshallers.Add(typeof(ComputeNewPlayerCompatibilityResult_t), (unmanaged) => { - ComputeNewPlayerCompatibilityResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_cPlayersThatDontLikeCandidate = value.m_cPlayersThatDontLikeCandidate; - result.m_cPlayersThatCandidateDoesntLike = value.m_cPlayersThatCandidateDoesntLike; - result.m_cClanPlayersThatDontLikeCandidate = value.m_cClanPlayersThatDontLikeCandidate; - result.m_SteamIDCandidate = value.m_SteamIDCandidate; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_cPlayersThatDontLikeCandidate = value.m_cPlayersThatDontLikeCandidate; - result.m_cPlayersThatCandidateDoesntLike = value.m_cPlayersThatCandidateDoesntLike; - result.m_cClanPlayersThatDontLikeCandidate = value.m_cClanPlayersThatDontLikeCandidate; - result.m_SteamIDCandidate = value.m_SteamIDCandidate; - } - - return result; - }); - marshallers.Add(typeof(GSStatsUnloaded_t), (unmanaged) => { - GSStatsUnloaded_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDUser = value.m_steamIDUser; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDUser = value.m_steamIDUser; - } - - return result; - }); - marshallers.Add(typeof(HTML_BrowserReady_t), (unmanaged) => { - HTML_BrowserReady_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - } - - return result; - }); - marshallers.Add(typeof(HTML_NeedsPaint_t), (unmanaged) => { - HTML_NeedsPaint_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pBGRA = value.pBGRA; - result.unWide = value.unWide; - result.unTall = value.unTall; - result.unUpdateX = value.unUpdateX; - result.unUpdateY = value.unUpdateY; - result.unUpdateWide = value.unUpdateWide; - result.unUpdateTall = value.unUpdateTall; - result.unScrollX = value.unScrollX; - result.unScrollY = value.unScrollY; - result.flPageScale = value.flPageScale; - result.unPageSerial = value.unPageSerial; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pBGRA = value.pBGRA; - result.unWide = value.unWide; - result.unTall = value.unTall; - result.unUpdateX = value.unUpdateX; - result.unUpdateY = value.unUpdateY; - result.unUpdateWide = value.unUpdateWide; - result.unUpdateTall = value.unUpdateTall; - result.unScrollX = value.unScrollX; - result.unScrollY = value.unScrollY; - result.flPageScale = value.flPageScale; - result.unPageSerial = value.unPageSerial; - } - - return result; - }); - marshallers.Add(typeof(HTML_StartRequest_t), (unmanaged) => { - HTML_StartRequest_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchURL = value.pchURL; - result.pchTarget = value.pchTarget; - result.pchPostData = value.pchPostData; - result.bIsRedirect = value.bIsRedirect; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchURL = value.pchURL; - result.pchTarget = value.pchTarget; - result.pchPostData = value.pchPostData; - result.bIsRedirect = value.bIsRedirect; - } - - return result; - }); - marshallers.Add(typeof(HTML_CloseBrowser_t), (unmanaged) => { - HTML_CloseBrowser_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - } - - return result; - }); - marshallers.Add(typeof(HTML_URLChanged_t), (unmanaged) => { - HTML_URLChanged_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchURL = value.pchURL; - result.pchPostData = value.pchPostData; - result.bIsRedirect = value.bIsRedirect; - result.pchPageTitle = value.pchPageTitle; - result.bNewNavigation = value.bNewNavigation; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchURL = value.pchURL; - result.pchPostData = value.pchPostData; - result.bIsRedirect = value.bIsRedirect; - result.pchPageTitle = value.pchPageTitle; - result.bNewNavigation = value.bNewNavigation; - } - - return result; - }); - marshallers.Add(typeof(HTML_FinishedRequest_t), (unmanaged) => { - HTML_FinishedRequest_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchURL = value.pchURL; - result.pchPageTitle = value.pchPageTitle; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchURL = value.pchURL; - result.pchPageTitle = value.pchPageTitle; - } - - return result; - }); - marshallers.Add(typeof(HTML_OpenLinkInNewTab_t), (unmanaged) => { - HTML_OpenLinkInNewTab_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchURL = value.pchURL; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchURL = value.pchURL; - } - - return result; - }); - marshallers.Add(typeof(HTML_ChangedTitle_t), (unmanaged) => { - HTML_ChangedTitle_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchTitle = value.pchTitle; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchTitle = value.pchTitle; - } - - return result; - }); - marshallers.Add(typeof(HTML_SearchResults_t), (unmanaged) => { - HTML_SearchResults_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.unResults = value.unResults; - result.unCurrentMatch = value.unCurrentMatch; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.unResults = value.unResults; - result.unCurrentMatch = value.unCurrentMatch; - } - - return result; - }); - marshallers.Add(typeof(HTML_CanGoBackAndForward_t), (unmanaged) => { - HTML_CanGoBackAndForward_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.bCanGoBack = value.bCanGoBack; - result.bCanGoForward = value.bCanGoForward; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.bCanGoBack = value.bCanGoBack; - result.bCanGoForward = value.bCanGoForward; - } - - return result; - }); - marshallers.Add(typeof(HTML_HorizontalScroll_t), (unmanaged) => { - HTML_HorizontalScroll_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.unScrollMax = value.unScrollMax; - result.unScrollCurrent = value.unScrollCurrent; - result.flPageScale = value.flPageScale; - result.bVisible = value.bVisible; - result.unPageSize = value.unPageSize; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.unScrollMax = value.unScrollMax; - result.unScrollCurrent = value.unScrollCurrent; - result.flPageScale = value.flPageScale; - result.bVisible = value.bVisible; - result.unPageSize = value.unPageSize; - } - - return result; - }); - marshallers.Add(typeof(HTML_VerticalScroll_t), (unmanaged) => { - HTML_VerticalScroll_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.unScrollMax = value.unScrollMax; - result.unScrollCurrent = value.unScrollCurrent; - result.flPageScale = value.flPageScale; - result.bVisible = value.bVisible; - result.unPageSize = value.unPageSize; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.unScrollMax = value.unScrollMax; - result.unScrollCurrent = value.unScrollCurrent; - result.flPageScale = value.flPageScale; - result.bVisible = value.bVisible; - result.unPageSize = value.unPageSize; - } - - return result; - }); - marshallers.Add(typeof(HTML_LinkAtPosition_t), (unmanaged) => { - HTML_LinkAtPosition_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.x = value.x; - result.y = value.y; - result.pchURL = value.pchURL; - result.bInput = value.bInput; - result.bLiveLink = value.bLiveLink; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.x = value.x; - result.y = value.y; - result.pchURL = value.pchURL; - result.bInput = value.bInput; - result.bLiveLink = value.bLiveLink; - } - - return result; - }); - marshallers.Add(typeof(HTML_JSAlert_t), (unmanaged) => { - HTML_JSAlert_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchMessage = value.pchMessage; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchMessage = value.pchMessage; - } - - return result; - }); - marshallers.Add(typeof(HTML_JSConfirm_t), (unmanaged) => { - HTML_JSConfirm_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchMessage = value.pchMessage; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchMessage = value.pchMessage; - } - - return result; - }); - marshallers.Add(typeof(HTML_FileOpenDialog_t), (unmanaged) => { - HTML_FileOpenDialog_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchTitle = value.pchTitle; - result.pchInitialFile = value.pchInitialFile; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchTitle = value.pchTitle; - result.pchInitialFile = value.pchInitialFile; - } - - return result; - }); - marshallers.Add(typeof(HTML_NewWindow_t), (unmanaged) => { - HTML_NewWindow_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchURL = value.pchURL; - result.unX = value.unX; - result.unY = value.unY; - result.unWide = value.unWide; - result.unTall = value.unTall; - result.unNewWindow_BrowserHandle_IGNORE = value.unNewWindow_BrowserHandle_IGNORE; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchURL = value.pchURL; - result.unX = value.unX; - result.unY = value.unY; - result.unWide = value.unWide; - result.unTall = value.unTall; - result.unNewWindow_BrowserHandle_IGNORE = value.unNewWindow_BrowserHandle_IGNORE; - } - - return result; - }); - marshallers.Add(typeof(HTML_SetCursor_t), (unmanaged) => { - HTML_SetCursor_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.eMouseCursor = value.eMouseCursor; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.eMouseCursor = value.eMouseCursor; - } - - return result; - }); - marshallers.Add(typeof(HTML_StatusText_t), (unmanaged) => { - HTML_StatusText_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchMsg = value.pchMsg; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchMsg = value.pchMsg; - } - - return result; - }); - marshallers.Add(typeof(HTML_ShowToolTip_t), (unmanaged) => { - HTML_ShowToolTip_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchMsg = value.pchMsg; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchMsg = value.pchMsg; - } - - return result; - }); - marshallers.Add(typeof(HTML_UpdateToolTip_t), (unmanaged) => { - HTML_UpdateToolTip_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchMsg = value.pchMsg; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.pchMsg = value.pchMsg; - } - - return result; - }); - marshallers.Add(typeof(HTML_HideToolTip_t), (unmanaged) => { - HTML_HideToolTip_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - } - - return result; - }); - marshallers.Add(typeof(HTML_BrowserRestarted_t), (unmanaged) => { - HTML_BrowserRestarted_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.unOldBrowserHandle = value.unOldBrowserHandle; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.unBrowserHandle = value.unBrowserHandle; - result.unOldBrowserHandle = value.unOldBrowserHandle; - } - - return result; - }); - marshallers.Add(typeof(HTTPRequestCompleted_t), (unmanaged) => { - HTTPRequestCompleted_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hRequest = value.m_hRequest; - result.m_ulContextValue = value.m_ulContextValue; - result.m_bRequestSuccessful = value.m_bRequestSuccessful; - result.m_eStatusCode = value.m_eStatusCode; - result.m_unBodySize = value.m_unBodySize; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hRequest = value.m_hRequest; - result.m_ulContextValue = value.m_ulContextValue; - result.m_bRequestSuccessful = value.m_bRequestSuccessful; - result.m_eStatusCode = value.m_eStatusCode; - result.m_unBodySize = value.m_unBodySize; - } - - return result; - }); - marshallers.Add(typeof(HTTPRequestHeadersReceived_t), (unmanaged) => { - HTTPRequestHeadersReceived_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hRequest = value.m_hRequest; - result.m_ulContextValue = value.m_ulContextValue; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hRequest = value.m_hRequest; - result.m_ulContextValue = value.m_ulContextValue; - } - - return result; - }); - marshallers.Add(typeof(HTTPRequestDataReceived_t), (unmanaged) => { - HTTPRequestDataReceived_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hRequest = value.m_hRequest; - result.m_ulContextValue = value.m_ulContextValue; - result.m_cOffset = value.m_cOffset; - result.m_cBytesReceived = value.m_cBytesReceived; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hRequest = value.m_hRequest; - result.m_ulContextValue = value.m_ulContextValue; - result.m_cOffset = value.m_cOffset; - result.m_cBytesReceived = value.m_cBytesReceived; - } - - return result; - }); - marshallers.Add(typeof(InputMotionData_t), (unmanaged) => { - InputMotionData_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.rotQuatX = value.rotQuatX; - result.rotQuatY = value.rotQuatY; - result.rotQuatZ = value.rotQuatZ; - result.rotQuatW = value.rotQuatW; - result.posAccelX = value.posAccelX; - result.posAccelY = value.posAccelY; - result.posAccelZ = value.posAccelZ; - result.rotVelX = value.rotVelX; - result.rotVelY = value.rotVelY; - result.rotVelZ = value.rotVelZ; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.rotQuatX = value.rotQuatX; - result.rotQuatY = value.rotQuatY; - result.rotQuatZ = value.rotQuatZ; - result.rotQuatW = value.rotQuatW; - result.posAccelX = value.posAccelX; - result.posAccelY = value.posAccelY; - result.posAccelZ = value.posAccelZ; - result.rotVelX = value.rotVelX; - result.rotVelY = value.rotVelY; - result.rotVelZ = value.rotVelZ; - } - - return result; - }); - marshallers.Add(typeof(SteamInputDeviceConnected_t), (unmanaged) => { - SteamInputDeviceConnected_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulConnectedDeviceHandle = value.m_ulConnectedDeviceHandle; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulConnectedDeviceHandle = value.m_ulConnectedDeviceHandle; - } - - return result; - }); - marshallers.Add(typeof(SteamInputDeviceDisconnected_t), (unmanaged) => { - SteamInputDeviceDisconnected_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulDisconnectedDeviceHandle = value.m_ulDisconnectedDeviceHandle; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulDisconnectedDeviceHandle = value.m_ulDisconnectedDeviceHandle; - } - - return result; - }); - marshallers.Add(typeof(SteamInputConfigurationLoaded_t), (unmanaged) => { - SteamInputConfigurationLoaded_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unAppID = value.m_unAppID; - result.m_ulDeviceHandle = value.m_ulDeviceHandle; - result.m_ulMappingCreator = value.m_ulMappingCreator; - result.m_unMajorRevision = value.m_unMajorRevision; - result.m_unMinorRevision = value.m_unMinorRevision; - result.m_bUsesSteamInputAPI = value.m_bUsesSteamInputAPI; - result.m_bUsesGamepadAPI = value.m_bUsesGamepadAPI; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unAppID = value.m_unAppID; - result.m_ulDeviceHandle = value.m_ulDeviceHandle; - result.m_ulMappingCreator = value.m_ulMappingCreator; - result.m_unMajorRevision = value.m_unMajorRevision; - result.m_unMinorRevision = value.m_unMinorRevision; - result.m_bUsesSteamInputAPI = value.m_bUsesSteamInputAPI; - result.m_bUsesGamepadAPI = value.m_bUsesGamepadAPI; - } - - return result; - }); - marshallers.Add(typeof(SteamInputGamepadSlotChange_t), (unmanaged) => { - SteamInputGamepadSlotChange_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unAppID = value.m_unAppID; - result.m_ulDeviceHandle = value.m_ulDeviceHandle; - result.m_eDeviceType = value.m_eDeviceType; - result.m_nOldGamepadSlot = value.m_nOldGamepadSlot; - result.m_nNewGamepadSlot = value.m_nNewGamepadSlot; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unAppID = value.m_unAppID; - result.m_ulDeviceHandle = value.m_ulDeviceHandle; - result.m_eDeviceType = value.m_eDeviceType; - result.m_nOldGamepadSlot = value.m_nOldGamepadSlot; - result.m_nNewGamepadSlot = value.m_nNewGamepadSlot; - } - - return result; - }); - marshallers.Add(typeof(SteamItemDetails_t), (unmanaged) => { - SteamItemDetails_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_itemId = value.m_itemId; - result.m_iDefinition = value.m_iDefinition; - result.m_unQuantity = value.m_unQuantity; - result.m_unFlags = value.m_unFlags; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_itemId = value.m_itemId; - result.m_iDefinition = value.m_iDefinition; - result.m_unQuantity = value.m_unQuantity; - result.m_unFlags = value.m_unFlags; - } - - return result; - }); - marshallers.Add(typeof(SteamInventoryResultReady_t), (unmanaged) => { - SteamInventoryResultReady_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_handle = value.m_handle; - result.m_result = value.m_result; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_handle = value.m_handle; - result.m_result = value.m_result; - } - - return result; - }); - marshallers.Add(typeof(SteamInventoryFullUpdate_t), (unmanaged) => { - SteamInventoryFullUpdate_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_handle = value.m_handle; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_handle = value.m_handle; - } - - return result; - }); - marshallers.Add(typeof(SteamInventoryDefinitionUpdate_t), (unmanaged) => { - SteamInventoryDefinitionUpdate_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(SteamInventoryEligiblePromoItemDefIDs_t), (unmanaged) => { - SteamInventoryEligiblePromoItemDefIDs_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_result = value.m_result; - result.m_steamID = value.m_steamID; - result.m_numEligiblePromoItemDefs = value.m_numEligiblePromoItemDefs; - result.m_bCachedData = value.m_bCachedData; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_result = value.m_result; - result.m_steamID = value.m_steamID; - result.m_numEligiblePromoItemDefs = value.m_numEligiblePromoItemDefs; - result.m_bCachedData = value.m_bCachedData; - } - - return result; - }); - marshallers.Add(typeof(SteamInventoryStartPurchaseResult_t), (unmanaged) => { - SteamInventoryStartPurchaseResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_result = value.m_result; - result.m_ulOrderID = value.m_ulOrderID; - result.m_ulTransID = value.m_ulTransID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_result = value.m_result; - result.m_ulOrderID = value.m_ulOrderID; - result.m_ulTransID = value.m_ulTransID; - } - - return result; - }); - marshallers.Add(typeof(SteamInventoryRequestPricesResult_t), (unmanaged) => { - SteamInventoryRequestPricesResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_result = value.m_result; - result.m_rgchCurrency_ = value.m_rgchCurrency_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_result = value.m_result; - result.m_rgchCurrency_ = value.m_rgchCurrency_; - } - - return result; - }); - marshallers.Add(typeof(SteamPartyBeaconLocation_t), (unmanaged) => { - SteamPartyBeaconLocation_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eType = value.m_eType; - result.m_ulLocationID = value.m_ulLocationID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eType = value.m_eType; - result.m_ulLocationID = value.m_ulLocationID; - } - - return result; - }); - marshallers.Add(typeof(FavoritesListChanged_t), (unmanaged) => { - FavoritesListChanged_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nIP = value.m_nIP; - result.m_nQueryPort = value.m_nQueryPort; - result.m_nConnPort = value.m_nConnPort; - result.m_nAppID = value.m_nAppID; - result.m_nFlags = value.m_nFlags; - result.m_bAdd = value.m_bAdd; - result.m_unAccountId = value.m_unAccountId; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nIP = value.m_nIP; - result.m_nQueryPort = value.m_nQueryPort; - result.m_nConnPort = value.m_nConnPort; - result.m_nAppID = value.m_nAppID; - result.m_nFlags = value.m_nFlags; - result.m_bAdd = value.m_bAdd; - result.m_unAccountId = value.m_unAccountId; - } - - return result; - }); - marshallers.Add(typeof(LobbyInvite_t), (unmanaged) => { - LobbyInvite_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDUser = value.m_ulSteamIDUser; - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_ulGameID = value.m_ulGameID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDUser = value.m_ulSteamIDUser; - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_ulGameID = value.m_ulGameID; - } - - return result; - }); - marshallers.Add(typeof(LobbyEnter_t), (unmanaged) => { - LobbyEnter_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_rgfChatPermissions = value.m_rgfChatPermissions; - result.m_bLocked = value.m_bLocked; - result.m_EChatRoomEnterResponse = value.m_EChatRoomEnterResponse; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_rgfChatPermissions = value.m_rgfChatPermissions; - result.m_bLocked = value.m_bLocked; - result.m_EChatRoomEnterResponse = value.m_EChatRoomEnterResponse; - } - - return result; - }); - marshallers.Add(typeof(LobbyDataUpdate_t), (unmanaged) => { - LobbyDataUpdate_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_ulSteamIDMember = value.m_ulSteamIDMember; - result.m_bSuccess = value.m_bSuccess; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_ulSteamIDMember = value.m_ulSteamIDMember; - result.m_bSuccess = value.m_bSuccess; - } - - return result; - }); - marshallers.Add(typeof(LobbyChatUpdate_t), (unmanaged) => { - LobbyChatUpdate_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_ulSteamIDUserChanged = value.m_ulSteamIDUserChanged; - result.m_ulSteamIDMakingChange = value.m_ulSteamIDMakingChange; - result.m_rgfChatMemberStateChange = value.m_rgfChatMemberStateChange; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_ulSteamIDUserChanged = value.m_ulSteamIDUserChanged; - result.m_ulSteamIDMakingChange = value.m_ulSteamIDMakingChange; - result.m_rgfChatMemberStateChange = value.m_rgfChatMemberStateChange; - } - - return result; - }); - marshallers.Add(typeof(LobbyChatMsg_t), (unmanaged) => { - LobbyChatMsg_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_ulSteamIDUser = value.m_ulSteamIDUser; - result.m_eChatEntryType = value.m_eChatEntryType; - result.m_iChatID = value.m_iChatID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_ulSteamIDUser = value.m_ulSteamIDUser; - result.m_eChatEntryType = value.m_eChatEntryType; - result.m_iChatID = value.m_iChatID; - } - - return result; - }); - marshallers.Add(typeof(LobbyGameCreated_t), (unmanaged) => { - LobbyGameCreated_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_ulSteamIDGameServer = value.m_ulSteamIDGameServer; - result.m_unIP = value.m_unIP; - result.m_usPort = value.m_usPort; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_ulSteamIDGameServer = value.m_ulSteamIDGameServer; - result.m_unIP = value.m_unIP; - result.m_usPort = value.m_usPort; - } - - return result; - }); - marshallers.Add(typeof(LobbyMatchList_t), (unmanaged) => { - LobbyMatchList_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nLobbiesMatching = value.m_nLobbiesMatching; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nLobbiesMatching = value.m_nLobbiesMatching; - } - - return result; - }); - marshallers.Add(typeof(LobbyKicked_t), (unmanaged) => { - LobbyKicked_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_ulSteamIDAdmin = value.m_ulSteamIDAdmin; - result.m_bKickedDueToDisconnect = value.m_bKickedDueToDisconnect; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - result.m_ulSteamIDAdmin = value.m_ulSteamIDAdmin; - result.m_bKickedDueToDisconnect = value.m_bKickedDueToDisconnect; - } - - return result; - }); - marshallers.Add(typeof(LobbyCreated_t), (unmanaged) => { - LobbyCreated_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; - } - - return result; - }); - marshallers.Add(typeof(FavoritesListAccountsUpdated_t), (unmanaged) => { - FavoritesListAccountsUpdated_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } - - return result; - }); - marshallers.Add(typeof(SearchForGameProgressCallback_t), (unmanaged) => { - SearchForGameProgressCallback_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ullSearchID = value.m_ullSearchID; - result.m_eResult = value.m_eResult; - result.m_lobbyID = value.m_lobbyID; - result.m_steamIDEndedSearch = value.m_steamIDEndedSearch; - result.m_nSecondsRemainingEstimate = value.m_nSecondsRemainingEstimate; - result.m_cPlayersSearching = value.m_cPlayersSearching; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ullSearchID = value.m_ullSearchID; - result.m_eResult = value.m_eResult; - result.m_lobbyID = value.m_lobbyID; - result.m_steamIDEndedSearch = value.m_steamIDEndedSearch; - result.m_nSecondsRemainingEstimate = value.m_nSecondsRemainingEstimate; - result.m_cPlayersSearching = value.m_cPlayersSearching; - } - - return result; - }); - marshallers.Add(typeof(SearchForGameResultCallback_t), (unmanaged) => { - SearchForGameResultCallback_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ullSearchID = value.m_ullSearchID; - result.m_eResult = value.m_eResult; - result.m_nCountPlayersInGame = value.m_nCountPlayersInGame; - result.m_nCountAcceptedGame = value.m_nCountAcceptedGame; - result.m_steamIDHost = value.m_steamIDHost; - result.m_bFinalCallback = value.m_bFinalCallback; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ullSearchID = value.m_ullSearchID; - result.m_eResult = value.m_eResult; - result.m_nCountPlayersInGame = value.m_nCountPlayersInGame; - result.m_nCountAcceptedGame = value.m_nCountAcceptedGame; - result.m_steamIDHost = value.m_steamIDHost; - result.m_bFinalCallback = value.m_bFinalCallback; - } - - return result; - }); - marshallers.Add(typeof(RequestPlayersForGameProgressCallback_t), (unmanaged) => { - RequestPlayersForGameProgressCallback_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ullSearchID = value.m_ullSearchID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ullSearchID = value.m_ullSearchID; - } - - return result; - }); - marshallers.Add(typeof(RequestPlayersForGameResultCallback_t), (unmanaged) => { - RequestPlayersForGameResultCallback_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ullSearchID = value.m_ullSearchID; - result.m_SteamIDPlayerFound = value.m_SteamIDPlayerFound; - result.m_SteamIDLobby = value.m_SteamIDLobby; - result.m_ePlayerAcceptState = value.m_ePlayerAcceptState; - result.m_nPlayerIndex = value.m_nPlayerIndex; - result.m_nTotalPlayersFound = value.m_nTotalPlayersFound; - result.m_nTotalPlayersAcceptedGame = value.m_nTotalPlayersAcceptedGame; - result.m_nSuggestedTeamIndex = value.m_nSuggestedTeamIndex; - result.m_ullUniqueGameID = value.m_ullUniqueGameID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ullSearchID = value.m_ullSearchID; - result.m_SteamIDPlayerFound = value.m_SteamIDPlayerFound; - result.m_SteamIDLobby = value.m_SteamIDLobby; - result.m_ePlayerAcceptState = value.m_ePlayerAcceptState; - result.m_nPlayerIndex = value.m_nPlayerIndex; - result.m_nTotalPlayersFound = value.m_nTotalPlayersFound; - result.m_nTotalPlayersAcceptedGame = value.m_nTotalPlayersAcceptedGame; - result.m_nSuggestedTeamIndex = value.m_nSuggestedTeamIndex; - result.m_ullUniqueGameID = value.m_ullUniqueGameID; - } - - return result; - }); - marshallers.Add(typeof(RequestPlayersForGameFinalResultCallback_t), (unmanaged) => { - RequestPlayersForGameFinalResultCallback_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ullSearchID = value.m_ullSearchID; - result.m_ullUniqueGameID = value.m_ullUniqueGameID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ullSearchID = value.m_ullSearchID; - result.m_ullUniqueGameID = value.m_ullUniqueGameID; - } - - return result; - }); - marshallers.Add(typeof(SubmitPlayerResultResultCallback_t), (unmanaged) => { - SubmitPlayerResultResultCallback_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.ullUniqueGameID = value.ullUniqueGameID; - result.steamIDPlayer = value.steamIDPlayer; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.ullUniqueGameID = value.ullUniqueGameID; - result.steamIDPlayer = value.steamIDPlayer; - } - - return result; - }); - marshallers.Add(typeof(EndGameResultCallback_t), (unmanaged) => { - EndGameResultCallback_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.ullUniqueGameID = value.ullUniqueGameID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.ullUniqueGameID = value.ullUniqueGameID; - } - - return result; - }); - marshallers.Add(typeof(JoinPartyCallback_t), (unmanaged) => { - JoinPartyCallback_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ulBeaconID = value.m_ulBeaconID; - result.m_SteamIDBeaconOwner = value.m_SteamIDBeaconOwner; - result.m_rgchConnectString_ = value.m_rgchConnectString_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ulBeaconID = value.m_ulBeaconID; - result.m_SteamIDBeaconOwner = value.m_SteamIDBeaconOwner; - result.m_rgchConnectString_ = value.m_rgchConnectString_; - } - - return result; - }); - marshallers.Add(typeof(CreateBeaconCallback_t), (unmanaged) => { - CreateBeaconCallback_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ulBeaconID = value.m_ulBeaconID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_ulBeaconID = value.m_ulBeaconID; - } - - return result; - }); - marshallers.Add(typeof(ReservationNotificationCallback_t), (unmanaged) => { - ReservationNotificationCallback_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulBeaconID = value.m_ulBeaconID; - result.m_steamIDJoiner = value.m_steamIDJoiner; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulBeaconID = value.m_ulBeaconID; - result.m_steamIDJoiner = value.m_steamIDJoiner; - } - - return result; - }); - marshallers.Add(typeof(ChangeNumOpenSlotsCallback_t), (unmanaged) => { - ChangeNumOpenSlotsCallback_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } - - return result; - }); - marshallers.Add(typeof(AvailableBeaconLocationsUpdated_t), (unmanaged) => { - AvailableBeaconLocationsUpdated_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(ActiveBeaconsUpdated_t), (unmanaged) => { - ActiveBeaconsUpdated_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(PlaybackStatusHasChanged_t), (unmanaged) => { - PlaybackStatusHasChanged_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(VolumeHasChanged_t), (unmanaged) => { - VolumeHasChanged_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_flNewVolume = value.m_flNewVolume; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_flNewVolume = value.m_flNewVolume; - } - - return result; - }); - marshallers.Add(typeof(MusicPlayerRemoteWillActivate_t), (unmanaged) => { - MusicPlayerRemoteWillActivate_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(MusicPlayerRemoteWillDeactivate_t), (unmanaged) => { - MusicPlayerRemoteWillDeactivate_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(MusicPlayerRemoteToFront_t), (unmanaged) => { - MusicPlayerRemoteToFront_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } + private static partial class Impl { + static Impl() { - return result; - }); - marshallers.Add(typeof(MusicPlayerWillQuit_t), (unmanaged) => { - MusicPlayerWillQuit_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(MusicPlayerWantsPlay_t), (unmanaged) => { - MusicPlayerWantsPlay_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(MusicPlayerWantsPause_t), (unmanaged) => { - MusicPlayerWantsPause_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(MusicPlayerWantsPlayPrevious_t), (unmanaged) => { - MusicPlayerWantsPlayPrevious_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(MusicPlayerWantsPlayNext_t), (unmanaged) => { - MusicPlayerWantsPlayNext_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(MusicPlayerWantsShuffled_t), (unmanaged) => { - MusicPlayerWantsShuffled_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bShuffled = value.m_bShuffled; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bShuffled = value.m_bShuffled; - } - - return result; - }); - marshallers.Add(typeof(MusicPlayerWantsLooped_t), (unmanaged) => { - MusicPlayerWantsLooped_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bLooped = value.m_bLooped; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bLooped = value.m_bLooped; - } - - return result; - }); - marshallers.Add(typeof(MusicPlayerWantsVolume_t), (unmanaged) => { - MusicPlayerWantsVolume_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_flNewVolume = value.m_flNewVolume; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_flNewVolume = value.m_flNewVolume; - } - - return result; - }); - marshallers.Add(typeof(MusicPlayerSelectsQueueEntry_t), (unmanaged) => { - MusicPlayerSelectsQueueEntry_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.nID = value.nID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.nID = value.nID; - } - - return result; - }); - marshallers.Add(typeof(MusicPlayerSelectsPlaylistEntry_t), (unmanaged) => { - MusicPlayerSelectsPlaylistEntry_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.nID = value.nID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.nID = value.nID; - } - - return result; - }); - marshallers.Add(typeof(MusicPlayerWantsPlayingRepeatStatus_t), (unmanaged) => { - MusicPlayerWantsPlayingRepeatStatus_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPlayingRepeatStatus = value.m_nPlayingRepeatStatus; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPlayingRepeatStatus = value.m_nPlayingRepeatStatus; - } - - return result; - }); - marshallers.Add(typeof(P2PSessionState_t), (unmanaged) => { - P2PSessionState_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bConnectionActive = value.m_bConnectionActive; - result.m_bConnecting = value.m_bConnecting; - result.m_eP2PSessionError = value.m_eP2PSessionError; - result.m_bUsingRelay = value.m_bUsingRelay; - result.m_nBytesQueuedForSend = value.m_nBytesQueuedForSend; - result.m_nPacketsQueuedForSend = value.m_nPacketsQueuedForSend; - result.m_nRemoteIP = value.m_nRemoteIP; - result.m_nRemotePort = value.m_nRemotePort; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bConnectionActive = value.m_bConnectionActive; - result.m_bConnecting = value.m_bConnecting; - result.m_eP2PSessionError = value.m_eP2PSessionError; - result.m_bUsingRelay = value.m_bUsingRelay; - result.m_nBytesQueuedForSend = value.m_nBytesQueuedForSend; - result.m_nPacketsQueuedForSend = value.m_nPacketsQueuedForSend; - result.m_nRemoteIP = value.m_nRemoteIP; - result.m_nRemotePort = value.m_nRemotePort; - } - - return result; - }); - marshallers.Add(typeof(P2PSessionRequest_t), (unmanaged) => { - P2PSessionRequest_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDRemote = value.m_steamIDRemote; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDRemote = value.m_steamIDRemote; - } - - return result; - }); - marshallers.Add(typeof(SteamNetworkingMessagesSessionRequest_t), (unmanaged) => { - SteamNetworkingMessagesSessionRequest_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_identityRemote = value.m_identityRemote; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_identityRemote = value.m_identityRemote; - } - - return result; - }); - marshallers.Add(typeof(SteamNetworkingMessagesSessionFailed_t), (unmanaged) => { - SteamNetworkingMessagesSessionFailed_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_info = value.m_info; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_info = value.m_info; - } - - return result; - }); - marshallers.Add(typeof(SteamNetConnectionStatusChangedCallback_t), (unmanaged) => { - SteamNetConnectionStatusChangedCallback_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hConn = value.m_hConn; - result.m_info = value.m_info; - result.m_eOldState = value.m_eOldState; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hConn = value.m_hConn; - result.m_info = value.m_info; - result.m_eOldState = value.m_eOldState; - } - - return result; - }); - marshallers.Add(typeof(SteamNetAuthenticationStatus_t), (unmanaged) => { - SteamNetAuthenticationStatus_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eAvail = value.m_eAvail; - result.m_debugMsg_ = value.m_debugMsg_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eAvail = value.m_eAvail; - result.m_debugMsg_ = value.m_debugMsg_; - } - - return result; - }); - marshallers.Add(typeof(SteamRelayNetworkStatus_t), (unmanaged) => { - SteamRelayNetworkStatus_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eAvail = value.m_eAvail; - result.m_bPingMeasurementInProgress = value.m_bPingMeasurementInProgress; - result.m_eAvailNetworkConfig = value.m_eAvailNetworkConfig; - result.m_eAvailAnyRelay = value.m_eAvailAnyRelay; - result.m_debugMsg_ = value.m_debugMsg_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eAvail = value.m_eAvail; - result.m_bPingMeasurementInProgress = value.m_bPingMeasurementInProgress; - result.m_eAvailNetworkConfig = value.m_eAvailNetworkConfig; - result.m_eAvailAnyRelay = value.m_eAvailAnyRelay; - result.m_debugMsg_ = value.m_debugMsg_; - } - - return result; - }); - marshallers.Add(typeof(SteamParentalSettingsChanged_t), (unmanaged) => { - SteamParentalSettingsChanged_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(RemotePlayInputMouseMotion_t), (unmanaged) => { - RemotePlayInputMouseMotion_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bAbsolute = value.m_bAbsolute; - result.m_flNormalizedX = value.m_flNormalizedX; - result.m_flNormalizedY = value.m_flNormalizedY; - result.m_nDeltaX = value.m_nDeltaX; - result.m_nDeltaY = value.m_nDeltaY; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bAbsolute = value.m_bAbsolute; - result.m_flNormalizedX = value.m_flNormalizedX; - result.m_flNormalizedY = value.m_flNormalizedY; - result.m_nDeltaX = value.m_nDeltaX; - result.m_nDeltaY = value.m_nDeltaY; - } - - return result; - }); - marshallers.Add(typeof(RemotePlayInputMouseWheel_t), (unmanaged) => { - RemotePlayInputMouseWheel_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eDirection = value.m_eDirection; - result.m_flAmount = value.m_flAmount; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eDirection = value.m_eDirection; - result.m_flAmount = value.m_flAmount; - } - - return result; - }); - marshallers.Add(typeof(RemotePlayInputKey_t), (unmanaged) => { - RemotePlayInputKey_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eScancode = value.m_eScancode; - result.m_unModifiers = value.m_unModifiers; - result.m_unKeycode = value.m_unKeycode; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eScancode = value.m_eScancode; - result.m_unModifiers = value.m_unModifiers; - result.m_unKeycode = value.m_unKeycode; - } - - return result; - }); - marshallers.Add(typeof(SteamRemotePlaySessionConnected_t), (unmanaged) => { - SteamRemotePlaySessionConnected_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unSessionID = value.m_unSessionID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unSessionID = value.m_unSessionID; - } - - return result; - }); - marshallers.Add(typeof(SteamRemotePlaySessionDisconnected_t), (unmanaged) => { - SteamRemotePlaySessionDisconnected_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unSessionID = value.m_unSessionID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unSessionID = value.m_unSessionID; - } - - return result; - }); - marshallers.Add(typeof(SteamRemotePlayTogetherGuestInvite_t), (unmanaged) => { - SteamRemotePlayTogetherGuestInvite_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_szConnectURL_ = value.m_szConnectURL_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_szConnectURL_ = value.m_szConnectURL_; - } - - return result; - }); - marshallers.Add(typeof(SteamParamStringArray_t), (unmanaged) => { - SteamParamStringArray_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ppStrings = value.m_ppStrings; - result.m_nNumStrings = value.m_nNumStrings; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ppStrings = value.m_ppStrings; - result.m_nNumStrings = value.m_nNumStrings; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageFileShareResult_t), (unmanaged) => { - RemoteStorageFileShareResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_hFile = value.m_hFile; - result.m_rgchFilename_ = value.m_rgchFilename_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_hFile = value.m_hFile; - result.m_rgchFilename_ = value.m_rgchFilename_; - } - - return result; - }); - marshallers.Add(typeof(RemoteStoragePublishFileResult_t), (unmanaged) => { - RemoteStoragePublishFileResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_bUserNeedsToAcceptWorkshopLegalAgreement = value.m_bUserNeedsToAcceptWorkshopLegalAgreement; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_bUserNeedsToAcceptWorkshopLegalAgreement = value.m_bUserNeedsToAcceptWorkshopLegalAgreement; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageDeletePublishedFileResult_t), (unmanaged) => { - RemoteStorageDeletePublishedFileResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageEnumerateUserPublishedFilesResult_t), (unmanaged) => { - RemoteStorageEnumerateUserPublishedFilesResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nResultsReturned = value.m_nResultsReturned; - result.m_nTotalResultCount = value.m_nTotalResultCount; - result.m_rgPublishedFileId = value.m_rgPublishedFileId; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nResultsReturned = value.m_nResultsReturned; - result.m_nTotalResultCount = value.m_nTotalResultCount; - result.m_rgPublishedFileId = value.m_rgPublishedFileId; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageSubscribePublishedFileResult_t), (unmanaged) => { - RemoteStorageSubscribePublishedFileResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t), (unmanaged) => { - RemoteStorageEnumerateUserSubscribedFilesResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nResultsReturned = value.m_nResultsReturned; - result.m_nTotalResultCount = value.m_nTotalResultCount; - result.m_rgPublishedFileId = value.m_rgPublishedFileId; - result.m_rgRTimeSubscribed = value.m_rgRTimeSubscribed; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nResultsReturned = value.m_nResultsReturned; - result.m_nTotalResultCount = value.m_nTotalResultCount; - result.m_rgPublishedFileId = value.m_rgPublishedFileId; - result.m_rgRTimeSubscribed = value.m_rgRTimeSubscribed; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageUnsubscribePublishedFileResult_t), (unmanaged) => { - RemoteStorageUnsubscribePublishedFileResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageUpdatePublishedFileResult_t), (unmanaged) => { - RemoteStorageUpdatePublishedFileResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_bUserNeedsToAcceptWorkshopLegalAgreement = value.m_bUserNeedsToAcceptWorkshopLegalAgreement; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_bUserNeedsToAcceptWorkshopLegalAgreement = value.m_bUserNeedsToAcceptWorkshopLegalAgreement; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageDownloadUGCResult_t), (unmanaged) => { - RemoteStorageDownloadUGCResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_hFile = value.m_hFile; - result.m_nAppID = value.m_nAppID; - result.m_nSizeInBytes = value.m_nSizeInBytes; - result.m_pchFileName_ = value.m_pchFileName_; - result.m_ulSteamIDOwner = value.m_ulSteamIDOwner; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_hFile = value.m_hFile; - result.m_nAppID = value.m_nAppID; - result.m_nSizeInBytes = value.m_nSizeInBytes; - result.m_pchFileName_ = value.m_pchFileName_; - result.m_ulSteamIDOwner = value.m_ulSteamIDOwner; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageGetPublishedFileDetailsResult_t), (unmanaged) => { - RemoteStorageGetPublishedFileDetailsResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nCreatorAppID = value.m_nCreatorAppID; - result.m_nConsumerAppID = value.m_nConsumerAppID; - result.m_rgchTitle_ = value.m_rgchTitle_; - result.m_rgchDescription_ = value.m_rgchDescription_; - result.m_hFile = value.m_hFile; - result.m_hPreviewFile = value.m_hPreviewFile; - result.m_ulSteamIDOwner = value.m_ulSteamIDOwner; - result.m_rtimeCreated = value.m_rtimeCreated; - result.m_rtimeUpdated = value.m_rtimeUpdated; - result.m_eVisibility = value.m_eVisibility; - result.m_bBanned = value.m_bBanned; - result.m_rgchTags_ = value.m_rgchTags_; - result.m_bTagsTruncated = value.m_bTagsTruncated; - result.m_pchFileName_ = value.m_pchFileName_; - result.m_nFileSize = value.m_nFileSize; - result.m_nPreviewFileSize = value.m_nPreviewFileSize; - result.m_rgchURL_ = value.m_rgchURL_; - result.m_eFileType = value.m_eFileType; - result.m_bAcceptedForUse = value.m_bAcceptedForUse; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nCreatorAppID = value.m_nCreatorAppID; - result.m_nConsumerAppID = value.m_nConsumerAppID; - result.m_rgchTitle_ = value.m_rgchTitle_; - result.m_rgchDescription_ = value.m_rgchDescription_; - result.m_hFile = value.m_hFile; - result.m_hPreviewFile = value.m_hPreviewFile; - result.m_ulSteamIDOwner = value.m_ulSteamIDOwner; - result.m_rtimeCreated = value.m_rtimeCreated; - result.m_rtimeUpdated = value.m_rtimeUpdated; - result.m_eVisibility = value.m_eVisibility; - result.m_bBanned = value.m_bBanned; - result.m_rgchTags_ = value.m_rgchTags_; - result.m_bTagsTruncated = value.m_bTagsTruncated; - result.m_pchFileName_ = value.m_pchFileName_; - result.m_nFileSize = value.m_nFileSize; - result.m_nPreviewFileSize = value.m_nPreviewFileSize; - result.m_rgchURL_ = value.m_rgchURL_; - result.m_eFileType = value.m_eFileType; - result.m_bAcceptedForUse = value.m_bAcceptedForUse; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageEnumerateWorkshopFilesResult_t), (unmanaged) => { - RemoteStorageEnumerateWorkshopFilesResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nResultsReturned = value.m_nResultsReturned; - result.m_nTotalResultCount = value.m_nTotalResultCount; - result.m_rgPublishedFileId = value.m_rgPublishedFileId; - result.m_rgScore = value.m_rgScore; - result.m_nAppId = value.m_nAppId; - result.m_unStartIndex = value.m_unStartIndex; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nResultsReturned = value.m_nResultsReturned; - result.m_nTotalResultCount = value.m_nTotalResultCount; - result.m_rgPublishedFileId = value.m_rgPublishedFileId; - result.m_rgScore = value.m_rgScore; - result.m_nAppId = value.m_nAppId; - result.m_unStartIndex = value.m_unStartIndex; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageGetPublishedItemVoteDetailsResult_t), (unmanaged) => { - RemoteStorageGetPublishedItemVoteDetailsResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_unPublishedFileId = value.m_unPublishedFileId; - result.m_nVotesFor = value.m_nVotesFor; - result.m_nVotesAgainst = value.m_nVotesAgainst; - result.m_nReports = value.m_nReports; - result.m_fScore = value.m_fScore; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_unPublishedFileId = value.m_unPublishedFileId; - result.m_nVotesFor = value.m_nVotesFor; - result.m_nVotesAgainst = value.m_nVotesAgainst; - result.m_nReports = value.m_nReports; - result.m_fScore = value.m_fScore; - } - - return result; - }); - marshallers.Add(typeof(RemoteStoragePublishedFileSubscribed_t), (unmanaged) => { - RemoteStoragePublishedFileSubscribed_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nAppID = value.m_nAppID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nAppID = value.m_nAppID; - } - - return result; - }); - marshallers.Add(typeof(RemoteStoragePublishedFileUnsubscribed_t), (unmanaged) => { - RemoteStoragePublishedFileUnsubscribed_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nAppID = value.m_nAppID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nAppID = value.m_nAppID; - } - - return result; - }); - marshallers.Add(typeof(RemoteStoragePublishedFileDeleted_t), (unmanaged) => { - RemoteStoragePublishedFileDeleted_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nAppID = value.m_nAppID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nAppID = value.m_nAppID; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageUpdateUserPublishedItemVoteResult_t), (unmanaged) => { - RemoteStorageUpdateUserPublishedItemVoteResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageUserVoteDetails_t), (unmanaged) => { - RemoteStorageUserVoteDetails_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eVote = value.m_eVote; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eVote = value.m_eVote; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t), (unmanaged) => { - RemoteStorageEnumerateUserSharedWorkshopFilesResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nResultsReturned = value.m_nResultsReturned; - result.m_nTotalResultCount = value.m_nTotalResultCount; - result.m_rgPublishedFileId = value.m_rgPublishedFileId; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nResultsReturned = value.m_nResultsReturned; - result.m_nTotalResultCount = value.m_nTotalResultCount; - result.m_rgPublishedFileId = value.m_rgPublishedFileId; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageSetUserPublishedFileActionResult_t), (unmanaged) => { - RemoteStorageSetUserPublishedFileActionResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eAction = value.m_eAction; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eAction = value.m_eAction; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageEnumeratePublishedFilesByUserActionResult_t), (unmanaged) => { - RemoteStorageEnumeratePublishedFilesByUserActionResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_eAction = value.m_eAction; - result.m_nResultsReturned = value.m_nResultsReturned; - result.m_nTotalResultCount = value.m_nTotalResultCount; - result.m_rgPublishedFileId = value.m_rgPublishedFileId; - result.m_rgRTimeUpdated = value.m_rgRTimeUpdated; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_eAction = value.m_eAction; - result.m_nResultsReturned = value.m_nResultsReturned; - result.m_nTotalResultCount = value.m_nTotalResultCount; - result.m_rgPublishedFileId = value.m_rgPublishedFileId; - result.m_rgRTimeUpdated = value.m_rgRTimeUpdated; - } - - return result; - }); - marshallers.Add(typeof(RemoteStoragePublishFileProgress_t), (unmanaged) => { - RemoteStoragePublishFileProgress_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_dPercentFile = value.m_dPercentFile; - result.m_bPreview = value.m_bPreview; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_dPercentFile = value.m_dPercentFile; - result.m_bPreview = value.m_bPreview; - } - - return result; - }); - marshallers.Add(typeof(RemoteStoragePublishedFileUpdated_t), (unmanaged) => { - RemoteStoragePublishedFileUpdated_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nAppID = value.m_nAppID; - result.m_ulUnused = value.m_ulUnused; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nAppID = value.m_nAppID; - result.m_ulUnused = value.m_ulUnused; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageFileWriteAsyncComplete_t), (unmanaged) => { - RemoteStorageFileWriteAsyncComplete_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageFileReadAsyncComplete_t), (unmanaged) => { - RemoteStorageFileReadAsyncComplete_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hFileReadAsync = value.m_hFileReadAsync; - result.m_eResult = value.m_eResult; - result.m_nOffset = value.m_nOffset; - result.m_cubRead = value.m_cubRead; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hFileReadAsync = value.m_hFileReadAsync; - result.m_eResult = value.m_eResult; - result.m_nOffset = value.m_nOffset; - result.m_cubRead = value.m_cubRead; - } - - return result; - }); - marshallers.Add(typeof(RemoteStorageLocalFileChange_t), (unmanaged) => { - RemoteStorageLocalFileChange_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(ScreenshotReady_t), (unmanaged) => { - ScreenshotReady_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hLocal = value.m_hLocal; - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hLocal = value.m_hLocal; - result.m_eResult = value.m_eResult; - } - - return result; - }); - marshallers.Add(typeof(ScreenshotRequested_t), (unmanaged) => { - ScreenshotRequested_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(SteamTimelineGamePhaseRecordingExists_t), (unmanaged) => { - SteamTimelineGamePhaseRecordingExists_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_rgchPhaseID_ = value.m_rgchPhaseID_; - result.m_ulRecordingMS = value.m_ulRecordingMS; - result.m_ulLongestClipMS = value.m_ulLongestClipMS; - result.m_unClipCount = value.m_unClipCount; - result.m_unScreenshotCount = value.m_unScreenshotCount; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_rgchPhaseID_ = value.m_rgchPhaseID_; - result.m_ulRecordingMS = value.m_ulRecordingMS; - result.m_ulLongestClipMS = value.m_ulLongestClipMS; - result.m_unClipCount = value.m_unClipCount; - result.m_unScreenshotCount = value.m_unScreenshotCount; - } - - return result; - }); - marshallers.Add(typeof(SteamTimelineEventRecordingExists_t), (unmanaged) => { - SteamTimelineEventRecordingExists_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulEventID = value.m_ulEventID; - result.m_bRecordingExists = value.m_bRecordingExists; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_ulEventID = value.m_ulEventID; - result.m_bRecordingExists = value.m_bRecordingExists; - } - - return result; - }); - marshallers.Add(typeof(SteamUGCDetails_t), (unmanaged) => { - SteamUGCDetails_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eResult = value.m_eResult; - result.m_eFileType = value.m_eFileType; - result.m_nCreatorAppID = value.m_nCreatorAppID; - result.m_nConsumerAppID = value.m_nConsumerAppID; - result.m_rgchTitle_ = value.m_rgchTitle_; - result.m_rgchDescription_ = value.m_rgchDescription_; - result.m_ulSteamIDOwner = value.m_ulSteamIDOwner; - result.m_rtimeCreated = value.m_rtimeCreated; - result.m_rtimeUpdated = value.m_rtimeUpdated; - result.m_rtimeAddedToUserList = value.m_rtimeAddedToUserList; - result.m_eVisibility = value.m_eVisibility; - result.m_bBanned = value.m_bBanned; - result.m_bAcceptedForUse = value.m_bAcceptedForUse; - result.m_bTagsTruncated = value.m_bTagsTruncated; - result.m_rgchTags_ = value.m_rgchTags_; - result.m_hFile = value.m_hFile; - result.m_hPreviewFile = value.m_hPreviewFile; - result.m_pchFileName_ = value.m_pchFileName_; - result.m_nFileSize = value.m_nFileSize; - result.m_nPreviewFileSize = value.m_nPreviewFileSize; - result.m_rgchURL_ = value.m_rgchURL_; - result.m_unVotesUp = value.m_unVotesUp; - result.m_unVotesDown = value.m_unVotesDown; - result.m_flScore = value.m_flScore; - result.m_unNumChildren = value.m_unNumChildren; - result.m_ulTotalFilesSize = value.m_ulTotalFilesSize; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eResult = value.m_eResult; - result.m_eFileType = value.m_eFileType; - result.m_nCreatorAppID = value.m_nCreatorAppID; - result.m_nConsumerAppID = value.m_nConsumerAppID; - result.m_rgchTitle_ = value.m_rgchTitle_; - result.m_rgchDescription_ = value.m_rgchDescription_; - result.m_ulSteamIDOwner = value.m_ulSteamIDOwner; - result.m_rtimeCreated = value.m_rtimeCreated; - result.m_rtimeUpdated = value.m_rtimeUpdated; - result.m_rtimeAddedToUserList = value.m_rtimeAddedToUserList; - result.m_eVisibility = value.m_eVisibility; - result.m_bBanned = value.m_bBanned; - result.m_bAcceptedForUse = value.m_bAcceptedForUse; - result.m_bTagsTruncated = value.m_bTagsTruncated; - result.m_rgchTags_ = value.m_rgchTags_; - result.m_hFile = value.m_hFile; - result.m_hPreviewFile = value.m_hPreviewFile; - result.m_pchFileName_ = value.m_pchFileName_; - result.m_nFileSize = value.m_nFileSize; - result.m_nPreviewFileSize = value.m_nPreviewFileSize; - result.m_rgchURL_ = value.m_rgchURL_; - result.m_unVotesUp = value.m_unVotesUp; - result.m_unVotesDown = value.m_unVotesDown; - result.m_flScore = value.m_flScore; - result.m_unNumChildren = value.m_unNumChildren; - result.m_ulTotalFilesSize = value.m_ulTotalFilesSize; - } - - return result; - }); - marshallers.Add(typeof(SteamUGCQueryCompleted_t), (unmanaged) => { - SteamUGCQueryCompleted_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_handle = value.m_handle; - result.m_eResult = value.m_eResult; - result.m_unNumResultsReturned = value.m_unNumResultsReturned; - result.m_unTotalMatchingResults = value.m_unTotalMatchingResults; - result.m_bCachedData = value.m_bCachedData; - result.m_rgchNextCursor_ = value.m_rgchNextCursor_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_handle = value.m_handle; - result.m_eResult = value.m_eResult; - result.m_unNumResultsReturned = value.m_unNumResultsReturned; - result.m_unTotalMatchingResults = value.m_unTotalMatchingResults; - result.m_bCachedData = value.m_bCachedData; - result.m_rgchNextCursor_ = value.m_rgchNextCursor_; - } - - return result; - }); - marshallers.Add(typeof(SteamUGCRequestUGCDetailsResult_t), (unmanaged) => { - SteamUGCRequestUGCDetailsResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_details = value.m_details; - result.m_bCachedData = value.m_bCachedData; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_details = value.m_details; - result.m_bCachedData = value.m_bCachedData; - } - - return result; - }); - marshallers.Add(typeof(CreateItemResult_t), (unmanaged) => { - CreateItemResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_bUserNeedsToAcceptWorkshopLegalAgreement = value.m_bUserNeedsToAcceptWorkshopLegalAgreement; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_bUserNeedsToAcceptWorkshopLegalAgreement = value.m_bUserNeedsToAcceptWorkshopLegalAgreement; - } - - return result; - }); - marshallers.Add(typeof(SubmitItemUpdateResult_t), (unmanaged) => { - SubmitItemUpdateResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_bUserNeedsToAcceptWorkshopLegalAgreement = value.m_bUserNeedsToAcceptWorkshopLegalAgreement; - result.m_nPublishedFileId = value.m_nPublishedFileId; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_bUserNeedsToAcceptWorkshopLegalAgreement = value.m_bUserNeedsToAcceptWorkshopLegalAgreement; - result.m_nPublishedFileId = value.m_nPublishedFileId; - } - - return result; - }); - marshallers.Add(typeof(ItemInstalled_t), (unmanaged) => { - ItemInstalled_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unAppID = value.m_unAppID; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_hLegacyContent = value.m_hLegacyContent; - result.m_unManifestID = value.m_unManifestID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unAppID = value.m_unAppID; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_hLegacyContent = value.m_hLegacyContent; - result.m_unManifestID = value.m_unManifestID; - } - - return result; - }); - marshallers.Add(typeof(DownloadItemResult_t), (unmanaged) => { - DownloadItemResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unAppID = value.m_unAppID; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unAppID = value.m_unAppID; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eResult = value.m_eResult; - } - - return result; - }); - marshallers.Add(typeof(UserFavoriteItemsListChanged_t), (unmanaged) => { - UserFavoriteItemsListChanged_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eResult = value.m_eResult; - result.m_bWasAddRequest = value.m_bWasAddRequest; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eResult = value.m_eResult; - result.m_bWasAddRequest = value.m_bWasAddRequest; - } - - return result; - }); - marshallers.Add(typeof(SetUserItemVoteResult_t), (unmanaged) => { - SetUserItemVoteResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eResult = value.m_eResult; - result.m_bVoteUp = value.m_bVoteUp; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eResult = value.m_eResult; - result.m_bVoteUp = value.m_bVoteUp; - } - - return result; - }); - marshallers.Add(typeof(GetUserItemVoteResult_t), (unmanaged) => { - GetUserItemVoteResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eResult = value.m_eResult; - result.m_bVotedUp = value.m_bVotedUp; - result.m_bVotedDown = value.m_bVotedDown; - result.m_bVoteSkipped = value.m_bVoteSkipped; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_eResult = value.m_eResult; - result.m_bVotedUp = value.m_bVotedUp; - result.m_bVotedDown = value.m_bVotedDown; - result.m_bVoteSkipped = value.m_bVoteSkipped; - } - - return result; - }); - marshallers.Add(typeof(StartPlaytimeTrackingResult_t), (unmanaged) => { - StartPlaytimeTrackingResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } - - return result; - }); - marshallers.Add(typeof(StopPlaytimeTrackingResult_t), (unmanaged) => { - StopPlaytimeTrackingResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } - - return result; - }); - marshallers.Add(typeof(AddUGCDependencyResult_t), (unmanaged) => { - AddUGCDependencyResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nChildPublishedFileId = value.m_nChildPublishedFileId; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nChildPublishedFileId = value.m_nChildPublishedFileId; - } - - return result; - }); - marshallers.Add(typeof(RemoveUGCDependencyResult_t), (unmanaged) => { - RemoveUGCDependencyResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nChildPublishedFileId = value.m_nChildPublishedFileId; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nChildPublishedFileId = value.m_nChildPublishedFileId; - } - - return result; - }); - marshallers.Add(typeof(AddAppDependencyResult_t), (unmanaged) => { - AddAppDependencyResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nAppID = value.m_nAppID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nAppID = value.m_nAppID; - } - - return result; - }); - marshallers.Add(typeof(RemoveAppDependencyResult_t), (unmanaged) => { - RemoveAppDependencyResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nAppID = value.m_nAppID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_nAppID = value.m_nAppID; - } - - return result; - }); - marshallers.Add(typeof(GetAppDependenciesResult_t), (unmanaged) => { - GetAppDependenciesResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_rgAppIDs = value.m_rgAppIDs; - result.m_nNumAppDependencies = value.m_nNumAppDependencies; - result.m_nTotalNumAppDependencies = value.m_nTotalNumAppDependencies; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - result.m_rgAppIDs = value.m_rgAppIDs; - result.m_nNumAppDependencies = value.m_nNumAppDependencies; - result.m_nTotalNumAppDependencies = value.m_nTotalNumAppDependencies; - } - - return result; - }); - marshallers.Add(typeof(DeleteItemResult_t), (unmanaged) => { - DeleteItemResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nPublishedFileId = value.m_nPublishedFileId; - } - - return result; - }); - marshallers.Add(typeof(UserSubscribedItemsListChanged_t), (unmanaged) => { - UserSubscribedItemsListChanged_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nAppID = value.m_nAppID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nAppID = value.m_nAppID; - } - - return result; - }); - marshallers.Add(typeof(WorkshopEULAStatus_t), (unmanaged) => { - WorkshopEULAStatus_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nAppID = value.m_nAppID; - result.m_unVersion = value.m_unVersion; - result.m_rtAction = value.m_rtAction; - result.m_bAccepted = value.m_bAccepted; - result.m_bNeedsAction = value.m_bNeedsAction; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_nAppID = value.m_nAppID; - result.m_unVersion = value.m_unVersion; - result.m_rtAction = value.m_rtAction; - result.m_bAccepted = value.m_bAccepted; - result.m_bNeedsAction = value.m_bNeedsAction; - } - - return result; - }); - marshallers.Add(typeof(SteamServersConnected_t), (unmanaged) => { - SteamServersConnected_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(SteamServerConnectFailure_t), (unmanaged) => { - SteamServerConnectFailure_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_bStillRetrying = value.m_bStillRetrying; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_bStillRetrying = value.m_bStillRetrying; - } - - return result; - }); - marshallers.Add(typeof(SteamServersDisconnected_t), (unmanaged) => { - SteamServersDisconnected_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } - - return result; - }); - marshallers.Add(typeof(ClientGameServerDeny_t), (unmanaged) => { - ClientGameServerDeny_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_uAppID = value.m_uAppID; - result.m_unGameServerIP = value.m_unGameServerIP; - result.m_usGameServerPort = value.m_usGameServerPort; - result.m_bSecure = value.m_bSecure; - result.m_uReason = value.m_uReason; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_uAppID = value.m_uAppID; - result.m_unGameServerIP = value.m_unGameServerIP; - result.m_usGameServerPort = value.m_usGameServerPort; - result.m_bSecure = value.m_bSecure; - result.m_uReason = value.m_uReason; - } - - return result; - }); - marshallers.Add(typeof(IPCFailure_t), (unmanaged) => { - IPCFailure_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eFailureType = value.m_eFailureType; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eFailureType = value.m_eFailureType; - } - - return result; - }); - marshallers.Add(typeof(LicensesUpdated_t), (unmanaged) => { - LicensesUpdated_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } - - return result; - }); - marshallers.Add(typeof(MicroTxnAuthorizationResponse_t), (unmanaged) => { - MicroTxnAuthorizationResponse_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unAppID = value.m_unAppID; - result.m_ulOrderID = value.m_ulOrderID; - result.m_bAuthorized = value.m_bAuthorized; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_unAppID = value.m_unAppID; - result.m_ulOrderID = value.m_ulOrderID; - result.m_bAuthorized = value.m_bAuthorized; - } - - return result; - }); - marshallers.Add(typeof(EncryptedAppTicketResponse_t), (unmanaged) => { - EncryptedAppTicketResponse_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } - - return result; - }); - marshallers.Add(typeof(GetAuthSessionTicketResponse_t), (unmanaged) => { - GetAuthSessionTicketResponse_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hAuthTicket = value.m_hAuthTicket; - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hAuthTicket = value.m_hAuthTicket; - result.m_eResult = value.m_eResult; - } - - return result; - }); - marshallers.Add(typeof(GameWebCallback_t), (unmanaged) => { - GameWebCallback_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_szURL_ = value.m_szURL_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_szURL_ = value.m_szURL_; - } - - return result; - }); - marshallers.Add(typeof(StoreAuthURLResponse_t), (unmanaged) => { - StoreAuthURLResponse_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_szURL_ = value.m_szURL_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_szURL_ = value.m_szURL_; - } - - return result; - }); - marshallers.Add(typeof(MarketEligibilityResponse_t), (unmanaged) => { - MarketEligibilityResponse_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bAllowed = value.m_bAllowed; - result.m_eNotAllowedReason = value.m_eNotAllowedReason; - result.m_rtAllowedAtTime = value.m_rtAllowedAtTime; - result.m_cdaySteamGuardRequiredDays = value.m_cdaySteamGuardRequiredDays; - result.m_cdayNewDeviceCooldown = value.m_cdayNewDeviceCooldown; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bAllowed = value.m_bAllowed; - result.m_eNotAllowedReason = value.m_eNotAllowedReason; - result.m_rtAllowedAtTime = value.m_rtAllowedAtTime; - result.m_cdaySteamGuardRequiredDays = value.m_cdaySteamGuardRequiredDays; - result.m_cdayNewDeviceCooldown = value.m_cdayNewDeviceCooldown; - } - - return result; - }); - marshallers.Add(typeof(DurationControl_t), (unmanaged) => { - DurationControl_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_appid = value.m_appid; - result.m_bApplicable = value.m_bApplicable; - result.m_csecsLast5h = value.m_csecsLast5h; - result.m_progress = value.m_progress; - result.m_notification = value.m_notification; - result.m_csecsToday = value.m_csecsToday; - result.m_csecsRemaining = value.m_csecsRemaining; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_appid = value.m_appid; - result.m_bApplicable = value.m_bApplicable; - result.m_csecsLast5h = value.m_csecsLast5h; - result.m_progress = value.m_progress; - result.m_notification = value.m_notification; - result.m_csecsToday = value.m_csecsToday; - result.m_csecsRemaining = value.m_csecsRemaining; - } - - return result; - }); - marshallers.Add(typeof(GetTicketForWebApiResponse_t), (unmanaged) => { - GetTicketForWebApiResponse_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hAuthTicket = value.m_hAuthTicket; - result.m_eResult = value.m_eResult; - result.m_cubTicket = value.m_cubTicket; - result.m_rgubTicket = value.m_rgubTicket; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hAuthTicket = value.m_hAuthTicket; - result.m_eResult = value.m_eResult; - result.m_cubTicket = value.m_cubTicket; - result.m_rgubTicket = value.m_rgubTicket; - } - - return result; - }); - marshallers.Add(typeof(LeaderboardEntry_t), (unmanaged) => { - LeaderboardEntry_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDUser = value.m_steamIDUser; - result.m_nGlobalRank = value.m_nGlobalRank; - result.m_nScore = value.m_nScore; - result.m_cDetails = value.m_cDetails; - result.m_hUGC = value.m_hUGC; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDUser = value.m_steamIDUser; - result.m_nGlobalRank = value.m_nGlobalRank; - result.m_nScore = value.m_nScore; - result.m_cDetails = value.m_cDetails; - result.m_hUGC = value.m_hUGC; - } - - return result; - }); - marshallers.Add(typeof(UserStatsStored_t), (unmanaged) => { - UserStatsStored_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nGameID = value.m_nGameID; - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nGameID = value.m_nGameID; - result.m_eResult = value.m_eResult; - } - - return result; - }); - marshallers.Add(typeof(UserAchievementStored_t), (unmanaged) => { - UserAchievementStored_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nGameID = value.m_nGameID; - result.m_bGroupAchievement = value.m_bGroupAchievement; - result.m_rgchAchievementName_ = value.m_rgchAchievementName_; - result.m_nCurProgress = value.m_nCurProgress; - result.m_nMaxProgress = value.m_nMaxProgress; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nGameID = value.m_nGameID; - result.m_bGroupAchievement = value.m_bGroupAchievement; - result.m_rgchAchievementName_ = value.m_rgchAchievementName_; - result.m_nCurProgress = value.m_nCurProgress; - result.m_nMaxProgress = value.m_nMaxProgress; - } - - return result; - }); - marshallers.Add(typeof(LeaderboardFindResult_t), (unmanaged) => { - LeaderboardFindResult_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hSteamLeaderboard = value.m_hSteamLeaderboard; - result.m_bLeaderboardFound = value.m_bLeaderboardFound; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hSteamLeaderboard = value.m_hSteamLeaderboard; - result.m_bLeaderboardFound = value.m_bLeaderboardFound; - } - - return result; - }); - marshallers.Add(typeof(LeaderboardScoresDownloaded_t), (unmanaged) => { - LeaderboardScoresDownloaded_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hSteamLeaderboard = value.m_hSteamLeaderboard; - result.m_hSteamLeaderboardEntries = value.m_hSteamLeaderboardEntries; - result.m_cEntryCount = value.m_cEntryCount; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hSteamLeaderboard = value.m_hSteamLeaderboard; - result.m_hSteamLeaderboardEntries = value.m_hSteamLeaderboardEntries; - result.m_cEntryCount = value.m_cEntryCount; - } - - return result; - }); - marshallers.Add(typeof(LeaderboardScoreUploaded_t), (unmanaged) => { - LeaderboardScoreUploaded_t result = default; - - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bSuccess = value.m_bSuccess; - result.m_hSteamLeaderboard = value.m_hSteamLeaderboard; - result.m_nScore = value.m_nScore; - result.m_bScoreChanged = value.m_bScoreChanged; - result.m_nGlobalRankNew = value.m_nGlobalRankNew; - result.m_nGlobalRankPrevious = value.m_nGlobalRankPrevious; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bSuccess = value.m_bSuccess; - result.m_hSteamLeaderboard = value.m_hSteamLeaderboard; - result.m_nScore = value.m_nScore; - result.m_bScoreChanged = value.m_bScoreChanged; - result.m_nGlobalRankNew = value.m_nGlobalRankNew; - result.m_nGlobalRankPrevious = value.m_nGlobalRankPrevious; - } - - return result; - }); - marshallers.Add(typeof(NumberOfCurrentPlayers_t), (unmanaged) => { - NumberOfCurrentPlayers_t result = default; + + if (typeof(T) == typeof(FileDetailsResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bSuccess = value.m_bSuccess; - result.m_cPlayers = value.m_cPlayers; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bSuccess = value.m_bSuccess; - result.m_cPlayers = value.m_cPlayers; - } + if (typeof(T) == typeof(GSReputation_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(UserStatsUnloaded_t), (unmanaged) => { - UserStatsUnloaded_t result = default; + if (typeof(T) == typeof(GSStatsReceived_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDUser = value.m_steamIDUser; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_steamIDUser = value.m_steamIDUser; - } + if (typeof(T) == typeof(GSStatsStored_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(UserAchievementIconFetched_t), (unmanaged) => { - UserAchievementIconFetched_t result = default; + if (typeof(T) == typeof(HTML_NeedsPaint_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nGameID = value.m_nGameID; - result.m_rgchAchievementName_ = value.m_rgchAchievementName_; - result.m_bAchieved = value.m_bAchieved; - result.m_nIconHandle = value.m_nIconHandle; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nGameID = value.m_nGameID; - result.m_rgchAchievementName_ = value.m_rgchAchievementName_; - result.m_bAchieved = value.m_bAchieved; - result.m_nIconHandle = value.m_nIconHandle; - } + if (typeof(T) == typeof(HTML_StartRequest_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(GlobalAchievementPercentagesReady_t), (unmanaged) => { - GlobalAchievementPercentagesReady_t result = default; + if (typeof(T) == typeof(HTML_URLChanged_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nGameID = value.m_nGameID; - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nGameID = value.m_nGameID; - result.m_eResult = value.m_eResult; - } + if (typeof(T) == typeof(HTML_FinishedRequest_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(LeaderboardUGCSet_t), (unmanaged) => { - LeaderboardUGCSet_t result = default; + if (typeof(T) == typeof(HTML_OpenLinkInNewTab_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_hSteamLeaderboard = value.m_hSteamLeaderboard; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_hSteamLeaderboard = value.m_hSteamLeaderboard; - } + if (typeof(T) == typeof(HTML_ChangedTitle_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(GlobalStatsReceived_t), (unmanaged) => { - GlobalStatsReceived_t result = default; + if (typeof(T) == typeof(HTML_LinkAtPosition_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nGameID = value.m_nGameID; - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nGameID = value.m_nGameID; - result.m_eResult = value.m_eResult; - } + if (typeof(T) == typeof(HTML_JSAlert_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(IPCountry_t), (unmanaged) => { - IPCountry_t result = default; + if (typeof(T) == typeof(HTML_JSConfirm_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } + if (typeof(T) == typeof(HTML_FileOpenDialog_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(LowBatteryPower_t), (unmanaged) => { - LowBatteryPower_t result = default; + if (typeof(T) == typeof(HTML_NewWindow_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nMinutesBatteryLeft = value.m_nMinutesBatteryLeft; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_nMinutesBatteryLeft = value.m_nMinutesBatteryLeft; - } + if (typeof(T) == typeof(HTML_StatusText_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(SteamAPICallCompleted_t), (unmanaged) => { - SteamAPICallCompleted_t result = default; + if (typeof(T) == typeof(HTML_ShowToolTip_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hAsyncCall = value.m_hAsyncCall; - result.m_iCallback = value.m_iCallback; - result.m_cubParam = value.m_cubParam; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hAsyncCall = value.m_hAsyncCall; - result.m_iCallback = value.m_iCallback; - result.m_cubParam = value.m_cubParam; - } + if (typeof(T) == typeof(HTML_UpdateToolTip_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(SteamShutdown_t), (unmanaged) => { - SteamShutdown_t result = default; + if (typeof(T) == typeof(HTTPRequestCompleted_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } + if (typeof(T) == typeof(HTTPRequestHeadersReceived_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(CheckFileSignature_t), (unmanaged) => { - CheckFileSignature_t result = default; + if (typeof(T) == typeof(HTTPRequestDataReceived_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eCheckFileSignature = value.m_eCheckFileSignature; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eCheckFileSignature = value.m_eCheckFileSignature; - } + if (typeof(T) == typeof(SteamInputConfigurationLoaded_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(GamepadTextInputDismissed_t), (unmanaged) => { - GamepadTextInputDismissed_t result = default; + if (typeof(T) == typeof(SteamInputGamepadSlotChange_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bSubmitted = value.m_bSubmitted; - result.m_unSubmittedText = value.m_unSubmittedText; - result.m_unAppID = value.m_unAppID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bSubmitted = value.m_bSubmitted; - result.m_unSubmittedText = value.m_unSubmittedText; - result.m_unAppID = value.m_unAppID; - } + if (typeof(T) == typeof(SteamInventoryEligiblePromoItemDefIDs_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(AppResumingFromSuspend_t), (unmanaged) => { - AppResumingFromSuspend_t result = default; + if (typeof(T) == typeof(SteamInventoryStartPurchaseResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } + if (typeof(T) == typeof(SteamPartyBeaconLocation_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(FloatingGamepadTextInputDismissed_t), (unmanaged) => { - FloatingGamepadTextInputDismissed_t result = default; + if (typeof(T) == typeof(LobbyCreated_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - } + if (typeof(T) == typeof(SearchForGameProgressCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(FilterTextDictionaryChanged_t), (unmanaged) => { - FilterTextDictionaryChanged_t result = default; + if (typeof(T) == typeof(SearchForGameResultCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eLanguage = value.m_eLanguage; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eLanguage = value.m_eLanguage; - } + if (typeof(T) == typeof(RequestPlayersForGameProgressCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(GetVideoURLResult_t), (unmanaged) => { - GetVideoURLResult_t result = default; + if (typeof(T) == typeof(RequestPlayersForGameResultCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_unVideoAppID = value.m_unVideoAppID; - result.m_rgchURL_ = value.m_rgchURL_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_unVideoAppID = value.m_unVideoAppID; - result.m_rgchURL_ = value.m_rgchURL_; - } + if (typeof(T) == typeof(RequestPlayersForGameFinalResultCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(GetOPFSettingsResult_t), (unmanaged) => { - GetOPFSettingsResult_t result = default; + if (typeof(T) == typeof(SubmitPlayerResultResultCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_unVideoAppID = value.m_unVideoAppID; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_unVideoAppID = value.m_unVideoAppID; - } + if (typeof(T) == typeof(EndGameResultCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(BroadcastUploadStart_t), (unmanaged) => { - BroadcastUploadStart_t result = default; + if (typeof(T) == typeof(JoinPartyCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bIsRTMP = value.m_bIsRTMP; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_bIsRTMP = value.m_bIsRTMP; - } + if (typeof(T) == typeof(CreateBeaconCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(BroadcastUploadStop_t), (unmanaged) => { - BroadcastUploadStop_t result = default; + if (typeof(T) == typeof(SteamNetConnectionStatusChangedCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - } + if (typeof(T) == typeof(SteamTimelineGamePhaseRecordingExists_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(MatchMakingKeyValuePair_t), (unmanaged) => { - MatchMakingKeyValuePair_t result = default; + if (typeof(T) == typeof(SteamUGCDetails_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_szKey_ = value.m_szKey_; - result.m_szValue_ = value.m_szValue_; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_szKey_ = value.m_szKey_; - result.m_szValue_ = value.m_szValue_; - } + if (typeof(T) == typeof(CreateItemResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(CallbackMsg_t), (unmanaged) => { - CallbackMsg_t result = default; + if (typeof(T) == typeof(ItemInstalled_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hSteamUser = value.m_hSteamUser; - result.m_iCallback = value.m_iCallback; - result.m_pubParam = value.m_pubParam; - result.m_cubParam = value.m_cubParam; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_hSteamUser = value.m_hSteamUser; - result.m_iCallback = value.m_iCallback; - result.m_pubParam = value.m_pubParam; - result.m_cubParam = value.m_cubParam; - } + if (typeof(T) == typeof(DownloadItemResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(SteamNetworkingFakeIPResult_t), (unmanaged) => { - SteamNetworkingFakeIPResult_t result = default; + if (typeof(T) == typeof(AddUGCDependencyResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_identity = value.m_identity; - result.m_unIP = value.m_unIP; - result.m_unPorts = value.m_unPorts; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eResult = value.m_eResult; - result.m_identity = value.m_identity; - result.m_unIP = value.m_unIP; - result.m_unPorts = value.m_unPorts; - } + if (typeof(T) == typeof(RemoveUGCDependencyResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(SteamNetConnectionInfo_t), (unmanaged) => { - SteamNetConnectionInfo_t result = default; + if (typeof(T) == typeof(AddAppDependencyResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_identityRemote = value.m_identityRemote; - result.m_nUserData = value.m_nUserData; - result.m_hListenSocket = value.m_hListenSocket; - result.m_addrRemote = value.m_addrRemote; - result.m__pad1 = value.m__pad1; - result.m_idPOPRemote = value.m_idPOPRemote; - result.m_idPOPRelay = value.m_idPOPRelay; - result.m_eState = value.m_eState; - result.m_eEndReason = value.m_eEndReason; - result.m_szEndDebug_ = value.m_szEndDebug_; - result.m_szConnectionDescription_ = value.m_szConnectionDescription_; - result.m_nFlags = value.m_nFlags; - result.reserved = value.reserved; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_identityRemote = value.m_identityRemote; - result.m_nUserData = value.m_nUserData; - result.m_hListenSocket = value.m_hListenSocket; - result.m_addrRemote = value.m_addrRemote; - result.m__pad1 = value.m__pad1; - result.m_idPOPRemote = value.m_idPOPRemote; - result.m_idPOPRelay = value.m_idPOPRelay; - result.m_eState = value.m_eState; - result.m_eEndReason = value.m_eEndReason; - result.m_szEndDebug_ = value.m_szEndDebug_; - result.m_szConnectionDescription_ = value.m_szConnectionDescription_; - result.m_nFlags = value.m_nFlags; - result.reserved = value.reserved; - } + if (typeof(T) == typeof(RemoveAppDependencyResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(SteamNetConnectionRealTimeStatus_t), (unmanaged) => { - SteamNetConnectionRealTimeStatus_t result = default; + if (typeof(T) == typeof(GetAppDependenciesResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eState = value.m_eState; - result.m_nPing = value.m_nPing; - result.m_flConnectionQualityLocal = value.m_flConnectionQualityLocal; - result.m_flConnectionQualityRemote = value.m_flConnectionQualityRemote; - result.m_flOutPacketsPerSec = value.m_flOutPacketsPerSec; - result.m_flOutBytesPerSec = value.m_flOutBytesPerSec; - result.m_flInPacketsPerSec = value.m_flInPacketsPerSec; - result.m_flInBytesPerSec = value.m_flInBytesPerSec; - result.m_nSendRateBytesPerSecond = value.m_nSendRateBytesPerSecond; - result.m_cbPendingUnreliable = value.m_cbPendingUnreliable; - result.m_cbPendingReliable = value.m_cbPendingReliable; - result.m_cbSentUnackedReliable = value.m_cbSentUnackedReliable; - result.m_usecQueueTime = value.m_usecQueueTime; - result.reserved = value.reserved; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_eState = value.m_eState; - result.m_nPing = value.m_nPing; - result.m_flConnectionQualityLocal = value.m_flConnectionQualityLocal; - result.m_flConnectionQualityRemote = value.m_flConnectionQualityRemote; - result.m_flOutPacketsPerSec = value.m_flOutPacketsPerSec; - result.m_flOutBytesPerSec = value.m_flOutBytesPerSec; - result.m_flInPacketsPerSec = value.m_flInPacketsPerSec; - result.m_flInBytesPerSec = value.m_flInBytesPerSec; - result.m_nSendRateBytesPerSecond = value.m_nSendRateBytesPerSecond; - result.m_cbPendingUnreliable = value.m_cbPendingUnreliable; - result.m_cbPendingReliable = value.m_cbPendingReliable; - result.m_cbSentUnackedReliable = value.m_cbSentUnackedReliable; - result.m_usecQueueTime = value.m_usecQueueTime; - result.reserved = value.reserved; - } + if (typeof(T) == typeof(DeleteItemResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(SteamNetConnectionRealTimeLaneStatus_t), (unmanaged) => { - SteamNetConnectionRealTimeLaneStatus_t result = default; + if (typeof(T) == typeof(ValidateAuthTicketResponse_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_cbPendingUnreliable = value.m_cbPendingUnreliable; - result.m_cbPendingReliable = value.m_cbPendingReliable; - result.m_cbSentUnackedReliable = value.m_cbSentUnackedReliable; - result._reservePad1 = value._reservePad1; - result.m_usecQueueTime = value.m_usecQueueTime; - result.reserved = value.reserved; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_cbPendingUnreliable = value.m_cbPendingUnreliable; - result.m_cbPendingReliable = value.m_cbPendingReliable; - result.m_cbSentUnackedReliable = value.m_cbSentUnackedReliable; - result._reservePad1 = value._reservePad1; - result.m_usecQueueTime = value.m_usecQueueTime; - result.reserved = value.reserved; - } + if (typeof(T) == typeof(MicroTxnAuthorizationResponse_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - marshallers.Add(typeof(SteamNetworkPingLocation_t), (unmanaged) => { - SteamNetworkPingLocation_t result = default; + if (typeof(T) == typeof(LeaderboardEntry_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (Packsize.IsLargePack) { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_data = value.m_data; - } else { - var value = System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - result.m_data = value.m_data; - } + if (typeof(T) == typeof(SteamNetConnectionInfo_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - return result; - }); - s_marshallerLookupTable = FrozenDictionary.ToFrozenDictionary(marshallers); + } } } } diff --git a/Standalone3.0/ICallbackIdentity.cs b/Standalone3.0/ICallbackIdentity.cs new file mode 100644 index 00000000..588be526 --- /dev/null +++ b/Standalone3.0/ICallbackIdentity.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Steamworks +{ + internal interface ICallbackIdentity + { + } +} diff --git a/com.rlabrecque.steamworks.net/Runtime/Packsize.cs b/com.rlabrecque.steamworks.net/Runtime/Packsize.cs index dbe6233a..2127721e 100644 --- a/com.rlabrecque.steamworks.net/Runtime/Packsize.cs +++ b/com.rlabrecque.steamworks.net/Runtime/Packsize.cs @@ -42,10 +42,11 @@ namespace Steamworks { public static class Packsize { #if VALVE_CALLBACK_PACK_LARGE - public const int value = 8; + internal const int value = 8; #elif VALVE_CALLBACK_PACK_SMALL - public const int value = 4; + internal const int value = 4; #endif + public static readonly int Value = value; #if !STEAMWORKS_ANYCPU public static bool Test() { @@ -68,7 +69,9 @@ public static bool Test() { public readonly static bool IsLargePack = AnyCpuRuntimeValue == 8; - private static int InitializeRuntimeValue() + public readonly static bool IsSmallPack = AnyCpuRuntimeValue == 4; + + private static int InitializeRuntimeValue() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) return 8; diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs index 2dd47fd6..8155da7b 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs @@ -21,36 +21,14 @@ namespace Steamworks { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 5)] - public struct DlcInstalled_t { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 5; - public AppId_t m_nAppID; // AppID of the DLC - } - + public struct DlcInstalled_t #if STEAMWORKS_ANYCPU - // callbacks - //----------------------------------------------------------------------------- - // Purpose: posted after the user gains ownership of DLC & that DLC is installed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 5)] - internal struct DlcInstalled_t_LargePack { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 5; - public AppId_t m_nAppID; // AppID of the DLC - } - - - // callbacks - //----------------------------------------------------------------------------- - // Purpose: posted after the user gains ownership of DLC & that DLC is installed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 5)] - internal struct DlcInstalled_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 5; + : ICallbackIdentity + #endif + { public AppId_t m_nAppID; // AppID of the DLC } - #endif //--------------------------------------------------------------------------------- // Purpose: posted after the user gains executes a Steam URL with command line or query parameters // such as steam://run///-commandline/?param1=value1¶m2=value2¶m3=value3 etc @@ -59,111 +37,43 @@ internal struct DlcInstalled_t_SmallPack { //--------------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 14)] - public struct NewUrlLaunchParameters_t { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 14; - } - + public struct NewUrlLaunchParameters_t #if STEAMWORKS_ANYCPU - //--------------------------------------------------------------------------------- - // Purpose: posted after the user gains executes a Steam URL with command line or query parameters - // such as steam://run///-commandline/?param1=value1¶m2=value2¶m3=value3 etc - // while the game is already running. The new params can be queried - // with GetLaunchQueryParam and GetLaunchCommandLine - //--------------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 14)] - internal struct NewUrlLaunchParameters_t_LargePack { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 14; - } - - - //--------------------------------------------------------------------------------- - // Purpose: posted after the user gains executes a Steam URL with command line or query parameters - // such as steam://run///-commandline/?param1=value1¶m2=value2¶m3=value3 etc - // while the game is already running. The new params can be queried - // with GetLaunchQueryParam and GetLaunchCommandLine - //--------------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 14)] - internal struct NewUrlLaunchParameters_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 14; - } - + : ICallbackIdentity #endif - //----------------------------------------------------------------------------- - // Purpose: response to RequestAppProofOfPurchaseKey/RequestAllProofOfPurchaseKeys - // for supporting third-party CD keys, or other proof-of-purchase systems. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 21)] - public struct AppProofOfPurchaseKeyResponse_t { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 21; - public EResult m_eResult; - public uint m_nAppID; - public uint m_cchKeyLength; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cubAppProofOfPurchaseKeyMax)] - internal byte[] m_rgchKey_; - public string m_rgchKey - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchKey_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchKey_, Constants.k_cubAppProofOfPurchaseKeyMax); } - } - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: response to RequestAppProofOfPurchaseKey/RequestAllProofOfPurchaseKeys - // for supporting third-party CD keys, or other proof-of-purchase systems. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 21)] - internal struct AppProofOfPurchaseKeyResponse_t_LargePack { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 21; - public EResult m_eResult; - public uint m_nAppID; - public uint m_cchKeyLength; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cubAppProofOfPurchaseKeyMax)] - internal byte[] m_rgchKey_; - public string m_rgchKey - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchKey_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchKey_, Constants.k_cubAppProofOfPurchaseKeyMax); } - } + { } - //----------------------------------------------------------------------------- // Purpose: response to RequestAppProofOfPurchaseKey/RequestAllProofOfPurchaseKeys // for supporting third-party CD keys, or other proof-of-purchase systems. //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 21)] - internal struct AppProofOfPurchaseKeyResponse_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 21; + public struct AppProofOfPurchaseKeyResponse_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public uint m_nAppID; public uint m_cchKeyLength; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cubAppProofOfPurchaseKeyMax)] - internal byte[] m_rgchKey_; - public string m_rgchKey - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchKey_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchKey_, Constants.k_cubAppProofOfPurchaseKeyMax); } - } + public string m_rgchKey; } - #endif //----------------------------------------------------------------------------- // Purpose: response to GetFileDetails //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 23)] - public struct FileDetailsResult_t { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 23; + public struct FileDetailsResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public ulong m_ulFileSize; // original file size in bytes - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[] m_FileSHA; // original file SHA1 hash + public byte m_FileSHA; // original file SHA1 hash public uint m_unFlags; // } @@ -171,30 +81,33 @@ public struct FileDetailsResult_t { //----------------------------------------------------------------------------- // Purpose: response to GetFileDetails //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 23)] internal struct FileDetailsResult_t_LargePack { public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 23; + public static int CallbackIdentity { get; } = Constants.k_iSteamAppsCallbacks + 23; public EResult m_eResult; public ulong m_ulFileSize; // original file size in bytes - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[] m_FileSHA; // original file SHA1 hash + public byte m_FileSHA; // original file SHA1 hash public uint m_unFlags; // - } + public static implicit operator FileDetailsResult_t(FileDetailsResult_t_LargePack value) { + FileDetailsResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_ulFileSize = value.m_ulFileSize; + result.m_FileSHA = value.m_FileSHA; + result.m_unFlags = value.m_unFlags; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: response to GetFileDetails - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 23)] - internal struct FileDetailsResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 23; - public EResult m_eResult; - public ulong m_ulFileSize; // original file size in bytes - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[] m_FileSHA; // original file SHA1 hash - public uint m_unFlags; // + public static implicit operator FileDetailsResult_t_LargePack(FileDetailsResult_t value) { + FileDetailsResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_ulFileSize = value.m_ulFileSize; + result.m_FileSHA = value.m_FileSHA; + result.m_unFlags = value.m_unFlags; + return result; + } } #endif @@ -203,38 +116,11 @@ internal struct FileDetailsResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 30)] - public struct TimedTrialStatus_t { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 30; - public AppId_t m_unAppID; // appID - [MarshalAs(UnmanagedType.I1)] - public bool m_bIsOffline; // if true, time allowed / played refers to offline time, not total time - public uint m_unSecondsAllowed; // how many seconds the app can be played in total - public uint m_unSecondsPlayed; // how many seconds the app was already played - } - + public struct TimedTrialStatus_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: called for games in Timed Trial mode - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 30)] - internal struct TimedTrialStatus_t_LargePack { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 30; - public AppId_t m_unAppID; // appID - [MarshalAs(UnmanagedType.I1)] - public bool m_bIsOffline; // if true, time allowed / played refers to offline time, not total time - public uint m_unSecondsAllowed; // how many seconds the app can be played in total - public uint m_unSecondsPlayed; // how many seconds the app was already played - } - - - //----------------------------------------------------------------------------- - // Purpose: called for games in Timed Trial mode - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 30)] - internal struct TimedTrialStatus_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 30; + : ICallbackIdentity + #endif + { public AppId_t m_unAppID; // appID [MarshalAs(UnmanagedType.I1)] public bool m_bIsOffline; // if true, time allowed / played refers to offline time, not total time @@ -242,89 +128,33 @@ internal struct TimedTrialStatus_t_SmallPack { public uint m_unSecondsPlayed; // how many seconds the app was already played } - #endif // callbacks //----------------------------------------------------------------------------- // Purpose: called when a friends' status changes //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 4)] - public struct PersonaStateChange_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 4; - - public ulong m_ulSteamID; // steamID of the friend who changed - public EPersonaChange m_nChangeFlags; // what's changed - } - + public struct PersonaStateChange_t #if STEAMWORKS_ANYCPU - // callbacks - //----------------------------------------------------------------------------- - // Purpose: called when a friends' status changes - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 4)] - internal struct PersonaStateChange_t_LargePack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 4; - - public ulong m_ulSteamID; // steamID of the friend who changed - public EPersonaChange m_nChangeFlags; // what's changed - } - - - // callbacks - //----------------------------------------------------------------------------- - // Purpose: called when a friends' status changes - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 4)] - internal struct PersonaStateChange_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 4; + : ICallbackIdentity + #endif + { public ulong m_ulSteamID; // steamID of the friend who changed public EPersonaChange m_nChangeFlags; // what's changed } - #endif //----------------------------------------------------------------------------- // Purpose: posted when game overlay activates or deactivates // the game can use this to be pause or resume single player games //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 31)] - public struct GameOverlayActivated_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 31; - public byte m_bActive; // true if it's just been activated, false otherwise - [MarshalAs(UnmanagedType.I1)] - public bool m_bUserInitiated; // true if the user asked for the overlay to be activated/deactivated - public AppId_t m_nAppID; // the appID of the game (should always be the current game) - public uint m_dwOverlayPID; // used internally - } - + public struct GameOverlayActivated_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: posted when game overlay activates or deactivates - // the game can use this to be pause or resume single player games - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 31)] - internal struct GameOverlayActivated_t_LargePack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 31; - public byte m_bActive; // true if it's just been activated, false otherwise - [MarshalAs(UnmanagedType.I1)] - public bool m_bUserInitiated; // true if the user asked for the overlay to be activated/deactivated - public AppId_t m_nAppID; // the appID of the game (should always be the current game) - public uint m_dwOverlayPID; // used internally - } - - - //----------------------------------------------------------------------------- - // Purpose: posted when game overlay activates or deactivates - // the game can use this to be pause or resume single player games - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 31)] - internal struct GameOverlayActivated_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 31; + : ICallbackIdentity + #endif + { public byte m_bActive; // true if it's just been activated, false otherwise [MarshalAs(UnmanagedType.I1)] public bool m_bUserInitiated; // true if the user asked for the overlay to be activated/deactivated @@ -332,135 +162,49 @@ internal struct GameOverlayActivated_t_SmallPack { public uint m_dwOverlayPID; // used internally } - #endif //----------------------------------------------------------------------------- // Purpose: called when the user tries to join a different game server from their friends list // game client should attempt to connect to specified server when this is received //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 32)] - public struct GameServerChangeRequested_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 32; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] - internal byte[] m_rgchServer_; - public string m_rgchServer // server address ("127.0.0.1:27015", "tf2.valvesoftware.com") - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchServer_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchServer_, 64); } - } - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] - internal byte[] m_rgchPassword_; - public string m_rgchPassword // server password, if any - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchPassword_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchPassword_, 64); } - } - } - + public struct GameServerChangeRequested_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: called when the user tries to join a different game server from their friends list - // game client should attempt to connect to specified server when this is received - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 32)] - internal struct GameServerChangeRequested_t_LargePack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 32; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] - internal byte[] m_rgchServer_; - public string m_rgchServer // server address ("127.0.0.1:27015", "tf2.valvesoftware.com") - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchServer_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchServer_, 64); } - } - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] - internal byte[] m_rgchPassword_; - public string m_rgchPassword // server password, if any - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchPassword_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchPassword_, 64); } - } - } - - - //----------------------------------------------------------------------------- - // Purpose: called when the user tries to join a different game server from their friends list - // game client should attempt to connect to specified server when this is received - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 32)] - internal struct GameServerChangeRequested_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 32; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] - internal byte[] m_rgchServer_; - public string m_rgchServer // server address ("127.0.0.1:27015", "tf2.valvesoftware.com") - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchServer_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchServer_, 64); } - } - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] - internal byte[] m_rgchPassword_; - public string m_rgchPassword // server password, if any - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchPassword_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchPassword_, 64); } - } - } - + : ICallbackIdentity #endif - //----------------------------------------------------------------------------- - // Purpose: called when the user tries to join a lobby from their friends list - // game client should attempt to connect to specified lobby when this is received - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 33)] - public struct GameLobbyJoinRequested_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 33; - public CSteamID m_steamIDLobby; - - // The friend they did the join via (will be invalid if not directly via a friend) - public CSteamID m_steamIDFriend; - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: called when the user tries to join a lobby from their friends list - // game client should attempt to connect to specified lobby when this is received - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 33)] - internal struct GameLobbyJoinRequested_t_LargePack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 33; - public CSteamID m_steamIDLobby; - - // The friend they did the join via (will be invalid if not directly via a friend) - public CSteamID m_steamIDFriend; + { + public string m_rgchServer; // server address ("127.0.0.1:27015", "tf2.valvesoftware.com") + public string m_rgchPassword; // server password, if any } - //----------------------------------------------------------------------------- // Purpose: called when the user tries to join a lobby from their friends list // game client should attempt to connect to specified lobby when this is received //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 33)] - internal struct GameLobbyJoinRequested_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 33; + public struct GameLobbyJoinRequested_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_steamIDLobby; // The friend they did the join via (will be invalid if not directly via a friend) public CSteamID m_steamIDFriend; } - #endif //----------------------------------------------------------------------------- // Purpose: called when an avatar is loaded in from a previous GetLargeFriendAvatar() call // if the image wasn't already available //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 4)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 34)] - public struct AvatarImageLoaded_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 34; + public struct AvatarImageLoaded_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_steamID; // steamid the avatar has been loaded for public int m_iImage; // the image index of the now loaded image public int m_iWide; // width of the loaded image @@ -470,49 +214,28 @@ public struct AvatarImageLoaded_t { //----------------------------------------------------------------------------- // Purpose: marks the return of a request officer list call //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 35)] - public struct ClanOfficerListResponse_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 35; - public CSteamID m_steamIDClan; - public int m_cOfficers; - public byte m_bSuccess; - } - + public struct ClanOfficerListResponse_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: marks the return of a request officer list call - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 35)] - internal struct ClanOfficerListResponse_t_LargePack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 35; - public CSteamID m_steamIDClan; - public int m_cOfficers; - public byte m_bSuccess; - } - - - //----------------------------------------------------------------------------- - // Purpose: marks the return of a request officer list call - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 35)] - internal struct ClanOfficerListResponse_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 35; + : ICallbackIdentity + #endif + { public CSteamID m_steamIDClan; public int m_cOfficers; public byte m_bSuccess; } - #endif //----------------------------------------------------------------------------- // Purpose: callback indicating updated data about friends rich presence information //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 4)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 36)] - public struct FriendRichPresenceUpdate_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 36; + public struct FriendRichPresenceUpdate_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_steamIDFriend; // friend who's rich presence has changed public AppId_t m_nAppID; // the appID of the game (should always be the current game) } @@ -521,66 +244,27 @@ public struct FriendRichPresenceUpdate_t { // Purpose: called when the user tries to join a game from their friends list // rich presence will have been set with the "connect" key which is set here //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 37)] - public struct GameRichPresenceJoinRequested_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 37; - public CSteamID m_steamIDFriend; // the friend they did the join via (will be invalid if not directly via a friend) - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchMaxRichPresenceValueLength)] - internal byte[] m_rgchConnect_; - public string m_rgchConnect - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchConnect_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchConnect_, Constants.k_cchMaxRichPresenceValueLength); } - } - } - + public struct GameRichPresenceJoinRequested_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: called when the user tries to join a game from their friends list - // rich presence will have been set with the "connect" key which is set here - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 37)] - internal struct GameRichPresenceJoinRequested_t_LargePack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 37; - public CSteamID m_steamIDFriend; // the friend they did the join via (will be invalid if not directly via a friend) - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchMaxRichPresenceValueLength)] - internal byte[] m_rgchConnect_; - public string m_rgchConnect - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchConnect_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchConnect_, Constants.k_cchMaxRichPresenceValueLength); } - } - } - - - //----------------------------------------------------------------------------- - // Purpose: called when the user tries to join a game from their friends list - // rich presence will have been set with the "connect" key which is set here - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 37)] - internal struct GameRichPresenceJoinRequested_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 37; + : ICallbackIdentity + #endif + { public CSteamID m_steamIDFriend; // the friend they did the join via (will be invalid if not directly via a friend) - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchMaxRichPresenceValueLength)] - internal byte[] m_rgchConnect_; - public string m_rgchConnect - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchConnect_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchConnect_, Constants.k_cchMaxRichPresenceValueLength); } - } + public string m_rgchConnect; } - #endif //----------------------------------------------------------------------------- // Purpose: a chat message has been received for a clan chat the game has joined //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 4)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 38)] - public struct GameConnectedClanChatMsg_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 38; + public struct GameConnectedClanChatMsg_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_steamIDClanChat; public CSteamID m_steamIDUser; public int m_iMessageID; @@ -589,46 +273,27 @@ public struct GameConnectedClanChatMsg_t { //----------------------------------------------------------------------------- // Purpose: a user has joined a clan chat //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 39)] - public struct GameConnectedChatJoin_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 39; - public CSteamID m_steamIDClanChat; - public CSteamID m_steamIDUser; - } - + public struct GameConnectedChatJoin_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: a user has joined a clan chat - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 39)] - internal struct GameConnectedChatJoin_t_LargePack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 39; - public CSteamID m_steamIDClanChat; - public CSteamID m_steamIDUser; - } - - - //----------------------------------------------------------------------------- - // Purpose: a user has joined a clan chat - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 39)] - internal struct GameConnectedChatJoin_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 39; + : ICallbackIdentity + #endif + { public CSteamID m_steamIDClanChat; public CSteamID m_steamIDUser; } - #endif //----------------------------------------------------------------------------- // Purpose: a user has left the chat we're in //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 1)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 40)] - public struct GameConnectedChatLeave_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 40; + public struct GameConnectedChatLeave_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_steamIDClanChat; public CSteamID m_steamIDUser; [MarshalAs(UnmanagedType.I1)] @@ -640,46 +305,27 @@ public struct GameConnectedChatLeave_t { //----------------------------------------------------------------------------- // Purpose: a DownloadClanActivityCounts() call has finished //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 41)] - public struct DownloadClanActivityCountsResult_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 41; - [MarshalAs(UnmanagedType.I1)] - public bool m_bSuccess; - } - + public struct DownloadClanActivityCountsResult_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: a DownloadClanActivityCounts() call has finished - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 41)] - internal struct DownloadClanActivityCountsResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 41; - [MarshalAs(UnmanagedType.I1)] - public bool m_bSuccess; - } - - - //----------------------------------------------------------------------------- - // Purpose: a DownloadClanActivityCounts() call has finished - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 41)] - internal struct DownloadClanActivityCountsResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 41; + : ICallbackIdentity + #endif + { [MarshalAs(UnmanagedType.I1)] public bool m_bSuccess; } - #endif //----------------------------------------------------------------------------- // Purpose: a JoinClanChatRoom() call has finished //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 4)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 42)] - public struct JoinClanChatRoomCompletionResult_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 42; + public struct JoinClanChatRoomCompletionResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_steamIDClanChat; public EChatRoomEnterResponse m_eChatRoomEnterResponse; } @@ -687,40 +333,51 @@ public struct JoinClanChatRoomCompletionResult_t { //----------------------------------------------------------------------------- // Purpose: a chat message has been received from a user //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 4)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 43)] - public struct GameConnectedFriendChatMsg_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 43; + public struct GameConnectedFriendChatMsg_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_steamIDUser; public int m_iMessageID; } - [StructLayout(LayoutKind.Sequential, Pack = 4)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 44)] - public struct FriendsGetFollowerCount_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 44; + public struct FriendsGetFollowerCount_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public CSteamID m_steamID; public int m_nCount; } - [StructLayout(LayoutKind.Sequential, Pack = 4)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 45)] - public struct FriendsIsFollowing_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 45; + public struct FriendsIsFollowing_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public CSteamID m_steamID; [MarshalAs(UnmanagedType.I1)] public bool m_bIsFollowing; } - [StructLayout(LayoutKind.Sequential, Pack = 4)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 46)] - public struct FriendsEnumerateFollowingList_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 46; + public struct FriendsEnumerateFollowingList_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cEnumerateFollowersMax)] - public CSteamID[] m_rgSteamID; + public CSteamID m_rgSteamID; public int m_nResultsReturned; public int m_nTotalResultCount; } @@ -728,172 +385,51 @@ public struct FriendsEnumerateFollowingList_t { //----------------------------------------------------------------------------- // Purpose: Invoked when the status of unread messages changes //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] + [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 48)] - public struct UnreadChatMessagesChanged_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 48; - } - + public struct UnreadChatMessagesChanged_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Invoked when the status of unread messages changes - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 48)] - internal struct UnreadChatMessagesChanged_t_LargePack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 48; - } - - - //----------------------------------------------------------------------------- - // Purpose: Invoked when the status of unread messages changes - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 48)] - internal struct UnreadChatMessagesChanged_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 48; - } - + : ICallbackIdentity #endif - //----------------------------------------------------------------------------- - // Purpose: Dispatched when an overlay browser instance is navigated to a protocol/scheme registered by RegisterProtocolInOverlayBrowser() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 49)] - public struct OverlayBrowserProtocolNavigation_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 49; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] - internal byte[] rgchURI_; - public string rgchURI - { - get { return InteropHelp.ByteArrayToStringUTF8(rgchURI_); } - set { InteropHelp.StringToByteArrayUTF8(value, rgchURI_, 1024); } - } - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Dispatched when an overlay browser instance is navigated to a protocol/scheme registered by RegisterProtocolInOverlayBrowser() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 49)] - internal struct OverlayBrowserProtocolNavigation_t_LargePack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 49; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] - internal byte[] rgchURI_; - public string rgchURI - { - get { return InteropHelp.ByteArrayToStringUTF8(rgchURI_); } - set { InteropHelp.StringToByteArrayUTF8(value, rgchURI_, 1024); } - } + { } - //----------------------------------------------------------------------------- // Purpose: Dispatched when an overlay browser instance is navigated to a protocol/scheme registered by RegisterProtocolInOverlayBrowser() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 49)] - internal struct OverlayBrowserProtocolNavigation_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 49; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] - internal byte[] rgchURI_; - public string rgchURI - { - get { return InteropHelp.ByteArrayToStringUTF8(rgchURI_); } - set { InteropHelp.StringToByteArrayUTF8(value, rgchURI_, 1024); } - } - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: A user's equipped profile items have changed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 50)] - public struct EquippedProfileItemsChanged_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 50; - public CSteamID m_steamID; - } - + public struct OverlayBrowserProtocolNavigation_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: A user's equipped profile items have changed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 50)] - internal struct EquippedProfileItemsChanged_t_LargePack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 50; - public CSteamID m_steamID; + : ICallbackIdentity + #endif + { + public string rgchURI; } - //----------------------------------------------------------------------------- // Purpose: A user's equipped profile items have changed //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 50)] - internal struct EquippedProfileItemsChanged_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 50; - public CSteamID m_steamID; - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 51)] - public struct EquippedProfileItems_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 51; - public EResult m_eResult; - public CSteamID m_steamID; - [MarshalAs(UnmanagedType.I1)] - public bool m_bHasAnimatedAvatar; - [MarshalAs(UnmanagedType.I1)] - public bool m_bHasAvatarFrame; - [MarshalAs(UnmanagedType.I1)] - public bool m_bHasProfileModifier; - [MarshalAs(UnmanagedType.I1)] - public bool m_bHasProfileBackground; - [MarshalAs(UnmanagedType.I1)] - public bool m_bHasMiniProfileBackground; - [MarshalAs(UnmanagedType.I1)] - public bool m_bFromCache; - } - + public struct EquippedProfileItemsChanged_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 51)] - internal struct EquippedProfileItems_t_LargePack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 51; - public EResult m_eResult; + : ICallbackIdentity + #endif + { public CSteamID m_steamID; - [MarshalAs(UnmanagedType.I1)] - public bool m_bHasAnimatedAvatar; - [MarshalAs(UnmanagedType.I1)] - public bool m_bHasAvatarFrame; - [MarshalAs(UnmanagedType.I1)] - public bool m_bHasProfileModifier; - [MarshalAs(UnmanagedType.I1)] - public bool m_bHasProfileBackground; - [MarshalAs(UnmanagedType.I1)] - public bool m_bHasMiniProfileBackground; - [MarshalAs(UnmanagedType.I1)] - public bool m_bFromCache; } - //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 51)] - internal struct EquippedProfileItems_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 51; + public struct EquippedProfileItems_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public CSteamID m_steamID; [MarshalAs(UnmanagedType.I1)] @@ -910,115 +446,62 @@ internal struct EquippedProfileItems_t_SmallPack { public bool m_bFromCache; } - #endif // callbacks // callback notification - A new message is available for reading from the message queue [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameCoordinatorCallbacks + 1)] - public struct GCMessageAvailable_t { - public const int k_iCallback = Constants.k_iSteamGameCoordinatorCallbacks + 1; - public uint m_nMessageSize; - } - + public struct GCMessageAvailable_t #if STEAMWORKS_ANYCPU - // callbacks - // callback notification - A new message is available for reading from the message queue - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameCoordinatorCallbacks + 1)] - internal struct GCMessageAvailable_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameCoordinatorCallbacks + 1; - public uint m_nMessageSize; - } - - - // callbacks - // callback notification - A new message is available for reading from the message queue - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameCoordinatorCallbacks + 1)] - internal struct GCMessageAvailable_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameCoordinatorCallbacks + 1; + : ICallbackIdentity + #endif + { public uint m_nMessageSize; } - #endif // callback notification - A message failed to make it to the GC. It may be down temporarily [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamGameCoordinatorCallbacks + 2)] - public struct GCMessageFailed_t { - public const int k_iCallback = Constants.k_iSteamGameCoordinatorCallbacks + 2; - } - + public struct GCMessageFailed_t #if STEAMWORKS_ANYCPU - // callback notification - A message failed to make it to the GC. It may be down temporarily - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamGameCoordinatorCallbacks + 2)] - internal struct GCMessageFailed_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameCoordinatorCallbacks + 2; - } - - - // callback notification - A message failed to make it to the GC. It may be down temporarily - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamGameCoordinatorCallbacks + 2)] - internal struct GCMessageFailed_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameCoordinatorCallbacks + 2; - } - + : ICallbackIdentity #endif - // callbacks - // client has been approved to connect to this game server - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 1)] - public struct GSClientApprove_t { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 1; - public CSteamID m_SteamID; // SteamID of approved player - public CSteamID m_OwnerSteamID; // SteamID of original owner for game license - } - - #if STEAMWORKS_ANYCPU - // callbacks - // client has been approved to connect to this game server - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 1)] - internal struct GSClientApprove_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 1; - public CSteamID m_SteamID; // SteamID of approved player - public CSteamID m_OwnerSteamID; // SteamID of original owner for game license + { } - // callbacks // client has been approved to connect to this game server [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 1)] - internal struct GSClientApprove_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 1; + public struct GSClientApprove_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_SteamID; // SteamID of approved player public CSteamID m_OwnerSteamID; // SteamID of original owner for game license } - #endif // client has been denied to connection to this game server [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 2)] - public struct GSClientDeny_t { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 2; + public struct GSClientDeny_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_SteamID; public EDenyReason m_eDenyReason; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] - internal byte[] m_rgchOptionalText_; - public string m_rgchOptionalText - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchOptionalText_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchOptionalText_, 128); } - } + public string m_rgchOptionalText; } // request the game server should kick the user [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 3)] - public struct GSClientKick_t { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 3; + public struct GSClientKick_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_SteamID; public EDenyReason m_eDenyReason; } @@ -1028,132 +511,51 @@ public struct GSClientKick_t { // client achievement info [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 6)] - public struct GSClientAchievementStatus_t { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 6; + public struct GSClientAchievementStatus_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public ulong m_SteamID; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] - internal byte[] m_pchAchievement_; - public string m_pchAchievement - { - get { return InteropHelp.ByteArrayToStringUTF8(m_pchAchievement_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_pchAchievement_, 128); } - } + public string m_pchAchievement; [MarshalAs(UnmanagedType.I1)] public bool m_bUnlocked; } + // received when the game server requests to be displayed as secure (VAC protected) + // m_bSecure is true if the game server should display itself as secure to users, false otherwise + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [CallbackIdentity(Constants.k_iSteamUserCallbacks + 15)] + public struct GSPolicyResponse_t #if STEAMWORKS_ANYCPU - // NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks, - // do not reuse them here. - // client achievement info - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 6)] - internal struct GSClientAchievementStatus_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 6; - public ulong m_SteamID; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] - internal byte[] m_pchAchievement_; - public string m_pchAchievement - { - get { return InteropHelp.ByteArrayToStringUTF8(m_pchAchievement_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_pchAchievement_, 128); } - } - [MarshalAs(UnmanagedType.I1)] - public bool m_bUnlocked; - } - - - // NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks, - // do not reuse them here. - // client achievement info - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 6)] - internal struct GSClientAchievementStatus_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 6; - public ulong m_SteamID; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] - internal byte[] m_pchAchievement_; - public string m_pchAchievement - { - get { return InteropHelp.ByteArrayToStringUTF8(m_pchAchievement_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_pchAchievement_, 128); } - } - [MarshalAs(UnmanagedType.I1)] - public bool m_bUnlocked; - } - + : ICallbackIdentity #endif - // received when the game server requests to be displayed as secure (VAC protected) - // m_bSecure is true if the game server should display itself as secure to users, false otherwise - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 15)] - public struct GSPolicyResponse_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 15; - public byte m_bSecure; - } - - #if STEAMWORKS_ANYCPU - // received when the game server requests to be displayed as secure (VAC protected) - // m_bSecure is true if the game server should display itself as secure to users, false otherwise - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 15)] - internal struct GSPolicyResponse_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 15; - public byte m_bSecure; - } - - - // received when the game server requests to be displayed as secure (VAC protected) - // m_bSecure is true if the game server should display itself as secure to users, false otherwise - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 15)] - internal struct GSPolicyResponse_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 15; + { public byte m_bSecure; } - #endif // GS gameplay stats info [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 7)] - public struct GSGameplayStats_t { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 7; - public EResult m_eResult; // Result of the call - public int m_nRank; // Overall rank of the server (0-based) - public uint m_unTotalConnects; // Total number of clients who have ever connected to the server - public uint m_unTotalMinutesPlayed; // Total number of minutes ever played on the server - } - + public struct GSGameplayStats_t #if STEAMWORKS_ANYCPU - // GS gameplay stats info - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 7)] - internal struct GSGameplayStats_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 7; - public EResult m_eResult; // Result of the call - public int m_nRank; // Overall rank of the server (0-based) - public uint m_unTotalConnects; // Total number of clients who have ever connected to the server - public uint m_unTotalMinutesPlayed; // Total number of minutes ever played on the server - } - - - // GS gameplay stats info - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 7)] - internal struct GSGameplayStats_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 7; + : ICallbackIdentity + #endif + { public EResult m_eResult; // Result of the call public int m_nRank; // Overall rank of the server (0-based) public uint m_unTotalConnects; // Total number of clients who have ever connected to the server public uint m_unTotalMinutesPlayed; // Total number of minutes ever played on the server } - #endif // send as a reply to RequestUserGroupStatus() [StructLayout(LayoutKind.Sequential, Pack = 1)] [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 8)] - public struct GSClientGroupStatus_t { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 8; + public struct GSClientGroupStatus_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_SteamIDUser; public CSteamID m_SteamIDGroup; [MarshalAs(UnmanagedType.I1)] @@ -1165,8 +567,11 @@ public struct GSClientGroupStatus_t { // Sent as a reply to GetServerReputation() [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 9)] - public struct GSReputation_t { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 9; + public struct GSReputation_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; // Result of the call; public uint m_unReputationScore; // The reputation score for the game server [MarshalAs(UnmanagedType.I1)] @@ -1186,10 +591,11 @@ public struct GSReputation_t { #if STEAMWORKS_ANYCPU // Sent as a reply to GetServerReputation() - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 9)] internal struct GSReputation_t_LargePack { public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 9; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerCallbacks + 9; public EResult m_eResult; // Result of the call; public uint m_unReputationScore; // The reputation score for the game server [MarshalAs(UnmanagedType.I1)] @@ -1205,77 +611,52 @@ internal struct GSReputation_t_LargePack { public ushort m_usBannedPort; // The port of the banned server public ulong m_ulBannedGameID; // The game ID the banned server is serving public uint m_unBanExpires; // Time the ban expires, expressed in the Unix epoch (seconds since 1/1/1970) - } + public static implicit operator GSReputation_t(GSReputation_t_LargePack value) { + GSReputation_t result = default; + result.m_eResult = value.m_eResult; + result.m_unReputationScore = value.m_unReputationScore; + result.m_bBanned = value.m_bBanned; + result.m_unBannedIP = value.m_unBannedIP; + result.m_usBannedPort = value.m_usBannedPort; + result.m_ulBannedGameID = value.m_ulBannedGameID; + result.m_unBanExpires = value.m_unBanExpires; + return result; + } - // Sent as a reply to GetServerReputation() - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 9)] - internal struct GSReputation_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 9; - public EResult m_eResult; // Result of the call; - public uint m_unReputationScore; // The reputation score for the game server - [MarshalAs(UnmanagedType.I1)] - public bool m_bBanned; // True if the server is banned from the Steam - // master servers - - // The following members are only filled out if m_bBanned is true. They will all - // be set to zero otherwise. Master server bans are by IP so it is possible to be - // banned even when the score is good high if there is a bad server on another port. - // This information can be used to determine which server is bad. - - public uint m_unBannedIP; // The IP of the banned server - public ushort m_usBannedPort; // The port of the banned server - public ulong m_ulBannedGameID; // The game ID the banned server is serving - public uint m_unBanExpires; // Time the ban expires, expressed in the Unix epoch (seconds since 1/1/1970) + public static implicit operator GSReputation_t_LargePack(GSReputation_t value) { + GSReputation_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_unReputationScore = value.m_unReputationScore; + result.m_bBanned = value.m_bBanned; + result.m_unBannedIP = value.m_unBannedIP; + result.m_usBannedPort = value.m_usBannedPort; + result.m_ulBannedGameID = value.m_ulBannedGameID; + result.m_unBanExpires = value.m_unBanExpires; + return result; + } } #endif // Sent as a reply to AssociateWithClan() [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 10)] - public struct AssociateWithClanResult_t { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 10; - public EResult m_eResult; // Result of the call; - } - + public struct AssociateWithClanResult_t #if STEAMWORKS_ANYCPU - // Sent as a reply to AssociateWithClan() - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 10)] - internal struct AssociateWithClanResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 10; - public EResult m_eResult; // Result of the call; - } - - - // Sent as a reply to AssociateWithClan() - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 10)] - internal struct AssociateWithClanResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 10; - public EResult m_eResult; // Result of the call; - } - + : ICallbackIdentity #endif - // Sent as a reply to ComputeNewPlayerCompatibility() - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 11)] - public struct ComputeNewPlayerCompatibilityResult_t { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 11; + { public EResult m_eResult; // Result of the call; - public int m_cPlayersThatDontLikeCandidate; - public int m_cPlayersThatCandidateDoesntLike; - public int m_cClanPlayersThatDontLikeCandidate; - public CSteamID m_SteamIDCandidate; } - #if STEAMWORKS_ANYCPU // Sent as a reply to ComputeNewPlayerCompatibility() [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 11)] - internal struct ComputeNewPlayerCompatibilityResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 11; + public struct ComputeNewPlayerCompatibilityResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; // Result of the call; public int m_cPlayersThatDontLikeCandidate; public int m_cPlayersThatCandidateDoesntLike; @@ -1283,123 +664,132 @@ internal struct ComputeNewPlayerCompatibilityResult_t_LargePack { public CSteamID m_SteamIDCandidate; } - - // Sent as a reply to ComputeNewPlayerCompatibility() - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 11)] - internal struct ComputeNewPlayerCompatibilityResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 11; - public EResult m_eResult; // Result of the call; - public int m_cPlayersThatDontLikeCandidate; - public int m_cPlayersThatCandidateDoesntLike; - public int m_cClanPlayersThatDontLikeCandidate; - public CSteamID m_SteamIDCandidate; + // callbacks + //----------------------------------------------------------------------------- + // Purpose: called when the latests stats and achievements have been received + // from the server + //----------------------------------------------------------------------------- + [StructLayout(LayoutKind.Sequential, Pack = 4)] + [CallbackIdentity(Constants.k_iSteamGameServerStatsCallbacks)] + public struct GSStatsReceived_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + public EResult m_eResult; // Success / error fetching the stats + public CSteamID m_steamIDUser; // The user for whom the stats are retrieved for } - #endif + #if STEAMWORKS_ANYCPU // callbacks //----------------------------------------------------------------------------- // Purpose: called when the latests stats and achievements have been received // from the server //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 4)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameServerStatsCallbacks)] - public struct GSStatsReceived_t { + internal struct GSStatsReceived_t_LargePack { public const int k_iCallback = Constants.k_iSteamGameServerStatsCallbacks; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerStatsCallbacks; public EResult m_eResult; // Success / error fetching the stats public CSteamID m_steamIDUser; // The user for whom the stats are retrieved for + + public static implicit operator GSStatsReceived_t(GSStatsReceived_t_LargePack value) { + GSStatsReceived_t result = default; + result.m_eResult = value.m_eResult; + result.m_steamIDUser = value.m_steamIDUser; + return result; + } + + public static implicit operator GSStatsReceived_t_LargePack(GSStatsReceived_t value) { + GSStatsReceived_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_steamIDUser = value.m_steamIDUser; + return result; + } } + #endif //----------------------------------------------------------------------------- // Purpose: result of a request to store the user stats for a game //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamGameServerStatsCallbacks + 1)] - public struct GSStatsStored_t { - public const int k_iCallback = Constants.k_iSteamGameServerStatsCallbacks + 1; + public struct GSStatsStored_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; // success / error public CSteamID m_steamIDUser; // The user for whom the stats were stored } - //----------------------------------------------------------------------------- - // Purpose: Callback indicating that a user's stats have been unloaded. - // Call RequestUserStats again to access stats for this user - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 8)] - public struct GSStatsUnloaded_t { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 8; - public CSteamID m_steamIDUser; // User whose stats have been unloaded - } - #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- - // Purpose: Callback indicating that a user's stats have been unloaded. - // Call RequestUserStats again to access stats for this user + // Purpose: result of a request to store the user stats for a game //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 8)] - internal struct GSStatsUnloaded_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 8; - public CSteamID m_steamIDUser; // User whose stats have been unloaded - } + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamGameServerStatsCallbacks + 1)] + internal struct GSStatsStored_t_LargePack { + public const int k_iCallback = Constants.k_iSteamGameServerStatsCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerStatsCallbacks + 1; + public EResult m_eResult; // success / error + public CSteamID m_steamIDUser; // The user for whom the stats were stored + + public static implicit operator GSStatsStored_t(GSStatsStored_t_LargePack value) { + GSStatsStored_t result = default; + result.m_eResult = value.m_eResult; + result.m_steamIDUser = value.m_steamIDUser; + return result; + } + public static implicit operator GSStatsStored_t_LargePack(GSStatsStored_t value) { + GSStatsStored_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_steamIDUser = value.m_steamIDUser; + return result; + } + } + #endif //----------------------------------------------------------------------------- // Purpose: Callback indicating that a user's stats have been unloaded. // Call RequestUserStats again to access stats for this user //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 8)] - internal struct GSStatsUnloaded_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 8; + public struct GSStatsUnloaded_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_steamIDUser; // User whose stats have been unloaded } - #endif // callbacks //----------------------------------------------------------------------------- // Purpose: The browser is ready for use //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 1)] - public struct HTML_BrowserReady_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 1; - public HHTMLBrowser unBrowserHandle; // this browser is now fully created and ready to navigate to pages - } - + public struct HTML_BrowserReady_t #if STEAMWORKS_ANYCPU - // callbacks - //----------------------------------------------------------------------------- - // Purpose: The browser is ready for use - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 1)] - internal struct HTML_BrowserReady_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 1; - public HHTMLBrowser unBrowserHandle; // this browser is now fully created and ready to navigate to pages - } - - - // callbacks - //----------------------------------------------------------------------------- - // Purpose: The browser is ready for use - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 1)] - internal struct HTML_BrowserReady_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 1; + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // this browser is now fully created and ready to navigate to pages } - #endif //----------------------------------------------------------------------------- // Purpose: the browser has a pending paint //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 2)] - public struct HTML_NeedsPaint_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 2; + public struct HTML_NeedsPaint_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the browser that needs the paint public IntPtr pBGRA; // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called public uint unWide; // the total width of the pBGRA texture @@ -1418,10 +808,11 @@ public struct HTML_NeedsPaint_t { //----------------------------------------------------------------------------- // Purpose: the browser has a pending paint //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 2)] internal struct HTML_NeedsPaint_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 2; public HHTMLBrowser unBrowserHandle; // the browser that needs the paint public IntPtr pBGRA; // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called public uint unWide; // the total width of the pBGRA texture @@ -1434,28 +825,40 @@ internal struct HTML_NeedsPaint_t_LargePack { public uint unScrollY; // the page scroll the browser was at when this texture was rendered public float flPageScale; // the page scale factor on this page when rendered public uint unPageSerial; // incremented on each new page load, you can use this to reject draws while navigating to new pages - } + public static implicit operator HTML_NeedsPaint_t(HTML_NeedsPaint_t_LargePack value) { + HTML_NeedsPaint_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pBGRA = value.pBGRA; + result.unWide = value.unWide; + result.unTall = value.unTall; + result.unUpdateX = value.unUpdateX; + result.unUpdateY = value.unUpdateY; + result.unUpdateWide = value.unUpdateWide; + result.unUpdateTall = value.unUpdateTall; + result.unScrollX = value.unScrollX; + result.unScrollY = value.unScrollY; + result.flPageScale = value.flPageScale; + result.unPageSerial = value.unPageSerial; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: the browser has a pending paint - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 2)] - internal struct HTML_NeedsPaint_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 2; - public HHTMLBrowser unBrowserHandle; // the browser that needs the paint - public IntPtr pBGRA; // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called - public uint unWide; // the total width of the pBGRA texture - public uint unTall; // the total height of the pBGRA texture - public uint unUpdateX; // the offset in X for the damage rect for this update - public uint unUpdateY; // the offset in Y for the damage rect for this update - public uint unUpdateWide; // the width of the damage rect for this update - public uint unUpdateTall; // the height of the damage rect for this update - public uint unScrollX; // the page scroll the browser was at when this texture was rendered - public uint unScrollY; // the page scroll the browser was at when this texture was rendered - public float flPageScale; // the page scale factor on this page when rendered - public uint unPageSerial; // incremented on each new page load, you can use this to reject draws while navigating to new pages + public static implicit operator HTML_NeedsPaint_t_LargePack(HTML_NeedsPaint_t value) { + HTML_NeedsPaint_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pBGRA = value.pBGRA; + result.unWide = value.unWide; + result.unTall = value.unTall; + result.unUpdateX = value.unUpdateX; + result.unUpdateY = value.unUpdateY; + result.unUpdateWide = value.unUpdateWide; + result.unUpdateTall = value.unUpdateTall; + result.unScrollX = value.unScrollX; + result.unScrollY = value.unScrollY; + result.flPageScale = value.flPageScale; + result.unPageSerial = value.unPageSerial; + return result; + } } #endif @@ -1465,8 +868,11 @@ internal struct HTML_NeedsPaint_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 3)] - public struct HTML_StartRequest_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 3; + public struct HTML_StartRequest_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface navigating public string pchURL; // the url they wish to navigate to public string pchTarget; // the html link target type (i.e _blank, _self, _parent, _top ) @@ -1480,33 +886,37 @@ public struct HTML_StartRequest_t { // Purpose: The browser wanted to navigate to a new page // NOTE - you MUST call AllowStartRequest in response to this callback //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 3)] internal struct HTML_StartRequest_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 3; public HHTMLBrowser unBrowserHandle; // the handle of the surface navigating public string pchURL; // the url they wish to navigate to public string pchTarget; // the html link target type (i.e _blank, _self, _parent, _top ) public string pchPostData; // any posted data for the request [MarshalAs(UnmanagedType.I1)] public bool bIsRedirect; // true if this was a http/html redirect from the last load request - } + public static implicit operator HTML_StartRequest_t(HTML_StartRequest_t_LargePack value) { + HTML_StartRequest_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchURL = value.pchURL; + result.pchTarget = value.pchTarget; + result.pchPostData = value.pchPostData; + result.bIsRedirect = value.bIsRedirect; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: The browser wanted to navigate to a new page - // NOTE - you MUST call AllowStartRequest in response to this callback - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 3)] - internal struct HTML_StartRequest_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 3; - public HHTMLBrowser unBrowserHandle; // the handle of the surface navigating - public string pchURL; // the url they wish to navigate to - public string pchTarget; // the html link target type (i.e _blank, _self, _parent, _top ) - public string pchPostData; // any posted data for the request - [MarshalAs(UnmanagedType.I1)] - public bool bIsRedirect; // true if this was a http/html redirect from the last load request + public static implicit operator HTML_StartRequest_t_LargePack(HTML_StartRequest_t value) { + HTML_StartRequest_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchURL = value.pchURL; + result.pchTarget = value.pchTarget; + result.pchPostData = value.pchPostData; + result.bIsRedirect = value.bIsRedirect; + return result; + } } #endif @@ -1515,41 +925,24 @@ internal struct HTML_StartRequest_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 4)] - public struct HTML_CloseBrowser_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 4; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - } - + public struct HTML_CloseBrowser_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The browser has been requested to close due to user interaction (usually from a javascript window.close() call) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 4)] - internal struct HTML_CloseBrowser_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 4; + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface } - //----------------------------------------------------------------------------- - // Purpose: The browser has been requested to close due to user interaction (usually from a javascript window.close() call) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 4)] - internal struct HTML_CloseBrowser_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 4; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: the browser is navigating to a new url + // Purpose: the browser is navigating to a new url //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 5)] - public struct HTML_URLChanged_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 5; + public struct HTML_URLChanged_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface navigating public string pchURL; // the url they wish to navigate to public string pchPostData; // any posted data for the request @@ -1564,10 +957,11 @@ public struct HTML_URLChanged_t { //----------------------------------------------------------------------------- // Purpose: the browser is navigating to a new url //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 5)] internal struct HTML_URLChanged_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 5; public HHTMLBrowser unBrowserHandle; // the handle of the surface navigating public string pchURL; // the url they wish to navigate to public string pchPostData; // any posted data for the request @@ -1576,24 +970,28 @@ internal struct HTML_URLChanged_t_LargePack { public string pchPageTitle; // the title of the page [MarshalAs(UnmanagedType.I1)] public bool bNewNavigation; // true if this was from a fresh tab and not a click on an existing page - } + public static implicit operator HTML_URLChanged_t(HTML_URLChanged_t_LargePack value) { + HTML_URLChanged_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchURL = value.pchURL; + result.pchPostData = value.pchPostData; + result.bIsRedirect = value.bIsRedirect; + result.pchPageTitle = value.pchPageTitle; + result.bNewNavigation = value.bNewNavigation; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: the browser is navigating to a new url - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 5)] - internal struct HTML_URLChanged_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 5; - public HHTMLBrowser unBrowserHandle; // the handle of the surface navigating - public string pchURL; // the url they wish to navigate to - public string pchPostData; // any posted data for the request - [MarshalAs(UnmanagedType.I1)] - public bool bIsRedirect; // true if this was a http/html redirect from the last load request - public string pchPageTitle; // the title of the page - [MarshalAs(UnmanagedType.I1)] - public bool bNewNavigation; // true if this was from a fresh tab and not a click on an existing page + public static implicit operator HTML_URLChanged_t_LargePack(HTML_URLChanged_t value) { + HTML_URLChanged_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchURL = value.pchURL; + result.pchPostData = value.pchPostData; + result.bIsRedirect = value.bIsRedirect; + result.pchPageTitle = value.pchPageTitle; + result.bNewNavigation = value.bNewNavigation; + return result; + } } #endif @@ -1602,8 +1000,11 @@ internal struct HTML_URLChanged_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 6)] - public struct HTML_FinishedRequest_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 6; + public struct HTML_FinishedRequest_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchURL; // public string pchPageTitle; // @@ -1613,26 +1014,30 @@ public struct HTML_FinishedRequest_t { //----------------------------------------------------------------------------- // Purpose: A page is finished loading //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 6)] internal struct HTML_FinishedRequest_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 6; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 6; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchURL; // public string pchPageTitle; // - } + public static implicit operator HTML_FinishedRequest_t(HTML_FinishedRequest_t_LargePack value) { + HTML_FinishedRequest_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchURL = value.pchURL; + result.pchPageTitle = value.pchPageTitle; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: A page is finished loading - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 6)] - internal struct HTML_FinishedRequest_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 6; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public string pchURL; // - public string pchPageTitle; // + public static implicit operator HTML_FinishedRequest_t_LargePack(HTML_FinishedRequest_t value) { + HTML_FinishedRequest_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchURL = value.pchURL; + result.pchPageTitle = value.pchPageTitle; + return result; + } } #endif @@ -1641,8 +1046,11 @@ internal struct HTML_FinishedRequest_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 7)] - public struct HTML_OpenLinkInNewTab_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 7; + public struct HTML_OpenLinkInNewTab_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchURL; // } @@ -1651,24 +1059,27 @@ public struct HTML_OpenLinkInNewTab_t { //----------------------------------------------------------------------------- // Purpose: a request to load this url in a new tab //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 7)] internal struct HTML_OpenLinkInNewTab_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 7; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 7; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchURL; // - } + public static implicit operator HTML_OpenLinkInNewTab_t(HTML_OpenLinkInNewTab_t_LargePack value) { + HTML_OpenLinkInNewTab_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchURL = value.pchURL; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: a request to load this url in a new tab - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 7)] - internal struct HTML_OpenLinkInNewTab_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 7; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public string pchURL; // + public static implicit operator HTML_OpenLinkInNewTab_t_LargePack(HTML_OpenLinkInNewTab_t value) { + HTML_OpenLinkInNewTab_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchURL = value.pchURL; + return result; + } } #endif @@ -1677,8 +1088,11 @@ internal struct HTML_OpenLinkInNewTab_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 8)] - public struct HTML_ChangedTitle_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 8; + public struct HTML_ChangedTitle_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchTitle; // } @@ -1687,24 +1101,27 @@ public struct HTML_ChangedTitle_t { //----------------------------------------------------------------------------- // Purpose: the page has a new title now //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 8)] internal struct HTML_ChangedTitle_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 8; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 8; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchTitle; // - } + public static implicit operator HTML_ChangedTitle_t(HTML_ChangedTitle_t_LargePack value) { + HTML_ChangedTitle_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchTitle = value.pchTitle; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: the page has a new title now - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 8)] - internal struct HTML_ChangedTitle_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 8; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public string pchTitle; // + public static implicit operator HTML_ChangedTitle_t_LargePack(HTML_ChangedTitle_t value) { + HTML_ChangedTitle_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchTitle = value.pchTitle; + return result; + } } #endif @@ -1713,77 +1130,26 @@ internal struct HTML_ChangedTitle_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 9)] - public struct HTML_SearchResults_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 9; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public uint unResults; // - public uint unCurrentMatch; // - } - + public struct HTML_SearchResults_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: results from a search - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 9)] - internal struct HTML_SearchResults_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 9; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public uint unResults; // - public uint unCurrentMatch; // - } - - - //----------------------------------------------------------------------------- - // Purpose: results from a search - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 9)] - internal struct HTML_SearchResults_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 9; + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public uint unResults; // public uint unCurrentMatch; // } - #endif //----------------------------------------------------------------------------- // Purpose: page history status changed on the ability to go backwards and forward //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 10)] - public struct HTML_CanGoBackAndForward_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 10; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - [MarshalAs(UnmanagedType.I1)] - public bool bCanGoBack; // - [MarshalAs(UnmanagedType.I1)] - public bool bCanGoForward; // - } - + public struct HTML_CanGoBackAndForward_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: page history status changed on the ability to go backwards and forward - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 10)] - internal struct HTML_CanGoBackAndForward_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 10; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - [MarshalAs(UnmanagedType.I1)] - public bool bCanGoBack; // - [MarshalAs(UnmanagedType.I1)] - public bool bCanGoForward; // - } - - - //----------------------------------------------------------------------------- - // Purpose: page history status changed on the ability to go backwards and forward - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 10)] - internal struct HTML_CanGoBackAndForward_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 10; + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface [MarshalAs(UnmanagedType.I1)] public bool bCanGoBack; // @@ -1791,82 +1157,16 @@ internal struct HTML_CanGoBackAndForward_t_SmallPack { public bool bCanGoForward; // } - #endif //----------------------------------------------------------------------------- // Purpose: details on the visibility and size of the horizontal scrollbar //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 11)] - public struct HTML_HorizontalScroll_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 11; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public uint unScrollMax; // - public uint unScrollCurrent; // - public float flPageScale; // - [MarshalAs(UnmanagedType.I1)] - public bool bVisible; // - public uint unPageSize; // - } - + public struct HTML_HorizontalScroll_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: details on the visibility and size of the horizontal scrollbar - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 11)] - internal struct HTML_HorizontalScroll_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 11; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public uint unScrollMax; // - public uint unScrollCurrent; // - public float flPageScale; // - [MarshalAs(UnmanagedType.I1)] - public bool bVisible; // - public uint unPageSize; // - } - - - //----------------------------------------------------------------------------- - // Purpose: details on the visibility and size of the horizontal scrollbar - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 11)] - internal struct HTML_HorizontalScroll_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 11; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public uint unScrollMax; // - public uint unScrollCurrent; // - public float flPageScale; // - [MarshalAs(UnmanagedType.I1)] - public bool bVisible; // - public uint unPageSize; // - } - + : ICallbackIdentity #endif - //----------------------------------------------------------------------------- - // Purpose: details on the visibility and size of the vertical scrollbar - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 12)] - public struct HTML_VerticalScroll_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 12; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public uint unScrollMax; // - public uint unScrollCurrent; // - public float flPageScale; // - [MarshalAs(UnmanagedType.I1)] - public bool bVisible; // - public uint unPageSize; // - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: details on the visibility and size of the vertical scrollbar - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 12)] - internal struct HTML_VerticalScroll_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 12; + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public uint unScrollMax; // public uint unScrollCurrent; // @@ -1876,14 +1176,16 @@ internal struct HTML_VerticalScroll_t_LargePack { public uint unPageSize; // } - //----------------------------------------------------------------------------- // Purpose: details on the visibility and size of the vertical scrollbar //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 12)] - internal struct HTML_VerticalScroll_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 12; + public struct HTML_VerticalScroll_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public uint unScrollMax; // public uint unScrollCurrent; // @@ -1893,14 +1195,16 @@ internal struct HTML_VerticalScroll_t_SmallPack { public uint unPageSize; // } - #endif //----------------------------------------------------------------------------- // Purpose: response to GetLinkAtPosition call //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 13)] - public struct HTML_LinkAtPosition_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 13; + public struct HTML_LinkAtPosition_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public uint x; // NOTE - Not currently set public uint y; // NOTE - Not currently set @@ -1915,10 +1219,11 @@ public struct HTML_LinkAtPosition_t { //----------------------------------------------------------------------------- // Purpose: response to GetLinkAtPosition call //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 13)] internal struct HTML_LinkAtPosition_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 13; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 13; public HHTMLBrowser unBrowserHandle; // the handle of the surface public uint x; // NOTE - Not currently set public uint y; // NOTE - Not currently set @@ -1927,24 +1232,28 @@ internal struct HTML_LinkAtPosition_t_LargePack { public bool bInput; // [MarshalAs(UnmanagedType.I1)] public bool bLiveLink; // - } + public static implicit operator HTML_LinkAtPosition_t(HTML_LinkAtPosition_t_LargePack value) { + HTML_LinkAtPosition_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.x = value.x; + result.y = value.y; + result.pchURL = value.pchURL; + result.bInput = value.bInput; + result.bLiveLink = value.bLiveLink; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: response to GetLinkAtPosition call - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 13)] - internal struct HTML_LinkAtPosition_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 13; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public uint x; // NOTE - Not currently set - public uint y; // NOTE - Not currently set - public string pchURL; // - [MarshalAs(UnmanagedType.I1)] - public bool bInput; // - [MarshalAs(UnmanagedType.I1)] - public bool bLiveLink; // + public static implicit operator HTML_LinkAtPosition_t_LargePack(HTML_LinkAtPosition_t value) { + HTML_LinkAtPosition_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.x = value.x; + result.y = value.y; + result.pchURL = value.pchURL; + result.bInput = value.bInput; + result.bLiveLink = value.bLiveLink; + return result; + } } #endif @@ -1954,8 +1263,11 @@ internal struct HTML_LinkAtPosition_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 14)] - public struct HTML_JSAlert_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 14; + public struct HTML_JSAlert_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMessage; // } @@ -1965,25 +1277,27 @@ public struct HTML_JSAlert_t { // Purpose: show a Javascript alert dialog, call JSDialogResponse // when the user dismisses this dialog (or right away to ignore it) //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 14)] internal struct HTML_JSAlert_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 14; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 14; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMessage; // - } + public static implicit operator HTML_JSAlert_t(HTML_JSAlert_t_LargePack value) { + HTML_JSAlert_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchMessage = value.pchMessage; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: show a Javascript alert dialog, call JSDialogResponse - // when the user dismisses this dialog (or right away to ignore it) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 14)] - internal struct HTML_JSAlert_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 14; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public string pchMessage; // + public static implicit operator HTML_JSAlert_t_LargePack(HTML_JSAlert_t value) { + HTML_JSAlert_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchMessage = value.pchMessage; + return result; + } } #endif @@ -1993,8 +1307,11 @@ internal struct HTML_JSAlert_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 15)] - public struct HTML_JSConfirm_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 15; + public struct HTML_JSConfirm_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMessage; // } @@ -2004,25 +1321,27 @@ public struct HTML_JSConfirm_t { // Purpose: show a Javascript confirmation dialog, call JSDialogResponse // when the user dismisses this dialog (or right away to ignore it) //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 15)] internal struct HTML_JSConfirm_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 15; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 15; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMessage; // - } + public static implicit operator HTML_JSConfirm_t(HTML_JSConfirm_t_LargePack value) { + HTML_JSConfirm_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchMessage = value.pchMessage; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: show a Javascript confirmation dialog, call JSDialogResponse - // when the user dismisses this dialog (or right away to ignore it) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 15)] - internal struct HTML_JSConfirm_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 15; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public string pchMessage; // + public static implicit operator HTML_JSConfirm_t_LargePack(HTML_JSConfirm_t value) { + HTML_JSConfirm_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchMessage = value.pchMessage; + return result; + } } #endif @@ -2032,8 +1351,11 @@ internal struct HTML_JSConfirm_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 16)] - public struct HTML_FileOpenDialog_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 16; + public struct HTML_FileOpenDialog_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchTitle; // public string pchInitialFile; // @@ -2044,30 +1366,33 @@ public struct HTML_FileOpenDialog_t { // Purpose: when received show a file open dialog // then call FileLoadDialogResponse with the file(s) the user selected. //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 16)] internal struct HTML_FileOpenDialog_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 16; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 16; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchTitle; // public string pchInitialFile; // - } + public static implicit operator HTML_FileOpenDialog_t(HTML_FileOpenDialog_t_LargePack value) { + HTML_FileOpenDialog_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchTitle = value.pchTitle; + result.pchInitialFile = value.pchInitialFile; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: when received show a file open dialog - // then call FileLoadDialogResponse with the file(s) the user selected. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 16)] - internal struct HTML_FileOpenDialog_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 16; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public string pchTitle; // - public string pchInitialFile; // - } - - #endif + public static implicit operator HTML_FileOpenDialog_t_LargePack(HTML_FileOpenDialog_t value) { + HTML_FileOpenDialog_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchTitle = value.pchTitle; + result.pchInitialFile = value.pchInitialFile; + return result; + } + } + + #endif //----------------------------------------------------------------------------- // Purpose: a new html window is being created. // @@ -2079,8 +1404,11 @@ internal struct HTML_FileOpenDialog_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 21)] - public struct HTML_NewWindow_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 21; + public struct HTML_NewWindow_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the current surface public string pchURL; // the page to load public uint unX; // the x pos into the page to display the popup @@ -2100,10 +1428,11 @@ public struct HTML_NewWindow_t { // to give your application the opportunity to call CreateBrowser and set up // a new browser in response to the attempted popup, if you wish to do so. //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 21)] internal struct HTML_NewWindow_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 21; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 21; public HHTMLBrowser unBrowserHandle; // the handle of the current surface public string pchURL; // the page to load public uint unX; // the x pos into the page to display the popup @@ -2111,29 +1440,30 @@ internal struct HTML_NewWindow_t_LargePack { public uint unWide; // the total width of the pBGRA texture public uint unTall; // the total height of the pBGRA texture public HHTMLBrowser unNewWindow_BrowserHandle_IGNORE; - } + public static implicit operator HTML_NewWindow_t(HTML_NewWindow_t_LargePack value) { + HTML_NewWindow_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchURL = value.pchURL; + result.unX = value.unX; + result.unY = value.unY; + result.unWide = value.unWide; + result.unTall = value.unTall; + result.unNewWindow_BrowserHandle_IGNORE = value.unNewWindow_BrowserHandle_IGNORE; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: a new html window is being created. - // - // IMPORTANT NOTE: at this time, the API does not allow you to acknowledge or - // render the contents of this new window, so the new window is always destroyed - // immediately. The URL and other parameters of the new window are passed here - // to give your application the opportunity to call CreateBrowser and set up - // a new browser in response to the attempted popup, if you wish to do so. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 21)] - internal struct HTML_NewWindow_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 21; - public HHTMLBrowser unBrowserHandle; // the handle of the current surface - public string pchURL; // the page to load - public uint unX; // the x pos into the page to display the popup - public uint unY; // the y pos into the page to display the popup - public uint unWide; // the total width of the pBGRA texture - public uint unTall; // the total height of the pBGRA texture - public HHTMLBrowser unNewWindow_BrowserHandle_IGNORE; + public static implicit operator HTML_NewWindow_t_LargePack(HTML_NewWindow_t value) { + HTML_NewWindow_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchURL = value.pchURL; + result.unX = value.unX; + result.unY = value.unY; + result.unWide = value.unWide; + result.unTall = value.unTall; + result.unNewWindow_BrowserHandle_IGNORE = value.unNewWindow_BrowserHandle_IGNORE; + return result; + } } #endif @@ -2142,44 +1472,25 @@ internal struct HTML_NewWindow_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 22)] - public struct HTML_SetCursor_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 22; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public uint eMouseCursor; // the EHTMLMouseCursor to display - } - + public struct HTML_SetCursor_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: change the cursor to display - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 22)] - internal struct HTML_SetCursor_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 22; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public uint eMouseCursor; // the EHTMLMouseCursor to display - } - - - //----------------------------------------------------------------------------- - // Purpose: change the cursor to display - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 22)] - internal struct HTML_SetCursor_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 22; + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public uint eMouseCursor; // the EHTMLMouseCursor to display } - #endif //----------------------------------------------------------------------------- // Purpose: informational message from the browser //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 23)] - public struct HTML_StatusText_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 23; + public struct HTML_StatusText_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMsg; // the message text } @@ -2188,24 +1499,27 @@ public struct HTML_StatusText_t { //----------------------------------------------------------------------------- // Purpose: informational message from the browser //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 23)] internal struct HTML_StatusText_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 23; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 23; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMsg; // the message text - } + public static implicit operator HTML_StatusText_t(HTML_StatusText_t_LargePack value) { + HTML_StatusText_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchMsg = value.pchMsg; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: informational message from the browser - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 23)] - internal struct HTML_StatusText_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 23; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public string pchMsg; // the message text + public static implicit operator HTML_StatusText_t_LargePack(HTML_StatusText_t value) { + HTML_StatusText_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchMsg = value.pchMsg; + return result; + } } #endif @@ -2214,8 +1528,11 @@ internal struct HTML_StatusText_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 24)] - public struct HTML_ShowToolTip_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 24; + public struct HTML_ShowToolTip_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMsg; // the tooltip text } @@ -2224,24 +1541,27 @@ public struct HTML_ShowToolTip_t { //----------------------------------------------------------------------------- // Purpose: show a tooltip //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 24)] internal struct HTML_ShowToolTip_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 24; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 24; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMsg; // the tooltip text - } + public static implicit operator HTML_ShowToolTip_t(HTML_ShowToolTip_t_LargePack value) { + HTML_ShowToolTip_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchMsg = value.pchMsg; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: show a tooltip - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 24)] - internal struct HTML_ShowToolTip_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 24; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public string pchMsg; // the tooltip text + public static implicit operator HTML_ShowToolTip_t_LargePack(HTML_ShowToolTip_t value) { + HTML_ShowToolTip_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchMsg = value.pchMsg; + return result; + } } #endif @@ -2250,8 +1570,11 @@ internal struct HTML_ShowToolTip_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 25)] - public struct HTML_UpdateToolTip_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 25; + public struct HTML_UpdateToolTip_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMsg; // the new tooltip text } @@ -2260,24 +1583,27 @@ public struct HTML_UpdateToolTip_t { //----------------------------------------------------------------------------- // Purpose: update the text of an existing tooltip //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 25)] internal struct HTML_UpdateToolTip_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 25; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 25; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMsg; // the new tooltip text - } + public static implicit operator HTML_UpdateToolTip_t(HTML_UpdateToolTip_t_LargePack value) { + HTML_UpdateToolTip_t result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchMsg = value.pchMsg; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: update the text of an existing tooltip - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 25)] - internal struct HTML_UpdateToolTip_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 25; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - public string pchMsg; // the new tooltip text + public static implicit operator HTML_UpdateToolTip_t_LargePack(HTML_UpdateToolTip_t value) { + HTML_UpdateToolTip_t_LargePack result = default; + result.unBrowserHandle = value.unBrowserHandle; + result.pchMsg = value.pchMsg; + return result; + } } #endif @@ -2286,75 +1612,36 @@ internal struct HTML_UpdateToolTip_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 26)] - public struct HTML_HideToolTip_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 26; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - } - + public struct HTML_HideToolTip_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: hide the tooltip you are showing - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 26)] - internal struct HTML_HideToolTip_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 26; - public HHTMLBrowser unBrowserHandle; // the handle of the surface - } - - - //----------------------------------------------------------------------------- - // Purpose: hide the tooltip you are showing - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 26)] - internal struct HTML_HideToolTip_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 26; + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // the handle of the surface } - #endif //----------------------------------------------------------------------------- // Purpose: The browser has restarted due to an internal failure, use this new handle value //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 27)] - public struct HTML_BrowserRestarted_t { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 27; - public HHTMLBrowser unBrowserHandle; // this is the new browser handle after the restart - public HHTMLBrowser unOldBrowserHandle; // the handle for the browser before the restart, if your handle was this then switch to using unBrowserHandle for API calls - } - + public struct HTML_BrowserRestarted_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The browser has restarted due to an internal failure, use this new handle value - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 27)] - internal struct HTML_BrowserRestarted_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 27; - public HHTMLBrowser unBrowserHandle; // this is the new browser handle after the restart - public HHTMLBrowser unOldBrowserHandle; // the handle for the browser before the restart, if your handle was this then switch to using unBrowserHandle for API calls - } - - - //----------------------------------------------------------------------------- - // Purpose: The browser has restarted due to an internal failure, use this new handle value - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 27)] - internal struct HTML_BrowserRestarted_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 27; + : ICallbackIdentity + #endif + { public HHTMLBrowser unBrowserHandle; // this is the new browser handle after the restart public HHTMLBrowser unOldBrowserHandle; // the handle for the browser before the restart, if your handle was this then switch to using unBrowserHandle for API calls } - #endif // callbacks [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTTPCallbacks + 1)] - public struct HTTPRequestCompleted_t { - public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 1; + public struct HTTPRequestCompleted_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { // Handle value for the request that has completed. public HTTPRequestHandle m_hRequest; @@ -2377,10 +1664,11 @@ public struct HTTPRequestCompleted_t { #if STEAMWORKS_ANYCPU // callbacks - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTTPCallbacks + 1)] internal struct HTTPRequestCompleted_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTTPCallbacks + 1; // Handle value for the request that has completed. public HTTPRequestHandle m_hRequest; @@ -2399,39 +1687,36 @@ internal struct HTTPRequestCompleted_t_LargePack { public EHTTPStatusCode m_eStatusCode; public uint m_unBodySize; // Same as GetHTTPResponseBodySize() - } + public static implicit operator HTTPRequestCompleted_t(HTTPRequestCompleted_t_LargePack value) { + HTTPRequestCompleted_t result = default; + result.m_hRequest = value.m_hRequest; + result.m_ulContextValue = value.m_ulContextValue; + result.m_bRequestSuccessful = value.m_bRequestSuccessful; + result.m_eStatusCode = value.m_eStatusCode; + result.m_unBodySize = value.m_unBodySize; + return result; + } - // callbacks - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTTPCallbacks + 1)] - internal struct HTTPRequestCompleted_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 1; - - // Handle value for the request that has completed. - public HTTPRequestHandle m_hRequest; - - // Context value that the user defined on the request that this callback is associated with, 0 if - // no context value was set. - public ulong m_ulContextValue; - - // This will be true if we actually got any sort of response from the server (even an error). - // It will be false if we failed due to an internal error or client side network failure. - [MarshalAs(UnmanagedType.I1)] - public bool m_bRequestSuccessful; - - // Will be the HTTP status code value returned by the server, k_EHTTPStatusCode200OK is the normal - // OK response, if you get something else you probably need to treat it as a failure. - public EHTTPStatusCode m_eStatusCode; - - public uint m_unBodySize; // Same as GetHTTPResponseBodySize() + public static implicit operator HTTPRequestCompleted_t_LargePack(HTTPRequestCompleted_t value) { + HTTPRequestCompleted_t_LargePack result = default; + result.m_hRequest = value.m_hRequest; + result.m_ulContextValue = value.m_ulContextValue; + result.m_bRequestSuccessful = value.m_bRequestSuccessful; + result.m_eStatusCode = value.m_eStatusCode; + result.m_unBodySize = value.m_unBodySize; + return result; + } } #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTTPCallbacks + 2)] - public struct HTTPRequestHeadersReceived_t { - public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 2; + public struct HTTPRequestHeadersReceived_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { // Handle value for the request that has received headers. public HTTPRequestHandle m_hRequest; @@ -2442,10 +1727,11 @@ public struct HTTPRequestHeadersReceived_t { } #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTTPCallbacks + 2)] internal struct HTTPRequestHeadersReceived_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTTPCallbacks + 2; // Handle value for the request that has received headers. public HTTPRequestHandle m_hRequest; @@ -2453,27 +1739,30 @@ internal struct HTTPRequestHeadersReceived_t_LargePack { // Context value that the user defined on the request that this callback is associated with, 0 if // no context value was set. public ulong m_ulContextValue; - } + public static implicit operator HTTPRequestHeadersReceived_t(HTTPRequestHeadersReceived_t_LargePack value) { + HTTPRequestHeadersReceived_t result = default; + result.m_hRequest = value.m_hRequest; + result.m_ulContextValue = value.m_ulContextValue; + return result; + } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTTPCallbacks + 2)] - internal struct HTTPRequestHeadersReceived_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 2; - - // Handle value for the request that has received headers. - public HTTPRequestHandle m_hRequest; - - // Context value that the user defined on the request that this callback is associated with, 0 if - // no context value was set. - public ulong m_ulContextValue; + public static implicit operator HTTPRequestHeadersReceived_t_LargePack(HTTPRequestHeadersReceived_t value) { + HTTPRequestHeadersReceived_t_LargePack result = default; + result.m_hRequest = value.m_hRequest; + result.m_ulContextValue = value.m_ulContextValue; + return result; + } } #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTTPCallbacks + 3)] - public struct HTTPRequestDataReceived_t { - public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 3; + public struct HTTPRequestDataReceived_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { // Handle value for the request that has received data. public HTTPRequestHandle m_hRequest; @@ -2491,10 +1780,11 @@ public struct HTTPRequestDataReceived_t { } #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTTPCallbacks + 3)] internal struct HTTPRequestDataReceived_t_LargePack { public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTTPCallbacks + 3; // Handle value for the request that has received data. public HTTPRequestHandle m_hRequest; @@ -2509,27 +1799,24 @@ internal struct HTTPRequestDataReceived_t_LargePack { // Size to provide to GetHTTPStreamingResponseBodyData to get this chunk of data public uint m_cBytesReceived; - } + public static implicit operator HTTPRequestDataReceived_t(HTTPRequestDataReceived_t_LargePack value) { + HTTPRequestDataReceived_t result = default; + result.m_hRequest = value.m_hRequest; + result.m_ulContextValue = value.m_ulContextValue; + result.m_cOffset = value.m_cOffset; + result.m_cBytesReceived = value.m_cBytesReceived; + return result; + } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamHTTPCallbacks + 3)] - internal struct HTTPRequestDataReceived_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 3; - - // Handle value for the request that has received data. - public HTTPRequestHandle m_hRequest; - - // Context value that the user defined on the request that this callback is associated with, 0 if - // no context value was set. - public ulong m_ulContextValue; - - - // Offset to provide to GetHTTPStreamingResponseBodyData to get this chunk of data - public uint m_cOffset; - - // Size to provide to GetHTTPStreamingResponseBodyData to get this chunk of data - public uint m_cBytesReceived; + public static implicit operator HTTPRequestDataReceived_t_LargePack(HTTPRequestDataReceived_t value) { + HTTPRequestDataReceived_t_LargePack result = default; + result.m_hRequest = value.m_hRequest; + result.m_ulContextValue = value.m_ulContextValue; + result.m_cOffset = value.m_cOffset; + result.m_cBytesReceived = value.m_cBytesReceived; + return result; + } } #endif @@ -2539,80 +1826,39 @@ internal struct HTTPRequestDataReceived_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 1)] - public struct SteamInputDeviceConnected_t { - public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 1; - public InputHandle_t m_ulConnectedDeviceHandle; // Handle for device - } - + public struct SteamInputDeviceConnected_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: called when a new controller has been connected, will fire once - // per controller if multiple new controllers connect in the same frame - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 1)] - internal struct SteamInputDeviceConnected_t_LargePack { - public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 1; - public InputHandle_t m_ulConnectedDeviceHandle; // Handle for device - } - - - //----------------------------------------------------------------------------- - // Purpose: called when a new controller has been connected, will fire once - // per controller if multiple new controllers connect in the same frame - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 1)] - internal struct SteamInputDeviceConnected_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 1; + : ICallbackIdentity + #endif + { public InputHandle_t m_ulConnectedDeviceHandle; // Handle for device } - #endif //----------------------------------------------------------------------------- // Purpose: called when a new controller has been connected, will fire once // per controller if multiple new controllers connect in the same frame //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 2)] - public struct SteamInputDeviceDisconnected_t { - public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 2; - public InputHandle_t m_ulDisconnectedDeviceHandle; // Handle for device - } - + public struct SteamInputDeviceDisconnected_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: called when a new controller has been connected, will fire once - // per controller if multiple new controllers connect in the same frame - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 2)] - internal struct SteamInputDeviceDisconnected_t_LargePack { - public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 2; - public InputHandle_t m_ulDisconnectedDeviceHandle; // Handle for device - } - - - //----------------------------------------------------------------------------- - // Purpose: called when a new controller has been connected, will fire once - // per controller if multiple new controllers connect in the same frame - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 2)] - internal struct SteamInputDeviceDisconnected_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 2; + : ICallbackIdentity + #endif + { public InputHandle_t m_ulDisconnectedDeviceHandle; // Handle for device } - #endif //----------------------------------------------------------------------------- // Purpose: called when a controller configuration has been loaded, will fire once // per controller per focus change for Steam Input enabled controllers //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 3)] - public struct SteamInputConfigurationLoaded_t { - public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 3; + public struct SteamInputConfigurationLoaded_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public AppId_t m_unAppID; public InputHandle_t m_ulDeviceHandle; // Handle for device public CSteamID m_ulMappingCreator; // May differ from local user when using @@ -2631,10 +1877,11 @@ public struct SteamInputConfigurationLoaded_t { // Purpose: called when a controller configuration has been loaded, will fire once // per controller per focus change for Steam Input enabled controllers //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 3)] internal struct SteamInputConfigurationLoaded_t_LargePack { public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamControllerCallbacks + 3; public AppId_t m_unAppID; public InputHandle_t m_ulDeviceHandle; // Handle for device public CSteamID m_ulMappingCreator; // May differ from local user when using @@ -2646,28 +1893,30 @@ internal struct SteamInputConfigurationLoaded_t_LargePack { public bool m_bUsesSteamInputAPI; // Does the configuration contain any Analog/Digital actions? [MarshalAs(UnmanagedType.I1)] public bool m_bUsesGamepadAPI; // Does the configuration contain any Xinput bindings? - } + public static implicit operator SteamInputConfigurationLoaded_t(SteamInputConfigurationLoaded_t_LargePack value) { + SteamInputConfigurationLoaded_t result = default; + result.m_unAppID = value.m_unAppID; + result.m_ulDeviceHandle = value.m_ulDeviceHandle; + result.m_ulMappingCreator = value.m_ulMappingCreator; + result.m_unMajorRevision = value.m_unMajorRevision; + result.m_unMinorRevision = value.m_unMinorRevision; + result.m_bUsesSteamInputAPI = value.m_bUsesSteamInputAPI; + result.m_bUsesGamepadAPI = value.m_bUsesGamepadAPI; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: called when a controller configuration has been loaded, will fire once - // per controller per focus change for Steam Input enabled controllers - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 3)] - internal struct SteamInputConfigurationLoaded_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 3; - public AppId_t m_unAppID; - public InputHandle_t m_ulDeviceHandle; // Handle for device - public CSteamID m_ulMappingCreator; // May differ from local user when using - // an unmodified community or official config - public uint m_unMajorRevision; // Binding revision from In-game Action File. - // Same value as queried by GetDeviceBindingRevision - public uint m_unMinorRevision; - [MarshalAs(UnmanagedType.I1)] - public bool m_bUsesSteamInputAPI; // Does the configuration contain any Analog/Digital actions? - [MarshalAs(UnmanagedType.I1)] - public bool m_bUsesGamepadAPI; // Does the configuration contain any Xinput bindings? + public static implicit operator SteamInputConfigurationLoaded_t_LargePack(SteamInputConfigurationLoaded_t value) { + SteamInputConfigurationLoaded_t_LargePack result = default; + result.m_unAppID = value.m_unAppID; + result.m_ulDeviceHandle = value.m_ulDeviceHandle; + result.m_ulMappingCreator = value.m_ulMappingCreator; + result.m_unMajorRevision = value.m_unMajorRevision; + result.m_unMinorRevision = value.m_unMinorRevision; + result.m_bUsesSteamInputAPI = value.m_bUsesSteamInputAPI; + result.m_bUsesGamepadAPI = value.m_bUsesGamepadAPI; + return result; + } } #endif @@ -2677,8 +1926,11 @@ internal struct SteamInputConfigurationLoaded_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 4)] - public struct SteamInputGamepadSlotChange_t { - public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 4; + public struct SteamInputGamepadSlotChange_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public AppId_t m_unAppID; public InputHandle_t m_ulDeviceHandle; // Handle for device public ESteamInputType m_eDeviceType; // Type of device @@ -2691,31 +1943,36 @@ public struct SteamInputGamepadSlotChange_t { // Purpose: called when controller gamepad slots change - on Linux/macOS these // slots are shared for all running apps. //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 4)] internal struct SteamInputGamepadSlotChange_t_LargePack { public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamControllerCallbacks + 4; public AppId_t m_unAppID; public InputHandle_t m_ulDeviceHandle; // Handle for device public ESteamInputType m_eDeviceType; // Type of device public int m_nOldGamepadSlot; // Previous GamepadSlot - can be -1 controller doesn't uses gamepad bindings public int m_nNewGamepadSlot; // New Gamepad Slot - can be -1 controller doesn't uses gamepad bindings - } + public static implicit operator SteamInputGamepadSlotChange_t(SteamInputGamepadSlotChange_t_LargePack value) { + SteamInputGamepadSlotChange_t result = default; + result.m_unAppID = value.m_unAppID; + result.m_ulDeviceHandle = value.m_ulDeviceHandle; + result.m_eDeviceType = value.m_eDeviceType; + result.m_nOldGamepadSlot = value.m_nOldGamepadSlot; + result.m_nNewGamepadSlot = value.m_nNewGamepadSlot; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: called when controller gamepad slots change - on Linux/macOS these - // slots are shared for all running apps. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 4)] - internal struct SteamInputGamepadSlotChange_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 4; - public AppId_t m_unAppID; - public InputHandle_t m_ulDeviceHandle; // Handle for device - public ESteamInputType m_eDeviceType; // Type of device - public int m_nOldGamepadSlot; // Previous GamepadSlot - can be -1 controller doesn't uses gamepad bindings - public int m_nNewGamepadSlot; // New Gamepad Slot - can be -1 controller doesn't uses gamepad bindings + public static implicit operator SteamInputGamepadSlotChange_t_LargePack(SteamInputGamepadSlotChange_t value) { + SteamInputGamepadSlotChange_t_LargePack result = default; + result.m_unAppID = value.m_unAppID; + result.m_ulDeviceHandle = value.m_ulDeviceHandle; + result.m_eDeviceType = value.m_eDeviceType; + result.m_nOldGamepadSlot = value.m_nOldGamepadSlot; + result.m_nNewGamepadSlot = value.m_nNewGamepadSlot; + return result; + } } #endif @@ -2724,37 +1981,15 @@ internal struct SteamInputGamepadSlotChange_t_SmallPack { // always be exactly one callback per handle. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 0)] - public struct SteamInventoryResultReady_t { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 0; - public SteamInventoryResult_t m_handle; - public EResult m_result; - } - + public struct SteamInventoryResultReady_t #if STEAMWORKS_ANYCPU - // SteamInventoryResultReady_t callbacks are fired whenever asynchronous - // results transition from "Pending" to "OK" or an error state. There will - // always be exactly one callback per handle. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 0)] - internal struct SteamInventoryResultReady_t_LargePack { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 0; - public SteamInventoryResult_t m_handle; - public EResult m_result; - } - - - // SteamInventoryResultReady_t callbacks are fired whenever asynchronous - // results transition from "Pending" to "OK" or an error state. There will - // always be exactly one callback per handle. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 0)] - internal struct SteamInventoryResultReady_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 0; + : ICallbackIdentity + #endif + { public SteamInventoryResult_t m_handle; public EResult m_result; } - #endif // SteamInventoryFullUpdate_t callbacks are triggered when GetAllItems // successfully returns a result which is newer / fresher than the last // known result. (It will not trigger if the inventory hasn't changed, @@ -2764,80 +1999,35 @@ internal struct SteamInventoryResultReady_t_SmallPack { // afterwards; this is an additional notification for your convenience. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 1)] - public struct SteamInventoryFullUpdate_t { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 1; - public SteamInventoryResult_t m_handle; - } - + public struct SteamInventoryFullUpdate_t #if STEAMWORKS_ANYCPU - // SteamInventoryFullUpdate_t callbacks are triggered when GetAllItems - // successfully returns a result which is newer / fresher than the last - // known result. (It will not trigger if the inventory hasn't changed, - // or if results from two overlapping calls are reversed in flight and - // the earlier result is already known to be stale/out-of-date.) - // The normal ResultReady callback will still be triggered immediately - // afterwards; this is an additional notification for your convenience. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 1)] - internal struct SteamInventoryFullUpdate_t_LargePack { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 1; - public SteamInventoryResult_t m_handle; - } - - - // SteamInventoryFullUpdate_t callbacks are triggered when GetAllItems - // successfully returns a result which is newer / fresher than the last - // known result. (It will not trigger if the inventory hasn't changed, - // or if results from two overlapping calls are reversed in flight and - // the earlier result is already known to be stale/out-of-date.) - // The normal ResultReady callback will still be triggered immediately - // afterwards; this is an additional notification for your convenience. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 1)] - internal struct SteamInventoryFullUpdate_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 1; + : ICallbackIdentity + #endif + { public SteamInventoryResult_t m_handle; } - #endif // A SteamInventoryDefinitionUpdate_t callback is triggered whenever // item definitions have been updated, which could be in response to // LoadItemDefinitions() or any other async request which required // a definition update in order to process results from the server. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 2)] - public struct SteamInventoryDefinitionUpdate_t { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 2; - } - + public struct SteamInventoryDefinitionUpdate_t #if STEAMWORKS_ANYCPU - // A SteamInventoryDefinitionUpdate_t callback is triggered whenever - // item definitions have been updated, which could be in response to - // LoadItemDefinitions() or any other async request which required - // a definition update in order to process results from the server. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 2)] - internal struct SteamInventoryDefinitionUpdate_t_LargePack { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 2; - } - - - // A SteamInventoryDefinitionUpdate_t callback is triggered whenever - // item definitions have been updated, which could be in response to - // LoadItemDefinitions() or any other async request which required - // a definition update in order to process results from the server. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 2)] - internal struct SteamInventoryDefinitionUpdate_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 2; + : ICallbackIdentity + #endif + { } - #endif // Returned [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 3)] - public struct SteamInventoryEligiblePromoItemDefIDs_t { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 3; + public struct SteamInventoryEligiblePromoItemDefIDs_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_result; public CSteamID m_steamID; public int m_numEligiblePromoItemDefs; @@ -2847,36 +2037,45 @@ public struct SteamInventoryEligiblePromoItemDefIDs_t { #if STEAMWORKS_ANYCPU // Returned - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 3)] internal struct SteamInventoryEligiblePromoItemDefIDs_t_LargePack { public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamInventoryCallbacks + 3; public EResult m_result; public CSteamID m_steamID; public int m_numEligiblePromoItemDefs; [MarshalAs(UnmanagedType.I1)] public bool m_bCachedData; // indicates that the data was retrieved from the cache and not the server - } + public static implicit operator SteamInventoryEligiblePromoItemDefIDs_t(SteamInventoryEligiblePromoItemDefIDs_t_LargePack value) { + SteamInventoryEligiblePromoItemDefIDs_t result = default; + result.m_result = value.m_result; + result.m_steamID = value.m_steamID; + result.m_numEligiblePromoItemDefs = value.m_numEligiblePromoItemDefs; + result.m_bCachedData = value.m_bCachedData; + return result; + } - // Returned - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 3)] - internal struct SteamInventoryEligiblePromoItemDefIDs_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 3; - public EResult m_result; - public CSteamID m_steamID; - public int m_numEligiblePromoItemDefs; - [MarshalAs(UnmanagedType.I1)] - public bool m_bCachedData; // indicates that the data was retrieved from the cache and not the server + public static implicit operator SteamInventoryEligiblePromoItemDefIDs_t_LargePack(SteamInventoryEligiblePromoItemDefIDs_t value) { + SteamInventoryEligiblePromoItemDefIDs_t_LargePack result = default; + result.m_result = value.m_result; + result.m_steamID = value.m_steamID; + result.m_numEligiblePromoItemDefs = value.m_numEligiblePromoItemDefs; + result.m_bCachedData = value.m_bCachedData; + return result; + } } #endif // Triggered from StartPurchase call [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 4)] - public struct SteamInventoryStartPurchaseResult_t { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 4; + public struct SteamInventoryStartPurchaseResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_result; public ulong m_ulOrderID; public ulong m_ulTransID; @@ -2884,75 +2083,45 @@ public struct SteamInventoryStartPurchaseResult_t { #if STEAMWORKS_ANYCPU // Triggered from StartPurchase call - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 4)] internal struct SteamInventoryStartPurchaseResult_t_LargePack { public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamInventoryCallbacks + 4; public EResult m_result; public ulong m_ulOrderID; public ulong m_ulTransID; - } - - - // Triggered from StartPurchase call - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 4)] - internal struct SteamInventoryStartPurchaseResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 4; - public EResult m_result; - public ulong m_ulOrderID; - public ulong m_ulTransID; - } - #endif - // Triggered from RequestPrices - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 5)] - public struct SteamInventoryRequestPricesResult_t { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 5; - public EResult m_result; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - internal byte[] m_rgchCurrency_; - public string m_rgchCurrency - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchCurrency_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchCurrency_, 4); } + public static implicit operator SteamInventoryStartPurchaseResult_t(SteamInventoryStartPurchaseResult_t_LargePack value) { + SteamInventoryStartPurchaseResult_t result = default; + result.m_result = value.m_result; + result.m_ulOrderID = value.m_ulOrderID; + result.m_ulTransID = value.m_ulTransID; + return result; } - } - #if STEAMWORKS_ANYCPU - // Triggered from RequestPrices - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 5)] - internal struct SteamInventoryRequestPricesResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 5; - public EResult m_result; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - internal byte[] m_rgchCurrency_; - public string m_rgchCurrency - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchCurrency_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchCurrency_, 4); } + public static implicit operator SteamInventoryStartPurchaseResult_t_LargePack(SteamInventoryStartPurchaseResult_t value) { + SteamInventoryStartPurchaseResult_t_LargePack result = default; + result.m_result = value.m_result; + result.m_ulOrderID = value.m_ulOrderID; + result.m_ulTransID = value.m_ulTransID; + return result; } } - + #endif // Triggered from RequestPrices [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 5)] - internal struct SteamInventoryRequestPricesResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 5; + public struct SteamInventoryRequestPricesResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_result; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - internal byte[] m_rgchCurrency_; - public string m_rgchCurrency - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchCurrency_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchCurrency_, 4); } - } + public string m_rgchCurrency; } - #endif //----------------------------------------------------------------------------- // Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system) //----------------------------------------------------------------------------- @@ -2960,48 +2129,11 @@ public string m_rgchCurrency //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 2)] - public struct FavoritesListChanged_t { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 2; - public uint m_nIP; // an IP of 0 means reload the whole list, any other value means just one server - public uint m_nQueryPort; - public uint m_nConnPort; - public uint m_nAppID; - public uint m_nFlags; - [MarshalAs(UnmanagedType.I1)] - public bool m_bAdd; // true if this is adding the entry, otherwise it is a remove - public AccountID_t m_unAccountId; - } - + public struct FavoritesListChanged_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system) - //----------------------------------------------------------------------------- - // Purpose: a server was added/removed from the favorites list, you should refresh now - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 2)] - internal struct FavoritesListChanged_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 2; - public uint m_nIP; // an IP of 0 means reload the whole list, any other value means just one server - public uint m_nQueryPort; - public uint m_nConnPort; - public uint m_nAppID; - public uint m_nFlags; - [MarshalAs(UnmanagedType.I1)] - public bool m_bAdd; // true if this is adding the entry, otherwise it is a remove - public AccountID_t m_unAccountId; - } - - - //----------------------------------------------------------------------------- - // Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system) - //----------------------------------------------------------------------------- - // Purpose: a server was added/removed from the favorites list, you should refresh now - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 2)] - internal struct FavoritesListChanged_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 2; + : ICallbackIdentity + #endif + { public uint m_nIP; // an IP of 0 means reload the whole list, any other value means just one server public uint m_nQueryPort; public uint m_nConnPort; @@ -3012,7 +2144,6 @@ internal struct FavoritesListChanged_t_SmallPack { public AccountID_t m_unAccountId; } - #endif //----------------------------------------------------------------------------- // Purpose: Someone has invited you to join a Lobby // normally you don't need to do anything with this, since @@ -3023,53 +2154,17 @@ internal struct FavoritesListChanged_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 3)] - public struct LobbyInvite_t { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 3; - - public ulong m_ulSteamIDUser; // Steam ID of the person making the invite - public ulong m_ulSteamIDLobby; // Steam ID of the Lobby - public ulong m_ulGameID; // GameID of the Lobby - } - + public struct LobbyInvite_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Someone has invited you to join a Lobby - // normally you don't need to do anything with this, since - // the Steam UI will also display a ' has invited you to the lobby, join?' dialog - // - // if the user outside a game chooses to join, your game will be launched with the parameter "+connect_lobby <64-bit lobby id>", - // or with the callback GameLobbyJoinRequested_t if they're already in-game - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 3)] - internal struct LobbyInvite_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 3; - - public ulong m_ulSteamIDUser; // Steam ID of the person making the invite - public ulong m_ulSteamIDLobby; // Steam ID of the Lobby - public ulong m_ulGameID; // GameID of the Lobby - } - - - //----------------------------------------------------------------------------- - // Purpose: Someone has invited you to join a Lobby - // normally you don't need to do anything with this, since - // the Steam UI will also display a ' has invited you to the lobby, join?' dialog - // - // if the user outside a game chooses to join, your game will be launched with the parameter "+connect_lobby <64-bit lobby id>", - // or with the callback GameLobbyJoinRequested_t if they're already in-game - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 3)] - internal struct LobbyInvite_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 3; + : ICallbackIdentity + #endif + { public ulong m_ulSteamIDUser; // Steam ID of the person making the invite public ulong m_ulSteamIDLobby; // Steam ID of the Lobby public ulong m_ulGameID; // GameID of the Lobby } - #endif //----------------------------------------------------------------------------- // Purpose: Sent on entering a lobby, or on failing to enter // m_EChatRoomEnterResponse will be set to k_EChatRoomEnterResponseSuccess on success, @@ -3077,8 +2172,11 @@ internal struct LobbyInvite_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 4)] - public struct LobbyEnter_t { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 4; + public struct LobbyEnter_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public ulong m_ulSteamIDLobby; // SteamID of the Lobby you have entered public uint m_rgfChatPermissions; // Permissions of the current user @@ -3087,136 +2185,36 @@ public struct LobbyEnter_t { public uint m_EChatRoomEnterResponse; // EChatRoomEnterResponse } - #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- - // Purpose: Sent on entering a lobby, or on failing to enter - // m_EChatRoomEnterResponse will be set to k_EChatRoomEnterResponseSuccess on success, - // or a higher value on failure (see enum EChatRoomEnterResponse) + // Purpose: The lobby metadata has changed + // if m_ulSteamIDMember is the steamID of a lobby member, use GetLobbyMemberData() to access per-user details + // if m_ulSteamIDMember == m_ulSteamIDLobby, use GetLobbyData() to access lobby metadata //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 4)] - internal struct LobbyEnter_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 4; + [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 5)] + public struct LobbyDataUpdate_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { - public ulong m_ulSteamIDLobby; // SteamID of the Lobby you have entered - public uint m_rgfChatPermissions; // Permissions of the current user - [MarshalAs(UnmanagedType.I1)] - public bool m_bLocked; // If true, then only invited users may join - public uint m_EChatRoomEnterResponse; // EChatRoomEnterResponse + public ulong m_ulSteamIDLobby; // steamID of the Lobby + public ulong m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself + public byte m_bSuccess; // true if we lobby data was successfully changed; + // will only be false if RequestLobbyData() was called on a lobby that no longer exists } - //----------------------------------------------------------------------------- - // Purpose: Sent on entering a lobby, or on failing to enter - // m_EChatRoomEnterResponse will be set to k_EChatRoomEnterResponseSuccess on success, - // or a higher value on failure (see enum EChatRoomEnterResponse) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 4)] - internal struct LobbyEnter_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 4; - - public ulong m_ulSteamIDLobby; // SteamID of the Lobby you have entered - public uint m_rgfChatPermissions; // Permissions of the current user - [MarshalAs(UnmanagedType.I1)] - public bool m_bLocked; // If true, then only invited users may join - public uint m_EChatRoomEnterResponse; // EChatRoomEnterResponse - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: The lobby metadata has changed - // if m_ulSteamIDMember is the steamID of a lobby member, use GetLobbyMemberData() to access per-user details - // if m_ulSteamIDMember == m_ulSteamIDLobby, use GetLobbyData() to access lobby metadata - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 5)] - public struct LobbyDataUpdate_t { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 5; - - public ulong m_ulSteamIDLobby; // steamID of the Lobby - public ulong m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself - public byte m_bSuccess; // true if we lobby data was successfully changed; - // will only be false if RequestLobbyData() was called on a lobby that no longer exists - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The lobby metadata has changed - // if m_ulSteamIDMember is the steamID of a lobby member, use GetLobbyMemberData() to access per-user details - // if m_ulSteamIDMember == m_ulSteamIDLobby, use GetLobbyData() to access lobby metadata - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 5)] - internal struct LobbyDataUpdate_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 5; - - public ulong m_ulSteamIDLobby; // steamID of the Lobby - public ulong m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself - public byte m_bSuccess; // true if we lobby data was successfully changed; - // will only be false if RequestLobbyData() was called on a lobby that no longer exists - } - - - //----------------------------------------------------------------------------- - // Purpose: The lobby metadata has changed - // if m_ulSteamIDMember is the steamID of a lobby member, use GetLobbyMemberData() to access per-user details - // if m_ulSteamIDMember == m_ulSteamIDLobby, use GetLobbyData() to access lobby metadata - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 5)] - internal struct LobbyDataUpdate_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 5; - - public ulong m_ulSteamIDLobby; // steamID of the Lobby - public ulong m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself - public byte m_bSuccess; // true if we lobby data was successfully changed; - // will only be false if RequestLobbyData() was called on a lobby that no longer exists - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: The lobby chat room state has changed - // this is usually sent when a user has joined or left the lobby + // Purpose: The lobby chat room state has changed + // this is usually sent when a user has joined or left the lobby //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 6)] - public struct LobbyChatUpdate_t { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 6; - - public ulong m_ulSteamIDLobby; // Lobby ID - public ulong m_ulSteamIDUserChanged; // user who's status in the lobby just changed - can be recipient - public ulong m_ulSteamIDMakingChange; // Chat member who made the change (different from SteamIDUserChange if kicking, muting, etc.) - // for example, if one user kicks another from the lobby, this will be set to the id of the user who initiated the kick - public uint m_rgfChatMemberStateChange; // bitfield of EChatMemberStateChange values - } - + public struct LobbyChatUpdate_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The lobby chat room state has changed - // this is usually sent when a user has joined or left the lobby - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 6)] - internal struct LobbyChatUpdate_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 6; - - public ulong m_ulSteamIDLobby; // Lobby ID - public ulong m_ulSteamIDUserChanged; // user who's status in the lobby just changed - can be recipient - public ulong m_ulSteamIDMakingChange; // Chat member who made the change (different from SteamIDUserChange if kicking, muting, etc.) - // for example, if one user kicks another from the lobby, this will be set to the id of the user who initiated the kick - public uint m_rgfChatMemberStateChange; // bitfield of EChatMemberStateChange values - } - - - //----------------------------------------------------------------------------- - // Purpose: The lobby chat room state has changed - // this is usually sent when a user has joined or left the lobby - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 6)] - internal struct LobbyChatUpdate_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 6; + : ICallbackIdentity + #endif + { public ulong m_ulSteamIDLobby; // Lobby ID public ulong m_ulSteamIDUserChanged; // user who's status in the lobby just changed - can be recipient @@ -3225,47 +2223,17 @@ internal struct LobbyChatUpdate_t_SmallPack { public uint m_rgfChatMemberStateChange; // bitfield of EChatMemberStateChange values } - #endif //----------------------------------------------------------------------------- // Purpose: A chat message for this lobby has been sent // use GetLobbyChatEntry( m_iChatID ) to retrieve the contents of this message //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 7)] - public struct LobbyChatMsg_t { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 7; - - public ulong m_ulSteamIDLobby; // the lobby id this is in - public ulong m_ulSteamIDUser; // steamID of the user who has sent this message - public byte m_eChatEntryType; // type of message - public uint m_iChatID; // index of the chat entry to lookup - } - + public struct LobbyChatMsg_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: A chat message for this lobby has been sent - // use GetLobbyChatEntry( m_iChatID ) to retrieve the contents of this message - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 7)] - internal struct LobbyChatMsg_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 7; - - public ulong m_ulSteamIDLobby; // the lobby id this is in - public ulong m_ulSteamIDUser; // steamID of the user who has sent this message - public byte m_eChatEntryType; // type of message - public uint m_iChatID; // index of the chat entry to lookup - } - - - //----------------------------------------------------------------------------- - // Purpose: A chat message for this lobby has been sent - // use GetLobbyChatEntry( m_iChatID ) to retrieve the contents of this message - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 7)] - internal struct LobbyChatMsg_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 7; + : ICallbackIdentity + #endif + { public ulong m_ulSteamIDLobby; // the lobby id this is in public ulong m_ulSteamIDUser; // steamID of the user who has sent this message @@ -3273,7 +2241,6 @@ internal struct LobbyChatMsg_t_SmallPack { public uint m_iChatID; // index of the chat entry to lookup } - #endif //----------------------------------------------------------------------------- // Purpose: A game created a game for all the members of the lobby to join, // as triggered by a SetLobbyGameServer() @@ -3282,44 +2249,11 @@ internal struct LobbyChatMsg_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 9)] - public struct LobbyGameCreated_t { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 9; - - public ulong m_ulSteamIDLobby; // the lobby we were in - public ulong m_ulSteamIDGameServer; // the new game server that has been created or found for the lobby members - public uint m_unIP; // IP & Port of the game server (if any) - public ushort m_usPort; - } - + public struct LobbyGameCreated_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: A game created a game for all the members of the lobby to join, - // as triggered by a SetLobbyGameServer() - // it's up to the individual clients to take action on this; the usual - // game behavior is to leave the lobby and connect to the specified game server - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 9)] - internal struct LobbyGameCreated_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 9; - - public ulong m_ulSteamIDLobby; // the lobby we were in - public ulong m_ulSteamIDGameServer; // the new game server that has been created or found for the lobby members - public uint m_unIP; // IP & Port of the game server (if any) - public ushort m_usPort; - } - - - //----------------------------------------------------------------------------- - // Purpose: A game created a game for all the members of the lobby to join, - // as triggered by a SetLobbyGameServer() - // it's up to the individual clients to take action on this; the usual - // game behavior is to leave the lobby and connect to the specified game server - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 9)] - internal struct LobbyGameCreated_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 9; + : ICallbackIdentity + #endif + { public ulong m_ulSteamIDLobby; // the lobby we were in public ulong m_ulSteamIDGameServer; // the new game server that has been created or found for the lobby members @@ -3327,85 +2261,36 @@ internal struct LobbyGameCreated_t_SmallPack { public ushort m_usPort; } - #endif //----------------------------------------------------------------------------- // Purpose: Number of matching lobbies found // iterate the returned lobbies with GetLobbyByIndex(), from values 0 to m_nLobbiesMatching-1 //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 10)] - public struct LobbyMatchList_t { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 10; - public uint m_nLobbiesMatching; // Number of lobbies that matched search criteria and we have SteamIDs for - } - + public struct LobbyMatchList_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Number of matching lobbies found - // iterate the returned lobbies with GetLobbyByIndex(), from values 0 to m_nLobbiesMatching-1 - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 10)] - internal struct LobbyMatchList_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 10; - public uint m_nLobbiesMatching; // Number of lobbies that matched search criteria and we have SteamIDs for - } - - - //----------------------------------------------------------------------------- - // Purpose: Number of matching lobbies found - // iterate the returned lobbies with GetLobbyByIndex(), from values 0 to m_nLobbiesMatching-1 - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 10)] - internal struct LobbyMatchList_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 10; + : ICallbackIdentity + #endif + { public uint m_nLobbiesMatching; // Number of lobbies that matched search criteria and we have SteamIDs for } - #endif //----------------------------------------------------------------------------- // Purpose: posted if a user is forcefully removed from a lobby // can occur if a user loses connection to Steam //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 12)] - public struct LobbyKicked_t { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 12; - public ulong m_ulSteamIDLobby; // Lobby - public ulong m_ulSteamIDAdmin; // User who kicked you - possibly the ID of the lobby itself - public byte m_bKickedDueToDisconnect; // true if you were kicked from the lobby due to the user losing connection to Steam (currently always true) - } - + public struct LobbyKicked_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: posted if a user is forcefully removed from a lobby - // can occur if a user loses connection to Steam - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 12)] - internal struct LobbyKicked_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 12; - public ulong m_ulSteamIDLobby; // Lobby - public ulong m_ulSteamIDAdmin; // User who kicked you - possibly the ID of the lobby itself - public byte m_bKickedDueToDisconnect; // true if you were kicked from the lobby due to the user losing connection to Steam (currently always true) - } - - - //----------------------------------------------------------------------------- - // Purpose: posted if a user is forcefully removed from a lobby - // can occur if a user loses connection to Steam - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 12)] - internal struct LobbyKicked_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 12; + : ICallbackIdentity + #endif + { public ulong m_ulSteamIDLobby; // Lobby public ulong m_ulSteamIDAdmin; // User who kicked you - possibly the ID of the lobby itself public byte m_bKickedDueToDisconnect; // true if you were kicked from the lobby due to the user losing connection to Steam (currently always true) } - #endif //----------------------------------------------------------------------------- // Purpose: Result of our request to create a Lobby // m_eResult == k_EResultOK on success @@ -3414,8 +2299,11 @@ internal struct LobbyKicked_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 13)] - public struct LobbyCreated_t { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 13; + public struct LobbyCreated_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; // k_EResultOK - the lobby was successfully created // k_EResultNoConnection - your Steam client doesn't have a connection to the back-end @@ -3434,10 +2322,11 @@ public struct LobbyCreated_t { // at this point, the lobby has been joined and is ready for use // a LobbyEnter_t callback will also be received (since the local user is joining their own lobby) //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 13)] internal struct LobbyCreated_t_LargePack { public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 13; + public static int CallbackIdentity { get; } = Constants.k_iSteamMatchmakingCallbacks + 13; public EResult m_eResult; // k_EResultOK - the lobby was successfully created // k_EResultNoConnection - your Steam client doesn't have a connection to the back-end @@ -3447,28 +2336,20 @@ internal struct LobbyCreated_t_LargePack { // k_EResultLimitExceeded - your game client has created too many lobbies public ulong m_ulSteamIDLobby; // chat room, zero if failed - } + public static implicit operator LobbyCreated_t(LobbyCreated_t_LargePack value) { + LobbyCreated_t result = default; + result.m_eResult = value.m_eResult; + result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: Result of our request to create a Lobby - // m_eResult == k_EResultOK on success - // at this point, the lobby has been joined and is ready for use - // a LobbyEnter_t callback will also be received (since the local user is joining their own lobby) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 13)] - internal struct LobbyCreated_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 13; - - public EResult m_eResult; // k_EResultOK - the lobby was successfully created - // k_EResultNoConnection - your Steam client doesn't have a connection to the back-end - // k_EResultTimeout - you the message to the Steam servers, but it didn't respond - // k_EResultFail - the server responded, but with an unknown internal error - // k_EResultAccessDenied - your game isn't set to allow lobbies, or your client does haven't rights to play the game - // k_EResultLimitExceeded - your game client has created too many lobbies - - public ulong m_ulSteamIDLobby; // chat room, zero if failed + public static implicit operator LobbyCreated_t_LargePack(LobbyCreated_t value) { + LobbyCreated_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_ulSteamIDLobby = value.m_ulSteamIDLobby; + return result; + } } #endif @@ -3484,75 +2365,43 @@ internal struct LobbyCreated_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 16)] - public struct FavoritesListAccountsUpdated_t { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 16; + public struct FavoritesListAccountsUpdated_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; } - #if STEAMWORKS_ANYCPU - // used by now obsolete RequestFriendsLobbiesResponse_t - // enum { k_iCallback = k_iSteamMatchmakingCallbacks + 14 }; - // used by now obsolete PSNGameBootInviteResult_t - // enum { k_iCallback = k_iSteamMatchmakingCallbacks + 15 }; - //----------------------------------------------------------------------------- - // Purpose: Result of our request to create a Lobby - // m_eResult == k_EResultOK on success - // at this point, the lobby has been joined and is ready for use - // a LobbyEnter_t callback will also be received (since the local user is joining their own lobby) //----------------------------------------------------------------------------- + // Callbacks for ISteamGameSearch (which go through the regular Steam callback registration system) [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 16)] - internal struct FavoritesListAccountsUpdated_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 16; + [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 1)] + public struct SearchForGameProgressCallback_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { - public EResult m_eResult; + public ulong m_ullSearchID; // all future callbacks referencing this search will include this Search ID + + public EResult m_eResult; // if search has started this result will be k_EResultOK, any other value indicates search has failed to start or has terminated + public CSteamID m_lobbyID; // lobby ID if lobby search, invalid steamID otherwise + public CSteamID m_steamIDEndedSearch; // if search was terminated, steamID that terminated search + + public int m_nSecondsRemainingEstimate; + public int m_cPlayersSearching; } - - // used by now obsolete RequestFriendsLobbiesResponse_t - // enum { k_iCallback = k_iSteamMatchmakingCallbacks + 14 }; - // used by now obsolete PSNGameBootInviteResult_t - // enum { k_iCallback = k_iSteamMatchmakingCallbacks + 15 }; - //----------------------------------------------------------------------------- - // Purpose: Result of our request to create a Lobby - // m_eResult == k_EResultOK on success - // at this point, the lobby has been joined and is ready for use - // a LobbyEnter_t callback will also be received (since the local user is joining their own lobby) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 16)] - internal struct FavoritesListAccountsUpdated_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 16; - - public EResult m_eResult; - } - - #endif - //----------------------------------------------------------------------------- - // Callbacks for ISteamGameSearch (which go through the regular Steam callback registration system) - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 1)] - public struct SearchForGameProgressCallback_t { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 1; - - public ulong m_ullSearchID; // all future callbacks referencing this search will include this Search ID - - public EResult m_eResult; // if search has started this result will be k_EResultOK, any other value indicates search has failed to start or has terminated - public CSteamID m_lobbyID; // lobby ID if lobby search, invalid steamID otherwise - public CSteamID m_steamIDEndedSearch; // if search was terminated, steamID that terminated search - - public int m_nSecondsRemainingEstimate; - public int m_cPlayersSearching; - } - - #if STEAMWORKS_ANYCPU + #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- // Callbacks for ISteamGameSearch (which go through the regular Steam callback registration system) - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 1)] internal struct SearchForGameProgressCallback_t_LargePack { public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 1; public ulong m_ullSearchID; // all future callbacks referencing this search will include this Search ID @@ -3562,32 +2411,39 @@ internal struct SearchForGameProgressCallback_t_LargePack { public int m_nSecondsRemainingEstimate; public int m_cPlayersSearching; - } + public static implicit operator SearchForGameProgressCallback_t(SearchForGameProgressCallback_t_LargePack value) { + SearchForGameProgressCallback_t result = default; + result.m_ullSearchID = value.m_ullSearchID; + result.m_eResult = value.m_eResult; + result.m_lobbyID = value.m_lobbyID; + result.m_steamIDEndedSearch = value.m_steamIDEndedSearch; + result.m_nSecondsRemainingEstimate = value.m_nSecondsRemainingEstimate; + result.m_cPlayersSearching = value.m_cPlayersSearching; + return result; + } - //----------------------------------------------------------------------------- - // Callbacks for ISteamGameSearch (which go through the regular Steam callback registration system) - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 1)] - internal struct SearchForGameProgressCallback_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 1; - - public ulong m_ullSearchID; // all future callbacks referencing this search will include this Search ID - - public EResult m_eResult; // if search has started this result will be k_EResultOK, any other value indicates search has failed to start or has terminated - public CSteamID m_lobbyID; // lobby ID if lobby search, invalid steamID otherwise - public CSteamID m_steamIDEndedSearch; // if search was terminated, steamID that terminated search - - public int m_nSecondsRemainingEstimate; - public int m_cPlayersSearching; + public static implicit operator SearchForGameProgressCallback_t_LargePack(SearchForGameProgressCallback_t value) { + SearchForGameProgressCallback_t_LargePack result = default; + result.m_ullSearchID = value.m_ullSearchID; + result.m_eResult = value.m_eResult; + result.m_lobbyID = value.m_lobbyID; + result.m_steamIDEndedSearch = value.m_steamIDEndedSearch; + result.m_nSecondsRemainingEstimate = value.m_nSecondsRemainingEstimate; + result.m_cPlayersSearching = value.m_cPlayersSearching; + return result; + } } #endif // notification to all players searching that a game has been found [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 2)] - public struct SearchForGameResultCallback_t { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 2; + public struct SearchForGameResultCallback_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public ulong m_ullSearchID; @@ -3604,10 +2460,11 @@ public struct SearchForGameResultCallback_t { #if STEAMWORKS_ANYCPU // notification to all players searching that a game has been found - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 2)] internal struct SearchForGameResultCallback_t_LargePack { public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 2; public ulong m_ullSearchID; @@ -3620,26 +2477,28 @@ internal struct SearchForGameResultCallback_t_LargePack { public CSteamID m_steamIDHost; [MarshalAs(UnmanagedType.I1)] public bool m_bFinalCallback; - } + public static implicit operator SearchForGameResultCallback_t(SearchForGameResultCallback_t_LargePack value) { + SearchForGameResultCallback_t result = default; + result.m_ullSearchID = value.m_ullSearchID; + result.m_eResult = value.m_eResult; + result.m_nCountPlayersInGame = value.m_nCountPlayersInGame; + result.m_nCountAcceptedGame = value.m_nCountAcceptedGame; + result.m_steamIDHost = value.m_steamIDHost; + result.m_bFinalCallback = value.m_bFinalCallback; + return result; + } - // notification to all players searching that a game has been found - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 2)] - internal struct SearchForGameResultCallback_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 2; - - public ulong m_ullSearchID; - - public EResult m_eResult; // if game/host was lost this will be an error value - - // if m_bGameFound is true the following are non-zero - public int m_nCountPlayersInGame; - public int m_nCountAcceptedGame; - // if m_steamIDHost is valid the host has started the game - public CSteamID m_steamIDHost; - [MarshalAs(UnmanagedType.I1)] - public bool m_bFinalCallback; + public static implicit operator SearchForGameResultCallback_t_LargePack(SearchForGameResultCallback_t value) { + SearchForGameResultCallback_t_LargePack result = default; + result.m_ullSearchID = value.m_ullSearchID; + result.m_eResult = value.m_eResult; + result.m_nCountPlayersInGame = value.m_nCountPlayersInGame; + result.m_nCountAcceptedGame = value.m_nCountAcceptedGame; + result.m_steamIDHost = value.m_steamIDHost; + result.m_bFinalCallback = value.m_bFinalCallback; + return result; + } } #endif @@ -3649,8 +2508,11 @@ internal struct SearchForGameResultCallback_t_SmallPack { // callback will also follow a call from CancelRequestPlayersForGame - m_bSearchInProgress will be false [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 11)] - public struct RequestPlayersForGameProgressCallback_t { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 11; + public struct RequestPlayersForGameProgressCallback_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK public ulong m_ullSearchID; // all future callbacks referencing this search will include this Search ID @@ -3661,27 +2523,28 @@ public struct RequestPlayersForGameProgressCallback_t { // ISteamGameSearch : Game Host API callbacks // callback from RequestPlayersForGame when the matchmaking service has started or ended search // callback will also follow a call from CancelRequestPlayersForGame - m_bSearchInProgress will be false - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 11)] internal struct RequestPlayersForGameProgressCallback_t_LargePack { public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 11; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 11; public EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK public ulong m_ullSearchID; // all future callbacks referencing this search will include this Search ID - } + public static implicit operator RequestPlayersForGameProgressCallback_t(RequestPlayersForGameProgressCallback_t_LargePack value) { + RequestPlayersForGameProgressCallback_t result = default; + result.m_eResult = value.m_eResult; + result.m_ullSearchID = value.m_ullSearchID; + return result; + } - //----------------------------------------------------------------------------- - // ISteamGameSearch : Game Host API callbacks - // callback from RequestPlayersForGame when the matchmaking service has started or ended search - // callback will also follow a call from CancelRequestPlayersForGame - m_bSearchInProgress will be false - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 11)] - internal struct RequestPlayersForGameProgressCallback_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 11; - - public EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK - public ulong m_ullSearchID; // all future callbacks referencing this search will include this Search ID + public static implicit operator RequestPlayersForGameProgressCallback_t_LargePack(RequestPlayersForGameProgressCallback_t value) { + RequestPlayersForGameProgressCallback_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_ullSearchID = value.m_ullSearchID; + return result; + } } #endif @@ -3690,71 +2553,63 @@ internal struct RequestPlayersForGameProgressCallback_t_SmallPack { // followed by additional callbacks when players accept or decline the game [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 12)] - public struct RequestPlayersForGameResultCallback_t { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 12; + public struct RequestPlayersForGameResultCallback_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK public ulong m_ullSearchID; public CSteamID m_SteamIDPlayerFound; // player steamID public CSteamID m_SteamIDLobby; // if the player is in a lobby, the lobby ID - public PlayerAcceptState_t m_ePlayerAcceptState; - public int m_nPlayerIndex; - public int m_nTotalPlayersFound; // expect this many callbacks at minimum - public int m_nTotalPlayersAcceptedGame; - public int m_nSuggestedTeamIndex; - public ulong m_ullUniqueGameID; } #if STEAMWORKS_ANYCPU // callback from RequestPlayersForGame // one of these will be sent per player // followed by additional callbacks when players accept or decline the game - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 12)] internal struct RequestPlayersForGameResultCallback_t_LargePack { public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 12; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 12; public EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK public ulong m_ullSearchID; public CSteamID m_SteamIDPlayerFound; // player steamID public CSteamID m_SteamIDLobby; // if the player is in a lobby, the lobby ID - public PlayerAcceptState_t m_ePlayerAcceptState; - public int m_nPlayerIndex; - public int m_nTotalPlayersFound; // expect this many callbacks at minimum - public int m_nTotalPlayersAcceptedGame; - public int m_nSuggestedTeamIndex; - public ulong m_ullUniqueGameID; - } + public static implicit operator RequestPlayersForGameResultCallback_t(RequestPlayersForGameResultCallback_t_LargePack value) { + RequestPlayersForGameResultCallback_t result = default; + result.m_eResult = value.m_eResult; + result.m_ullSearchID = value.m_ullSearchID; + result.m_SteamIDPlayerFound = value.m_SteamIDPlayerFound; + result.m_SteamIDLobby = value.m_SteamIDLobby; + return result; + } - // callback from RequestPlayersForGame - // one of these will be sent per player - // followed by additional callbacks when players accept or decline the game - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 12)] - internal struct RequestPlayersForGameResultCallback_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 12; - - public EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK - public ulong m_ullSearchID; - - public CSteamID m_SteamIDPlayerFound; // player steamID - public CSteamID m_SteamIDLobby; // if the player is in a lobby, the lobby ID - public PlayerAcceptState_t m_ePlayerAcceptState; - public int m_nPlayerIndex; - public int m_nTotalPlayersFound; // expect this many callbacks at minimum - public int m_nTotalPlayersAcceptedGame; - public int m_nSuggestedTeamIndex; - public ulong m_ullUniqueGameID; + public static implicit operator RequestPlayersForGameResultCallback_t_LargePack(RequestPlayersForGameResultCallback_t value) { + RequestPlayersForGameResultCallback_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_ullSearchID = value.m_ullSearchID; + result.m_SteamIDPlayerFound = value.m_SteamIDPlayerFound; + result.m_SteamIDLobby = value.m_SteamIDLobby; + return result; + } } #endif + // expect this many callbacks at minimum [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 13)] - public struct RequestPlayersForGameFinalResultCallback_t { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 13; + public struct RequestPlayersForGameFinalResultCallback_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public ulong m_ullSearchID; @@ -3762,33 +2617,43 @@ public struct RequestPlayersForGameFinalResultCallback_t { } #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + // expect this many callbacks at minimum + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 13)] internal struct RequestPlayersForGameFinalResultCallback_t_LargePack { public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 13; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 13; public EResult m_eResult; public ulong m_ullSearchID; public ulong m_ullUniqueGameID; - } + public static implicit operator RequestPlayersForGameFinalResultCallback_t(RequestPlayersForGameFinalResultCallback_t_LargePack value) { + RequestPlayersForGameFinalResultCallback_t result = default; + result.m_eResult = value.m_eResult; + result.m_ullSearchID = value.m_ullSearchID; + result.m_ullUniqueGameID = value.m_ullUniqueGameID; + return result; + } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 13)] - internal struct RequestPlayersForGameFinalResultCallback_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 13; - - public EResult m_eResult; - public ulong m_ullSearchID; - public ulong m_ullUniqueGameID; + public static implicit operator RequestPlayersForGameFinalResultCallback_t_LargePack(RequestPlayersForGameFinalResultCallback_t value) { + RequestPlayersForGameFinalResultCallback_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_ullSearchID = value.m_ullSearchID; + result.m_ullUniqueGameID = value.m_ullUniqueGameID; + return result; + } } #endif // this callback confirms that results were received by the matchmaking service for this player [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 14)] - public struct SubmitPlayerResultResultCallback_t { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 14; + public struct SubmitPlayerResultResultCallback_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public ulong ullUniqueGameID; @@ -3797,26 +2662,31 @@ public struct SubmitPlayerResultResultCallback_t { #if STEAMWORKS_ANYCPU // this callback confirms that results were received by the matchmaking service for this player - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 14)] internal struct SubmitPlayerResultResultCallback_t_LargePack { public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 14; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 14; public EResult m_eResult; public ulong ullUniqueGameID; public CSteamID steamIDPlayer; - } + public static implicit operator SubmitPlayerResultResultCallback_t(SubmitPlayerResultResultCallback_t_LargePack value) { + SubmitPlayerResultResultCallback_t result = default; + result.m_eResult = value.m_eResult; + result.ullUniqueGameID = value.ullUniqueGameID; + result.steamIDPlayer = value.steamIDPlayer; + return result; + } - // this callback confirms that results were received by the matchmaking service for this player - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 14)] - internal struct SubmitPlayerResultResultCallback_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 14; - - public EResult m_eResult; - public ulong ullUniqueGameID; - public CSteamID steamIDPlayer; + public static implicit operator SubmitPlayerResultResultCallback_t_LargePack(SubmitPlayerResultResultCallback_t value) { + SubmitPlayerResultResultCallback_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.ullUniqueGameID = value.ullUniqueGameID; + result.steamIDPlayer = value.steamIDPlayer; + return result; + } } #endif @@ -3824,8 +2694,11 @@ internal struct SubmitPlayerResultResultCallback_t_SmallPack { // the next call to RequestPlayersForGame will generate a new unique game ID [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 15)] - public struct EndGameResultCallback_t { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 15; + public struct EndGameResultCallback_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public ulong ullUniqueGameID; @@ -3834,25 +2707,28 @@ public struct EndGameResultCallback_t { #if STEAMWORKS_ANYCPU // this callback confirms that the game is recorded as complete on the matchmaking service // the next call to RequestPlayersForGame will generate a new unique game ID - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 15)] internal struct EndGameResultCallback_t_LargePack { public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 15; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 15; public EResult m_eResult; public ulong ullUniqueGameID; - } + public static implicit operator EndGameResultCallback_t(EndGameResultCallback_t_LargePack value) { + EndGameResultCallback_t result = default; + result.m_eResult = value.m_eResult; + result.ullUniqueGameID = value.ullUniqueGameID; + return result; + } - // this callback confirms that the game is recorded as complete on the matchmaking service - // the next call to RequestPlayersForGame will generate a new unique game ID - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 15)] - internal struct EndGameResultCallback_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 15; - - public EResult m_eResult; - public ulong ullUniqueGameID; + public static implicit operator EndGameResultCallback_t_LargePack(EndGameResultCallback_t value) { + EndGameResultCallback_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.ullUniqueGameID = value.ullUniqueGameID; + return result; + } } #endif @@ -3861,60 +2737,49 @@ internal struct EndGameResultCallback_t_SmallPack { // to the game with that party. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 1)] - public struct JoinPartyCallback_t { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 1; + public struct JoinPartyCallback_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public PartyBeaconID_t m_ulBeaconID; public CSteamID m_SteamIDBeaconOwner; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_rgchConnectString_; - public string m_rgchConnectString - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchConnectString_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchConnectString_, 256); } - } + public string m_rgchConnectString; } #if STEAMWORKS_ANYCPU // Steam has responded to the user request to join a party via the given Beacon ID. // If successful, the connect string contains game-specific instructions to connect // to the game with that party. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 1)] internal struct JoinPartyCallback_t_LargePack { public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamPartiesCallbacks + 1; public EResult m_eResult; public PartyBeaconID_t m_ulBeaconID; public CSteamID m_SteamIDBeaconOwner; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_rgchConnectString_; - public string m_rgchConnectString - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchConnectString_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchConnectString_, 256); } + public string m_rgchConnectString; + + public static implicit operator JoinPartyCallback_t(JoinPartyCallback_t_LargePack value) { + JoinPartyCallback_t result = default; + result.m_eResult = value.m_eResult; + result.m_ulBeaconID = value.m_ulBeaconID; + result.m_SteamIDBeaconOwner = value.m_SteamIDBeaconOwner; + result.m_rgchConnectString = value.m_rgchConnectString; + return result; } - } - - // Steam has responded to the user request to join a party via the given Beacon ID. - // If successful, the connect string contains game-specific instructions to connect - // to the game with that party. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 1)] - internal struct JoinPartyCallback_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 1; - - public EResult m_eResult; - public PartyBeaconID_t m_ulBeaconID; - public CSteamID m_SteamIDBeaconOwner; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_rgchConnectString_; - public string m_rgchConnectString - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchConnectString_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchConnectString_, 256); } + public static implicit operator JoinPartyCallback_t_LargePack(JoinPartyCallback_t value) { + JoinPartyCallback_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_ulBeaconID = value.m_ulBeaconID; + result.m_SteamIDBeaconOwner = value.m_SteamIDBeaconOwner; + result.m_rgchConnectString = value.m_rgchConnectString; + return result; } } @@ -3922,8 +2787,11 @@ public string m_rgchConnectString // Response to CreateBeacon request. If successful, the beacon ID is provided. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 2)] - public struct CreateBeaconCallback_t { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 2; + public struct CreateBeaconCallback_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public PartyBeaconID_t m_ulBeaconID; @@ -3931,24 +2799,28 @@ public struct CreateBeaconCallback_t { #if STEAMWORKS_ANYCPU // Response to CreateBeacon request. If successful, the beacon ID is provided. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 2)] internal struct CreateBeaconCallback_t_LargePack { public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamPartiesCallbacks + 2; public EResult m_eResult; public PartyBeaconID_t m_ulBeaconID; - } + public static implicit operator CreateBeaconCallback_t(CreateBeaconCallback_t_LargePack value) { + CreateBeaconCallback_t result = default; + result.m_eResult = value.m_eResult; + result.m_ulBeaconID = value.m_ulBeaconID; + return result; + } - // Response to CreateBeacon request. If successful, the beacon ID is provided. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 2)] - internal struct CreateBeaconCallback_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 2; - - public EResult m_eResult; - public PartyBeaconID_t m_ulBeaconID; + public static implicit operator CreateBeaconCallback_t_LargePack(CreateBeaconCallback_t value) { + CreateBeaconCallback_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_ulBeaconID = value.m_ulBeaconID; + return result; + } } #endif @@ -3958,539 +2830,239 @@ internal struct CreateBeaconCallback_t_SmallPack { // Otherwise, Steam may timeout their reservation eventually. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 3)] - public struct ReservationNotificationCallback_t { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 3; - - public PartyBeaconID_t m_ulBeaconID; - public CSteamID m_steamIDJoiner; - } - + public struct ReservationNotificationCallback_t #if STEAMWORKS_ANYCPU - // Someone has used the beacon to join your party - they are in-flight now - // and we've reserved one of the open slots for them. - // You should confirm when they join your party by calling OnReservationCompleted(). - // Otherwise, Steam may timeout their reservation eventually. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 3)] - internal struct ReservationNotificationCallback_t_LargePack { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 3; - - public PartyBeaconID_t m_ulBeaconID; - public CSteamID m_steamIDJoiner; - } - - - // Someone has used the beacon to join your party - they are in-flight now - // and we've reserved one of the open slots for them. - // You should confirm when they join your party by calling OnReservationCompleted(). - // Otherwise, Steam may timeout their reservation eventually. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 3)] - internal struct ReservationNotificationCallback_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 3; + : ICallbackIdentity + #endif + { public PartyBeaconID_t m_ulBeaconID; public CSteamID m_steamIDJoiner; } - #endif // Response to ChangeNumOpenSlots call [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 4)] - public struct ChangeNumOpenSlotsCallback_t { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 4; - - public EResult m_eResult; - } - + public struct ChangeNumOpenSlotsCallback_t #if STEAMWORKS_ANYCPU - // Response to ChangeNumOpenSlots call - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 4)] - internal struct ChangeNumOpenSlotsCallback_t_LargePack { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 4; - - public EResult m_eResult; - } - - - // Response to ChangeNumOpenSlots call - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 4)] - internal struct ChangeNumOpenSlotsCallback_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 4; + : ICallbackIdentity + #endif + { public EResult m_eResult; } - #endif // The list of possible Party beacon locations has changed [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 5)] - public struct AvailableBeaconLocationsUpdated_t { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 5; - } - + public struct AvailableBeaconLocationsUpdated_t #if STEAMWORKS_ANYCPU - // The list of possible Party beacon locations has changed - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 5)] - internal struct AvailableBeaconLocationsUpdated_t_LargePack { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 5; - } - - - // The list of possible Party beacon locations has changed - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 5)] - internal struct AvailableBeaconLocationsUpdated_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 5; - } - + : ICallbackIdentity #endif - // The list of active beacons may have changed - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 6)] - public struct ActiveBeaconsUpdated_t { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 6; - } - - #if STEAMWORKS_ANYCPU - // The list of active beacons may have changed - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 6)] - internal struct ActiveBeaconsUpdated_t_LargePack { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 6; + { } - // The list of active beacons may have changed [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 6)] - internal struct ActiveBeaconsUpdated_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 6; + public struct ActiveBeaconsUpdated_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { } - #endif // callbacks [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 1)] - public struct PlaybackStatusHasChanged_t { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 1; + public struct PlaybackStatusHasChanged_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { } + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 2)] + public struct VolumeHasChanged_t #if STEAMWORKS_ANYCPU - // callbacks - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 1)] - internal struct PlaybackStatusHasChanged_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 1; - } - - - // callbacks - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 1)] - internal struct PlaybackStatusHasChanged_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 1; - } - + : ICallbackIdentity #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 2)] - public struct VolumeHasChanged_t { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 2; - public float m_flNewVolume; - } - - #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 2)] - internal struct VolumeHasChanged_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 2; - public float m_flNewVolume; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 2)] - internal struct VolumeHasChanged_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 2; + { public float m_flNewVolume; } - #endif // callbacks [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 1)] - public struct MusicPlayerRemoteWillActivate_t { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 1; - } - + public struct MusicPlayerRemoteWillActivate_t #if STEAMWORKS_ANYCPU - // callbacks - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 1)] - internal struct MusicPlayerRemoteWillActivate_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 1; - } - - - // callbacks - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 1)] - internal struct MusicPlayerRemoteWillActivate_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 1; - } - + : ICallbackIdentity #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 2)] - public struct MusicPlayerRemoteWillDeactivate_t { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 2; + { } - #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 2)] - internal struct MusicPlayerRemoteWillDeactivate_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 2; - } - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 2)] - internal struct MusicPlayerRemoteWillDeactivate_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 2; - } - - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 3)] - public struct MusicPlayerRemoteToFront_t { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 3; - } - + public struct MusicPlayerRemoteWillDeactivate_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 3)] - internal struct MusicPlayerRemoteToFront_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 3; + : ICallbackIdentity + #endif + { } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 3)] - internal struct MusicPlayerRemoteToFront_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 3; - } - - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 4)] - public struct MusicPlayerWillQuit_t { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 4; - } - + public struct MusicPlayerRemoteToFront_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 4)] - internal struct MusicPlayerWillQuit_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 4; + : ICallbackIdentity + #endif + { } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 4)] - internal struct MusicPlayerWillQuit_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 4; - } - - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 5)] - public struct MusicPlayerWantsPlay_t { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 5; - } - + public struct MusicPlayerWillQuit_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 5)] - internal struct MusicPlayerWantsPlay_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 5; + : ICallbackIdentity + #endif + { } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 5)] - internal struct MusicPlayerWantsPlay_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 5; - } - - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 6)] - public struct MusicPlayerWantsPause_t { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 6; - } - + public struct MusicPlayerWantsPlay_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 6)] - internal struct MusicPlayerWantsPause_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 6; + : ICallbackIdentity + #endif + { } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 6)] - internal struct MusicPlayerWantsPause_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 6; - } - - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 7)] - public struct MusicPlayerWantsPlayPrevious_t { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 7; - } - + public struct MusicPlayerWantsPause_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 7)] - internal struct MusicPlayerWantsPlayPrevious_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 7; + : ICallbackIdentity + #endif + { } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 7)] - internal struct MusicPlayerWantsPlayPrevious_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 7; - } - - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 8)] - public struct MusicPlayerWantsPlayNext_t { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 8; - } - + public struct MusicPlayerWantsPlayPrevious_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 8)] - internal struct MusicPlayerWantsPlayNext_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 8; + : ICallbackIdentity + #endif + { } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 8)] - internal struct MusicPlayerWantsPlayNext_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 8; - } - - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 9)] - public struct MusicPlayerWantsShuffled_t { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 9; - [MarshalAs(UnmanagedType.I1)] - public bool m_bShuffled; - } - + public struct MusicPlayerWantsPlayNext_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 9)] - internal struct MusicPlayerWantsShuffled_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 9; - [MarshalAs(UnmanagedType.I1)] - public bool m_bShuffled; + : ICallbackIdentity + #endif + { } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 9)] - internal struct MusicPlayerWantsShuffled_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 9; + public struct MusicPlayerWantsShuffled_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { [MarshalAs(UnmanagedType.I1)] public bool m_bShuffled; } - #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 10)] - public struct MusicPlayerWantsLooped_t { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 10; - [MarshalAs(UnmanagedType.I1)] - public bool m_bLooped; - } - + public struct MusicPlayerWantsLooped_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 10)] - internal struct MusicPlayerWantsLooped_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 10; - [MarshalAs(UnmanagedType.I1)] - public bool m_bLooped; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 10)] - internal struct MusicPlayerWantsLooped_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 10; + : ICallbackIdentity + #endif + { [MarshalAs(UnmanagedType.I1)] public bool m_bLooped; } - #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 11)] - public struct MusicPlayerWantsVolume_t { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 11; - public float m_flNewVolume; - } - + public struct MusicPlayerWantsVolume_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 11)] - internal struct MusicPlayerWantsVolume_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 11; - public float m_flNewVolume; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 11)] - internal struct MusicPlayerWantsVolume_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 11; + : ICallbackIdentity + #endif + { public float m_flNewVolume; } - #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 12)] - public struct MusicPlayerSelectsQueueEntry_t { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 12; - public int nID; - } - + public struct MusicPlayerSelectsQueueEntry_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 12)] - internal struct MusicPlayerSelectsQueueEntry_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 12; - public int nID; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 12)] - internal struct MusicPlayerSelectsQueueEntry_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 12; - public int nID; - } - + : ICallbackIdentity #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 13)] - public struct MusicPlayerSelectsPlaylistEntry_t { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 13; - public int nID; - } - - #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 13)] - internal struct MusicPlayerSelectsPlaylistEntry_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 13; + { public int nID; } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMusicCallbacks + 13)] - internal struct MusicPlayerSelectsPlaylistEntry_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 13; + public struct MusicPlayerSelectsPlaylistEntry_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public int nID; } - #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 14)] - public struct MusicPlayerWantsPlayingRepeatStatus_t { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 14; - public int m_nPlayingRepeatStatus; - } - + public struct MusicPlayerWantsPlayingRepeatStatus_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 14)] - internal struct MusicPlayerWantsPlayingRepeatStatus_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 14; - public int m_nPlayingRepeatStatus; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 14)] - internal struct MusicPlayerWantsPlayingRepeatStatus_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 14; + : ICallbackIdentity + #endif + { public int m_nPlayingRepeatStatus; } - #endif // callbacks // callback notification - a user wants to talk to us over the P2P channel via the SendP2PPacket() API // in response, a call to AcceptP2PPacketsFromUser() needs to be made, if you want to talk with them - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamNetworkingCallbacks + 2)] - public struct P2PSessionRequest_t { - public const int k_iCallback = Constants.k_iSteamNetworkingCallbacks + 2; - public CSteamID m_steamIDRemote; // user who wants to talk to us - } - + public struct P2PSessionRequest_t #if STEAMWORKS_ANYCPU - // callbacks - // callback notification - a user wants to talk to us over the P2P channel via the SendP2PPacket() API - // in response, a call to AcceptP2PPacketsFromUser() needs to be made, if you want to talk with them - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamNetworkingCallbacks + 2)] - internal struct P2PSessionRequest_t_LargePack { - public const int k_iCallback = Constants.k_iSteamNetworkingCallbacks + 2; - public CSteamID m_steamIDRemote; // user who wants to talk to us - } - - - // callbacks - // callback notification - a user wants to talk to us over the P2P channel via the SendP2PPacket() API - // in response, a call to AcceptP2PPacketsFromUser() needs to be made, if you want to talk with them - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamNetworkingCallbacks + 2)] - internal struct P2PSessionRequest_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamNetworkingCallbacks + 2; + : ICallbackIdentity + #endif + { public CSteamID m_steamIDRemote; // user who wants to talk to us } - #endif // callback notification - packets can't get through to the specified user via the SendP2PPacket() API // all packets queued packets unsent at this point will be dropped // further attempts to send will retry making the connection (but will be dropped if we fail again) - [StructLayout(LayoutKind.Sequential, Pack = 1)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamNetworkingCallbacks + 3)] - public struct P2PSessionConnectFail_t { - public const int k_iCallback = Constants.k_iSteamNetworkingCallbacks + 3; + public struct P2PSessionConnectFail_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_steamIDRemote; // user we were sending packets to public byte m_eP2PSessionError; // EP2PSessionError indicating why we're having trouble } // callback notification - status of a socket has changed // used as part of the CreateListenSocket() / CreateP2PConnectionSocket() - [StructLayout(LayoutKind.Sequential, Pack = 4)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamNetworkingCallbacks + 1)] - public struct SocketStatusCallback_t { - public const int k_iCallback = Constants.k_iSteamNetworkingCallbacks + 1; + public struct SocketStatusCallback_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host public SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection public CSteamID m_steamIDRemote; // remote steamID we have connected to, if it has one @@ -4501,38 +3073,16 @@ public struct SocketStatusCallback_t { // Callbacks // /// Posted when a remote host is sending us a message, and we do not already have a session with them - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 1)] [CallbackIdentity(Constants.k_iSteamNetworkingMessagesCallbacks + 1)] - public struct SteamNetworkingMessagesSessionRequest_t { - public const int k_iCallback = Constants.k_iSteamNetworkingMessagesCallbacks + 1; - public SteamNetworkingIdentity m_identityRemote; // user who wants to talk to us - } - + public struct SteamNetworkingMessagesSessionRequest_t #if STEAMWORKS_ANYCPU - // - // Callbacks - // - /// Posted when a remote host is sending us a message, and we do not already have a session with them - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamNetworkingMessagesCallbacks + 1)] - internal struct SteamNetworkingMessagesSessionRequest_t_LargePack { - public const int k_iCallback = Constants.k_iSteamNetworkingMessagesCallbacks + 1; - public SteamNetworkingIdentity m_identityRemote; // user who wants to talk to us - } - - - // - // Callbacks - // - /// Posted when a remote host is sending us a message, and we do not already have a session with them - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamNetworkingMessagesCallbacks + 1)] - internal struct SteamNetworkingMessagesSessionRequest_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamNetworkingMessagesCallbacks + 1; + : ICallbackIdentity + #endif + { public SteamNetworkingIdentity m_identityRemote; // user who wants to talk to us } - #endif /// Posted when we fail to establish a connection, or we detect that communications /// have been disrupted it an unusual way. There is no notification when a peer proactively /// closes the session. ("Closed by peer" is not a concept of UDP-style communications, and @@ -4544,10 +3094,13 @@ internal struct SteamNetworkingMessagesSessionRequest_t_SmallPack { /// Also, if a session times out due to inactivity, no callbacks will be posted. The only /// way to detect that this is happening is that querying the session state may return /// none, connecting, and findingroute again. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 1)] [CallbackIdentity(Constants.k_iSteamNetworkingMessagesCallbacks + 2)] - public struct SteamNetworkingMessagesSessionFailed_t { - public const int k_iCallback = Constants.k_iSteamNetworkingMessagesCallbacks + 2; + public struct SteamNetworkingMessagesSessionFailed_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { /// Detailed info about the session that failed. /// SteamNetConnectionInfo_t::m_identityRemote indicates who this session @@ -4555,53 +3108,6 @@ public struct SteamNetworkingMessagesSessionFailed_t { public SteamNetConnectionInfo_t m_info; } - #if STEAMWORKS_ANYCPU - /// Posted when we fail to establish a connection, or we detect that communications - /// have been disrupted it an unusual way. There is no notification when a peer proactively - /// closes the session. ("Closed by peer" is not a concept of UDP-style communications, and - /// SteamNetworkingMessages is primarily intended to make porting UDP code easy.) - /// - /// Remember: callbacks are asynchronous. See notes on SendMessageToUser, - /// and k_nSteamNetworkingSend_AutoRestartBrokenSession in particular. - /// - /// Also, if a session times out due to inactivity, no callbacks will be posted. The only - /// way to detect that this is happening is that querying the session state may return - /// none, connecting, and findingroute again. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamNetworkingMessagesCallbacks + 2)] - internal struct SteamNetworkingMessagesSessionFailed_t_LargePack { - public const int k_iCallback = Constants.k_iSteamNetworkingMessagesCallbacks + 2; - - /// Detailed info about the session that failed. - /// SteamNetConnectionInfo_t::m_identityRemote indicates who this session - /// was with. - public SteamNetConnectionInfo_t m_info; - } - - - /// Posted when we fail to establish a connection, or we detect that communications - /// have been disrupted it an unusual way. There is no notification when a peer proactively - /// closes the session. ("Closed by peer" is not a concept of UDP-style communications, and - /// SteamNetworkingMessages is primarily intended to make porting UDP code easy.) - /// - /// Remember: callbacks are asynchronous. See notes on SendMessageToUser, - /// and k_nSteamNetworkingSend_AutoRestartBrokenSession in particular. - /// - /// Also, if a session times out due to inactivity, no callbacks will be posted. The only - /// way to detect that this is happening is that querying the session state may return - /// none, connecting, and findingroute again. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamNetworkingMessagesCallbacks + 2)] - internal struct SteamNetworkingMessagesSessionFailed_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamNetworkingMessagesCallbacks + 2; - - /// Detailed info about the session that failed. - /// SteamNetConnectionInfo_t::m_identityRemote indicates who this session - /// was with. - public SteamNetConnectionInfo_t m_info; - } - - #endif /// Callback struct used to notify when a connection has changed state /// This callback is posted whenever a connection is created, destroyed, or changes state. /// The m_info field will contain a complete description of the connection at the time the @@ -4640,8 +3146,11 @@ internal struct SteamNetworkingMessagesSessionFailed_t_SmallPack { /// Also note that callbacks will be posted when connections are created and destroyed by your own API calls. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamNetworkingSocketsCallbacks + 1)] - public struct SteamNetConnectionStatusChangedCallback_t { - public const int k_iCallback = Constants.k_iSteamNetworkingSocketsCallbacks + 1; + public struct SteamNetConnectionStatusChangedCallback_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { /// Connection handle public HSteamNetConnection m_hConn; @@ -4690,10 +3199,11 @@ public struct SteamNetConnectionStatusChangedCallback_t { /// state by the time you process this callback. /// /// Also note that callbacks will be posted when connections are created and destroyed by your own API calls. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamNetworkingSocketsCallbacks + 1)] internal struct SteamNetConnectionStatusChangedCallback_t_LargePack { public const int k_iCallback = Constants.k_iSteamNetworkingSocketsCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamNetworkingSocketsCallbacks + 1; /// Connection handle public HSteamNetConnection m_hConn; @@ -4703,117 +3213,25 @@ internal struct SteamNetConnectionStatusChangedCallback_t_LargePack { /// Previous state. (Current state is in m_info.m_eState) public ESteamNetworkingConnectionState m_eOldState; - } - - - /// Callback struct used to notify when a connection has changed state - /// This callback is posted whenever a connection is created, destroyed, or changes state. - /// The m_info field will contain a complete description of the connection at the time the - /// change occurred and the callback was posted. In particular, m_eState will have the - /// new connection state. - /// - /// You will usually need to listen for this callback to know when: - /// - A new connection arrives on a listen socket. - /// m_info.m_hListenSocket will be set, m_eOldState = k_ESteamNetworkingConnectionState_None, - /// and m_info.m_eState = k_ESteamNetworkingConnectionState_Connecting. - /// See ISteamNetworkigSockets::AcceptConnection. - /// - A connection you initiated has been accepted by the remote host. - /// m_eOldState = k_ESteamNetworkingConnectionState_Connecting, and - /// m_info.m_eState = k_ESteamNetworkingConnectionState_Connected. - /// Some connections might transition to k_ESteamNetworkingConnectionState_FindingRoute first. - /// - A connection has been actively rejected or closed by the remote host. - /// m_eOldState = k_ESteamNetworkingConnectionState_Connecting or k_ESteamNetworkingConnectionState_Connected, - /// and m_info.m_eState = k_ESteamNetworkingConnectionState_ClosedByPeer. m_info.m_eEndReason - /// and m_info.m_szEndDebug will have for more details. - /// NOTE: upon receiving this callback, you must still destroy the connection using - /// ISteamNetworkingSockets::CloseConnection to free up local resources. (The details - /// passed to the function are not used in this case, since the connection is already closed.) - /// - A problem was detected with the connection, and it has been closed by the local host. - /// The most common failure is timeout, but other configuration or authentication failures - /// can cause this. m_eOldState = k_ESteamNetworkingConnectionState_Connecting or - /// k_ESteamNetworkingConnectionState_Connected, and m_info.m_eState = k_ESteamNetworkingConnectionState_ProblemDetectedLocally. - /// m_info.m_eEndReason and m_info.m_szEndDebug will have for more details. - /// NOTE: upon receiving this callback, you must still destroy the connection using - /// ISteamNetworkingSockets::CloseConnection to free up local resources. (The details - /// passed to the function are not used in this case, since the connection is already closed.) - /// - /// Remember that callbacks are posted to a queue, and networking connections can - /// change at any time. It is possible that the connection has already changed - /// state by the time you process this callback. - /// - /// Also note that callbacks will be posted when connections are created and destroyed by your own API calls. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamNetworkingSocketsCallbacks + 1)] - internal struct SteamNetConnectionStatusChangedCallback_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamNetworkingSocketsCallbacks + 1; - - /// Connection handle - public HSteamNetConnection m_hConn; - - /// Full connection info - public SteamNetConnectionInfo_t m_info; - - /// Previous state. (Current state is in m_info.m_eState) - public ESteamNetworkingConnectionState m_eOldState; - } - #endif - /// A struct used to describe our readiness to participate in authenticated, - /// encrypted communication. In order to do this we need: - /// - /// - The list of trusted CA certificates that might be relevant for this - /// app. - /// - A valid certificate issued by a CA. - /// - /// This callback is posted whenever the state of our readiness changes. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamNetworkingSocketsCallbacks + 2)] - public struct SteamNetAuthenticationStatus_t { - public const int k_iCallback = Constants.k_iSteamNetworkingSocketsCallbacks + 2; - - /// Status - public ESteamNetworkingAvailability m_eAvail; - - /// Non-localized English language status. For diagnostic/debugging - /// purposes only. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_debugMsg_; - public string m_debugMsg - { - get { return InteropHelp.ByteArrayToStringUTF8(m_debugMsg_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_debugMsg_, 256); } + public static implicit operator SteamNetConnectionStatusChangedCallback_t(SteamNetConnectionStatusChangedCallback_t_LargePack value) { + SteamNetConnectionStatusChangedCallback_t result = default; + result.m_hConn = value.m_hConn; + result.m_info = value.m_info; + result.m_eOldState = value.m_eOldState; + return result; } - } - #if STEAMWORKS_ANYCPU - /// A struct used to describe our readiness to participate in authenticated, - /// encrypted communication. In order to do this we need: - /// - /// - The list of trusted CA certificates that might be relevant for this - /// app. - /// - A valid certificate issued by a CA. - /// - /// This callback is posted whenever the state of our readiness changes. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamNetworkingSocketsCallbacks + 2)] - internal struct SteamNetAuthenticationStatus_t_LargePack { - public const int k_iCallback = Constants.k_iSteamNetworkingSocketsCallbacks + 2; - - /// Status - public ESteamNetworkingAvailability m_eAvail; - - /// Non-localized English language status. For diagnostic/debugging - /// purposes only. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_debugMsg_; - public string m_debugMsg - { - get { return InteropHelp.ByteArrayToStringUTF8(m_debugMsg_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_debugMsg_, 256); } + public static implicit operator SteamNetConnectionStatusChangedCallback_t_LargePack(SteamNetConnectionStatusChangedCallback_t value) { + SteamNetConnectionStatusChangedCallback_t_LargePack result = default; + result.m_hConn = value.m_hConn; + result.m_info = value.m_info; + result.m_eOldState = value.m_eOldState; + return result; } } - + #endif /// A struct used to describe our readiness to participate in authenticated, /// encrypted communication. In order to do this we need: /// @@ -4824,116 +3242,30 @@ public string m_debugMsg /// This callback is posted whenever the state of our readiness changes. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamNetworkingSocketsCallbacks + 2)] - internal struct SteamNetAuthenticationStatus_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamNetworkingSocketsCallbacks + 2; - - /// Status - public ESteamNetworkingAvailability m_eAvail; - - /// Non-localized English language status. For diagnostic/debugging - /// purposes only. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_debugMsg_; - public string m_debugMsg - { - get { return InteropHelp.ByteArrayToStringUTF8(m_debugMsg_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_debugMsg_, 256); } - } - } - - #endif - /// A struct used to describe our readiness to use the relay network. - /// To do this we first need to fetch the network configuration, - /// which describes what POPs are available. - [CallbackIdentity(Constants.k_iSteamNetworkingUtilsCallbacks + 1)] - public struct SteamRelayNetworkStatus_t { - public const int k_iCallback = Constants.k_iSteamNetworkingUtilsCallbacks + 1; - - /// Summary status. When this is "current", initialization has - /// completed. Anything else means you are not ready yet, or - /// there is a significant problem. - public ESteamNetworkingAvailability m_eAvail; - - /// Nonzero if latency measurement is in progress (or pending, - /// awaiting a prerequisite). - public int m_bPingMeasurementInProgress; - - /// Status obtaining the network config. This is a prerequisite - /// for relay network access. - /// - /// Failure to obtain the network config almost always indicates - /// a problem with the local internet connection. - public ESteamNetworkingAvailability m_eAvailNetworkConfig; - - /// Current ability to communicate with ANY relay. Note that - /// the complete failure to communicate with any relays almost - /// always indicates a problem with the local Internet connection. - /// (However, just because you can reach a single relay doesn't - /// mean that the local connection is in perfect health.) - public ESteamNetworkingAvailability m_eAvailAnyRelay; - - /// Non-localized English language status. For diagnostic/debugging - /// purposes only. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_debugMsg_; - public string m_debugMsg - { - get { return InteropHelp.ByteArrayToStringUTF8(m_debugMsg_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_debugMsg_, 256); } - } - } - + public struct SteamNetAuthenticationStatus_t #if STEAMWORKS_ANYCPU - /// A struct used to describe our readiness to use the relay network. - /// To do this we first need to fetch the network configuration, - /// which describes what POPs are available. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamNetworkingUtilsCallbacks + 1)] - internal struct SteamRelayNetworkStatus_t_LargePack { - public const int k_iCallback = Constants.k_iSteamNetworkingUtilsCallbacks + 1; + : ICallbackIdentity + #endif + { - /// Summary status. When this is "current", initialization has - /// completed. Anything else means you are not ready yet, or - /// there is a significant problem. + /// Status public ESteamNetworkingAvailability m_eAvail; - /// Nonzero if latency measurement is in progress (or pending, - /// awaiting a prerequisite). - public int m_bPingMeasurementInProgress; - - /// Status obtaining the network config. This is a prerequisite - /// for relay network access. - /// - /// Failure to obtain the network config almost always indicates - /// a problem with the local internet connection. - public ESteamNetworkingAvailability m_eAvailNetworkConfig; - - /// Current ability to communicate with ANY relay. Note that - /// the complete failure to communicate with any relays almost - /// always indicates a problem with the local Internet connection. - /// (However, just because you can reach a single relay doesn't - /// mean that the local connection is in perfect health.) - public ESteamNetworkingAvailability m_eAvailAnyRelay; - /// Non-localized English language status. For diagnostic/debugging /// purposes only. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_debugMsg_; - public string m_debugMsg - { - get { return InteropHelp.ByteArrayToStringUTF8(m_debugMsg_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_debugMsg_, 256); } - } + public string m_debugMsg; } - /// A struct used to describe our readiness to use the relay network. /// To do this we first need to fetch the network configuration, /// which describes what POPs are available. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamNetworkingUtilsCallbacks + 1)] - internal struct SteamRelayNetworkStatus_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamNetworkingUtilsCallbacks + 1; + public struct SteamRelayNetworkStatus_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { /// Summary status. When this is "current", initialization has /// completed. Anything else means you are not ready yet, or @@ -4960,711 +3292,211 @@ internal struct SteamRelayNetworkStatus_t_SmallPack { /// Non-localized English language status. For diagnostic/debugging /// purposes only. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_debugMsg_; - public string m_debugMsg - { - get { return InteropHelp.ByteArrayToStringUTF8(m_debugMsg_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_debugMsg_, 256); } - } - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: Callback for querying UGC - //----------------------------------------------------------------------------- - [CallbackIdentity(Constants.k_ISteamParentalSettingsCallbacks + 1)] - public struct SteamParentalSettingsChanged_t { - public const int k_iCallback = Constants.k_ISteamParentalSettingsCallbacks + 1; - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Callback for querying UGC - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_ISteamParentalSettingsCallbacks + 1)] - internal struct SteamParentalSettingsChanged_t_LargePack { - public const int k_iCallback = Constants.k_ISteamParentalSettingsCallbacks + 1; + public string m_debugMsg; } - //----------------------------------------------------------------------------- // Purpose: Callback for querying UGC //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_ISteamParentalSettingsCallbacks + 1)] - internal struct SteamParentalSettingsChanged_t_SmallPack { - public const int k_iCallback = Constants.k_ISteamParentalSettingsCallbacks + 1; - } - + public struct SteamParentalSettingsChanged_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity #endif - // callbacks - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 1)] - public struct SteamRemotePlaySessionConnected_t { - public const int k_iCallback = Constants.k_iSteamRemotePlayCallbacks + 1; - public RemotePlaySessionID_t m_unSessionID; + { } - #if STEAMWORKS_ANYCPU // callbacks - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 1)] - internal struct SteamRemotePlaySessionConnected_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemotePlayCallbacks + 1; + public struct SteamRemotePlaySessionConnected_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public RemotePlaySessionID_t m_unSessionID; } - - // callbacks - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 1)] - internal struct SteamRemotePlaySessionConnected_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemotePlayCallbacks + 1; + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 2)] + public struct SteamRemotePlaySessionDisconnected_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public RemotePlaySessionID_t m_unSessionID; } + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 3)] + public struct SteamRemotePlayTogetherGuestInvite_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 2)] - public struct SteamRemotePlaySessionDisconnected_t { - public const int k_iCallback = Constants.k_iSteamRemotePlayCallbacks + 2; - public RemotePlaySessionID_t m_unSessionID; + { + public string m_szConnectURL; } + // callbacks + //----------------------------------------------------------------------------- + // Purpose: The result of a call to FileShare() + //----------------------------------------------------------------------------- + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 7)] + public struct RemoteStorageFileShareResult_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 2)] - internal struct SteamRemotePlaySessionDisconnected_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemotePlayCallbacks + 2; - public RemotePlaySessionID_t m_unSessionID; + : ICallbackIdentity + #endif + { + public EResult m_eResult; // The result of the operation + public UGCHandle_t m_hFile; // The handle that can be shared with users and features + public string m_rgchFilename; // The name of the file that was shared } - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 2)] - internal struct SteamRemotePlaySessionDisconnected_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemotePlayCallbacks + 2; - public RemotePlaySessionID_t m_unSessionID; - } - - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 3)] - public struct SteamRemotePlayTogetherGuestInvite_t { - public const int k_iCallback = Constants.k_iSteamRemotePlayCallbacks + 3; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] - internal byte[] m_szConnectURL_; - public string m_szConnectURL - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szConnectURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szConnectURL_, 1024); } - } - } - - #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 3)] - internal struct SteamRemotePlayTogetherGuestInvite_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemotePlayCallbacks + 3; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] - internal byte[] m_szConnectURL_; - public string m_szConnectURL - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szConnectURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szConnectURL_, 1024); } - } - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 3)] - internal struct SteamRemotePlayTogetherGuestInvite_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemotePlayCallbacks + 3; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] - internal byte[] m_szConnectURL_; - public string m_szConnectURL - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szConnectURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szConnectURL_, 1024); } - } - } - - #endif - // callbacks - //----------------------------------------------------------------------------- - // Purpose: The result of a call to FileShare() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 7)] - public struct RemoteStorageFileShareResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 7; - public EResult m_eResult; // The result of the operation - public UGCHandle_t m_hFile; // The handle that can be shared with users and features - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] - internal byte[] m_rgchFilename_; - public string m_rgchFilename // The name of the file that was shared - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchFilename_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchFilename_, Constants.k_cchFilenameMax); } - } - } - - #if STEAMWORKS_ANYCPU - // callbacks - //----------------------------------------------------------------------------- - // Purpose: The result of a call to FileShare() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 7)] - internal struct RemoteStorageFileShareResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 7; - public EResult m_eResult; // The result of the operation - public UGCHandle_t m_hFile; // The handle that can be shared with users and features - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] - internal byte[] m_rgchFilename_; - public string m_rgchFilename // The name of the file that was shared - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchFilename_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchFilename_, Constants.k_cchFilenameMax); } - } - } - - - // callbacks - //----------------------------------------------------------------------------- - // Purpose: The result of a call to FileShare() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 7)] - internal struct RemoteStorageFileShareResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 7; - public EResult m_eResult; // The result of the operation - public UGCHandle_t m_hFile; // The handle that can be shared with users and features - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] - internal byte[] m_rgchFilename_; - public string m_rgchFilename // The name of the file that was shared - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchFilename_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchFilename_, Constants.k_cchFilenameMax); } - } - } - - #endif // k_iSteamRemoteStorageCallbacks + 8 is deprecated! Do not reuse //----------------------------------------------------------------------------- // Purpose: The result of a call to PublishFile() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 9)] - public struct RemoteStoragePublishFileResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 9; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; - [MarshalAs(UnmanagedType.I1)] - public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; - } - + public struct RemoteStoragePublishFileResult_t #if STEAMWORKS_ANYCPU - // k_iSteamRemoteStorageCallbacks + 8 is deprecated! Do not reuse - //----------------------------------------------------------------------------- - // Purpose: The result of a call to PublishFile() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 9)] - internal struct RemoteStoragePublishFileResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 9; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; - [MarshalAs(UnmanagedType.I1)] - public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; - } - - - // k_iSteamRemoteStorageCallbacks + 8 is deprecated! Do not reuse - //----------------------------------------------------------------------------- - // Purpose: The result of a call to PublishFile() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 9)] - internal struct RemoteStoragePublishFileResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 9; + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; [MarshalAs(UnmanagedType.I1)] public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; } - #endif // k_iSteamRemoteStorageCallbacks + 10 is deprecated! Do not reuse //----------------------------------------------------------------------------- // Purpose: The result of a call to DeletePublishedFile() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 11)] - public struct RemoteStorageDeletePublishedFileResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 11; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; - } - + public struct RemoteStorageDeletePublishedFileResult_t #if STEAMWORKS_ANYCPU - // k_iSteamRemoteStorageCallbacks + 10 is deprecated! Do not reuse - //----------------------------------------------------------------------------- - // Purpose: The result of a call to DeletePublishedFile() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 11)] - internal struct RemoteStorageDeletePublishedFileResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 11; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; - } - - - // k_iSteamRemoteStorageCallbacks + 10 is deprecated! Do not reuse - //----------------------------------------------------------------------------- - // Purpose: The result of a call to DeletePublishedFile() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 11)] - internal struct RemoteStorageDeletePublishedFileResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 11; + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; } - #endif //----------------------------------------------------------------------------- // Purpose: The result of a call to EnumerateUserPublishedFiles() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 12)] - public struct RemoteStorageEnumerateUserPublishedFilesResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 12; - public EResult m_eResult; // The result of the operation. - public int m_nResultsReturned; - public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; - } - + public struct RemoteStorageEnumerateUserPublishedFilesResult_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The result of a call to EnumerateUserPublishedFiles() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 12)] - internal struct RemoteStorageEnumerateUserPublishedFilesResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 12; - public EResult m_eResult; // The result of the operation. - public int m_nResultsReturned; - public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; - } - - - //----------------------------------------------------------------------------- - // Purpose: The result of a call to EnumerateUserPublishedFiles() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 12)] - internal struct RemoteStorageEnumerateUserPublishedFilesResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 12; + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation. public int m_nResultsReturned; public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; + public PublishedFileId_t m_rgPublishedFileId; } - #endif //----------------------------------------------------------------------------- // Purpose: The result of a call to SubscribePublishedFile() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 13)] - public struct RemoteStorageSubscribePublishedFileResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 13; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; - } - + public struct RemoteStorageSubscribePublishedFileResult_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The result of a call to SubscribePublishedFile() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 13)] - internal struct RemoteStorageSubscribePublishedFileResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 13; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; - } - - - //----------------------------------------------------------------------------- - // Purpose: The result of a call to SubscribePublishedFile() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 13)] - internal struct RemoteStorageSubscribePublishedFileResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 13; + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; } - #endif //----------------------------------------------------------------------------- // Purpose: The result of a call to EnumerateSubscribePublishedFiles() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 14)] - public struct RemoteStorageEnumerateUserSubscribedFilesResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 14; - public EResult m_eResult; // The result of the operation. - public int m_nResultsReturned; - public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public uint[] m_rgRTimeSubscribed; - } - + public struct RemoteStorageEnumerateUserSubscribedFilesResult_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The result of a call to EnumerateSubscribePublishedFiles() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 14)] - internal struct RemoteStorageEnumerateUserSubscribedFilesResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 14; - public EResult m_eResult; // The result of the operation. - public int m_nResultsReturned; - public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public uint[] m_rgRTimeSubscribed; - } - - - //----------------------------------------------------------------------------- - // Purpose: The result of a call to EnumerateSubscribePublishedFiles() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 14)] - internal struct RemoteStorageEnumerateUserSubscribedFilesResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 14; + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation. public int m_nResultsReturned; public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public uint[] m_rgRTimeSubscribed; + public PublishedFileId_t m_rgPublishedFileId; + public uint m_rgRTimeSubscribed; } - #endif //----------------------------------------------------------------------------- // Purpose: The result of a call to UnsubscribePublishedFile() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 15)] - public struct RemoteStorageUnsubscribePublishedFileResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 15; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; - } - + public struct RemoteStorageUnsubscribePublishedFileResult_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The result of a call to UnsubscribePublishedFile() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 15)] - internal struct RemoteStorageUnsubscribePublishedFileResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 15; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; - } - - - //----------------------------------------------------------------------------- - // Purpose: The result of a call to UnsubscribePublishedFile() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 15)] - internal struct RemoteStorageUnsubscribePublishedFileResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 15; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; - } - + : ICallbackIdentity #endif - //----------------------------------------------------------------------------- - // Purpose: The result of a call to CommitPublishedFileUpdate() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 16)] - public struct RemoteStorageUpdatePublishedFileResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 16; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; - [MarshalAs(UnmanagedType.I1)] - public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The result of a call to CommitPublishedFileUpdate() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 16)] - internal struct RemoteStorageUpdatePublishedFileResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 16; + { public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; - [MarshalAs(UnmanagedType.I1)] - public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; } - //----------------------------------------------------------------------------- // Purpose: The result of a call to CommitPublishedFileUpdate() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 16)] - internal struct RemoteStorageUpdatePublishedFileResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 16; + public struct RemoteStorageUpdatePublishedFileResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; [MarshalAs(UnmanagedType.I1)] public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; } - #endif //----------------------------------------------------------------------------- // Purpose: The result of a call to UGCDownload() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 17)] - public struct RemoteStorageDownloadUGCResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 17; - public EResult m_eResult; // The result of the operation. - public UGCHandle_t m_hFile; // The handle to the file that was attempted to be downloaded. - public AppId_t m_nAppID; // ID of the app that created this file. - public int m_nSizeInBytes; // The size of the file that was downloaded, in bytes. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] - internal byte[] m_pchFileName_; - public string m_pchFileName // The name of the file that was downloaded. - { - get { return InteropHelp.ByteArrayToStringUTF8(m_pchFileName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } - } - public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. - } - + public struct RemoteStorageDownloadUGCResult_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The result of a call to UGCDownload() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 17)] - internal struct RemoteStorageDownloadUGCResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 17; - public EResult m_eResult; // The result of the operation. - public UGCHandle_t m_hFile; // The handle to the file that was attempted to be downloaded. - public AppId_t m_nAppID; // ID of the app that created this file. - public int m_nSizeInBytes; // The size of the file that was downloaded, in bytes. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] - internal byte[] m_pchFileName_; - public string m_pchFileName // The name of the file that was downloaded. - { - get { return InteropHelp.ByteArrayToStringUTF8(m_pchFileName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } - } - public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. - } - - - //----------------------------------------------------------------------------- - // Purpose: The result of a call to UGCDownload() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 17)] - internal struct RemoteStorageDownloadUGCResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 17; + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation. public UGCHandle_t m_hFile; // The handle to the file that was attempted to be downloaded. public AppId_t m_nAppID; // ID of the app that created this file. public int m_nSizeInBytes; // The size of the file that was downloaded, in bytes. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] - internal byte[] m_pchFileName_; - public string m_pchFileName // The name of the file that was downloaded. - { - get { return InteropHelp.ByteArrayToStringUTF8(m_pchFileName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } - } + public string m_pchFileName; // The name of the file that was downloaded. public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. } - #endif //----------------------------------------------------------------------------- // Purpose: The result of a call to GetPublishedFileDetails() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 18)] - public struct RemoteStorageGetPublishedFileDetailsResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 18; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; - public AppId_t m_nCreatorAppID; // ID of the app that created this file. - public AppId_t m_nConsumerAppID; // ID of the app that will consume this file. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentTitleMax)] - internal byte[] m_rgchTitle_; - public string m_rgchTitle // title of document - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTitle_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTitle_, Constants.k_cchPublishedDocumentTitleMax); } - } - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentDescriptionMax)] - internal byte[] m_rgchDescription_; - public string m_rgchDescription // description of document - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchDescription_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchDescription_, Constants.k_cchPublishedDocumentDescriptionMax); } - } - public UGCHandle_t m_hFile; // The handle of the primary file - public UGCHandle_t m_hPreviewFile; // The handle of the preview file - public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. - public uint m_rtimeCreated; // time when the published file was created - public uint m_rtimeUpdated; // time when the published file was last updated - public ERemoteStoragePublishedFileVisibility m_eVisibility; - [MarshalAs(UnmanagedType.I1)] - public bool m_bBanned; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchTagListMax)] - internal byte[] m_rgchTags_; - public string m_rgchTags // comma separated list of all tags associated with this file - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTags_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTags_, Constants.k_cchTagListMax); } - } - [MarshalAs(UnmanagedType.I1)] - public bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] - internal byte[] m_pchFileName_; - public string m_pchFileName // The name of the primary file - { - get { return InteropHelp.ByteArrayToStringUTF8(m_pchFileName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } - } - public int m_nFileSize; // Size of the primary file - public int m_nPreviewFileSize; // Size of the preview file - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedFileURLMax)] - internal byte[] m_rgchURL_; - public string m_rgchURL // URL (for a video or a website) - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchURL_, Constants.k_cchPublishedFileURLMax); } - } - public EWorkshopFileType m_eFileType; // Type of the file - [MarshalAs(UnmanagedType.I1)] - public bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop - } - + public struct RemoteStorageGetPublishedFileDetailsResult_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The result of a call to GetPublishedFileDetails() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 18)] - internal struct RemoteStorageGetPublishedFileDetailsResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 18; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; - public AppId_t m_nCreatorAppID; // ID of the app that created this file. - public AppId_t m_nConsumerAppID; // ID of the app that will consume this file. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentTitleMax)] - internal byte[] m_rgchTitle_; - public string m_rgchTitle // title of document - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTitle_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTitle_, Constants.k_cchPublishedDocumentTitleMax); } - } - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentDescriptionMax)] - internal byte[] m_rgchDescription_; - public string m_rgchDescription // description of document - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchDescription_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchDescription_, Constants.k_cchPublishedDocumentDescriptionMax); } - } - public UGCHandle_t m_hFile; // The handle of the primary file - public UGCHandle_t m_hPreviewFile; // The handle of the preview file - public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. - public uint m_rtimeCreated; // time when the published file was created - public uint m_rtimeUpdated; // time when the published file was last updated - public ERemoteStoragePublishedFileVisibility m_eVisibility; - [MarshalAs(UnmanagedType.I1)] - public bool m_bBanned; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchTagListMax)] - internal byte[] m_rgchTags_; - public string m_rgchTags // comma separated list of all tags associated with this file - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTags_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTags_, Constants.k_cchTagListMax); } - } - [MarshalAs(UnmanagedType.I1)] - public bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] - internal byte[] m_pchFileName_; - public string m_pchFileName // The name of the primary file - { - get { return InteropHelp.ByteArrayToStringUTF8(m_pchFileName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } - } - public int m_nFileSize; // Size of the primary file - public int m_nPreviewFileSize; // Size of the preview file - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedFileURLMax)] - internal byte[] m_rgchURL_; - public string m_rgchURL // URL (for a video or a website) - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchURL_, Constants.k_cchPublishedFileURLMax); } - } - public EWorkshopFileType m_eFileType; // Type of the file - [MarshalAs(UnmanagedType.I1)] - public bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop - } - - - //----------------------------------------------------------------------------- - // Purpose: The result of a call to GetPublishedFileDetails() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 18)] - internal struct RemoteStorageGetPublishedFileDetailsResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 18; + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nCreatorAppID; // ID of the app that created this file. public AppId_t m_nConsumerAppID; // ID of the app that will consume this file. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentTitleMax)] - internal byte[] m_rgchTitle_; - public string m_rgchTitle // title of document - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTitle_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTitle_, Constants.k_cchPublishedDocumentTitleMax); } - } - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentDescriptionMax)] - internal byte[] m_rgchDescription_; - public string m_rgchDescription // description of document - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchDescription_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchDescription_, Constants.k_cchPublishedDocumentDescriptionMax); } - } + public string m_rgchTitle; // title of document + public string m_rgchDescription; // description of document public UGCHandle_t m_hFile; // The handle of the primary file public UGCHandle_t m_hPreviewFile; // The handle of the preview file public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. @@ -5673,124 +3505,44 @@ public string m_rgchDescription // description of document public ERemoteStoragePublishedFileVisibility m_eVisibility; [MarshalAs(UnmanagedType.I1)] public bool m_bBanned; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchTagListMax)] - internal byte[] m_rgchTags_; - public string m_rgchTags // comma separated list of all tags associated with this file - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTags_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTags_, Constants.k_cchTagListMax); } - } + public string m_rgchTags; // comma separated list of all tags associated with this file [MarshalAs(UnmanagedType.I1)] public bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] - internal byte[] m_pchFileName_; - public string m_pchFileName // The name of the primary file - { - get { return InteropHelp.ByteArrayToStringUTF8(m_pchFileName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } - } + public string m_pchFileName; // The name of the primary file public int m_nFileSize; // Size of the primary file public int m_nPreviewFileSize; // Size of the preview file - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedFileURLMax)] - internal byte[] m_rgchURL_; - public string m_rgchURL // URL (for a video or a website) - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchURL_, Constants.k_cchPublishedFileURLMax); } - } + public string m_rgchURL; // URL (for a video or a website) public EWorkshopFileType m_eFileType; // Type of the file [MarshalAs(UnmanagedType.I1)] public bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop } - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 19)] - public struct RemoteStorageEnumerateWorkshopFilesResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 19; - public EResult m_eResult; - public int m_nResultsReturned; - public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public float[] m_rgScore; - public AppId_t m_nAppId; - public uint m_unStartIndex; - } - + public struct RemoteStorageEnumerateWorkshopFilesResult_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 19)] - internal struct RemoteStorageEnumerateWorkshopFilesResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 19; - public EResult m_eResult; - public int m_nResultsReturned; - public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public float[] m_rgScore; - public AppId_t m_nAppId; - public uint m_unStartIndex; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 19)] - internal struct RemoteStorageEnumerateWorkshopFilesResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 19; + : ICallbackIdentity + #endif + { public EResult m_eResult; public int m_nResultsReturned; public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public float[] m_rgScore; + public PublishedFileId_t m_rgPublishedFileId; + public float m_rgScore; public AppId_t m_nAppId; public uint m_unStartIndex; } - #endif //----------------------------------------------------------------------------- // Purpose: The result of GetPublishedItemVoteDetails //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 20)] - public struct RemoteStorageGetPublishedItemVoteDetailsResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 20; - public EResult m_eResult; - public PublishedFileId_t m_unPublishedFileId; - public int m_nVotesFor; - public int m_nVotesAgainst; - public int m_nReports; - public float m_fScore; - } - + public struct RemoteStorageGetPublishedItemVoteDetailsResult_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The result of GetPublishedItemVoteDetails - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 20)] - internal struct RemoteStorageGetPublishedItemVoteDetailsResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 20; - public EResult m_eResult; - public PublishedFileId_t m_unPublishedFileId; - public int m_nVotesFor; - public int m_nVotesAgainst; - public int m_nReports; - public float m_fScore; - } - - - //----------------------------------------------------------------------------- - // Purpose: The result of GetPublishedItemVoteDetails - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 20)] - internal struct RemoteStorageGetPublishedItemVoteDetailsResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 20; + : ICallbackIdentity + #endif + { public EResult m_eResult; public PublishedFileId_t m_unPublishedFileId; public int m_nVotesFor; @@ -5799,556 +3551,206 @@ internal struct RemoteStorageGetPublishedItemVoteDetailsResult_t_SmallPack { public float m_fScore; } - #endif //----------------------------------------------------------------------------- // Purpose: User subscribed to a file for the app (from within the app or on the web) //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 21)] - public struct RemoteStoragePublishedFileSubscribed_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 21; - public PublishedFileId_t m_nPublishedFileId; // The published file id - public AppId_t m_nAppID; // ID of the app that will consume this file. - } - + public struct RemoteStoragePublishedFileSubscribed_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: User subscribed to a file for the app (from within the app or on the web) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 21)] - internal struct RemoteStoragePublishedFileSubscribed_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 21; - public PublishedFileId_t m_nPublishedFileId; // The published file id - public AppId_t m_nAppID; // ID of the app that will consume this file. - } - - - //----------------------------------------------------------------------------- - // Purpose: User subscribed to a file for the app (from within the app or on the web) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 21)] - internal struct RemoteStoragePublishedFileSubscribed_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 21; - public PublishedFileId_t m_nPublishedFileId; // The published file id - public AppId_t m_nAppID; // ID of the app that will consume this file. - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: User unsubscribed from a file for the app (from within the app or on the web) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 22)] - public struct RemoteStoragePublishedFileUnsubscribed_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 22; - public PublishedFileId_t m_nPublishedFileId; // The published file id - public AppId_t m_nAppID; // ID of the app that will consume this file. - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: User unsubscribed from a file for the app (from within the app or on the web) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 22)] - internal struct RemoteStoragePublishedFileUnsubscribed_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 22; - public PublishedFileId_t m_nPublishedFileId; // The published file id - public AppId_t m_nAppID; // ID of the app that will consume this file. - } - - - //----------------------------------------------------------------------------- - // Purpose: User unsubscribed from a file for the app (from within the app or on the web) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 22)] - internal struct RemoteStoragePublishedFileUnsubscribed_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 22; - public PublishedFileId_t m_nPublishedFileId; // The published file id - public AppId_t m_nAppID; // ID of the app that will consume this file. - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: Published file that a user owns was deleted (from within the app or the web) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 23)] - public struct RemoteStoragePublishedFileDeleted_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 23; - public PublishedFileId_t m_nPublishedFileId; // The published file id - public AppId_t m_nAppID; // ID of the app that will consume this file. - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Published file that a user owns was deleted (from within the app or the web) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 23)] - internal struct RemoteStoragePublishedFileDeleted_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 23; - public PublishedFileId_t m_nPublishedFileId; // The published file id - public AppId_t m_nAppID; // ID of the app that will consume this file. - } - - - //----------------------------------------------------------------------------- - // Purpose: Published file that a user owns was deleted (from within the app or the web) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 23)] - internal struct RemoteStoragePublishedFileDeleted_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 23; - public PublishedFileId_t m_nPublishedFileId; // The published file id - public AppId_t m_nAppID; // ID of the app that will consume this file. - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: The result of a call to UpdateUserPublishedItemVote() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 24)] - public struct RemoteStorageUpdateUserPublishedItemVoteResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 24; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; // The published file id - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The result of a call to UpdateUserPublishedItemVote() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 24)] - internal struct RemoteStorageUpdateUserPublishedItemVoteResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 24; - public EResult m_eResult; // The result of the operation. + : ICallbackIdentity + #endif + { public PublishedFileId_t m_nPublishedFileId; // The published file id + public AppId_t m_nAppID; // ID of the app that will consume this file. } - //----------------------------------------------------------------------------- - // Purpose: The result of a call to UpdateUserPublishedItemVote() + // Purpose: User unsubscribed from a file for the app (from within the app or on the web) //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 24)] - internal struct RemoteStorageUpdateUserPublishedItemVoteResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 24; - public EResult m_eResult; // The result of the operation. + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 22)] + public struct RemoteStoragePublishedFileUnsubscribed_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public PublishedFileId_t m_nPublishedFileId; // The published file id + public AppId_t m_nAppID; // ID of the app that will consume this file. } - #endif //----------------------------------------------------------------------------- - // Purpose: The result of a call to GetUserPublishedItemVoteDetails() + // Purpose: Published file that a user owns was deleted (from within the app or the web) //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 25)] - public struct RemoteStorageUserVoteDetails_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 25; - public EResult m_eResult; // The result of the operation. + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 23)] + public struct RemoteStoragePublishedFileDeleted_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public PublishedFileId_t m_nPublishedFileId; // The published file id - public EWorkshopVote m_eVote; // what the user voted + public AppId_t m_nAppID; // ID of the app that will consume this file. } - #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- - // Purpose: The result of a call to GetUserPublishedItemVoteDetails() + // Purpose: The result of a call to UpdateUserPublishedItemVote() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 25)] - internal struct RemoteStorageUserVoteDetails_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 25; + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 24)] + public struct RemoteStorageUpdateUserPublishedItemVoteResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; // The published file id - public EWorkshopVote m_eVote; // what the user voted } - //----------------------------------------------------------------------------- // Purpose: The result of a call to GetUserPublishedItemVoteDetails() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 25)] - internal struct RemoteStorageUserVoteDetails_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 25; + public struct RemoteStorageUserVoteDetails_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; // The published file id public EWorkshopVote m_eVote; // what the user voted } - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 26)] - public struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 26; - public EResult m_eResult; // The result of the operation. - public int m_nResultsReturned; - public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; - } - + public struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 26)] - internal struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 26; - public EResult m_eResult; // The result of the operation. - public int m_nResultsReturned; - public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 26)] - internal struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 26; + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation. public int m_nResultsReturned; public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; + public PublishedFileId_t m_rgPublishedFileId; } - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 27)] - public struct RemoteStorageSetUserPublishedFileActionResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 27; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; // The published file id - public EWorkshopFileAction m_eAction; // the action that was attempted - } - + public struct RemoteStorageSetUserPublishedFileActionResult_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 27)] - internal struct RemoteStorageSetUserPublishedFileActionResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 27; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; // The published file id - public EWorkshopFileAction m_eAction; // the action that was attempted - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 27)] - internal struct RemoteStorageSetUserPublishedFileActionResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 27; + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; // The published file id public EWorkshopFileAction m_eAction; // the action that was attempted } - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 28)] - public struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 28; - public EResult m_eResult; // The result of the operation. - public EWorkshopFileAction m_eAction; // the action that was filtered on - public int m_nResultsReturned; - public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public uint[] m_rgRTimeUpdated; - } - + public struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 28)] - internal struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 28; - public EResult m_eResult; // The result of the operation. - public EWorkshopFileAction m_eAction; // the action that was filtered on - public int m_nResultsReturned; - public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public uint[] m_rgRTimeUpdated; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 28)] - internal struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 28; + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation. public EWorkshopFileAction m_eAction; // the action that was filtered on public int m_nResultsReturned; public int m_nTotalResultCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public PublishedFileId_t[] m_rgPublishedFileId; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] - public uint[] m_rgRTimeUpdated; + public PublishedFileId_t m_rgPublishedFileId; + public uint m_rgRTimeUpdated; } - #endif //----------------------------------------------------------------------------- // Purpose: Called periodically while a PublishWorkshopFile is in progress //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 29)] - public struct RemoteStoragePublishFileProgress_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 29; - public double m_dPercentFile; - [MarshalAs(UnmanagedType.I1)] - public bool m_bPreview; - } - + public struct RemoteStoragePublishFileProgress_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Called periodically while a PublishWorkshopFile is in progress - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 29)] - internal struct RemoteStoragePublishFileProgress_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 29; - public double m_dPercentFile; - [MarshalAs(UnmanagedType.I1)] - public bool m_bPreview; - } - - - //----------------------------------------------------------------------------- - // Purpose: Called periodically while a PublishWorkshopFile is in progress - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 29)] - internal struct RemoteStoragePublishFileProgress_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 29; + : ICallbackIdentity + #endif + { public double m_dPercentFile; [MarshalAs(UnmanagedType.I1)] public bool m_bPreview; } - #endif //----------------------------------------------------------------------------- // Purpose: Called when the content for a published file is updated //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 30)] - public struct RemoteStoragePublishedFileUpdated_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 30; - public PublishedFileId_t m_nPublishedFileId; // The published file id - public AppId_t m_nAppID; // ID of the app that will consume this file. - public ulong m_ulUnused; // not used anymore - } - + public struct RemoteStoragePublishedFileUpdated_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Called when the content for a published file is updated - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 30)] - internal struct RemoteStoragePublishedFileUpdated_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 30; - public PublishedFileId_t m_nPublishedFileId; // The published file id - public AppId_t m_nAppID; // ID of the app that will consume this file. - public ulong m_ulUnused; // not used anymore - } - - - //----------------------------------------------------------------------------- - // Purpose: Called when the content for a published file is updated - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 30)] - internal struct RemoteStoragePublishedFileUpdated_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 30; + : ICallbackIdentity + #endif + { public PublishedFileId_t m_nPublishedFileId; // The published file id public AppId_t m_nAppID; // ID of the app that will consume this file. public ulong m_ulUnused; // not used anymore } - #endif //----------------------------------------------------------------------------- // Purpose: Called when a FileWriteAsync completes //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 31)] - public struct RemoteStorageFileWriteAsyncComplete_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 31; - public EResult m_eResult; // result - } - + public struct RemoteStorageFileWriteAsyncComplete_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Called when a FileWriteAsync completes - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 31)] - internal struct RemoteStorageFileWriteAsyncComplete_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 31; - public EResult m_eResult; // result - } - - - //----------------------------------------------------------------------------- - // Purpose: Called when a FileWriteAsync completes - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 31)] - internal struct RemoteStorageFileWriteAsyncComplete_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 31; - public EResult m_eResult; // result - } - + : ICallbackIdentity #endif - //----------------------------------------------------------------------------- - // Purpose: Called when a FileReadAsync completes - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 32)] - public struct RemoteStorageFileReadAsyncComplete_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 32; - public SteamAPICall_t m_hFileReadAsync; // call handle of the async read which was made - public EResult m_eResult; // result - public uint m_nOffset; // offset in the file this read was at - public uint m_cubRead; // amount read - will the <= the amount requested - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Called when a FileReadAsync completes - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 32)] - internal struct RemoteStorageFileReadAsyncComplete_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 32; - public SteamAPICall_t m_hFileReadAsync; // call handle of the async read which was made + { public EResult m_eResult; // result - public uint m_nOffset; // offset in the file this read was at - public uint m_cubRead; // amount read - will the <= the amount requested } - //----------------------------------------------------------------------------- // Purpose: Called when a FileReadAsync completes //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 32)] - internal struct RemoteStorageFileReadAsyncComplete_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 32; + public struct RemoteStorageFileReadAsyncComplete_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public SteamAPICall_t m_hFileReadAsync; // call handle of the async read which was made public EResult m_eResult; // result public uint m_nOffset; // offset in the file this read was at public uint m_cubRead; // amount read - will the <= the amount requested } - #endif //----------------------------------------------------------------------------- // Purpose: one or more files for this app have changed locally after syncing // to remote session changes // Note: only posted if this happens DURING the local app session //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] + [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 33)] - public struct RemoteStorageLocalFileChange_t { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 33; - } - + public struct RemoteStorageLocalFileChange_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: one or more files for this app have changed locally after syncing - // to remote session changes - // Note: only posted if this happens DURING the local app session - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 33)] - internal struct RemoteStorageLocalFileChange_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 33; - } - - - //----------------------------------------------------------------------------- - // Purpose: one or more files for this app have changed locally after syncing - // to remote session changes - // Note: only posted if this happens DURING the local app session - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 33)] - internal struct RemoteStorageLocalFileChange_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 33; - } - + : ICallbackIdentity #endif - // callbacks - //----------------------------------------------------------------------------- - // Purpose: Screenshot successfully written or otherwise added to the library - // and can now be tagged - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamScreenshotsCallbacks + 1)] - public struct ScreenshotReady_t { - public const int k_iCallback = Constants.k_iSteamScreenshotsCallbacks + 1; - public ScreenshotHandle m_hLocal; - public EResult m_eResult; - } - - #if STEAMWORKS_ANYCPU - // callbacks - //----------------------------------------------------------------------------- - // Purpose: Screenshot successfully written or otherwise added to the library - // and can now be tagged - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamScreenshotsCallbacks + 1)] - internal struct ScreenshotReady_t_LargePack { - public const int k_iCallback = Constants.k_iSteamScreenshotsCallbacks + 1; - public ScreenshotHandle m_hLocal; - public EResult m_eResult; + { } - // callbacks //----------------------------------------------------------------------------- // Purpose: Screenshot successfully written or otherwise added to the library // and can now be tagged - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamScreenshotsCallbacks + 1)] - internal struct ScreenshotReady_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamScreenshotsCallbacks + 1; - public ScreenshotHandle m_hLocal; - public EResult m_eResult; - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: Screenshot has been requested by the user. Only sent if - // HookScreenshots() has been called, in which case Steam will not take - // the screenshot itself. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamScreenshotsCallbacks + 2)] - public struct ScreenshotRequested_t { - public const int k_iCallback = Constants.k_iSteamScreenshotsCallbacks + 2; - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Screenshot has been requested by the user. Only sent if - // HookScreenshots() has been called, in which case Steam will not take - // the screenshot itself. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamScreenshotsCallbacks + 2)] - internal struct ScreenshotRequested_t_LargePack { - public const int k_iCallback = Constants.k_iSteamScreenshotsCallbacks + 2; + //----------------------------------------------------------------------------- + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [CallbackIdentity(Constants.k_iSteamScreenshotsCallbacks + 1)] + public struct ScreenshotReady_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + public ScreenshotHandle m_hLocal; + public EResult m_eResult; } - //----------------------------------------------------------------------------- // Purpose: Screenshot has been requested by the user. Only sent if // HookScreenshots() has been called, in which case Steam will not take @@ -6356,25 +3758,24 @@ internal struct ScreenshotRequested_t_LargePack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamScreenshotsCallbacks + 2)] - internal struct ScreenshotRequested_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamScreenshotsCallbacks + 2; + public struct ScreenshotRequested_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { } - #endif //----------------------------------------------------------------------------- // Purpose: Callback for querying UGC //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamTimelineCallbacks + 1)] - public struct SteamTimelineGamePhaseRecordingExists_t { - public const int k_iCallback = Constants.k_iSteamTimelineCallbacks + 1; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchMaxPhaseIDLength)] - internal byte[] m_rgchPhaseID_; - public string m_rgchPhaseID - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchPhaseID_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchPhaseID_, Constants.k_cchMaxPhaseIDLength); } - } + public struct SteamTimelineGamePhaseRecordingExists_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + public string m_rgchPhaseID; public ulong m_ulRecordingMS; public ulong m_ulLongestClipMS; public uint m_unClipCount; @@ -6385,42 +3786,36 @@ public string m_rgchPhaseID //----------------------------------------------------------------------------- // Purpose: Callback for querying UGC //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamTimelineCallbacks + 1)] internal struct SteamTimelineGamePhaseRecordingExists_t_LargePack { public const int k_iCallback = Constants.k_iSteamTimelineCallbacks + 1; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchMaxPhaseIDLength)] - internal byte[] m_rgchPhaseID_; - public string m_rgchPhaseID - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchPhaseID_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchPhaseID_, Constants.k_cchMaxPhaseIDLength); } - } + public static int CallbackIdentity { get; } = Constants.k_iSteamTimelineCallbacks + 1; + public string m_rgchPhaseID; public ulong m_ulRecordingMS; public ulong m_ulLongestClipMS; public uint m_unClipCount; public uint m_unScreenshotCount; - } + public static implicit operator SteamTimelineGamePhaseRecordingExists_t(SteamTimelineGamePhaseRecordingExists_t_LargePack value) { + SteamTimelineGamePhaseRecordingExists_t result = default; + result.m_rgchPhaseID = value.m_rgchPhaseID; + result.m_ulRecordingMS = value.m_ulRecordingMS; + result.m_ulLongestClipMS = value.m_ulLongestClipMS; + result.m_unClipCount = value.m_unClipCount; + result.m_unScreenshotCount = value.m_unScreenshotCount; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: Callback for querying UGC - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamTimelineCallbacks + 1)] - internal struct SteamTimelineGamePhaseRecordingExists_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamTimelineCallbacks + 1; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchMaxPhaseIDLength)] - internal byte[] m_rgchPhaseID_; - public string m_rgchPhaseID - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchPhaseID_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchPhaseID_, Constants.k_cchMaxPhaseIDLength); } + public static implicit operator SteamTimelineGamePhaseRecordingExists_t_LargePack(SteamTimelineGamePhaseRecordingExists_t value) { + SteamTimelineGamePhaseRecordingExists_t_LargePack result = default; + result.m_rgchPhaseID = value.m_rgchPhaseID; + result.m_ulRecordingMS = value.m_ulRecordingMS; + result.m_ulLongestClipMS = value.m_ulLongestClipMS; + result.m_unClipCount = value.m_unClipCount; + result.m_unScreenshotCount = value.m_unScreenshotCount; + return result; } - public ulong m_ulRecordingMS; - public ulong m_ulLongestClipMS; - public uint m_unClipCount; - public uint m_unScreenshotCount; } #endif @@ -6429,155 +3824,60 @@ public string m_rgchPhaseID //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamTimelineCallbacks + 2)] - public struct SteamTimelineEventRecordingExists_t { - public const int k_iCallback = Constants.k_iSteamTimelineCallbacks + 2; - public ulong m_ulEventID; - [MarshalAs(UnmanagedType.I1)] - public bool m_bRecordingExists; - } - + public struct SteamTimelineEventRecordingExists_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Callback for querying UGC - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamTimelineCallbacks + 2)] - internal struct SteamTimelineEventRecordingExists_t_LargePack { - public const int k_iCallback = Constants.k_iSteamTimelineCallbacks + 2; - public ulong m_ulEventID; - [MarshalAs(UnmanagedType.I1)] - public bool m_bRecordingExists; - } - - - //----------------------------------------------------------------------------- - // Purpose: Callback for querying UGC - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamTimelineCallbacks + 2)] - internal struct SteamTimelineEventRecordingExists_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamTimelineCallbacks + 2; + : ICallbackIdentity + #endif + { public ulong m_ulEventID; [MarshalAs(UnmanagedType.I1)] public bool m_bRecordingExists; } - #endif //----------------------------------------------------------------------------- // Purpose: Callback for querying UGC //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 1)] - public struct SteamUGCQueryCompleted_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 1; - public UGCQueryHandle_t m_handle; - public EResult m_eResult; - public uint m_unNumResultsReturned; - public uint m_unTotalMatchingResults; - [MarshalAs(UnmanagedType.I1)] - public bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedFileURLMax)] - internal byte[] m_rgchNextCursor_; - public string m_rgchNextCursor // If a paging cursor was used, then this will be the next cursor to get the next result set. - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchNextCursor_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchNextCursor_, Constants.k_cchPublishedFileURLMax); } - } - } - + public struct SteamUGCQueryCompleted_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Callback for querying UGC - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 1)] - internal struct SteamUGCQueryCompleted_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 1; - public UGCQueryHandle_t m_handle; - public EResult m_eResult; - public uint m_unNumResultsReturned; - public uint m_unTotalMatchingResults; - [MarshalAs(UnmanagedType.I1)] - public bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedFileURLMax)] - internal byte[] m_rgchNextCursor_; - public string m_rgchNextCursor // If a paging cursor was used, then this will be the next cursor to get the next result set. - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchNextCursor_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchNextCursor_, Constants.k_cchPublishedFileURLMax); } - } - } - - - //----------------------------------------------------------------------------- - // Purpose: Callback for querying UGC - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 1)] - internal struct SteamUGCQueryCompleted_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 1; + : ICallbackIdentity + #endif + { public UGCQueryHandle_t m_handle; public EResult m_eResult; public uint m_unNumResultsReturned; public uint m_unTotalMatchingResults; [MarshalAs(UnmanagedType.I1)] public bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedFileURLMax)] - internal byte[] m_rgchNextCursor_; - public string m_rgchNextCursor // If a paging cursor was used, then this will be the next cursor to get the next result set. - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchNextCursor_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchNextCursor_, Constants.k_cchPublishedFileURLMax); } - } + public string m_rgchNextCursor; // If a paging cursor was used, then this will be the next cursor to get the next result set. } - #endif //----------------------------------------------------------------------------- // Purpose: Callback for requesting details on one piece of UGC //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 2)] - public struct SteamUGCRequestUGCDetailsResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 2; - public SteamUGCDetails_t m_details; - [MarshalAs(UnmanagedType.I1)] - public bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache - } - + public struct SteamUGCRequestUGCDetailsResult_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Callback for requesting details on one piece of UGC - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 2)] - internal struct SteamUGCRequestUGCDetailsResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 2; - public SteamUGCDetails_t m_details; - [MarshalAs(UnmanagedType.I1)] - public bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache - } - - - //----------------------------------------------------------------------------- - // Purpose: Callback for requesting details on one piece of UGC - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 2)] - internal struct SteamUGCRequestUGCDetailsResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 2; + : ICallbackIdentity + #endif + { public SteamUGCDetails_t m_details; [MarshalAs(UnmanagedType.I1)] public bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache } - #endif //----------------------------------------------------------------------------- // Purpose: result for ISteamUGC::CreateItem() //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 3)] - public struct CreateItemResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 3; + public struct CreateItemResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID [MarshalAs(UnmanagedType.I1)] @@ -6588,28 +3888,31 @@ public struct CreateItemResult_t { //----------------------------------------------------------------------------- // Purpose: result for ISteamUGC::CreateItem() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 3)] internal struct CreateItemResult_t_LargePack { public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 3; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID [MarshalAs(UnmanagedType.I1)] public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; - } + public static implicit operator CreateItemResult_t(CreateItemResult_t_LargePack value) { + CreateItemResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_bUserNeedsToAcceptWorkshopLegalAgreement = value.m_bUserNeedsToAcceptWorkshopLegalAgreement; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: result for ISteamUGC::CreateItem() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 3)] - internal struct CreateItemResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 3; - public EResult m_eResult; - public PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID - [MarshalAs(UnmanagedType.I1)] - public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; + public static implicit operator CreateItemResult_t_LargePack(CreateItemResult_t value) { + CreateItemResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_bUserNeedsToAcceptWorkshopLegalAgreement = value.m_bUserNeedsToAcceptWorkshopLegalAgreement; + return result; + } } #endif @@ -6618,50 +3921,27 @@ internal struct CreateItemResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 4)] - public struct SubmitItemUpdateResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 4; - public EResult m_eResult; - [MarshalAs(UnmanagedType.I1)] - public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; - public PublishedFileId_t m_nPublishedFileId; - } - + public struct SubmitItemUpdateResult_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: result for ISteamUGC::SubmitItemUpdate() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 4)] - internal struct SubmitItemUpdateResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 4; - public EResult m_eResult; - [MarshalAs(UnmanagedType.I1)] - public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; - public PublishedFileId_t m_nPublishedFileId; - } - - - //----------------------------------------------------------------------------- - // Purpose: result for ISteamUGC::SubmitItemUpdate() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 4)] - internal struct SubmitItemUpdateResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 4; + : ICallbackIdentity + #endif + { public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; public PublishedFileId_t m_nPublishedFileId; } - #endif //----------------------------------------------------------------------------- // Purpose: a Workshop item has been installed or updated //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 5)] - public struct ItemInstalled_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 5; + public struct ItemInstalled_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public AppId_t m_unAppID; public PublishedFileId_t m_nPublishedFileId; public UGCHandle_t m_hLegacyContent; @@ -6672,28 +3952,33 @@ public struct ItemInstalled_t { //----------------------------------------------------------------------------- // Purpose: a Workshop item has been installed or updated //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 5)] internal struct ItemInstalled_t_LargePack { public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 5; public AppId_t m_unAppID; public PublishedFileId_t m_nPublishedFileId; public UGCHandle_t m_hLegacyContent; public ulong m_unManifestID; - } + public static implicit operator ItemInstalled_t(ItemInstalled_t_LargePack value) { + ItemInstalled_t result = default; + result.m_unAppID = value.m_unAppID; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_hLegacyContent = value.m_hLegacyContent; + result.m_unManifestID = value.m_unManifestID; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: a Workshop item has been installed or updated - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 5)] - internal struct ItemInstalled_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 5; - public AppId_t m_unAppID; - public PublishedFileId_t m_nPublishedFileId; - public UGCHandle_t m_hLegacyContent; - public ulong m_unManifestID; + public static implicit operator ItemInstalled_t_LargePack(ItemInstalled_t value) { + ItemInstalled_t_LargePack result = default; + result.m_unAppID = value.m_unAppID; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_hLegacyContent = value.m_hLegacyContent; + result.m_unManifestID = value.m_unManifestID; + return result; + } } #endif @@ -6702,167 +3987,89 @@ internal struct ItemInstalled_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 6)] - public struct DownloadItemResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 6; - public AppId_t m_unAppID; - public PublishedFileId_t m_nPublishedFileId; - public EResult m_eResult; - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: result of DownloadItem(), existing item files can be accessed again - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 6)] - internal struct DownloadItemResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 6; - public AppId_t m_unAppID; - public PublishedFileId_t m_nPublishedFileId; - public EResult m_eResult; - } - - - //----------------------------------------------------------------------------- - // Purpose: result of DownloadItem(), existing item files can be accessed again - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 6)] - internal struct DownloadItemResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 6; - public AppId_t m_unAppID; - public PublishedFileId_t m_nPublishedFileId; - public EResult m_eResult; - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: result of AddItemToFavorites() or RemoveItemFromFavorites() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 7)] - public struct UserFavoriteItemsListChanged_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 7; - public PublishedFileId_t m_nPublishedFileId; - public EResult m_eResult; - [MarshalAs(UnmanagedType.I1)] - public bool m_bWasAddRequest; - } - + public struct DownloadItemResult_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: result of AddItemToFavorites() or RemoveItemFromFavorites() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 7)] - internal struct UserFavoriteItemsListChanged_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 7; - public PublishedFileId_t m_nPublishedFileId; - public EResult m_eResult; - [MarshalAs(UnmanagedType.I1)] - public bool m_bWasAddRequest; - } - - - //----------------------------------------------------------------------------- - // Purpose: result of AddItemToFavorites() or RemoveItemFromFavorites() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 7)] - internal struct UserFavoriteItemsListChanged_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 7; - public PublishedFileId_t m_nPublishedFileId; - public EResult m_eResult; - [MarshalAs(UnmanagedType.I1)] - public bool m_bWasAddRequest; - } - + : ICallbackIdentity #endif - //----------------------------------------------------------------------------- - // Purpose: The result of a call to SetUserItemVote() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 8)] - public struct SetUserItemVoteResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 8; + { + public AppId_t m_unAppID; public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; - [MarshalAs(UnmanagedType.I1)] - public bool m_bVoteUp; } #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- - // Purpose: The result of a call to SetUserItemVote() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 8)] - internal struct SetUserItemVoteResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 8; - public PublishedFileId_t m_nPublishedFileId; - public EResult m_eResult; - [MarshalAs(UnmanagedType.I1)] - public bool m_bVoteUp; - } - - - //----------------------------------------------------------------------------- - // Purpose: The result of a call to SetUserItemVote() + // Purpose: result of DownloadItem(), existing item files can be accessed again //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 8)] - internal struct SetUserItemVoteResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 8; + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 6)] + internal struct DownloadItemResult_t_LargePack { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 6; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 6; + public AppId_t m_unAppID; public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; - [MarshalAs(UnmanagedType.I1)] - public bool m_bVoteUp; + + public static implicit operator DownloadItemResult_t(DownloadItemResult_t_LargePack value) { + DownloadItemResult_t result = default; + result.m_unAppID = value.m_unAppID; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_eResult = value.m_eResult; + return result; + } + + public static implicit operator DownloadItemResult_t_LargePack(DownloadItemResult_t value) { + DownloadItemResult_t_LargePack result = default; + result.m_unAppID = value.m_unAppID; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_eResult = value.m_eResult; + return result; + } } #endif //----------------------------------------------------------------------------- - // Purpose: The result of a call to GetUserItemVote() + // Purpose: result of AddItemToFavorites() or RemoveItemFromFavorites() //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 9)] - public struct GetUserItemVoteResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 9; + [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 7)] + public struct UserFavoriteItemsListChanged_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] - public bool m_bVotedUp; - [MarshalAs(UnmanagedType.I1)] - public bool m_bVotedDown; - [MarshalAs(UnmanagedType.I1)] - public bool m_bVoteSkipped; + public bool m_bWasAddRequest; } - #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- - // Purpose: The result of a call to GetUserItemVote() + // Purpose: The result of a call to SetUserItemVote() //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 9)] - internal struct GetUserItemVoteResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 9; + [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 8)] + public struct SetUserItemVoteResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] - public bool m_bVotedUp; - [MarshalAs(UnmanagedType.I1)] - public bool m_bVotedDown; - [MarshalAs(UnmanagedType.I1)] - public bool m_bVoteSkipped; + public bool m_bVoteUp; } - //----------------------------------------------------------------------------- // Purpose: The result of a call to GetUserItemVote() //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 9)] - internal struct GetUserItemVoteResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 9; + public struct GetUserItemVoteResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] @@ -6873,80 +4080,42 @@ internal struct GetUserItemVoteResult_t_SmallPack { public bool m_bVoteSkipped; } - #endif //----------------------------------------------------------------------------- // Purpose: The result of a call to StartPlaytimeTracking() //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 10)] - public struct StartPlaytimeTrackingResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 10; - public EResult m_eResult; - } - + public struct StartPlaytimeTrackingResult_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The result of a call to StartPlaytimeTracking() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 10)] - internal struct StartPlaytimeTrackingResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 10; - public EResult m_eResult; - } - - - //----------------------------------------------------------------------------- - // Purpose: The result of a call to StartPlaytimeTracking() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 10)] - internal struct StartPlaytimeTrackingResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 10; - public EResult m_eResult; - } - + : ICallbackIdentity #endif - //----------------------------------------------------------------------------- - // Purpose: The result of a call to StopPlaytimeTracking() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 11)] - public struct StopPlaytimeTrackingResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 11; + { public EResult m_eResult; } - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The result of a call to StopPlaytimeTracking() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 11)] - internal struct StopPlaytimeTrackingResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 11; - public EResult m_eResult; - } - - //----------------------------------------------------------------------------- // Purpose: The result of a call to StopPlaytimeTracking() //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 11)] - internal struct StopPlaytimeTrackingResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 11; + public struct StopPlaytimeTrackingResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; } - #endif //----------------------------------------------------------------------------- // Purpose: The result of a call to AddDependency //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 12)] - public struct AddUGCDependencyResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 12; + public struct AddUGCDependencyResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public PublishedFileId_t m_nChildPublishedFileId; @@ -6956,26 +4125,30 @@ public struct AddUGCDependencyResult_t { //----------------------------------------------------------------------------- // Purpose: The result of a call to AddDependency //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 12)] internal struct AddUGCDependencyResult_t_LargePack { public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 12; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 12; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public PublishedFileId_t m_nChildPublishedFileId; - } + public static implicit operator AddUGCDependencyResult_t(AddUGCDependencyResult_t_LargePack value) { + AddUGCDependencyResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_nChildPublishedFileId = value.m_nChildPublishedFileId; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: The result of a call to AddDependency - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 12)] - internal struct AddUGCDependencyResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 12; - public EResult m_eResult; - public PublishedFileId_t m_nPublishedFileId; - public PublishedFileId_t m_nChildPublishedFileId; + public static implicit operator AddUGCDependencyResult_t_LargePack(AddUGCDependencyResult_t value) { + AddUGCDependencyResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_nChildPublishedFileId = value.m_nChildPublishedFileId; + return result; + } } #endif @@ -6984,8 +4157,11 @@ internal struct AddUGCDependencyResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 13)] - public struct RemoveUGCDependencyResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 13; + public struct RemoveUGCDependencyResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public PublishedFileId_t m_nChildPublishedFileId; @@ -6995,26 +4171,30 @@ public struct RemoveUGCDependencyResult_t { //----------------------------------------------------------------------------- // Purpose: The result of a call to RemoveDependency //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 13)] internal struct RemoveUGCDependencyResult_t_LargePack { public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 13; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 13; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public PublishedFileId_t m_nChildPublishedFileId; - } + public static implicit operator RemoveUGCDependencyResult_t(RemoveUGCDependencyResult_t_LargePack value) { + RemoveUGCDependencyResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_nChildPublishedFileId = value.m_nChildPublishedFileId; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: The result of a call to RemoveDependency - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 13)] - internal struct RemoveUGCDependencyResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 13; - public EResult m_eResult; - public PublishedFileId_t m_nPublishedFileId; - public PublishedFileId_t m_nChildPublishedFileId; + public static implicit operator RemoveUGCDependencyResult_t_LargePack(RemoveUGCDependencyResult_t value) { + RemoveUGCDependencyResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_nChildPublishedFileId = value.m_nChildPublishedFileId; + return result; + } } #endif @@ -7023,8 +4203,11 @@ internal struct RemoveUGCDependencyResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 14)] - public struct AddAppDependencyResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 14; + public struct AddAppDependencyResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; @@ -7034,26 +4217,30 @@ public struct AddAppDependencyResult_t { //----------------------------------------------------------------------------- // Purpose: The result of a call to AddAppDependency //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 14)] internal struct AddAppDependencyResult_t_LargePack { public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 14; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 14; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; - } + public static implicit operator AddAppDependencyResult_t(AddAppDependencyResult_t_LargePack value) { + AddAppDependencyResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_nAppID = value.m_nAppID; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: The result of a call to AddAppDependency - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 14)] - internal struct AddAppDependencyResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 14; - public EResult m_eResult; - public PublishedFileId_t m_nPublishedFileId; - public AppId_t m_nAppID; + public static implicit operator AddAppDependencyResult_t_LargePack(AddAppDependencyResult_t value) { + AddAppDependencyResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_nAppID = value.m_nAppID; + return result; + } } #endif @@ -7062,8 +4249,11 @@ internal struct AddAppDependencyResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 15)] - public struct RemoveAppDependencyResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 15; + public struct RemoveAppDependencyResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; @@ -7073,26 +4263,30 @@ public struct RemoveAppDependencyResult_t { //----------------------------------------------------------------------------- // Purpose: The result of a call to RemoveAppDependency //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 15)] internal struct RemoveAppDependencyResult_t_LargePack { public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 15; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 15; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; - } + public static implicit operator RemoveAppDependencyResult_t(RemoveAppDependencyResult_t_LargePack value) { + RemoveAppDependencyResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_nAppID = value.m_nAppID; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: The result of a call to RemoveAppDependency - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 15)] - internal struct RemoveAppDependencyResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 15; - public EResult m_eResult; - public PublishedFileId_t m_nPublishedFileId; - public AppId_t m_nAppID; + public static implicit operator RemoveAppDependencyResult_t_LargePack(RemoveAppDependencyResult_t value) { + RemoveAppDependencyResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_nAppID = value.m_nAppID; + return result; + } } #endif @@ -7102,12 +4296,14 @@ internal struct RemoveAppDependencyResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 16)] - public struct GetAppDependenciesResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 16; + public struct GetAppDependenciesResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public AppId_t[] m_rgAppIDs; + public AppId_t m_rgAppIDs; public uint m_nNumAppDependencies; // number returned in this struct public uint m_nTotalNumAppDependencies; // total found } @@ -7117,33 +4313,36 @@ public struct GetAppDependenciesResult_t { // Purpose: The result of a call to GetAppDependencies. Callback may be called // multiple times until all app dependencies have been returned. //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 16)] internal struct GetAppDependenciesResult_t_LargePack { public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 16; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 16; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public AppId_t[] m_rgAppIDs; + public AppId_t m_rgAppIDs; public uint m_nNumAppDependencies; // number returned in this struct public uint m_nTotalNumAppDependencies; // total found - } + public static implicit operator GetAppDependenciesResult_t(GetAppDependenciesResult_t_LargePack value) { + GetAppDependenciesResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_rgAppIDs = value.m_rgAppIDs; + result.m_nNumAppDependencies = value.m_nNumAppDependencies; + result.m_nTotalNumAppDependencies = value.m_nTotalNumAppDependencies; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: The result of a call to GetAppDependencies. Callback may be called - // multiple times until all app dependencies have been returned. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 16)] - internal struct GetAppDependenciesResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 16; - public EResult m_eResult; - public PublishedFileId_t m_nPublishedFileId; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public AppId_t[] m_rgAppIDs; - public uint m_nNumAppDependencies; // number returned in this struct - public uint m_nTotalNumAppDependencies; // total found + public static implicit operator GetAppDependenciesResult_t_LargePack(GetAppDependenciesResult_t value) { + GetAppDependenciesResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_rgAppIDs = value.m_rgAppIDs; + result.m_nNumAppDependencies = value.m_nNumAppDependencies; + result.m_nTotalNumAppDependencies = value.m_nTotalNumAppDependencies; + return result; + } } #endif @@ -7152,8 +4351,11 @@ internal struct GetAppDependenciesResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 17)] - public struct DeleteItemResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 17; + public struct DeleteItemResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; } @@ -7162,24 +4364,27 @@ public struct DeleteItemResult_t { //----------------------------------------------------------------------------- // Purpose: The result of a call to DeleteItem //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 17)] internal struct DeleteItemResult_t_LargePack { public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 17; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 17; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; - } + public static implicit operator DeleteItemResult_t(DeleteItemResult_t_LargePack value) { + DeleteItemResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: The result of a call to DeleteItem - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 17)] - internal struct DeleteItemResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 17; - public EResult m_eResult; - public PublishedFileId_t m_nPublishedFileId; + public static implicit operator DeleteItemResult_t_LargePack(DeleteItemResult_t value) { + DeleteItemResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + return result; + } } #endif @@ -7188,118 +4393,34 @@ internal struct DeleteItemResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 18)] - public struct UserSubscribedItemsListChanged_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 18; - public AppId_t m_nAppID; - } - + public struct UserSubscribedItemsListChanged_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: signal that the list of subscribed items changed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 18)] - internal struct UserSubscribedItemsListChanged_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 18; - public AppId_t m_nAppID; - } - - - //----------------------------------------------------------------------------- - // Purpose: signal that the list of subscribed items changed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 18)] - internal struct UserSubscribedItemsListChanged_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 18; - public AppId_t m_nAppID; - } - + : ICallbackIdentity #endif - //----------------------------------------------------------------------------- - // Purpose: Status of the user's acceptable/rejection of the app's specific Workshop EULA - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 20)] - public struct WorkshopEULAStatus_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 20; - public EResult m_eResult; - public AppId_t m_nAppID; - public uint m_unVersion; - public RTime32 m_rtAction; - [MarshalAs(UnmanagedType.I1)] - public bool m_bAccepted; - [MarshalAs(UnmanagedType.I1)] - public bool m_bNeedsAction; - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Status of the user's acceptable/rejection of the app's specific Workshop EULA - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 20)] - internal struct WorkshopEULAStatus_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 20; - public EResult m_eResult; + { public AppId_t m_nAppID; - public uint m_unVersion; - public RTime32 m_rtAction; - [MarshalAs(UnmanagedType.I1)] - public bool m_bAccepted; - [MarshalAs(UnmanagedType.I1)] - public bool m_bNeedsAction; } - //----------------------------------------------------------------------------- // Purpose: Status of the user's acceptable/rejection of the app's specific Workshop EULA //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 20)] - internal struct WorkshopEULAStatus_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 20; + public struct WorkshopEULAStatus_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public AppId_t m_nAppID; public uint m_unVersion; - public RTime32 m_rtAction; - [MarshalAs(UnmanagedType.I1)] - public bool m_bAccepted; - [MarshalAs(UnmanagedType.I1)] - public bool m_bNeedsAction; - } - - #endif - // callbacks - //----------------------------------------------------------------------------- - // Purpose: Called when an authenticated connection to the Steam back-end has been established. - // This means the Steam client now has a working connection to the Steam servers. - // Usually this will have occurred before the game has launched, and should - // only be seen if the user has dropped connection due to a networking issue - // or a Steam server update. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 1)] - public struct SteamServersConnected_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 1; - } - - #if STEAMWORKS_ANYCPU - // callbacks - //----------------------------------------------------------------------------- - // Purpose: Called when an authenticated connection to the Steam back-end has been established. - // This means the Steam client now has a working connection to the Steam servers. - // Usually this will have occurred before the game has launched, and should - // only be seen if the user has dropped connection due to a networking issue - // or a Steam server update. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 1)] - internal struct SteamServersConnected_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 1; + public RTime32 m_rtAction; + [MarshalAs(UnmanagedType.I1)] + public bool m_bAccepted; + [MarshalAs(UnmanagedType.I1)] + public bool m_bNeedsAction; } - // callbacks //----------------------------------------------------------------------------- // Purpose: Called when an authenticated connection to the Steam back-end has been established. @@ -7310,41 +4431,13 @@ internal struct SteamServersConnected_t_LargePack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 1)] - internal struct SteamServersConnected_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 1; - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: called when a connection attempt has failed - // this will occur periodically if the Steam client is not connected, - // and has failed in it's retry to establish a connection - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 2)] - public struct SteamServerConnectFailure_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 2; - public EResult m_eResult; - [MarshalAs(UnmanagedType.I1)] - public bool m_bStillRetrying; - } - + public struct SteamServersConnected_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: called when a connection attempt has failed - // this will occur periodically if the Steam client is not connected, - // and has failed in it's retry to establish a connection - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 2)] - internal struct SteamServerConnectFailure_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 2; - public EResult m_eResult; - [MarshalAs(UnmanagedType.I1)] - public bool m_bStillRetrying; + : ICallbackIdentity + #endif + { } - //----------------------------------------------------------------------------- // Purpose: called when a connection attempt has failed // this will occur periodically if the Steam client is not connected, @@ -7352,50 +4445,30 @@ internal struct SteamServerConnectFailure_t_LargePack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 2)] - internal struct SteamServerConnectFailure_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 2; + public struct SteamServerConnectFailure_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] public bool m_bStillRetrying; } - #endif //----------------------------------------------------------------------------- // Purpose: called if the client has lost connection to the Steam servers // real-time services will be disabled until a matching SteamServersConnected_t has been posted //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 3)] - public struct SteamServersDisconnected_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 3; - public EResult m_eResult; - } - + public struct SteamServersDisconnected_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: called if the client has lost connection to the Steam servers - // real-time services will be disabled until a matching SteamServersConnected_t has been posted - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 3)] - internal struct SteamServersDisconnected_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 3; - public EResult m_eResult; - } - - - //----------------------------------------------------------------------------- - // Purpose: called if the client has lost connection to the Steam servers - // real-time services will be disabled until a matching SteamServersConnected_t has been posted - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 3)] - internal struct SteamServersDisconnected_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 3; + : ICallbackIdentity + #endif + { public EResult m_eResult; } - #endif //----------------------------------------------------------------------------- // Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server, // which it may be in the process of or already connected to. @@ -7404,46 +4477,11 @@ internal struct SteamServersDisconnected_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 13)] - public struct ClientGameServerDeny_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 13; - - public uint m_uAppID; - public uint m_unGameServerIP; - public ushort m_usGameServerPort; - public ushort m_bSecure; - public uint m_uReason; - } - + public struct ClientGameServerDeny_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server, - // which it may be in the process of or already connected to. - // The game client should immediately disconnect upon receiving this message. - // This can usually occur if the user doesn't have rights to play on the game server. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 13)] - internal struct ClientGameServerDeny_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 13; - - public uint m_uAppID; - public uint m_unGameServerIP; - public ushort m_usGameServerPort; - public ushort m_bSecure; - public uint m_uReason; - } - - - //----------------------------------------------------------------------------- - // Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server, - // which it may be in the process of or already connected to. - // The game client should immediately disconnect upon receiving this message. - // This can usually occur if the user doesn't have rights to play on the game server. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 13)] - internal struct ClientGameServerDeny_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 13; + : ICallbackIdentity + #endif + { public uint m_uAppID; public uint m_unGameServerIP; @@ -7452,345 +4490,190 @@ internal struct ClientGameServerDeny_t_SmallPack { public uint m_uReason; } - #endif //----------------------------------------------------------------------------- // Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks) // When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect. // This usually occurs in the rare event the Steam client has some kind of fatal error. //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 17)] - public struct IPCFailure_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 17; - public byte m_eFailureType; - } - + public struct IPCFailure_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks) - // When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect. - // This usually occurs in the rare event the Steam client has some kind of fatal error. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 17)] - internal struct IPCFailure_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 17; - public byte m_eFailureType; - } - - - //----------------------------------------------------------------------------- - // Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks) - // When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect. - // This usually occurs in the rare event the Steam client has some kind of fatal error. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 17)] - internal struct IPCFailure_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 17; - public byte m_eFailureType; - } - + : ICallbackIdentity #endif - //----------------------------------------------------------------------------- - // Purpose: Signaled whenever licenses change - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 25)] - public struct LicensesUpdated_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 25; + { } - #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- // Purpose: Signaled whenever licenses change //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 25)] - internal struct LicensesUpdated_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 25; + public struct LicensesUpdated_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { } - //----------------------------------------------------------------------------- - // Purpose: Signaled whenever licenses change + // callback for BeginAuthSession //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 25)] - internal struct LicensesUpdated_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 25; + [StructLayout(LayoutKind.Sequential, Pack = 4)] + [CallbackIdentity(Constants.k_iSteamUserCallbacks + 43)] + public struct ValidateAuthTicketResponse_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + public CSteamID m_SteamID; + public EAuthSessionResponse m_eAuthSessionResponse; + public CSteamID m_OwnerSteamID; // different from m_SteamID if borrowed } - #endif + #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- // callback for BeginAuthSession //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 4)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 43)] - public struct ValidateAuthTicketResponse_t { + internal struct ValidateAuthTicketResponse_t_LargePack { public const int k_iCallback = Constants.k_iSteamUserCallbacks + 43; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 43; public CSteamID m_SteamID; public EAuthSessionResponse m_eAuthSessionResponse; public CSteamID m_OwnerSteamID; // different from m_SteamID if borrowed - } - //----------------------------------------------------------------------------- - // Purpose: called when a user has responded to a microtransaction authorization request - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 52)] - public struct MicroTxnAuthorizationResponse_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 52; - - public uint m_unAppID; // AppID for this microtransaction - public ulong m_ulOrderID; // OrderID provided for the microtransaction - public byte m_bAuthorized; // if user authorized transaction - } + public static implicit operator ValidateAuthTicketResponse_t(ValidateAuthTicketResponse_t_LargePack value) { + ValidateAuthTicketResponse_t result = default; + result.m_SteamID = value.m_SteamID; + result.m_eAuthSessionResponse = value.m_eAuthSessionResponse; + result.m_OwnerSteamID = value.m_OwnerSteamID; + return result; + } - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: called when a user has responded to a microtransaction authorization request - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 52)] - internal struct MicroTxnAuthorizationResponse_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 52; - - public uint m_unAppID; // AppID for this microtransaction - public ulong m_ulOrderID; // OrderID provided for the microtransaction - public byte m_bAuthorized; // if user authorized transaction + public static implicit operator ValidateAuthTicketResponse_t_LargePack(ValidateAuthTicketResponse_t value) { + ValidateAuthTicketResponse_t_LargePack result = default; + result.m_SteamID = value.m_SteamID; + result.m_eAuthSessionResponse = value.m_eAuthSessionResponse; + result.m_OwnerSteamID = value.m_OwnerSteamID; + return result; + } } - + #endif //----------------------------------------------------------------------------- // Purpose: called when a user has responded to a microtransaction authorization request //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 52)] - internal struct MicroTxnAuthorizationResponse_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 52; + public struct MicroTxnAuthorizationResponse_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public uint m_unAppID; // AppID for this microtransaction public ulong m_ulOrderID; // OrderID provided for the microtransaction public byte m_bAuthorized; // if user authorized transaction } - #endif - //----------------------------------------------------------------------------- - // Purpose: Result from RequestEncryptedAppTicket - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 54)] - public struct EncryptedAppTicketResponse_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 54; - - public EResult m_eResult; - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Result from RequestEncryptedAppTicket - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 54)] - internal struct EncryptedAppTicketResponse_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 54; - - public EResult m_eResult; - } - - - //----------------------------------------------------------------------------- - // Purpose: Result from RequestEncryptedAppTicket - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 54)] - internal struct EncryptedAppTicketResponse_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 54; - - public EResult m_eResult; - } - - #endif - //----------------------------------------------------------------------------- - // callback for GetAuthSessionTicket - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 63)] - public struct GetAuthSessionTicketResponse_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 63; - public HAuthTicket m_hAuthTicket; - public EResult m_eResult; - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // callback for GetAuthSessionTicket - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 63)] - internal struct GetAuthSessionTicketResponse_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 63; - public HAuthTicket m_hAuthTicket; - public EResult m_eResult; - } - - - //----------------------------------------------------------------------------- - // callback for GetAuthSessionTicket - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 63)] - internal struct GetAuthSessionTicketResponse_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 63; - public HAuthTicket m_hAuthTicket; - public EResult m_eResult; - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: sent to your game in response to a steam://gamewebcallback/ command - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 64)] - public struct GameWebCallback_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 64; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_szURL_; - public string m_szURL - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szURL_, 256); } - } - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: sent to your game in response to a steam://gamewebcallback/ command - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 64)] - internal struct GameWebCallback_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 64; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_szURL_; - public string m_szURL - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szURL_, 256); } - } - } - - - //----------------------------------------------------------------------------- - // Purpose: sent to your game in response to a steam://gamewebcallback/ command - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 64)] - internal struct GameWebCallback_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 64; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_szURL_; - public string m_szURL - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szURL_, 256); } - } - } - - #endif + #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- - // Purpose: sent to your game in response to ISteamUser::RequestStoreAuthURL + // Purpose: called when a user has responded to a microtransaction authorization request //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 65)] - public struct StoreAuthURLResponse_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 65; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] - internal byte[] m_szURL_; - public string m_szURL - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szURL_, 512); } + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamUserCallbacks + 52)] + internal struct MicroTxnAuthorizationResponse_t_LargePack { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 52; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 52; + + public uint m_unAppID; // AppID for this microtransaction + public ulong m_ulOrderID; // OrderID provided for the microtransaction + public byte m_bAuthorized; // if user authorized transaction + + public static implicit operator MicroTxnAuthorizationResponse_t(MicroTxnAuthorizationResponse_t_LargePack value) { + MicroTxnAuthorizationResponse_t result = default; + result.m_unAppID = value.m_unAppID; + result.m_ulOrderID = value.m_ulOrderID; + result.m_bAuthorized = value.m_bAuthorized; + return result; + } + + public static implicit operator MicroTxnAuthorizationResponse_t_LargePack(MicroTxnAuthorizationResponse_t value) { + MicroTxnAuthorizationResponse_t_LargePack result = default; + result.m_unAppID = value.m_unAppID; + result.m_ulOrderID = value.m_ulOrderID; + result.m_bAuthorized = value.m_bAuthorized; + return result; } } - #if STEAMWORKS_ANYCPU + #endif //----------------------------------------------------------------------------- - // Purpose: sent to your game in response to ISteamUser::RequestStoreAuthURL + // Purpose: Result from RequestEncryptedAppTicket //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 65)] - internal struct StoreAuthURLResponse_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 65; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] - internal byte[] m_szURL_; - public string m_szURL - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szURL_, 512); } - } + [CallbackIdentity(Constants.k_iSteamUserCallbacks + 54)] + public struct EncryptedAppTicketResponse_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + + public EResult m_eResult; } - //----------------------------------------------------------------------------- - // Purpose: sent to your game in response to ISteamUser::RequestStoreAuthURL + // callback for GetAuthSessionTicket //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 65)] - internal struct StoreAuthURLResponse_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 65; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] - internal byte[] m_szURL_; - public string m_szURL - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szURL_, 512); } - } + [CallbackIdentity(Constants.k_iSteamUserCallbacks + 63)] + public struct GetAuthSessionTicketResponse_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + public HAuthTicket m_hAuthTicket; + public EResult m_eResult; } - #endif //----------------------------------------------------------------------------- - // Purpose: sent in response to ISteamUser::GetMarketEligibility + // Purpose: sent to your game in response to a steam://gamewebcallback/ command //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 66)] - public struct MarketEligibilityResponse_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 66; - [MarshalAs(UnmanagedType.I1)] - public bool m_bAllowed; - public EMarketNotAllowedReasonFlags m_eNotAllowedReason; - public RTime32 m_rtAllowedAtTime; - - public int m_cdaySteamGuardRequiredDays; // The number of days any user is required to have had Steam Guard before they can use the market - public int m_cdayNewDeviceCooldown; // The number of days after initial device authorization a user must wait before using the market on that device + [CallbackIdentity(Constants.k_iSteamUserCallbacks + 64)] + public struct GameWebCallback_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + public string m_szURL; } - #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- - // Purpose: sent in response to ISteamUser::GetMarketEligibility + // Purpose: sent to your game in response to ISteamUser::RequestStoreAuthURL //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 66)] - internal struct MarketEligibilityResponse_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 66; - [MarshalAs(UnmanagedType.I1)] - public bool m_bAllowed; - public EMarketNotAllowedReasonFlags m_eNotAllowedReason; - public RTime32 m_rtAllowedAtTime; - - public int m_cdaySteamGuardRequiredDays; // The number of days any user is required to have had Steam Guard before they can use the market - public int m_cdayNewDeviceCooldown; // The number of days after initial device authorization a user must wait before using the market on that device + [CallbackIdentity(Constants.k_iSteamUserCallbacks + 65)] + public struct StoreAuthURLResponse_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + public string m_szURL; } - //----------------------------------------------------------------------------- // Purpose: sent in response to ISteamUser::GetMarketEligibility //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 66)] - internal struct MarketEligibilityResponse_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 66; + public struct MarketEligibilityResponse_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { [MarshalAs(UnmanagedType.I1)] public bool m_bAllowed; public EMarketNotAllowedReasonFlags m_eNotAllowedReason; @@ -7800,7 +4683,6 @@ internal struct MarketEligibilityResponse_t_SmallPack { public int m_cdayNewDeviceCooldown; // The number of days after initial device authorization a user must wait before using the market on that device } - #endif //----------------------------------------------------------------------------- // Purpose: sent for games with enabled anti indulgence / duration control, for // enabled users. Lets the game know whether the user can keep playing or @@ -7811,64 +4693,11 @@ internal struct MarketEligibilityResponse_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 67)] - public struct DurationControl_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 67; - - public EResult m_eResult; // result of call (always k_EResultOK for asynchronous timer-based notifications) - public AppId_t m_appid; // appid generating playtime - - [MarshalAs(UnmanagedType.I1)] - public bool m_bApplicable; // is duration control applicable to user + game combination - public int m_csecsLast5h; // playtime since most recent 5 hour gap in playtime, only counting up to regulatory limit of playtime, in seconds - - public EDurationControlProgress m_progress; // recommended progress (either everything is fine, or please exit game) - public EDurationControlNotification m_notification; // notification to show, if any (always k_EDurationControlNotification_None for API calls) - - public int m_csecsToday; // playtime on current calendar day - public int m_csecsRemaining; // playtime remaining until the user hits a regulatory limit - } - + public struct DurationControl_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: sent for games with enabled anti indulgence / duration control, for - // enabled users. Lets the game know whether the user can keep playing or - // whether the game should exit, and returns info about remaining gameplay time. - // - // This callback is fired asynchronously in response to timers triggering. - // It is also fired in response to calls to GetDurationControl(). - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 67)] - internal struct DurationControl_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 67; - - public EResult m_eResult; // result of call (always k_EResultOK for asynchronous timer-based notifications) - public AppId_t m_appid; // appid generating playtime - - [MarshalAs(UnmanagedType.I1)] - public bool m_bApplicable; // is duration control applicable to user + game combination - public int m_csecsLast5h; // playtime since most recent 5 hour gap in playtime, only counting up to regulatory limit of playtime, in seconds - - public EDurationControlProgress m_progress; // recommended progress (either everything is fine, or please exit game) - public EDurationControlNotification m_notification; // notification to show, if any (always k_EDurationControlNotification_None for API calls) - - public int m_csecsToday; // playtime on current calendar day - public int m_csecsRemaining; // playtime remaining until the user hits a regulatory limit - } - - - //----------------------------------------------------------------------------- - // Purpose: sent for games with enabled anti indulgence / duration control, for - // enabled users. Lets the game know whether the user can keep playing or - // whether the game should exit, and returns info about remaining gameplay time. - // - // This callback is fired asynchronously in response to timers triggering. - // It is also fired in response to calls to GetDurationControl(). - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 67)] - internal struct DurationControl_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 67; + : ICallbackIdentity + #endif + { public EResult m_eResult; // result of call (always k_EResultOK for asynchronous timer-based notifications) public AppId_t m_appid; // appid generating playtime @@ -7884,52 +4713,22 @@ internal struct DurationControl_t_SmallPack { public int m_csecsRemaining; // playtime remaining until the user hits a regulatory limit } - #endif //----------------------------------------------------------------------------- // callback for GetTicketForWebApi //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 68)] - public struct GetTicketForWebApiResponse_t { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 68; - public HAuthTicket m_hAuthTicket; - public EResult m_eResult; - public int m_cubTicket; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_nCubTicketMaxLength)] - public byte[] m_rgubTicket; - } - + public struct GetTicketForWebApiResponse_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // callback for GetTicketForWebApi - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 68)] - internal struct GetTicketForWebApiResponse_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 68; - public HAuthTicket m_hAuthTicket; - public EResult m_eResult; - public int m_cubTicket; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_nCubTicketMaxLength)] - public byte[] m_rgubTicket; - } - - - //----------------------------------------------------------------------------- - // callback for GetTicketForWebApi - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 68)] - internal struct GetTicketForWebApiResponse_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 68; + : ICallbackIdentity + #endif + { public HAuthTicket m_hAuthTicket; public EResult m_eResult; public int m_cubTicket; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_nCubTicketMaxLength)] - public byte[] m_rgubTicket; + public byte m_rgubTicket; } - #endif // callbacks //----------------------------------------------------------------------------- // Purpose: called when the latests stats and achievements have been received @@ -7937,8 +4736,11 @@ internal struct GetTicketForWebApiResponse_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Explicit, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 1)] - public struct UserStatsReceived_t { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 1; + public struct UserStatsReceived_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { [FieldOffset(0)] public ulong m_nGameID; // Game these stats are for [FieldOffset(8)] @@ -7950,237 +4752,80 @@ public struct UserStatsReceived_t { //----------------------------------------------------------------------------- // Purpose: result of a request to store the user stats for a game //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 2)] - public struct UserStatsStored_t { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 2; - public ulong m_nGameID; // Game these stats are for - public EResult m_eResult; // success / error - } - + public struct UserStatsStored_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: result of a request to store the user stats for a game - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 2)] - internal struct UserStatsStored_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 2; - public ulong m_nGameID; // Game these stats are for - public EResult m_eResult; // success / error - } - - - //----------------------------------------------------------------------------- - // Purpose: result of a request to store the user stats for a game - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 2)] - internal struct UserStatsStored_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 2; + : ICallbackIdentity + #endif + { public ulong m_nGameID; // Game these stats are for public EResult m_eResult; // success / error } - #endif - //----------------------------------------------------------------------------- - // Purpose: result of a request to store the achievements for a game, or an - // "indicate progress" call. If both m_nCurProgress and m_nMaxProgress - // are zero, that means the achievement has been fully unlocked. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 3)] - public struct UserAchievementStored_t { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 3; - - public ulong m_nGameID; // Game this is for - [MarshalAs(UnmanagedType.I1)] - public bool m_bGroupAchievement; // if this is a "group" achievement - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchStatNameMax)] - internal byte[] m_rgchAchievementName_; - public string m_rgchAchievementName // name of the achievement - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchAchievementName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchAchievementName_, Constants.k_cchStatNameMax); } - } - public uint m_nCurProgress; // current progress towards the achievement - public uint m_nMaxProgress; // "out of" this many - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: result of a request to store the achievements for a game, or an - // "indicate progress" call. If both m_nCurProgress and m_nMaxProgress - // are zero, that means the achievement has been fully unlocked. - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 3)] - internal struct UserAchievementStored_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 3; - - public ulong m_nGameID; // Game this is for - [MarshalAs(UnmanagedType.I1)] - public bool m_bGroupAchievement; // if this is a "group" achievement - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchStatNameMax)] - internal byte[] m_rgchAchievementName_; - public string m_rgchAchievementName // name of the achievement - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchAchievementName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchAchievementName_, Constants.k_cchStatNameMax); } - } - public uint m_nCurProgress; // current progress towards the achievement - public uint m_nMaxProgress; // "out of" this many - } - - //----------------------------------------------------------------------------- // Purpose: result of a request to store the achievements for a game, or an // "indicate progress" call. If both m_nCurProgress and m_nMaxProgress // are zero, that means the achievement has been fully unlocked. //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 3)] - internal struct UserAchievementStored_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 3; - - public ulong m_nGameID; // Game this is for - [MarshalAs(UnmanagedType.I1)] - public bool m_bGroupAchievement; // if this is a "group" achievement - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchStatNameMax)] - internal byte[] m_rgchAchievementName_; - public string m_rgchAchievementName // name of the achievement - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchAchievementName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchAchievementName_, Constants.k_cchStatNameMax); } - } - public uint m_nCurProgress; // current progress towards the achievement - public uint m_nMaxProgress; // "out of" this many - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: call result for finding a leaderboard, returned as a result of FindOrCreateLeaderboard() or FindLeaderboard() - // use CCallResult<> to map this async result to a member function - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 4)] - public struct LeaderboardFindResult_t { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 4; - public SteamLeaderboard_t m_hSteamLeaderboard; // handle to the leaderboard serarched for, 0 if no leaderboard found - public byte m_bLeaderboardFound; // 0 if no leaderboard found - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: call result for finding a leaderboard, returned as a result of FindOrCreateLeaderboard() or FindLeaderboard() - // use CCallResult<> to map this async result to a member function - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 4)] - internal struct LeaderboardFindResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 4; - public SteamLeaderboard_t m_hSteamLeaderboard; // handle to the leaderboard serarched for, 0 if no leaderboard found - public byte m_bLeaderboardFound; // 0 if no leaderboard found - } - - - //----------------------------------------------------------------------------- - // Purpose: call result for finding a leaderboard, returned as a result of FindOrCreateLeaderboard() or FindLeaderboard() - // use CCallResult<> to map this async result to a member function - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 4)] - internal struct LeaderboardFindResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 4; - public SteamLeaderboard_t m_hSteamLeaderboard; // handle to the leaderboard serarched for, 0 if no leaderboard found - public byte m_bLeaderboardFound; // 0 if no leaderboard found - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: call result indicating scores for a leaderboard have been downloaded and are ready to be retrieved, returned as a result of DownloadLeaderboardEntries() - // use CCallResult<> to map this async result to a member function - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 5)] - public struct LeaderboardScoresDownloaded_t { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 5; - public SteamLeaderboard_t m_hSteamLeaderboard; - public SteamLeaderboardEntries_t m_hSteamLeaderboardEntries; // the handle to pass into GetDownloadedLeaderboardEntries() - public int m_cEntryCount; // the number of entries downloaded + public struct UserAchievementStored_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + + public ulong m_nGameID; // Game this is for + [MarshalAs(UnmanagedType.I1)] + public bool m_bGroupAchievement; // if this is a "group" achievement + public string m_rgchAchievementName; // name of the achievement + public uint m_nCurProgress; // current progress towards the achievement + public uint m_nMaxProgress; // "out of" this many } - #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- - // Purpose: call result indicating scores for a leaderboard have been downloaded and are ready to be retrieved, returned as a result of DownloadLeaderboardEntries() + // Purpose: call result for finding a leaderboard, returned as a result of FindOrCreateLeaderboard() or FindLeaderboard() // use CCallResult<> to map this async result to a member function //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 5)] - internal struct LeaderboardScoresDownloaded_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 5; - public SteamLeaderboard_t m_hSteamLeaderboard; - public SteamLeaderboardEntries_t m_hSteamLeaderboardEntries; // the handle to pass into GetDownloadedLeaderboardEntries() - public int m_cEntryCount; // the number of entries downloaded + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 4)] + public struct LeaderboardFindResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + public SteamLeaderboard_t m_hSteamLeaderboard; // handle to the leaderboard serarched for, 0 if no leaderboard found + public byte m_bLeaderboardFound; // 0 if no leaderboard found } - //----------------------------------------------------------------------------- // Purpose: call result indicating scores for a leaderboard have been downloaded and are ready to be retrieved, returned as a result of DownloadLeaderboardEntries() // use CCallResult<> to map this async result to a member function //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 5)] - internal struct LeaderboardScoresDownloaded_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 5; + public struct LeaderboardScoresDownloaded_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public SteamLeaderboard_t m_hSteamLeaderboard; public SteamLeaderboardEntries_t m_hSteamLeaderboardEntries; // the handle to pass into GetDownloadedLeaderboardEntries() public int m_cEntryCount; // the number of entries downloaded } - #endif //----------------------------------------------------------------------------- // Purpose: call result indicating scores has been uploaded, returned as a result of UploadLeaderboardScore() // use CCallResult<> to map this async result to a member function //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 6)] - public struct LeaderboardScoreUploaded_t { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 6; - public byte m_bSuccess; // 1 if the call was successful - public SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was - public int m_nScore; // the score that was attempted to set - public byte m_bScoreChanged; // true if the score in the leaderboard change, false if the existing score was better - public int m_nGlobalRankNew; // the new global rank of the user in this leaderboard - public int m_nGlobalRankPrevious; // the previous global rank of the user in this leaderboard; 0 if the user had no existing entry in the leaderboard - } - + public struct LeaderboardScoreUploaded_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: call result indicating scores has been uploaded, returned as a result of UploadLeaderboardScore() - // use CCallResult<> to map this async result to a member function - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 6)] - internal struct LeaderboardScoreUploaded_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 6; - public byte m_bSuccess; // 1 if the call was successful - public SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was - public int m_nScore; // the score that was attempted to set - public byte m_bScoreChanged; // true if the score in the leaderboard change, false if the existing score was better - public int m_nGlobalRankNew; // the new global rank of the user in this leaderboard - public int m_nGlobalRankPrevious; // the previous global rank of the user in this leaderboard; 0 if the user had no existing entry in the leaderboard - } - - - //----------------------------------------------------------------------------- - // Purpose: call result indicating scores has been uploaded, returned as a result of UploadLeaderboardScore() - // use CCallResult<> to map this async result to a member function - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 6)] - internal struct LeaderboardScoreUploaded_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 6; + : ICallbackIdentity + #endif + { public byte m_bSuccess; // 1 if the call was successful public SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was public int m_nScore; // the score that was attempted to set @@ -8189,679 +4834,256 @@ internal struct LeaderboardScoreUploaded_t_SmallPack { public int m_nGlobalRankPrevious; // the previous global rank of the user in this leaderboard; 0 if the user had no existing entry in the leaderboard } - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 7)] - public struct NumberOfCurrentPlayers_t { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 7; - public byte m_bSuccess; // 1 if the call was successful - public int m_cPlayers; // Number of players currently playing - } - + public struct NumberOfCurrentPlayers_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 7)] - internal struct NumberOfCurrentPlayers_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 7; - public byte m_bSuccess; // 1 if the call was successful - public int m_cPlayers; // Number of players currently playing - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 7)] - internal struct NumberOfCurrentPlayers_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 7; + : ICallbackIdentity + #endif + { public byte m_bSuccess; // 1 if the call was successful public int m_cPlayers; // Number of players currently playing } - #endif //----------------------------------------------------------------------------- // Purpose: Callback indicating that a user's stats have been unloaded. // Call RequestUserStats again to access stats for this user //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 8)] - public struct UserStatsUnloaded_t { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 8; - public CSteamID m_steamIDUser; // User whose stats have been unloaded - } - + public struct UserStatsUnloaded_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Callback indicating that a user's stats have been unloaded. - // Call RequestUserStats again to access stats for this user - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 8)] - internal struct UserStatsUnloaded_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 8; - public CSteamID m_steamIDUser; // User whose stats have been unloaded - } - - - //----------------------------------------------------------------------------- - // Purpose: Callback indicating that a user's stats have been unloaded. - // Call RequestUserStats again to access stats for this user - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 8)] - internal struct UserStatsUnloaded_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 8; + : ICallbackIdentity + #endif + { public CSteamID m_steamIDUser; // User whose stats have been unloaded } - #endif //----------------------------------------------------------------------------- // Purpose: Callback indicating that an achievement icon has been fetched //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 9)] - public struct UserAchievementIconFetched_t { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 9; - - public CGameID m_nGameID; // Game this is for - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchStatNameMax)] - internal byte[] m_rgchAchievementName_; - public string m_rgchAchievementName // name of the achievement - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchAchievementName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchAchievementName_, Constants.k_cchStatNameMax); } - } - [MarshalAs(UnmanagedType.I1)] - public bool m_bAchieved; // Is the icon for the achieved or not achieved version? - public int m_nIconHandle; // Handle to the image, which can be used in SteamUtils()->GetImageRGBA(), 0 means no image is set for the achievement - } - + public struct UserAchievementIconFetched_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Callback indicating that an achievement icon has been fetched - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 9)] - internal struct UserAchievementIconFetched_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 9; - - public CGameID m_nGameID; // Game this is for - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchStatNameMax)] - internal byte[] m_rgchAchievementName_; - public string m_rgchAchievementName // name of the achievement - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchAchievementName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchAchievementName_, Constants.k_cchStatNameMax); } - } - [MarshalAs(UnmanagedType.I1)] - public bool m_bAchieved; // Is the icon for the achieved or not achieved version? - public int m_nIconHandle; // Handle to the image, which can be used in SteamUtils()->GetImageRGBA(), 0 means no image is set for the achievement - } - - - //----------------------------------------------------------------------------- - // Purpose: Callback indicating that an achievement icon has been fetched - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 9)] - internal struct UserAchievementIconFetched_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 9; + : ICallbackIdentity + #endif + { public CGameID m_nGameID; // Game this is for - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchStatNameMax)] - internal byte[] m_rgchAchievementName_; - public string m_rgchAchievementName // name of the achievement - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchAchievementName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchAchievementName_, Constants.k_cchStatNameMax); } - } + public string m_rgchAchievementName; // name of the achievement [MarshalAs(UnmanagedType.I1)] public bool m_bAchieved; // Is the icon for the achieved or not achieved version? public int m_nIconHandle; // Handle to the image, which can be used in SteamUtils()->GetImageRGBA(), 0 means no image is set for the achievement } - #endif //----------------------------------------------------------------------------- // Purpose: Callback indicating that global achievement percentages are fetched //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 10)] - public struct GlobalAchievementPercentagesReady_t { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 10; - - public ulong m_nGameID; // Game this is for - public EResult m_eResult; // Result of the operation - } - + public struct GlobalAchievementPercentagesReady_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Callback indicating that global achievement percentages are fetched - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 10)] - internal struct GlobalAchievementPercentagesReady_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 10; - - public ulong m_nGameID; // Game this is for - public EResult m_eResult; // Result of the operation - } - - - //----------------------------------------------------------------------------- - // Purpose: Callback indicating that global achievement percentages are fetched - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 10)] - internal struct GlobalAchievementPercentagesReady_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 10; + : ICallbackIdentity + #endif + { public ulong m_nGameID; // Game this is for public EResult m_eResult; // Result of the operation } - #endif //----------------------------------------------------------------------------- // Purpose: call result indicating UGC has been uploaded, returned as a result of SetLeaderboardUGC() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 11)] - public struct LeaderboardUGCSet_t { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 11; - public EResult m_eResult; // The result of the operation - public SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was - } - + public struct LeaderboardUGCSet_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: call result indicating UGC has been uploaded, returned as a result of SetLeaderboardUGC() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 11)] - internal struct LeaderboardUGCSet_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 11; - public EResult m_eResult; // The result of the operation - public SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was - } - - - //----------------------------------------------------------------------------- - // Purpose: call result indicating UGC has been uploaded, returned as a result of SetLeaderboardUGC() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 11)] - internal struct LeaderboardUGCSet_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 11; + : ICallbackIdentity + #endif + { public EResult m_eResult; // The result of the operation public SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was } - #endif //----------------------------------------------------------------------------- // Purpose: callback indicating global stats have been received. // Returned as a result of RequestGlobalStats() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 12)] - public struct GlobalStatsReceived_t { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 12; - public ulong m_nGameID; // Game global stats were requested for - public EResult m_eResult; // The result of the request - } - + public struct GlobalStatsReceived_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: callback indicating global stats have been received. - // Returned as a result of RequestGlobalStats() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 12)] - internal struct GlobalStatsReceived_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 12; - public ulong m_nGameID; // Game global stats were requested for - public EResult m_eResult; // The result of the request - } - - - //----------------------------------------------------------------------------- - // Purpose: callback indicating global stats have been received. - // Returned as a result of RequestGlobalStats() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 12)] - internal struct GlobalStatsReceived_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 12; + : ICallbackIdentity + #endif + { public ulong m_nGameID; // Game global stats were requested for public EResult m_eResult; // The result of the request } - #endif // callbacks //----------------------------------------------------------------------------- // Purpose: The country of the user changed //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 1)] - public struct IPCountry_t { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 1; - } - + public struct IPCountry_t #if STEAMWORKS_ANYCPU - // callbacks - //----------------------------------------------------------------------------- - // Purpose: The country of the user changed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 1)] - internal struct IPCountry_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 1; - } - - - // callbacks - //----------------------------------------------------------------------------- - // Purpose: The country of the user changed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 1)] - internal struct IPCountry_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 1; - } - + : ICallbackIdentity #endif - //----------------------------------------------------------------------------- - // Purpose: Fired when running on a handheld PC or laptop with less than 10 minutes of battery is left, fires then every minute - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 2)] - public struct LowBatteryPower_t { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 2; - public byte m_nMinutesBatteryLeft; - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Fired when running on a handheld PC or laptop with less than 10 minutes of battery is left, fires then every minute - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 2)] - internal struct LowBatteryPower_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 2; - public byte m_nMinutesBatteryLeft; + { } - //----------------------------------------------------------------------------- // Purpose: Fired when running on a handheld PC or laptop with less than 10 minutes of battery is left, fires then every minute //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 2)] - internal struct LowBatteryPower_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 2; - public byte m_nMinutesBatteryLeft; - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: called when a SteamAsyncCall_t has completed (or failed) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 3)] - public struct SteamAPICallCompleted_t { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 3; - public SteamAPICall_t m_hAsyncCall; - public int m_iCallback; - public uint m_cubParam; - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: called when a SteamAsyncCall_t has completed (or failed) - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 3)] - internal struct SteamAPICallCompleted_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 3; - public SteamAPICall_t m_hAsyncCall; - public int m_iCallback; - public uint m_cubParam; + [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 2)] + public struct LowBatteryPower_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + public byte m_nMinutesBatteryLeft; } - //----------------------------------------------------------------------------- // Purpose: called when a SteamAsyncCall_t has completed (or failed) //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 3)] - internal struct SteamAPICallCompleted_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 3; + public struct SteamAPICallCompleted_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public SteamAPICall_t m_hAsyncCall; public int m_iCallback; public uint m_cubParam; } - #endif //----------------------------------------------------------------------------- // called when Steam wants to shutdown //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 4)] - public struct SteamShutdown_t { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 4; - } - + public struct SteamShutdown_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // called when Steam wants to shutdown - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 4)] - internal struct SteamShutdown_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 4; - } - - - //----------------------------------------------------------------------------- - // called when Steam wants to shutdown - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 4)] - internal struct SteamShutdown_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 4; - } - + : ICallbackIdentity #endif - //----------------------------------------------------------------------------- - // callback for CheckFileSignature - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 5)] - public struct CheckFileSignature_t { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 5; - public ECheckFileSignature m_eCheckFileSignature; - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // callback for CheckFileSignature - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 5)] - internal struct CheckFileSignature_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 5; - public ECheckFileSignature m_eCheckFileSignature; + { } - //----------------------------------------------------------------------------- // callback for CheckFileSignature //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 5)] - internal struct CheckFileSignature_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 5; + public struct CheckFileSignature_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public ECheckFileSignature m_eCheckFileSignature; } - #endif // k_iSteamUtilsCallbacks + 13 is taken //----------------------------------------------------------------------------- // Full Screen gamepad text input has been closed //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 14)] - public struct GamepadTextInputDismissed_t { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 14; - [MarshalAs(UnmanagedType.I1)] - public bool m_bSubmitted; // true if user entered & accepted text (Call ISteamUtils::GetEnteredGamepadTextInput() for text), false if canceled input - public uint m_unSubmittedText; - public AppId_t m_unAppID; - } - + public struct GamepadTextInputDismissed_t #if STEAMWORKS_ANYCPU - // k_iSteamUtilsCallbacks + 13 is taken - //----------------------------------------------------------------------------- - // Full Screen gamepad text input has been closed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 14)] - internal struct GamepadTextInputDismissed_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 14; - [MarshalAs(UnmanagedType.I1)] - public bool m_bSubmitted; // true if user entered & accepted text (Call ISteamUtils::GetEnteredGamepadTextInput() for text), false if canceled input - public uint m_unSubmittedText; - public AppId_t m_unAppID; - } - - - // k_iSteamUtilsCallbacks + 13 is taken - //----------------------------------------------------------------------------- - // Full Screen gamepad text input has been closed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 14)] - internal struct GamepadTextInputDismissed_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 14; + : ICallbackIdentity + #endif + { [MarshalAs(UnmanagedType.I1)] public bool m_bSubmitted; // true if user entered & accepted text (Call ISteamUtils::GetEnteredGamepadTextInput() for text), false if canceled input public uint m_unSubmittedText; public AppId_t m_unAppID; } - #endif // k_iSteamUtilsCallbacks + 15 through 35 are taken [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 36)] - public struct AppResumingFromSuspend_t { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 36; - } - + public struct AppResumingFromSuspend_t #if STEAMWORKS_ANYCPU - // k_iSteamUtilsCallbacks + 15 through 35 are taken - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 36)] - internal struct AppResumingFromSuspend_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 36; - } - - - // k_iSteamUtilsCallbacks + 15 through 35 are taken - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 36)] - internal struct AppResumingFromSuspend_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 36; - } - + : ICallbackIdentity #endif - // k_iSteamUtilsCallbacks + 37 is taken - //----------------------------------------------------------------------------- - // The floating on-screen keyboard has been closed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 38)] - public struct FloatingGamepadTextInputDismissed_t { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 38; - } - - #if STEAMWORKS_ANYCPU - // k_iSteamUtilsCallbacks + 37 is taken - //----------------------------------------------------------------------------- - // The floating on-screen keyboard has been closed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 38)] - internal struct FloatingGamepadTextInputDismissed_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 38; + { } - // k_iSteamUtilsCallbacks + 37 is taken //----------------------------------------------------------------------------- // The floating on-screen keyboard has been closed //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 38)] - internal struct FloatingGamepadTextInputDismissed_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 38; - } - - #endif - //----------------------------------------------------------------------------- - // The text filtering dictionary has changed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 39)] - public struct FilterTextDictionaryChanged_t { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 39; - public int m_eLanguage; // One of ELanguage, or k_LegallyRequiredFiltering - } - + public struct FloatingGamepadTextInputDismissed_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // The text filtering dictionary has changed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 39)] - internal struct FilterTextDictionaryChanged_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 39; - public int m_eLanguage; // One of ELanguage, or k_LegallyRequiredFiltering + : ICallbackIdentity + #endif + { } - //----------------------------------------------------------------------------- // The text filtering dictionary has changed //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 39)] - internal struct FilterTextDictionaryChanged_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 39; + public struct FilterTextDictionaryChanged_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public int m_eLanguage; // One of ELanguage, or k_LegallyRequiredFiltering } - #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamVideoCallbacks + 11)] - public struct GetVideoURLResult_t { - public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 11; - public EResult m_eResult; - public AppId_t m_unVideoAppID; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_rgchURL_; - public string m_rgchURL - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchURL_, 256); } - } - } - + public struct GetVideoURLResult_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamVideoCallbacks + 11)] - internal struct GetVideoURLResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 11; - public EResult m_eResult; - public AppId_t m_unVideoAppID; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_rgchURL_; - public string m_rgchURL - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchURL_, 256); } - } - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamVideoCallbacks + 11)] - internal struct GetVideoURLResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 11; - public EResult m_eResult; - public AppId_t m_unVideoAppID; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] - internal byte[] m_rgchURL_; - public string m_rgchURL - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchURL_, 256); } - } - } - + : ICallbackIdentity #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamVideoCallbacks + 24)] - public struct GetOPFSettingsResult_t { - public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 24; + { public EResult m_eResult; public AppId_t m_unVideoAppID; + public string m_rgchURL; } - #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamVideoCallbacks + 24)] - internal struct GetOPFSettingsResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 24; - public EResult m_eResult; - public AppId_t m_unVideoAppID; - } - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamVideoCallbacks + 24)] - internal struct GetOPFSettingsResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 24; + public struct GetOPFSettingsResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public EResult m_eResult; public AppId_t m_unVideoAppID; } - #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamVideoCallbacks + 4)] - public struct BroadcastUploadStart_t { - public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 4; - [MarshalAs(UnmanagedType.I1)] - public bool m_bIsRTMP; - } - + public struct BroadcastUploadStart_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamVideoCallbacks + 4)] - internal struct BroadcastUploadStart_t_LargePack { - public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 4; - [MarshalAs(UnmanagedType.I1)] - public bool m_bIsRTMP; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamVideoCallbacks + 4)] - internal struct BroadcastUploadStart_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 4; + : ICallbackIdentity + #endif + { [MarshalAs(UnmanagedType.I1)] public bool m_bIsRTMP; } - #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamVideoCallbacks + 5)] - public struct BroadcastUploadStop_t { - public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 5; - public EBroadcastUploadResult m_eResult; - } - + public struct BroadcastUploadStop_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamVideoCallbacks + 5)] - internal struct BroadcastUploadStop_t_LargePack { - public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 5; - public EBroadcastUploadResult m_eResult; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamVideoCallbacks + 5)] - internal struct BroadcastUploadStop_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 5; + : ICallbackIdentity + #endif + { public EBroadcastUploadResult m_eResult; } - #endif /// Callback struct used to notify when a connection has changed state /// A struct used to describe a "fake IP" we have been assigned to /// use as an identifier. This callback is posted when @@ -8869,88 +5091,11 @@ internal struct BroadcastUploadStop_t_SmallPack { /// See also ISteamNetworkingSockets::GetFakeIP [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamNetworkingSocketsCallbacks + 3)] - public struct SteamNetworkingFakeIPResult_t { - public const int k_iCallback = Constants.k_iSteamNetworkingSocketsCallbacks + 3; - - /// Status/result of the allocation request. Possible failure values are: - /// - k_EResultBusy - you called GetFakeIP but the request has not completed. - /// - k_EResultInvalidParam - you called GetFakeIP with an invalid port index - /// - k_EResultLimitExceeded - You asked for too many ports, or made an - /// additional request after one had already succeeded - /// - k_EResultNoMatch - GetFakeIP was called, but no request has been made - /// - /// Note that, with the exception of k_EResultBusy (if you are polling), - /// it is highly recommended to treat all failures as fatal. - public EResult m_eResult; - - /// Local identity of the ISteamNetworkingSockets object that made - /// this request and is assigned the IP. This is needed in the callback - /// in the case where there are multiple ISteamNetworkingSockets objects. - /// (E.g. one for the user, and another for the local gameserver). - public SteamNetworkingIdentity m_identity; - - /// Fake IPv4 IP address that we have been assigned. NOTE: this - /// IP address is not exclusively ours! Steam tries to avoid sharing - /// IP addresses, but this may not always be possible. The IP address - /// may be currently in use by another host, but with different port(s). - /// The exact same IP:port address may have been used previously. - /// Steam tries to avoid reusing ports until they have not been in use for - /// some time, but this may not always be possible. - public uint m_unIP; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_nMaxReturnPorts)] - public ushort[] m_unPorts; - } - + public struct SteamNetworkingFakeIPResult_t #if STEAMWORKS_ANYCPU - /// Callback struct used to notify when a connection has changed state - /// A struct used to describe a "fake IP" we have been assigned to - /// use as an identifier. This callback is posted when - /// ISteamNetworkingSoockets::BeginAsyncRequestFakeIP completes. - /// See also ISteamNetworkingSockets::GetFakeIP - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamNetworkingSocketsCallbacks + 3)] - internal struct SteamNetworkingFakeIPResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamNetworkingSocketsCallbacks + 3; - - /// Status/result of the allocation request. Possible failure values are: - /// - k_EResultBusy - you called GetFakeIP but the request has not completed. - /// - k_EResultInvalidParam - you called GetFakeIP with an invalid port index - /// - k_EResultLimitExceeded - You asked for too many ports, or made an - /// additional request after one had already succeeded - /// - k_EResultNoMatch - GetFakeIP was called, but no request has been made - /// - /// Note that, with the exception of k_EResultBusy (if you are polling), - /// it is highly recommended to treat all failures as fatal. - public EResult m_eResult; - - /// Local identity of the ISteamNetworkingSockets object that made - /// this request and is assigned the IP. This is needed in the callback - /// in the case where there are multiple ISteamNetworkingSockets objects. - /// (E.g. one for the user, and another for the local gameserver). - public SteamNetworkingIdentity m_identity; - - /// Fake IPv4 IP address that we have been assigned. NOTE: this - /// IP address is not exclusively ours! Steam tries to avoid sharing - /// IP addresses, but this may not always be possible. The IP address - /// may be currently in use by another host, but with different port(s). - /// The exact same IP:port address may have been used previously. - /// Steam tries to avoid reusing ports until they have not been in use for - /// some time, but this may not always be possible. - public uint m_unIP; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_nMaxReturnPorts)] - public ushort[] m_unPorts; - } - - - /// Callback struct used to notify when a connection has changed state - /// A struct used to describe a "fake IP" we have been assigned to - /// use as an identifier. This callback is posted when - /// ISteamNetworkingSoockets::BeginAsyncRequestFakeIP completes. - /// See also ISteamNetworkingSockets::GetFakeIP - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamNetworkingSocketsCallbacks + 3)] - internal struct SteamNetworkingFakeIPResult_t_SmallPack { - public const int k_iCallback = Constants.k_iSteamNetworkingSocketsCallbacks + 3; + : ICallbackIdentity + #endif + { /// Status/result of the allocation request. Possible failure values are: /// - k_EResultBusy - you called GetFakeIP but the request has not completed. @@ -8977,11 +5122,9 @@ internal struct SteamNetworkingFakeIPResult_t_SmallPack { /// Steam tries to avoid reusing ports until they have not been in use for /// some time, but this may not always be possible. public uint m_unIP; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_nMaxReturnPorts)] - public ushort[] m_unPorts; + public ushort m_unPorts; } - #endif } #endif // !DISABLESTEAMWORKS diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamConstants.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamConstants.cs index f552eee9..ab1ba72a 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamConstants.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamConstants.cs @@ -181,6 +181,14 @@ public static class Constants { public const int k_nMaxReturnPorts = 8; /// Max length of diagnostic error message public const int k_cchMaxSteamNetworkingErrMsg = 1024; + // Max length of the buffer needed to hold IP formatted using ToString, including '\0' + // ([0123:4567:89ab:cdef:0123:4567:89ab:cdef]:12345) + public const int k_cchMaxString = 48; + // Max sizes + public const int k_cchMaxString = 128; // Max length of the buffer needed to hold any identity, formatted in string format by ToString + public const int k_cchMaxGenericString = 32; // Max length of the string for generic string identities. Including terminating '\0' + public const int k_cchMaxXboxPairwiseID = 33; // Including terminating '\0' + public const int k_cbMaxGenericBytes = 32; /// Max length, in bytes (including null terminator) of the reason string /// when a connection is closed. public const int k_cchSteamNetworkingMaxConnectionCloseReason = 128; diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs index d4b7f655..4ca6bad6 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs @@ -17,29 +17,11 @@ namespace Steamworks { // friend game played information [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct FriendGameInfo_t { - public CGameID m_gameID; - public uint m_unGameIP; - public ushort m_usGamePort; - public ushort m_usQueryPort; - public CSteamID m_steamIDLobby; - } - + public struct FriendGameInfo_t #if STEAMWORKS_ANYCPU - // friend game played information - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct FriendGameInfo_t_LargePack { - public CGameID m_gameID; - public uint m_unGameIP; - public ushort m_usGamePort; - public ushort m_usQueryPort; - public CSteamID m_steamIDLobby; - } - - - // friend game played information - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct FriendGameInfo_t_SmallPack { + : ICallbackIdentity + #endif + { public CGameID m_gameID; public uint m_unGameIP; public ushort m_usGamePort; @@ -47,21 +29,31 @@ internal struct FriendGameInfo_t_SmallPack { public CSteamID m_steamIDLobby; } - #endif [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct InputAnalogActionData_t { + public struct InputAnalogActionData_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { // Type of data coming from this action, this will match what got specified in the action set public EInputSourceMode eMode; // The current state of this action; will be delta updates for mouse actions - public float x, y; + public float x; + + // The current state of this action; will be delta updates for mouse actions + public float y; // Whether or not this action is currently available to be bound in the active action set public byte bActive; } [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct InputDigitalActionData_t { + public struct InputDigitalActionData_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { // The current state of this action; will be true if currently pressed public byte bState; @@ -69,82 +61,12 @@ public struct InputDigitalActionData_t { public byte bActive; } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct InputMotionData_t { - // Gyro Quaternion: - // Absolute rotation of the controller since wakeup, using the Accelerometer reading at startup to determine the first value. - // This means real world "up" is know, but heading is not known. - // Every rotation packet is integrated using sensor time delta, and that change is used to update this quaternion. - // A Quaternion Identity ( x:0, y:0, z:0, w:1 ) will be sent in the first few packets while the controller's IMU is still waking up; - // some controllers have a short "warmup" period before these values should be used. - - // After the first time GetMotionData is called per controller handle, the IMU will be active until your app is closed. - // The exception is the Sony Dualshock, which will stay on until the controller has been turned off. - - // Filtering: When rotating the controller at low speeds, low level noise is filtered out without noticeable latency. High speed movement is always unfiltered. - // Drift: Gyroscopic "Drift" can be fixed using the Steam Input "Gyro Calibration" button. Users will have to be informed of this feature. - public float rotQuatX; - public float rotQuatY; - public float rotQuatZ; - public float rotQuatW; - - // Positional acceleration - // This represents only the latest hardware packet's state. - // Values range from -SHRT_MAX..SHRT_MAX - // This represents -2G..+2G along each axis - public float posAccelX; // +tive when controller's Right hand side is pointed toward the sky. - public float posAccelY; // +tive when controller's charging port (forward side of controller) is pointed toward the sky. - public float posAccelZ; // +tive when controller's sticks point toward the sky. - - // Angular velocity - // Values range from -SHRT_MAX..SHRT_MAX - // These values map to a real world range of -2000..+2000 degrees per second on each axis (SDL standard) - // This represents only the latest hardware packet's state. - public float rotVelX; // Local Pitch - public float rotVelY; // Local Roll - public float rotVelZ; // Local Yaw - } - + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct InputMotionData_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct InputMotionData_t_LargePack { - // Gyro Quaternion: - // Absolute rotation of the controller since wakeup, using the Accelerometer reading at startup to determine the first value. - // This means real world "up" is know, but heading is not known. - // Every rotation packet is integrated using sensor time delta, and that change is used to update this quaternion. - // A Quaternion Identity ( x:0, y:0, z:0, w:1 ) will be sent in the first few packets while the controller's IMU is still waking up; - // some controllers have a short "warmup" period before these values should be used. - - // After the first time GetMotionData is called per controller handle, the IMU will be active until your app is closed. - // The exception is the Sony Dualshock, which will stay on until the controller has been turned off. - - // Filtering: When rotating the controller at low speeds, low level noise is filtered out without noticeable latency. High speed movement is always unfiltered. - // Drift: Gyroscopic "Drift" can be fixed using the Steam Input "Gyro Calibration" button. Users will have to be informed of this feature. - public float rotQuatX; - public float rotQuatY; - public float rotQuatZ; - public float rotQuatW; - - // Positional acceleration - // This represents only the latest hardware packet's state. - // Values range from -SHRT_MAX..SHRT_MAX - // This represents -2G..+2G along each axis - public float posAccelX; // +tive when controller's Right hand side is pointed toward the sky. - public float posAccelY; // +tive when controller's charging port (forward side of controller) is pointed toward the sky. - public float posAccelZ; // +tive when controller's sticks point toward the sky. - - // Angular velocity - // Values range from -SHRT_MAX..SHRT_MAX - // These values map to a real world range of -2000..+2000 degrees per second on each axis (SDL standard) - // This represents only the latest hardware packet's state. - public float rotVelX; // Local Pitch - public float rotVelY; // Local Roll - public float rotVelZ; // Local Yaw - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct InputMotionData_t_SmallPack { + : ICallbackIdentity + #endif + { // Gyro Quaternion: // Absolute rotation of the controller since wakeup, using the Accelerometer reading at startup to determine the first value. // This means real world "up" is know, but heading is not known. @@ -179,89 +101,78 @@ internal struct InputMotionData_t_SmallPack { public float rotVelZ; // Local Yaw } + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct AnalogAction_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamItemDetails_t { - public SteamItemInstanceID_t m_itemId; - public SteamItemDef_t m_iDefinition; - public ushort m_unQuantity; - public ushort m_unFlags; // see ESteamItemFlags + { + public InputAnalogActionHandle_t actionHandle; + public InputAnalogActionData_t analogActionData; } + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct DigitalAction_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamItemDetails_t_LargePack { - public SteamItemInstanceID_t m_itemId; - public SteamItemDef_t m_iDefinition; - public ushort m_unQuantity; - public ushort m_unFlags; // see ESteamItemFlags + : ICallbackIdentity + #endif + { + public InputDigitalActionHandle_t actionHandle; + public InputDigitalActionData_t digitalActionData; } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamItemDetails_t_SmallPack { + public struct SteamItemDetails_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public SteamItemInstanceID_t m_itemId; public SteamItemDef_t m_iDefinition; public ushort m_unQuantity; public ushort m_unFlags; // see ESteamItemFlags } - #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamPartyBeaconLocation_t { + public struct SteamPartyBeaconLocation_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public ESteamPartyBeaconLocationType m_eType; public ulong m_ulLocationID; } #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] internal struct SteamPartyBeaconLocation_t_LargePack { public ESteamPartyBeaconLocationType m_eType; public ulong m_ulLocationID; - } + public static implicit operator SteamPartyBeaconLocation_t(SteamPartyBeaconLocation_t_LargePack value) { + SteamPartyBeaconLocation_t result = default; + result.m_eType = value.m_eType; + result.m_ulLocationID = value.m_ulLocationID; + return result; + } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamPartyBeaconLocation_t_SmallPack { - public ESteamPartyBeaconLocationType m_eType; - public ulong m_ulLocationID; + public static implicit operator SteamPartyBeaconLocation_t_LargePack(SteamPartyBeaconLocation_t value) { + SteamPartyBeaconLocation_t_LargePack result = default; + result.m_eType = value.m_eType; + result.m_ulLocationID = value.m_ulLocationID; + return result; + } } #endif // connection state to a specified user, returned by GetP2PSessionState() // this is under-the-hood info about what's going on with a SendP2PPacket(), shouldn't be needed except for debuggin [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct P2PSessionState_t { - public byte m_bConnectionActive; // true if we've got an active open connection - public byte m_bConnecting; // true if we're currently trying to establish a connection - public byte m_eP2PSessionError; // last error recorded (see enum above) - public byte m_bUsingRelay; // true if it's going through a relay server (TURN) - public int m_nBytesQueuedForSend; - public int m_nPacketsQueuedForSend; - public uint m_nRemoteIP; // potential IP:Port of remote host. Could be TURN server. - public ushort m_nRemotePort; // Only exists for compatibility with older authentication api's - } - + public struct P2PSessionState_t #if STEAMWORKS_ANYCPU - // connection state to a specified user, returned by GetP2PSessionState() - // this is under-the-hood info about what's going on with a SendP2PPacket(), shouldn't be needed except for debuggin - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct P2PSessionState_t_LargePack { - public byte m_bConnectionActive; // true if we've got an active open connection - public byte m_bConnecting; // true if we're currently trying to establish a connection - public byte m_eP2PSessionError; // last error recorded (see enum above) - public byte m_bUsingRelay; // true if it's going through a relay server (TURN) - public int m_nBytesQueuedForSend; - public int m_nPacketsQueuedForSend; - public uint m_nRemoteIP; // potential IP:Port of remote host. Could be TURN server. - public ushort m_nRemotePort; // Only exists for compatibility with older authentication api's - } - - - // connection state to a specified user, returned by GetP2PSessionState() - // this is under-the-hood info about what's going on with a SendP2PPacket(), shouldn't be needed except for debuggin - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct P2PSessionState_t_SmallPack { + : ICallbackIdentity + #endif + { public byte m_bConnectionActive; // true if we've got an active open connection public byte m_bConnecting; // true if we're currently trying to establish a connection public byte m_eP2PSessionError; // last error recorded (see enum above) @@ -272,34 +183,13 @@ internal struct P2PSessionState_t_SmallPack { public ushort m_nRemotePort; // Only exists for compatibility with older authentication api's } - #endif // Mouse motion event data, valid when m_eType is k_ERemotePlayInputMouseMotion [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct RemotePlayInputMouseMotion_t { - [MarshalAs(UnmanagedType.I1)] - public bool m_bAbsolute; // True if this is absolute mouse motion and m_flNormalizedX and m_flNormalizedY are valid - public float m_flNormalizedX; // The absolute X position of the mouse, normalized to the display, if m_bAbsolute is true - public float m_flNormalizedY; // The absolute Y position of the mouse, normalized to the display, if m_bAbsolute is true - public int m_nDeltaX; // Relative mouse motion in the X direction - public int m_nDeltaY; // Relative mouse motion in the Y direction - } - + public struct RemotePlayInputMouseMotion_t #if STEAMWORKS_ANYCPU - // Mouse motion event data, valid when m_eType is k_ERemotePlayInputMouseMotion - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct RemotePlayInputMouseMotion_t_LargePack { - [MarshalAs(UnmanagedType.I1)] - public bool m_bAbsolute; // True if this is absolute mouse motion and m_flNormalizedX and m_flNormalizedY are valid - public float m_flNormalizedX; // The absolute X position of the mouse, normalized to the display, if m_bAbsolute is true - public float m_flNormalizedY; // The absolute Y position of the mouse, normalized to the display, if m_bAbsolute is true - public int m_nDeltaX; // Relative mouse motion in the X direction - public int m_nDeltaY; // Relative mouse motion in the Y direction - } - - - // Mouse motion event data, valid when m_eType is k_ERemotePlayInputMouseMotion - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct RemotePlayInputMouseMotion_t_SmallPack { + : ICallbackIdentity + #endif + { [MarshalAs(UnmanagedType.I1)] public bool m_bAbsolute; // True if this is absolute mouse motion and m_flNormalizedX and m_flNormalizedY are valid public float m_flNormalizedX; // The absolute X position of the mouse, normalized to the display, if m_bAbsolute is true @@ -308,110 +198,55 @@ internal struct RemotePlayInputMouseMotion_t_SmallPack { public int m_nDeltaY; // Relative mouse motion in the Y direction } - #endif // Mouse wheel event data, valid when m_eType is k_ERemotePlayInputMouseWheel [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct RemotePlayInputMouseWheel_t { - public ERemotePlayMouseWheelDirection m_eDirection; - public float m_flAmount; // 1.0f is a single click of the wheel, 120 units on Windows - } - + public struct RemotePlayInputMouseWheel_t #if STEAMWORKS_ANYCPU - // Mouse wheel event data, valid when m_eType is k_ERemotePlayInputMouseWheel - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct RemotePlayInputMouseWheel_t_LargePack { - public ERemotePlayMouseWheelDirection m_eDirection; - public float m_flAmount; // 1.0f is a single click of the wheel, 120 units on Windows - } - - - // Mouse wheel event data, valid when m_eType is k_ERemotePlayInputMouseWheel - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct RemotePlayInputMouseWheel_t_SmallPack { + : ICallbackIdentity + #endif + { public ERemotePlayMouseWheelDirection m_eDirection; public float m_flAmount; // 1.0f is a single click of the wheel, 120 units on Windows } - #endif // Key event data, valid when m_eType is k_ERemotePlayInputKeyDown or k_ERemotePlayInputKeyUp [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct RemotePlayInputKey_t { - public int m_eScancode; // Keyboard scancode, common values are defined in ERemotePlayScancode - public uint m_unModifiers; // Mask of ERemotePlayKeyModifier active for this key event - public uint m_unKeycode; // UCS-4 character generated by the keypress, or 0 if it wasn't a character key, e.g. Delete or Left Arrow - } - + public struct RemotePlayInputKey_t #if STEAMWORKS_ANYCPU - // Key event data, valid when m_eType is k_ERemotePlayInputKeyDown or k_ERemotePlayInputKeyUp - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct RemotePlayInputKey_t_LargePack { - public int m_eScancode; // Keyboard scancode, common values are defined in ERemotePlayScancode - public uint m_unModifiers; // Mask of ERemotePlayKeyModifier active for this key event - public uint m_unKeycode; // UCS-4 character generated by the keypress, or 0 if it wasn't a character key, e.g. Delete or Left Arrow - } - - - // Key event data, valid when m_eType is k_ERemotePlayInputKeyDown or k_ERemotePlayInputKeyUp - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct RemotePlayInputKey_t_SmallPack { + : ICallbackIdentity + #endif + { public int m_eScancode; // Keyboard scancode, common values are defined in ERemotePlayScancode public uint m_unModifiers; // Mask of ERemotePlayKeyModifier active for this key event public uint m_unKeycode; // UCS-4 character generated by the keypress, or 0 if it wasn't a character key, e.g. Delete or Left Arrow } - #endif //----------------------------------------------------------------------------- // Purpose: Structure that contains an array of const char * strings and the number of those strings //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamParamStringArray_t { - public IntPtr m_ppStrings; - public int m_nNumStrings; - } - + public struct SteamParamStringArray_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Structure that contains an array of const char * strings and the number of those strings - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamParamStringArray_t_LargePack { - public IntPtr m_ppStrings; - public int m_nNumStrings; - } - - - //----------------------------------------------------------------------------- - // Purpose: Structure that contains an array of const char * strings and the number of those strings - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamParamStringArray_t_SmallPack { - public IntPtr m_ppStrings; + : ICallbackIdentity + #endif + { public int m_nNumStrings; } - #endif // Details for a single published file/UGC [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamUGCDetails_t { + public struct SteamUGCDetails_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; // The result of the operation. public EWorkshopFileType m_eFileType; // Type of the file public AppId_t m_nCreatorAppID; // ID of the app that created this file. public AppId_t m_nConsumerAppID; // ID of the app that will consume this file. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentTitleMax)] - internal byte[] m_rgchTitle_; - public string m_rgchTitle // title of document - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTitle_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTitle_, Constants.k_cchPublishedDocumentTitleMax); } - } - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentDescriptionMax)] - internal byte[] m_rgchDescription_; - public string m_rgchDescription // description of document - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchDescription_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchDescription_, Constants.k_cchPublishedDocumentDescriptionMax); } - } + public string m_rgchTitle; // title of document + public string m_rgchDescription; // description of document public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. public uint m_rtimeCreated; // time when the published file was created public uint m_rtimeUpdated; // time when the published file was last updated @@ -423,32 +258,14 @@ public string m_rgchDescription // description of document public bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop [MarshalAs(UnmanagedType.I1)] public bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchTagListMax)] - internal byte[] m_rgchTags_; - public string m_rgchTags // comma separated list of all tags associated with this file - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTags_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTags_, Constants.k_cchTagListMax); } - } + public string m_rgchTags; // comma separated list of all tags associated with this file // file/url information public UGCHandle_t m_hFile; // The handle of the primary file public UGCHandle_t m_hPreviewFile; // The handle of the preview file - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] - internal byte[] m_pchFileName_; - public string m_pchFileName // The cloud filename of the primary file - { - get { return InteropHelp.ByteArrayToStringUTF8(m_pchFileName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } - } + public string m_pchFileName; // The cloud filename of the primary file public int m_nFileSize; // Size of the primary file (for legacy items which only support one file). This may not be accurate for non-legacy items which can be greater than 4gb in size. public int m_nPreviewFileSize; // Size of the preview file - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedFileURLMax)] - internal byte[] m_rgchURL_; - public string m_rgchURL // URL (for a video or a website) - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchURL_, Constants.k_cchPublishedFileURLMax); } - } + public string m_rgchURL; // URL (for a video or a website) // voting information public uint m_unVotesUp; // number of votes up public uint m_unVotesDown; // number of votes down @@ -460,27 +277,15 @@ public string m_pchFileName // The cloud filename of the primary file #if STEAMWORKS_ANYCPU // Details for a single published file/UGC - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] internal struct SteamUGCDetails_t_LargePack { public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; // The result of the operation. public EWorkshopFileType m_eFileType; // Type of the file public AppId_t m_nCreatorAppID; // ID of the app that created this file. public AppId_t m_nConsumerAppID; // ID of the app that will consume this file. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentTitleMax)] - internal byte[] m_rgchTitle_; - public string m_rgchTitle // title of document - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTitle_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTitle_, Constants.k_cchPublishedDocumentTitleMax); } - } - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentDescriptionMax)] - internal byte[] m_rgchDescription_; - public string m_rgchDescription // description of document - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchDescription_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchDescription_, Constants.k_cchPublishedDocumentDescriptionMax); } - } + public string m_rgchTitle; // title of document + public string m_rgchDescription; // description of document public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. public uint m_rtimeCreated; // time when the published file was created public uint m_rtimeUpdated; // time when the published file was last updated @@ -492,32 +297,14 @@ public string m_rgchDescription // description of document public bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop [MarshalAs(UnmanagedType.I1)] public bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchTagListMax)] - internal byte[] m_rgchTags_; - public string m_rgchTags // comma separated list of all tags associated with this file - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTags_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTags_, Constants.k_cchTagListMax); } - } + public string m_rgchTags; // comma separated list of all tags associated with this file // file/url information public UGCHandle_t m_hFile; // The handle of the primary file public UGCHandle_t m_hPreviewFile; // The handle of the preview file - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] - internal byte[] m_pchFileName_; - public string m_pchFileName // The cloud filename of the primary file - { - get { return InteropHelp.ByteArrayToStringUTF8(m_pchFileName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } - } + public string m_pchFileName; // The cloud filename of the primary file public int m_nFileSize; // Size of the primary file (for legacy items which only support one file). This may not be accurate for non-legacy items which can be greater than 4gb in size. public int m_nPreviewFileSize; // Size of the preview file - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedFileURLMax)] - internal byte[] m_rgchURL_; - public string m_rgchURL // URL (for a video or a website) - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchURL_, Constants.k_cchPublishedFileURLMax); } - } + public string m_rgchURL; // URL (for a video or a website) // voting information public uint m_unVotesUp; // number of votes up public uint m_unVotesDown; // number of votes down @@ -525,81 +312,80 @@ public string m_pchFileName // The cloud filename of the primary file // collection details public uint m_unNumChildren; public ulong m_ulTotalFilesSize; // Total size of all files (non-legacy), excluding the preview file - } - - // Details for a single published file/UGC - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamUGCDetails_t_SmallPack { - public PublishedFileId_t m_nPublishedFileId; - public EResult m_eResult; // The result of the operation. - public EWorkshopFileType m_eFileType; // Type of the file - public AppId_t m_nCreatorAppID; // ID of the app that created this file. - public AppId_t m_nConsumerAppID; // ID of the app that will consume this file. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentTitleMax)] - internal byte[] m_rgchTitle_; - public string m_rgchTitle // title of document - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTitle_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTitle_, Constants.k_cchPublishedDocumentTitleMax); } - } - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentDescriptionMax)] - internal byte[] m_rgchDescription_; - public string m_rgchDescription // description of document - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchDescription_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchDescription_, Constants.k_cchPublishedDocumentDescriptionMax); } + public static implicit operator SteamUGCDetails_t(SteamUGCDetails_t_LargePack value) { + SteamUGCDetails_t result = default; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_eResult = value.m_eResult; + result.m_eFileType = value.m_eFileType; + result.m_nCreatorAppID = value.m_nCreatorAppID; + result.m_nConsumerAppID = value.m_nConsumerAppID; + result.m_rgchTitle = value.m_rgchTitle; + result.m_rgchDescription = value.m_rgchDescription; + result.m_ulSteamIDOwner = value.m_ulSteamIDOwner; + result.m_rtimeCreated = value.m_rtimeCreated; + result.m_rtimeUpdated = value.m_rtimeUpdated; + result.m_rtimeAddedToUserList = value.m_rtimeAddedToUserList; + result.m_eVisibility = value.m_eVisibility; + result.m_bBanned = value.m_bBanned; + result.m_bAcceptedForUse = value.m_bAcceptedForUse; + result.m_bTagsTruncated = value.m_bTagsTruncated; + result.m_rgchTags = value.m_rgchTags; + result.m_hFile = value.m_hFile; + result.m_hPreviewFile = value.m_hPreviewFile; + result.m_pchFileName = value.m_pchFileName; + result.m_nFileSize = value.m_nFileSize; + result.m_nPreviewFileSize = value.m_nPreviewFileSize; + result.m_rgchURL = value.m_rgchURL; + result.m_unVotesUp = value.m_unVotesUp; + result.m_unVotesDown = value.m_unVotesDown; + result.m_flScore = value.m_flScore; + result.m_unNumChildren = value.m_unNumChildren; + result.m_ulTotalFilesSize = value.m_ulTotalFilesSize; + return result; } - public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. - public uint m_rtimeCreated; // time when the published file was created - public uint m_rtimeUpdated; // time when the published file was last updated - public uint m_rtimeAddedToUserList; // time when the user added the published file to their list (not always applicable) - public ERemoteStoragePublishedFileVisibility m_eVisibility; // visibility - [MarshalAs(UnmanagedType.I1)] - public bool m_bBanned; // whether the file was banned - [MarshalAs(UnmanagedType.I1)] - public bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop - [MarshalAs(UnmanagedType.I1)] - public bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchTagListMax)] - internal byte[] m_rgchTags_; - public string m_rgchTags // comma separated list of all tags associated with this file - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTags_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTags_, Constants.k_cchTagListMax); } - } - // file/url information - public UGCHandle_t m_hFile; // The handle of the primary file - public UGCHandle_t m_hPreviewFile; // The handle of the preview file - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] - internal byte[] m_pchFileName_; - public string m_pchFileName // The cloud filename of the primary file - { - get { return InteropHelp.ByteArrayToStringUTF8(m_pchFileName_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } - } - public int m_nFileSize; // Size of the primary file (for legacy items which only support one file). This may not be accurate for non-legacy items which can be greater than 4gb in size. - public int m_nPreviewFileSize; // Size of the preview file - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedFileURLMax)] - internal byte[] m_rgchURL_; - public string m_rgchURL // URL (for a video or a website) - { - get { return InteropHelp.ByteArrayToStringUTF8(m_rgchURL_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_rgchURL_, Constants.k_cchPublishedFileURLMax); } + + public static implicit operator SteamUGCDetails_t_LargePack(SteamUGCDetails_t value) { + SteamUGCDetails_t_LargePack result = default; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_eResult = value.m_eResult; + result.m_eFileType = value.m_eFileType; + result.m_nCreatorAppID = value.m_nCreatorAppID; + result.m_nConsumerAppID = value.m_nConsumerAppID; + result.m_rgchTitle = value.m_rgchTitle; + result.m_rgchDescription = value.m_rgchDescription; + result.m_ulSteamIDOwner = value.m_ulSteamIDOwner; + result.m_rtimeCreated = value.m_rtimeCreated; + result.m_rtimeUpdated = value.m_rtimeUpdated; + result.m_rtimeAddedToUserList = value.m_rtimeAddedToUserList; + result.m_eVisibility = value.m_eVisibility; + result.m_bBanned = value.m_bBanned; + result.m_bAcceptedForUse = value.m_bAcceptedForUse; + result.m_bTagsTruncated = value.m_bTagsTruncated; + result.m_rgchTags = value.m_rgchTags; + result.m_hFile = value.m_hFile; + result.m_hPreviewFile = value.m_hPreviewFile; + result.m_pchFileName = value.m_pchFileName; + result.m_nFileSize = value.m_nFileSize; + result.m_nPreviewFileSize = value.m_nPreviewFileSize; + result.m_rgchURL = value.m_rgchURL; + result.m_unVotesUp = value.m_unVotesUp; + result.m_unVotesDown = value.m_unVotesDown; + result.m_flScore = value.m_flScore; + result.m_unNumChildren = value.m_unNumChildren; + result.m_ulTotalFilesSize = value.m_ulTotalFilesSize; + return result; } - // voting information - public uint m_unVotesUp; // number of votes up - public uint m_unVotesDown; // number of votes down - public float m_flScore; // calculated score - // collection details - public uint m_unNumChildren; - public ulong m_ulTotalFilesSize; // Total size of all files (non-legacy), excluding the preview file } #endif // a single entry in a leaderboard, as returned by GetDownloadedLeaderboardEntry() [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct LeaderboardEntry_t { + public struct LeaderboardEntry_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public CSteamID m_steamIDUser; // user with the entry - use SteamFriends()->GetFriendPersonaName() & SteamFriends()->GetFriendAvatar() to get more info public int m_nGlobalRank; // [1..N], where N is the number of users with an entry in the leaderboard public int m_nScore; // score as set in the leaderboard @@ -609,24 +395,33 @@ public struct LeaderboardEntry_t { #if STEAMWORKS_ANYCPU // a single entry in a leaderboard, as returned by GetDownloadedLeaderboardEntry() - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] internal struct LeaderboardEntry_t_LargePack { public CSteamID m_steamIDUser; // user with the entry - use SteamFriends()->GetFriendPersonaName() & SteamFriends()->GetFriendAvatar() to get more info public int m_nGlobalRank; // [1..N], where N is the number of users with an entry in the leaderboard public int m_nScore; // score as set in the leaderboard public int m_cDetails; // number of int32 details available for this entry public UGCHandle_t m_hUGC; // handle for UGC attached to the entry - } + public static implicit operator LeaderboardEntry_t(LeaderboardEntry_t_LargePack value) { + LeaderboardEntry_t result = default; + result.m_steamIDUser = value.m_steamIDUser; + result.m_nGlobalRank = value.m_nGlobalRank; + result.m_nScore = value.m_nScore; + result.m_cDetails = value.m_cDetails; + result.m_hUGC = value.m_hUGC; + return result; + } - // a single entry in a leaderboard, as returned by GetDownloadedLeaderboardEntry() - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct LeaderboardEntry_t_SmallPack { - public CSteamID m_steamIDUser; // user with the entry - use SteamFriends()->GetFriendPersonaName() & SteamFriends()->GetFriendAvatar() to get more info - public int m_nGlobalRank; // [1..N], where N is the number of users with an entry in the leaderboard - public int m_nScore; // score as set in the leaderboard - public int m_cDetails; // number of int32 details available for this entry - public UGCHandle_t m_hUGC; // handle for UGC attached to the entry + public static implicit operator LeaderboardEntry_t_LargePack(LeaderboardEntry_t value) { + LeaderboardEntry_t_LargePack result = default; + result.m_steamIDUser = value.m_steamIDUser; + result.m_nGlobalRank = value.m_nGlobalRank; + result.m_nScore = value.m_nScore; + result.m_cDetails = value.m_cDetails; + result.m_hUGC = value.m_hUGC; + return result; + } } #endif @@ -635,155 +430,115 @@ internal struct LeaderboardEntry_t_SmallPack { /// Actually, the name Key/Value is a bit misleading. The "key" is better /// understood as "filter operation code" and the "value" is the operand to this /// filter operation. The meaning of the operand depends upon the filter. + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [StructLayout(LayoutKind.Sequential)] - public struct MatchMakingKeyValuePair_t { + public struct MatchMakingKeyValuePair_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { MatchMakingKeyValuePair_t(string strKey, string strValue) { m_szKey = strKey; m_szValue = strValue; } - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string m_szKey; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string m_szValue; - } - - #if STEAMWORKS_ANYCPU - /// Store key/value pair used in matchmaking queries. - /// - /// Actually, the name Key/Value is a bit misleading. The "key" is better - /// understood as "filter operation code" and the "value" is the operand to this - /// filter operation. The meaning of the operand depends upon the filter. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct MatchMakingKeyValuePair_t_LargePack { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_szKey; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_szValue; } - - /// Store key/value pair used in matchmaking queries. - /// - /// Actually, the name Key/Value is a bit misleading. The "key" is better - /// understood as "filter operation code" and the "value" is the operand to this - /// filter operation. The meaning of the operand depends upon the filter. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct MatchMakingKeyValuePair_t_SmallPack { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string m_szKey; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string m_szValue; - } - - #endif // structure that contains client callback data // see callbacks documentation for more details /// Internal structure used in manual callback dispatch [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct CallbackMsg_t { + public struct CallbackMsg_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public int m_hSteamUser; // Specific user to whom this callback applies. public int m_iCallback; // Callback identifier. (Corresponds to the k_iCallback enum in the callback structure.) - public IntPtr m_pubParam; // Points to the callback structure public int m_cubParam; // Size of the data pointed to by m_pubParam } + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct SteamIDComponent_t #if STEAMWORKS_ANYCPU - // structure that contains client callback data - // see callbacks documentation for more details - /// Internal structure used in manual callback dispatch - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct CallbackMsg_t_LargePack { - public int m_hSteamUser; // Specific user to whom this callback applies. - public int m_iCallback; // Callback identifier. (Corresponds to the k_iCallback enum in the callback structure.) - public IntPtr m_pubParam; // Points to the callback structure - public int m_cubParam; // Size of the data pointed to by m_pubParam + : ICallbackIdentity + #endif + { + + public ulong m_unAll64Bits; + public ulong m_unAll64Bits; } + // each type has it's own invalid fixed point: + // k_unMaxExpectedLocalAppId - shortcuts are pushed beyond that range + // + // Internal stuff. Use the accessors above if possible + // + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] + public struct GameID_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + } - // structure that contains client callback data - // see callbacks documentation for more details - /// Internal structure used in manual callback dispatch - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct CallbackMsg_t_SmallPack { - public int m_hSteamUser; // Specific user to whom this callback applies. - public int m_iCallback; // Callback identifier. (Corresponds to the k_iCallback enum in the callback structure.) - public IntPtr m_pubParam; // Points to the callback structure - public int m_cubParam; // Size of the data pointed to by m_pubParam + /// RFC4038, section 4.2 + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct IPv4MappedAddress + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + public ulong m_8zeros; + public ushort m_0000; + public ushort m_ffff; + public byte m_ip; // NOTE: As bytes, i.e. network byte order } + /// Store an IP and port. IPv6 is always used; IPv4 is represented using + /// "IPv4-mapped" addresses: IPv4 aa.bb.cc.dd => IPv6 ::ffff:aabb:ccdd + /// (RFC 4291 section 2.5.5.2.) + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct SteamNetworkingIPAddr + #if STEAMWORKS_ANYCPU + : ICallbackIdentity #endif - /// Describe the state of a connection. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamNetConnectionInfo_t { - - /// Who is on the other end? Depending on the connection type and phase of the connection, we might not know - public SteamNetworkingIdentity m_identityRemote; - - /// Arbitrary user data set by the local application code - public long m_nUserData; - - /// Handle to listen socket this was connected on, or k_HSteamListenSocket_Invalid if we initiated the connection - public HSteamListenSocket m_hListenSocket; - - /// Remote address. Might be all 0's if we don't know it, or if this is N/A. - /// (E.g. Basically everything except direct UDP connection.) - public SteamNetworkingIPAddr m_addrRemote; - public ushort m__pad1; - - /// What data center is the remote host in? (0 if we don't know.) - public SteamNetworkingPOPID m_idPOPRemote; - - /// What relay are we using to communicate with the remote host? - /// (0 if not applicable.) - public SteamNetworkingPOPID m_idPOPRelay; - - /// High level state of the connection - public ESteamNetworkingConnectionState m_eState; - - /// Basic cause of the connection termination or problem. - /// See ESteamNetConnectionEnd for the values used - public int m_eEndReason; - - /// Human-readable, but non-localized explanation for connection - /// termination or problem. This is intended for debugging / - /// diagnostic purposes only, not to display to users. It might - /// have some details specific to the issue. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchSteamNetworkingMaxConnectionCloseReason)] - internal byte[] m_szEndDebug_; - public string m_szEndDebug - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szEndDebug_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szEndDebug_, Constants.k_cchSteamNetworkingMaxConnectionCloseReason); } - } - - /// Debug description. This includes the internal connection ID, - /// connection type (and peer information), and any name - /// given to the connection by the app. This string is used in various - /// internal logging messages. - /// - /// Note that the connection ID *usually* matches the HSteamNetConnection - /// handle, but in certain cases with symmetric connections it might not. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchSteamNetworkingMaxConnectionDescription)] - internal byte[] m_szConnectionDescription_; - public string m_szConnectionDescription - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szConnectionDescription_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szConnectionDescription_, Constants.k_cchSteamNetworkingMaxConnectionDescription); } - } - - /// Misc flags. Bitmask of k_nSteamNetworkConnectionInfoFlags_Xxxx - public int m_nFlags; - - /// Internal stuff, room to change API easily - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 63)] - public uint[] reserved; + { + public byte m_ipv6; + public byte m_ipv6; + public IPv4MappedAddress m_ipv4; + public IPv4MappedAddress m_ipv4; + } + + // Host byte order + /// See if two addresses are identical + /// Classify address as FakeIP. This function never returns + /// k_ESteamNetworkingFakeIPType_Invalid. + /// Return true if we are a FakeIP + /// An abstract way to represent the identity of a network host. All identities can + /// be represented as simple string. Furthermore, this string representation is actually + /// used on the wire in several places, even though it is less efficient, in order to + /// facilitate forward compatibility. (Old client code can handle an identity type that + /// it doesn't understand.) + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct SteamNetworkingIdentity + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + /// Type of identity. + public ESteamNetworkingIdentityType m_eType; } - #if STEAMWORKS_ANYCPU /// Describe the state of a connection. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamNetConnectionInfo_t_LargePack { + public struct SteamNetConnectionInfo_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { /// Who is on the other end? Depending on the connection type and phase of the connection, we might not know public SteamNetworkingIdentity m_identityRemote; @@ -817,13 +572,7 @@ internal struct SteamNetConnectionInfo_t_LargePack { /// termination or problem. This is intended for debugging / /// diagnostic purposes only, not to display to users. It might /// have some details specific to the issue. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchSteamNetworkingMaxConnectionCloseReason)] - internal byte[] m_szEndDebug_; - public string m_szEndDebug - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szEndDebug_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szEndDebug_, Constants.k_cchSteamNetworkingMaxConnectionCloseReason); } - } + public string m_szEndDebug; /// Debug description. This includes the internal connection ID, /// connection type (and peer information), and any name @@ -832,26 +581,19 @@ public string m_szEndDebug /// /// Note that the connection ID *usually* matches the HSteamNetConnection /// handle, but in certain cases with symmetric connections it might not. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchSteamNetworkingMaxConnectionDescription)] - internal byte[] m_szConnectionDescription_; - public string m_szConnectionDescription - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szConnectionDescription_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szConnectionDescription_, Constants.k_cchSteamNetworkingMaxConnectionDescription); } - } + public string m_szConnectionDescription; /// Misc flags. Bitmask of k_nSteamNetworkConnectionInfoFlags_Xxxx public int m_nFlags; /// Internal stuff, room to change API easily - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 63)] - public uint[] reserved; + public uint reserved; } - + #if STEAMWORKS_ANYCPU /// Describe the state of a connection. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamNetConnectionInfo_t_SmallPack { + [StructLayout(LayoutKind.Sequential, Pack = 8)] + internal struct SteamNetConnectionInfo_t_LargePack { /// Who is on the other end? Depending on the connection type and phase of the connection, we might not know public SteamNetworkingIdentity m_identityRemote; @@ -885,13 +627,7 @@ internal struct SteamNetConnectionInfo_t_SmallPack { /// termination or problem. This is intended for debugging / /// diagnostic purposes only, not to display to users. It might /// have some details specific to the issue. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchSteamNetworkingMaxConnectionCloseReason)] - internal byte[] m_szEndDebug_; - public string m_szEndDebug - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szEndDebug_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szEndDebug_, Constants.k_cchSteamNetworkingMaxConnectionCloseReason); } - } + public string m_szEndDebug; /// Debug description. This includes the internal connection ID, /// connection type (and peer information), and any name @@ -900,187 +636,60 @@ public string m_szEndDebug /// /// Note that the connection ID *usually* matches the HSteamNetConnection /// handle, but in certain cases with symmetric connections it might not. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchSteamNetworkingMaxConnectionDescription)] - internal byte[] m_szConnectionDescription_; - public string m_szConnectionDescription - { - get { return InteropHelp.ByteArrayToStringUTF8(m_szConnectionDescription_); } - set { InteropHelp.StringToByteArrayUTF8(value, m_szConnectionDescription_, Constants.k_cchSteamNetworkingMaxConnectionDescription); } - } + public string m_szConnectionDescription; /// Misc flags. Bitmask of k_nSteamNetworkConnectionInfoFlags_Xxxx public int m_nFlags; /// Internal stuff, room to change API easily - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 63)] - public uint[] reserved; + public uint reserved; + + public static implicit operator SteamNetConnectionInfo_t(SteamNetConnectionInfo_t_LargePack value) { + SteamNetConnectionInfo_t result = default; + result.m_identityRemote = value.m_identityRemote; + result.m_nUserData = value.m_nUserData; + result.m_hListenSocket = value.m_hListenSocket; + result.m_addrRemote = value.m_addrRemote; + result.m__pad1 = value.m__pad1; + result.m_idPOPRemote = value.m_idPOPRemote; + result.m_idPOPRelay = value.m_idPOPRelay; + result.m_eState = value.m_eState; + result.m_eEndReason = value.m_eEndReason; + result.m_szEndDebug = value.m_szEndDebug; + result.m_szConnectionDescription = value.m_szConnectionDescription; + result.m_nFlags = value.m_nFlags; + result.reserved = value.reserved; + return result; + } + + public static implicit operator SteamNetConnectionInfo_t_LargePack(SteamNetConnectionInfo_t value) { + SteamNetConnectionInfo_t_LargePack result = default; + result.m_identityRemote = value.m_identityRemote; + result.m_nUserData = value.m_nUserData; + result.m_hListenSocket = value.m_hListenSocket; + result.m_addrRemote = value.m_addrRemote; + result.m__pad1 = value.m__pad1; + result.m_idPOPRemote = value.m_idPOPRemote; + result.m_idPOPRelay = value.m_idPOPRelay; + result.m_eState = value.m_eState; + result.m_eEndReason = value.m_eEndReason; + result.m_szEndDebug = value.m_szEndDebug; + result.m_szConnectionDescription = value.m_szConnectionDescription; + result.m_nFlags = value.m_nFlags; + result.reserved = value.reserved; + return result; + } } #endif /// Quick connection state, pared down to something you could call /// more frequently without it being too big of a perf hit. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamNetConnectionRealTimeStatus_t { - - /// High level state of the connection - public ESteamNetworkingConnectionState m_eState; - - /// Current ping (ms) - public int m_nPing; - - /// Connection quality measured locally, 0...1. (Percentage of packets delivered - /// end-to-end in order). - public float m_flConnectionQualityLocal; - - /// Packet delivery success rate as observed from remote host - public float m_flConnectionQualityRemote; - - /// Current data rates from recent history. - public float m_flOutPacketsPerSec; - public float m_flOutBytesPerSec; - public float m_flInPacketsPerSec; - public float m_flInBytesPerSec; - - /// Estimate rate that we believe that we can send data to our peer. - /// Note that this could be significantly higher than m_flOutBytesPerSec, - /// meaning the capacity of the channel is higher than you are sending data. - /// (That's OK!) - public int m_nSendRateBytesPerSecond; - - /// Number of bytes pending to be sent. This is data that you have recently - /// requested to be sent but has not yet actually been put on the wire. The - /// reliable number ALSO includes data that was previously placed on the wire, - /// but has now been scheduled for re-transmission. Thus, it's possible to - /// observe m_cbPendingReliable increasing between two checks, even if no - /// calls were made to send reliable data between the checks. Data that is - /// awaiting the Nagle delay will appear in these numbers. - public int m_cbPendingUnreliable; - public int m_cbPendingReliable; - - /// Number of bytes of reliable data that has been placed the wire, but - /// for which we have not yet received an acknowledgment, and thus we may - /// have to re-transmit. - public int m_cbSentUnackedReliable; - - /// If you queued a message right now, approximately how long would that message - /// wait in the queue before we actually started putting its data on the wire in - /// a packet? - /// - /// In general, data that is sent by the application is limited by the bandwidth - /// of the channel. If you send data faster than this, it must be queued and - /// put on the wire at a metered rate. Even sending a small amount of data (e.g. - /// a few MTU, say ~3k) will require some of the data to be delayed a bit. - /// - /// Ignoring multiple lanes, the estimated delay will be approximately equal to - /// - /// ( m_cbPendingUnreliable+m_cbPendingReliable ) / m_nSendRateBytesPerSecond - /// - /// plus or minus one MTU. It depends on how much time has elapsed since the last - /// packet was put on the wire. For example, the queue might have *just* been emptied, - /// and the last packet placed on the wire, and we are exactly up against the send - /// rate limit. In that case we might need to wait for one packet's worth of time to - /// elapse before we can send again. On the other extreme, the queue might have data - /// in it waiting for Nagle. (This will always be less than one packet, because as - /// soon as we have a complete packet we would send it.) In that case, we might be - /// ready to send data now, and this value will be 0. - /// - /// This value is only valid if multiple lanes are not used. If multiple lanes are - /// in use, then the queue time will be different for each lane, and you must use - /// the value in SteamNetConnectionRealTimeLaneStatus_t. - /// - /// Nagle delay is ignored for the purposes of this calculation. - public SteamNetworkingMicroseconds m_usecQueueTime; - - // Internal stuff, room to change API easily - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public uint[] reserved; - } - + public struct SteamNetConnectionRealTimeStatus_t #if STEAMWORKS_ANYCPU - /// Quick connection state, pared down to something you could call - /// more frequently without it being too big of a perf hit. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamNetConnectionRealTimeStatus_t_LargePack { - - /// High level state of the connection - public ESteamNetworkingConnectionState m_eState; - - /// Current ping (ms) - public int m_nPing; - - /// Connection quality measured locally, 0...1. (Percentage of packets delivered - /// end-to-end in order). - public float m_flConnectionQualityLocal; - - /// Packet delivery success rate as observed from remote host - public float m_flConnectionQualityRemote; - - /// Current data rates from recent history. - public float m_flOutPacketsPerSec; - public float m_flOutBytesPerSec; - public float m_flInPacketsPerSec; - public float m_flInBytesPerSec; - - /// Estimate rate that we believe that we can send data to our peer. - /// Note that this could be significantly higher than m_flOutBytesPerSec, - /// meaning the capacity of the channel is higher than you are sending data. - /// (That's OK!) - public int m_nSendRateBytesPerSecond; - - /// Number of bytes pending to be sent. This is data that you have recently - /// requested to be sent but has not yet actually been put on the wire. The - /// reliable number ALSO includes data that was previously placed on the wire, - /// but has now been scheduled for re-transmission. Thus, it's possible to - /// observe m_cbPendingReliable increasing between two checks, even if no - /// calls were made to send reliable data between the checks. Data that is - /// awaiting the Nagle delay will appear in these numbers. - public int m_cbPendingUnreliable; - public int m_cbPendingReliable; - - /// Number of bytes of reliable data that has been placed the wire, but - /// for which we have not yet received an acknowledgment, and thus we may - /// have to re-transmit. - public int m_cbSentUnackedReliable; - - /// If you queued a message right now, approximately how long would that message - /// wait in the queue before we actually started putting its data on the wire in - /// a packet? - /// - /// In general, data that is sent by the application is limited by the bandwidth - /// of the channel. If you send data faster than this, it must be queued and - /// put on the wire at a metered rate. Even sending a small amount of data (e.g. - /// a few MTU, say ~3k) will require some of the data to be delayed a bit. - /// - /// Ignoring multiple lanes, the estimated delay will be approximately equal to - /// - /// ( m_cbPendingUnreliable+m_cbPendingReliable ) / m_nSendRateBytesPerSecond - /// - /// plus or minus one MTU. It depends on how much time has elapsed since the last - /// packet was put on the wire. For example, the queue might have *just* been emptied, - /// and the last packet placed on the wire, and we are exactly up against the send - /// rate limit. In that case we might need to wait for one packet's worth of time to - /// elapse before we can send again. On the other extreme, the queue might have data - /// in it waiting for Nagle. (This will always be less than one packet, because as - /// soon as we have a complete packet we would send it.) In that case, we might be - /// ready to send data now, and this value will be 0. - /// - /// This value is only valid if multiple lanes are not used. If multiple lanes are - /// in use, then the queue time will be different for each lane, and you must use - /// the value in SteamNetConnectionRealTimeLaneStatus_t. - /// - /// Nagle delay is ignored for the purposes of this calculation. - public SteamNetworkingMicroseconds m_usecQueueTime; - - // Internal stuff, room to change API easily - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public uint[] reserved; - } - - - /// Quick connection state, pared down to something you could call - /// more frequently without it being too big of a perf hit. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamNetConnectionRealTimeStatus_t_SmallPack { + : ICallbackIdentity + #endif + { /// High level state of the connection public ESteamNetworkingConnectionState m_eState; @@ -1152,14 +761,16 @@ internal struct SteamNetConnectionRealTimeStatus_t_SmallPack { public SteamNetworkingMicroseconds m_usecQueueTime; // Internal stuff, room to change API easily - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public uint[] reserved; + public uint reserved; } - #endif /// Quick status of a particular lane [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamNetConnectionRealTimeLaneStatus_t { + public struct SteamNetConnectionRealTimeLaneStatus_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { // Counters for this particular lane. See the corresponding variables // in SteamNetConnectionRealTimeStatus_t public int m_cbPendingUnreliable; @@ -1173,53 +784,80 @@ public struct SteamNetConnectionRealTimeLaneStatus_t { public SteamNetworkingMicroseconds m_usecQueueTime; // Internal stuff, room to change API easily - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] - public uint[] reserved; + public uint reserved; } + /// A message that has been received. + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public struct SteamNetworkingMessage_t #if STEAMWORKS_ANYCPU - /// Quick status of a particular lane - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamNetConnectionRealTimeLaneStatus_t_LargePack { - // Counters for this particular lane. See the corresponding variables - // in SteamNetConnectionRealTimeStatus_t - public int m_cbPendingUnreliable; - public int m_cbPendingReliable; - public int m_cbSentUnackedReliable; - public int _reservePad1; // Reserved for future use + : ICallbackIdentity + #endif + { - /// Lane-specific queue time. This value takes into consideration lane priorities - /// and weights, and how much data is queued in each lane, and attempts to predict - /// how any data currently queued will be sent out. - public SteamNetworkingMicroseconds m_usecQueueTime; + /// Size of the payload. + public int m_cbSize; - // Internal stuff, room to change API easily - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] - public uint[] reserved; - } - - - /// Quick status of a particular lane - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamNetConnectionRealTimeLaneStatus_t_SmallPack { - // Counters for this particular lane. See the corresponding variables - // in SteamNetConnectionRealTimeStatus_t - public int m_cbPendingUnreliable; - public int m_cbPendingReliable; - public int m_cbSentUnackedReliable; - public int _reservePad1; // Reserved for future use + /// For messages received on connections: what connection did this come from? + /// For outgoing messages: what connection to send it to? + /// Not used when using the ISteamNetworkingMessages interface + public HSteamNetConnection m_conn; - /// Lane-specific queue time. This value takes into consideration lane priorities - /// and weights, and how much data is queued in each lane, and attempts to predict - /// how any data currently queued will be sent out. - public SteamNetworkingMicroseconds m_usecQueueTime; + /// For inbound messages: Who sent this to us? + /// For outbound messages on connections: not used. + /// For outbound messages on the ad-hoc ISteamNetworkingMessages interface: who should we send this to? + public SteamNetworkingIdentity m_identityPeer; - // Internal stuff, room to change API easily - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] - public uint[] reserved; + /// For messages received on connections, this is the user data + /// associated with the connection. + /// + /// This is *usually* the same as calling GetConnection() and then + /// fetching the user data associated with that connection, but for + /// the following subtle differences: + /// + /// - This user data will match the connection's user data at the time + /// is captured at the time the message is returned by the API. + /// If you subsequently change the userdata on the connection, + /// this won't be updated. + /// - This is an inline call, so it's *much* faster. + /// - You might have closed the connection, so fetching the user data + /// would not be possible. + /// + /// Not used when sending messages. + public long m_nConnUserData; + + /// Local timestamp when the message was received + /// Not used for outbound messages. + public SteamNetworkingMicroseconds m_usecTimeReceived; + + /// Message number assigned by the sender. This is not used for outbound + /// messages. Note that if multiple lanes are used, each lane has its own + /// message numbers, which are assigned sequentially, so messages from + /// different lanes will share the same numbers. + public long m_nMessageNumber; + + /// When using ISteamNetworkingMessages, the channel number the message was received on + /// (Not used for messages sent or received on "connections") + public int m_nChannel; + + /// Bitmask of k_nSteamNetworkingSend_xxx flags. + /// For received messages, only the k_nSteamNetworkingSend_Reliable bit is valid. + /// For outbound messages, all bits are relevant + public int m_nFlags; + + /// Arbitrary user data that you can use when sending messages using + /// ISteamNetworkingUtils::AllocateMessage and ISteamNetworkingSockets::SendMessage. + /// (The callback you set in m_pfnFreeData might use this field.) + /// + /// Not used for received messages. + public long m_nUserData; + + /// For outbound messages, which lane to use? See ISteamNetworkingSockets::ConfigureConnectionLanes. + /// For inbound messages, what lane was the message received on? + public ushort m_idxLane; + public ushort _pad1__; } - #endif // // Ping location / measurement // @@ -1236,59 +874,45 @@ internal struct SteamNetConnectionRealTimeLaneStatus_t_SmallPack { /// send it over the wire, or persist it in a file or database! If you need /// to do that, convert it to a string representation using the methods in /// ISteamNetworkingUtils(). - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamNetworkPingLocation_t { - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] - public byte[] m_data; - } - + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public struct SteamNetworkPingLocation_t #if STEAMWORKS_ANYCPU - // - // Ping location / measurement - // - /// Object that describes a "location" on the Internet with sufficient - /// detail that we can reasonably estimate an upper bound on the ping between - /// the two hosts, even if a direct route between the hosts is not possible, - /// and the connection must be routed through the Steam Datagram Relay network. - /// This does not contain any information that identifies the host. Indeed, - /// if two hosts are in the same building or otherwise have nearly identical - /// networking characteristics, then it's valid to use the same location - /// object for both of them. - /// - /// NOTE: This object should only be used in the same process! Do not serialize it, - /// send it over the wire, or persist it in a file or database! If you need - /// to do that, convert it to a string representation using the methods in - /// ISteamNetworkingUtils(). - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamNetworkPingLocation_t_LargePack { - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] - public byte[] m_data; + : ICallbackIdentity + #endif + { + public byte m_data; } - - // - // Ping location / measurement - // - /// Object that describes a "location" on the Internet with sufficient - /// detail that we can reasonably estimate an upper bound on the ping between - /// the two hosts, even if a direct route between the hosts is not possible, - /// and the connection must be routed through the Steam Datagram Relay network. - /// This does not contain any information that identifies the host. Indeed, - /// if two hosts are in the same building or otherwise have nearly identical - /// networking characteristics, then it's valid to use the same location - /// object for both of them. + /// In a few places we need to set configuration options on listen sockets and connections, and + /// have them take effect *before* the listen socket or connection really starts doing anything. + /// Creating the object and then setting the options "immediately" after creation doesn't work + /// completely, because network packets could be received between the time the object is created and + /// when the options are applied. To set options at creation time in a reliable way, they must be + /// passed to the creation function. This structure is used to pass those options. /// - /// NOTE: This object should only be used in the same process! Do not serialize it, - /// send it over the wire, or persist it in a file or database! If you need - /// to do that, convert it to a string representation using the methods in - /// ISteamNetworkingUtils(). - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamNetworkPingLocation_t_SmallPack { - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] - public byte[] m_data; + /// For the meaning of these fields, see ISteamNetworkingUtils::SetConfigValue. Basically + /// when the object is created, we just iterate over the list of options and call + /// ISteamNetworkingUtils::SetConfigValueStruct, where the scope arguments are supplied by the + /// object being created. + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public struct SteamNetworkingConfigValue_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + /// Which option is being set + public ESteamNetworkingConfigValue m_eValue; + + /// Which field below did you fill in? + public ESteamNetworkingConfigDataType m_eDataType; + public int32_t m_int32; + public int32_t m_int32; + public int64_t m_int64; + public int64_t m_int64; + public float m_float; + public float m_float; } - #endif } #endif // !DISABLESTEAMWORKS From 118c2646ba218a12a7d465b3b32c2bbb661b4448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sun, 19 Oct 2025 02:13:23 +0800 Subject: [PATCH 48/82] Allow generator to ignore structs, clearify ambiguous type of `Field.arraysize` by Python type annotation --- CodeGen/SteamworksParser/steamworksparser.py | 39 ++++++++++++-------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/CodeGen/SteamworksParser/steamworksparser.py b/CodeGen/SteamworksParser/steamworksparser.py index 26ecc9d1..e440ec14 100644 --- a/CodeGen/SteamworksParser/steamworksparser.py +++ b/CodeGen/SteamworksParser/steamworksparser.py @@ -38,14 +38,15 @@ g_SkippedStructs = ( # steamnetworkingtypes.h - #"SteamNetworkingIPAddr", - #"SteamNetworkingIdentity", - #"SteamNetworkingMessage_t", - #"SteamNetworkingConfigValue_t", + "SteamNetworkingIPAddr", + "SteamNetworkingIdentity", + "SteamNetworkingMessage_t", + "SteamNetworkingConfigValue_t", # steamdatagram_tickets.h - #"SteamDatagramHostedAddress", - #"SteamDatagramRelayAuthTicket", + "SteamDatagramHostedAddress", + "SteamDatagramRelayAuthTicket", + "SteamIDComponent_t" # sync with g_SpecialStructsLP and g_SpecialStructsSP ) @@ -190,7 +191,7 @@ class Function: def __init__(self): self.name = "" self.returntype = "" - self.args = [] # Arg + self.args: list[Arg] = [] # Arg self.ifstatements = [] self.comments = [] self.linecomment = "" @@ -200,7 +201,7 @@ def __init__(self): class Interface: def __init__(self): self.name = "" - self.functions = [] # Function + self.functions: list[Function] = [] # Function self.c = None # Comment class Define: @@ -240,8 +241,6 @@ def __init__(self, name, packsize: int | None, comments, scopePath): self.name = name # keep it to remain compatibility self.packsize = packsize - # use this property for packsize is preferred - self.pack = packsize self.c = comments # Comment self.fields: list[StructField] = [] # StructField self.nested_struct: list[Struct] = [] # nested structs @@ -249,8 +248,10 @@ def __init__(self, name, packsize: int | None, comments, scopePath): self.scopeDepth: int = scopePath self.callbackid = None self.endcomments = None # Comment + self.pack = packsize self.size: int | None = None self.packsize_aware = False + self.is_skipped: bool = False def calculate_offsets(self, defaultAlign: int): def calcRealSize(sizelike: int | Literal['intptr']) -> int: @@ -298,6 +299,9 @@ def calcRealSize(sizelike: int | Literal['intptr']) -> int: self.size = total_size return result + def should_not_generate(self): + return self.is_skipped or (self.outer_type is not None) or len(self.nested_struct) > 0 + class Union: def __init__(self, name, isUnnamed, pack): self.name: str = name @@ -459,9 +463,9 @@ def __init__(self, folder): infile = open(filepath, 'r', encoding="utf-8") s.lines = infile.readlines() s.lines[0] = s.lines[0][3:] - - if Settings.warn_utf8bom: - printWarning("File contains a UTF8 BOM.", s) + + if Settings.warn_utf8bom: + printWarning("File contains a UTF8 BOM.", s) self.parse(s) @@ -925,6 +929,8 @@ def parse_structs(self, s: ParserState): s.struct = Struct(s.linesplit[1].strip(), s.getCurrentPack(),\ comments, s.scopeDepth) s.struct.outer_type = oldStruct + if s.linesplit[1].strip() in g_SkippedStructs: + s.struct.is_skipped = True def parse_struct_fields(self, s): comments = self.consume_comments(s) @@ -1358,7 +1364,7 @@ def populate_union_sizes(self, defaultPack = 8): for union in unions: union.calculate_offsets(defaultPack) - def populate_struct_field_layout(self, struct, defaultPack = 8): + def populate_struct_field_layout(self, struct: Struct, defaultPack = 8): for field in struct.fields: typeinfo = self.resolveTypeInfo(field.type) # check if we facing a struct which may not populated yet @@ -1372,7 +1378,10 @@ def populate_struct_field_layout(self, struct, defaultPack = 8): field.size = typeinfo.size field.pack = typeinfo.pack or defaultPack - + if (field.arraysizeStr is not None): + arrsize = field.arraysizeStr + field.arraysize = int(arrsize) if arrsize.isdigit() else eval(self.resolveConstValue(arrsize).value) + struct.calculate_offsets(defaultPack) From 21ab2c999ae3006a5f55adb8fed57a86d0379148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sun, 19 Oct 2025 02:18:40 +0800 Subject: [PATCH 49/82] Source geneator now generate both native function variant for packsize aware structs. Corresponding wrapper method is pending. --- CodeGen/src/interfaces.py | 131 +++++++++++++++++++++++++------------- 1 file changed, 87 insertions(+), 44 deletions(-) diff --git a/CodeGen/src/interfaces.py b/CodeGen/src/interfaces.py index a007b5d2..be4f4680 100644 --- a/CodeGen/src/interfaces.py +++ b/CodeGen/src/interfaces.py @@ -1,7 +1,7 @@ import os import sys from collections import OrderedDict -from SteamworksParser import steamworksparser +from SteamworksParser.steamworksparser import Arg, Function, FunctionAttribute, Interface, Parser, Struct, ArgAttribute g_SkippedFiles = ( # We don't currently support the following interfaces because they don't provide a factory of their own. @@ -532,38 +532,38 @@ g_FixedAttributeValues = { "ISteamInventory_GetItemsWithPrices": { - "pArrayItemDefs": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "unArrayLength"), - "pCurrentPrices": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "unArrayLength"), - "pBasePrices": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "unArrayLength"), + "pArrayItemDefs": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "unArrayLength"), + "pCurrentPrices": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "unArrayLength"), + "pBasePrices": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "unArrayLength"), }, "ISteamGameServerInventory_GetItemsWithPrices": { - "pArrayItemDefs": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "unArrayLength"), - "pCurrentPrices": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "unArrayLength"), - "pBasePrices": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "unArrayLength"), + "pArrayItemDefs": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "unArrayLength"), + "pCurrentPrices": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "unArrayLength"), + "pBasePrices": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "unArrayLength"), }, "ISteamUGC_GetQueryUGCContentDescriptors": { - "pvecDescriptors": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "cMaxEntries"), + "pvecDescriptors": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "cMaxEntries"), }, "ISteamGameServerUGC_GetQueryUGCContentDescriptors": { - "pvecDescriptors": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "cMaxEntries"), + "pvecDescriptors": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "cMaxEntries"), }, "ISteamNetworkingMessages_ReceiveMessagesOnChannel": { - "ppOutMessages": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "nMaxMessages"), + "ppOutMessages": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "nMaxMessages"), }, "ISteamGameServerNetworkingMessages_ReceiveMessagesOnChannel": { - "ppOutMessages": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "nMaxMessages"), + "ppOutMessages": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "nMaxMessages"), }, "ISteamNetworkingSockets_ReceiveMessagesOnConnection": { - "ppOutMessages": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "nMaxMessages"), + "ppOutMessages": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "nMaxMessages"), }, "ISteamGameServerNetworkingSockets_ReceiveMessagesOnConnection": { - "ppOutMessages": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "nMaxMessages"), + "ppOutMessages": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "nMaxMessages"), }, "ISteamNetworkingSockets_ReceiveMessagesOnPollGroup": { - "ppOutMessages": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "nMaxMessages"), + "ppOutMessages": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "nMaxMessages"), }, "ISteamGameServerNetworkingSockets_ReceiveMessagesOnPollGroup": { - "ppOutMessages": steamworksparser.ArgAttribute("STEAM_OUT_ARRAY_COUNT", "nMaxMessages"), + "ppOutMessages": ArgAttribute("STEAM_OUT_ARRAY_COUNT", "nMaxMessages"), }, } @@ -597,7 +597,7 @@ g_Output = [] g_Typedefs = None -def main(parser): +def main(parser: Parser): try: os.makedirs("../com.rlabrecque.steamworks.net/Runtime/autogen/") except OSError: @@ -610,7 +610,7 @@ def main(parser): global g_Typedefs g_Typedefs = parser.typedefs for f in parser.files: - parse(f) + parse(f, parser) with open("../com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs", "wb") as out: #out.write(bytes(HEADER, "utf-8")) @@ -625,7 +625,7 @@ def main(parser): def get_arg_attribute(strEntryPoint, arg): return g_FixedAttributeValues.get(strEntryPoint, dict()).get(arg.name, arg.attribute) -def parse(f): +def parse(f, parser: Parser): if f.name in g_SkippedFiles: return @@ -633,7 +633,7 @@ def parse(f): del g_Output[:] for interface in f.interfaces: - parse_interface(f, interface) + parse_interface(f, interface, parser) if g_Output: with open('../com.rlabrecque.steamworks.net/Runtime/autogen/' + os.path.splitext(f.name)[0] + '.cs', 'wb') as out: @@ -645,7 +645,7 @@ def parse(f): out.write(bytes("#endif // !DISABLESTEAMWORKS\n", "utf-8")) -def parse_interface(f, interface): +def parse_interface(f, interface: Interface, parser: Parser): if interface.name in g_SkippedInterfaces: return @@ -686,7 +686,27 @@ def parse_interface(f, interface): if func.private: continue - parse_func(f, interface, func) + shouldGenerateLargePack = False + strEntryPoint = interface.name + '_' + func.name + for attr in func.attributes: + if attr.name == "STEAM_FLAT_NAME": + strEntryPoint = interface.name + '_' + attr.value + break + + parsed_args = parse_args(strEntryPoint, func.args) + parse_func_native(f, interface, func, parsed_args, strEntryPoint, False, bGameServerVersion, parser) + + # Check if any args are pack-size aware structs + # If so, we need to generate an alternate version of the function + for arg in func.args: + argType = parser.resolveTypeInfo(arg.type) + if isinstance(argType, Struct) and argType.name in parser.packSizeAwareStructs: + parse_func_native(f, interface, parsed_args, func, True, bGameServerVersion, parser) + shouldGenerateLargePack = True + break + + generate_wrapper_function(f, interface, func, parsed_args, strEntryPoint, shouldGenerateLargePack) + # Remove last whitespace if not bGameServerVersion: @@ -705,19 +725,7 @@ def parse_interface(f, interface): g_Output.append("\t}") -def parse_func(f, interface, func): - strEntryPoint = interface.name + '_' + func.name - - for attr in func.attributes: - if attr.name == "STEAM_FLAT_NAME": - strEntryPoint = interface.name + '_' + attr.value - break - - if "GameServer" in interface.name and interface.name != "ISteamGameServer" and interface.name != "ISteamGameServerStats": - bGameServerVersion = True - else: - bGameServerVersion = False - +def parse_func_native(f, interface, func: Function, strEntryPoint: str, args, generatingLargePack: bool, bGameServerVersion: bool, parser: Parser): wrapperreturntype = None strCast = "" returntype = func.returntype @@ -735,24 +743,45 @@ def parse_func(f, interface, func): if wrapperreturntype == None: wrapperreturntype = returntype - args = parse_args(strEntryPoint, func.args) pinvokeargs = args[0] # TODO: NamedTuple - wrapperargs = args[1] - argnames = args[2] - stringargs = args[3] - outstringargs = args[4][0] - outstringsize = args[4][1] - args_with_explicit_count = args[5] - + largePackPInvokeArgs = args[6] if not bGameServerVersion: g_NativeMethods.append("\t\t[DllImport(NativeLibraryName, EntryPoint = \"SteamAPI_{0}\", CallingConvention = CallingConvention.Cdecl)]".format(strEntryPoint)) if returntype == "bool": g_NativeMethods.append("\t\t[return: MarshalAs(UnmanagedType.I1)]") - g_NativeMethods.append("\t\tpublic static extern {0} {1}({2});".format(returntype, strEntryPoint, pinvokeargs)) + g_NativeMethods.append("\t\tpublic static extern {0} {1}({2});".format(returntype, strEntryPoint, + pinvokeargs if not generatingLargePack else largePackPInvokeArgs)) g_NativeMethods.append("") + pass +def generate_wrapper_function(f, interface, func: Function, + args: tuple[str, str, str, list[str], tuple[list[str], list[Arg]], OrderedDict, str], + strEntryPoint: str, bGameServerVersion: bool): + wrapperargs = args[1] + argnames = args[2] + stringargs = args[3] + outstringargs = args[4][0] + outstringsize = args[4][1] + args_with_explicit_count = args[5] + + strCast = "" + returntype = func.returntype + returntype = g_SpecialReturnTypeDict.get(strEntryPoint, returntype) + for t in g_Typedefs: + if t.name == returntype: + if t.name not in g_SkippedTypedefs: + wrapperreturntype = returntype + strCast = "(" + returntype + ")" + returntype = t.type + break + returntype = g_TypeDict.get(returntype, returntype) + returntype = g_TypeDict.get(func.returntype, returntype) + returntype = g_ReturnTypeDict.get(func.returntype, returntype) + if wrapperreturntype == None: + wrapperreturntype = returntype + functionBody = [] if 'GameServer' in interface.name: @@ -857,8 +886,9 @@ def parse_func(f, interface, func): g_Output.append("\t\t}") g_Output.append("") -def parse_args(strEntryPoint, args): +def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): pinvokeargs = "IntPtr instancePtr, " + largePackPInvokeArgs = "IntPtr instancePtr, " wrapperargs = "" argnames = "" stringargs = [] @@ -877,12 +907,21 @@ def parse_args(strEntryPoint, args): getNextArgAsStringSize = False argNamesToAddAsStringSize = [] + packsizeAware = False + # Scan for packsize aware parameter first, duplicated from below + for arg in args: + potentialtype = arg.type.rstrip("*").lstrip("const ").rstrip() + if potentialtype in parser.packSizeAwareStructs: + packsizeAware = True + for arg in args: potentialtype = arg.type.rstrip("*").lstrip("const ").rstrip() argtype = g_TypeDict.get(arg.type, arg.type) if argtype.endswith("*"): argtype = "out " + g_TypeDict.get(potentialtype, potentialtype) argtype = g_SpecialArgsDict.get(strEntryPoint, dict()).get(arg.name, argtype) + argTypeInfo = parser.resolveTypeInfo(arg.type) + argattribute = get_arg_attribute(strEntryPoint, arg) if argattribute: @@ -908,6 +947,9 @@ def parse_args(strEntryPoint, args): argtype = "[MarshalAs(UnmanagedType.I1)] " + argtype pinvokeargs += argtype + " " + arg.name + ", " + if packsizeAware: + largePackPInvokeArgs += f"{argtype}_LargePack {arg.name}," + argtype = argtype.replace("[In, Out] ", "").replace("[MarshalAs(UnmanagedType.I1)] ", "") wrapperargtype = g_WrapperArgsTypeDict.get(arg.type, argtype) @@ -969,6 +1011,7 @@ def parse_args(strEntryPoint, args): argnames += ", " pinvokeargs = pinvokeargs.rstrip(", ") + largePackPInvokeArgs = largePackPInvokeArgs.rstrip(", ") wrapperargs = wrapperargs.rstrip(", ") argnames = argnames.rstrip(", ") return (pinvokeargs, wrapperargs, argnames, stringargs, (outstringargs, outstringsize), args_with_explicit_count) From 7656460eb6fffc09dd6ef043709416c257da0616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sun, 19 Oct 2025 02:19:29 +0800 Subject: [PATCH 50/82] Source generator now generate both variant of packsize aware struct. --- CodeGen/Steamworks.NET_CodeGen.py | 2 +- CodeGen/src/structs.py | 72 +- Standalone3.0/ConditionalMarshallerTable.g.cs | 4 - Standalone3.0/ICallbackIdentity.cs | 1 + .../Runtime/autogen/SteamCallbacks.cs | 958 +++++++++++++----- .../Runtime/autogen/SteamStructs.cs | 464 +++------ 6 files changed, 915 insertions(+), 586 deletions(-) diff --git a/CodeGen/Steamworks.NET_CodeGen.py b/CodeGen/Steamworks.NET_CodeGen.py index 660dcd35..e3ecf231 100644 --- a/CodeGen/Steamworks.NET_CodeGen.py +++ b/CodeGen/Steamworks.NET_CodeGen.py @@ -11,7 +11,7 @@ def main(): steamworksparser.Settings.fake_gameserver_interfaces = True ___parser = steamworksparser.parse(steam_path) - interfaces.main(___parser) + # TODO interfaces.main(___parser) constants.main(___parser) enums.main(___parser) structs.main(___parser) diff --git a/CodeGen/src/structs.py b/CodeGen/src/structs.py index 25cd45b8..4d0e1ac3 100644 --- a/CodeGen/src/structs.py +++ b/CodeGen/src/structs.py @@ -1,17 +1,23 @@ import os import sys from copy import deepcopy -from SteamworksParser.steamworksparser import BlankLine, Parser, Settings +from SteamworksParser.steamworksparser import BlankLine, FieldOffset, Parser, Settings, Struct, StructField g_TypeConversionDict = { "uint8": "byte", "uint16": "ushort", "uint32": "uint", "uint64": "ulong", + "uint8_t": "byte", + "uint16_t": "ushort", + "uint32_t": "uint", + "uint64_t": "ulong", "char": "string", "int32": "int", "int64": "long", + "int32_t": "int", + "int64_t": "long", "uint8 *": "IntPtr", "const char *": "string", @@ -147,8 +153,11 @@ def main(parser: Parser): out.write(bytes("#endif // !DISABLESTEAMWORKS\n", "utf-8")) -def parse(struct, isMainStruct, marshalTableLines: list[str], packsizeAwareStructNames: list[str]) -> list[str]: - if struct.name in g_SkippedStructs: +def parse(struct: Struct, isMainStruct, marshalTableLines: list[str], packsizeAwareStructNames: list[str]) -> list[str]: + # ignore structs that manually defined by us + # ignore nested structs, they probably handled by hand + # ignore structs which has nested types, they probably interop by hand + if struct.name in g_SkippedStructs or struct.should_not_generate(): return [] lines = [] @@ -158,20 +167,27 @@ def parse(struct, isMainStruct, marshalTableLines: list[str], packsizeAwareStruc lines.append("\t" + comment) structname: str = struct.name - # We have analyzed this struct and stored the value of its packsize, + # We have analyzed this struct and stored the value of its packsize, # it's stored in Struct.pack, None for default packsize - # If the struct is packsize-aware, we generate large variants of it. + # If the struct is packsize-aware, we generate large variants of it. packsize = g_CustomPackSize.get(structname, "Packsize.value") isExplicitStruct = False if g_ExplicitStructs.get(structname, False): lines.append("\t[StructLayout(LayoutKind.Explicit, Pack = " + packsize + ")]") isExplicitStruct = True - elif struct.packsize != "Packsize.value": - packsize = packsize if struct.packsize is None else str(struct.packsize) + elif isMainStruct: + + if struct.packsize != "Packsize.value" and structname not in g_SequentialStructs: + customsize = "" + if len(struct.fields) == 0: + customsize = ", Size = 1" + lines.append("\t[StructLayout(LayoutKind.Sequential, Pack = " + packsize + customsize + ")]") + elif not isMainStruct: + packsize = str(8) customsize = "" if len(struct.fields) == 0: - customsize = ", Size = 1" - lines.append("\t[StructLayout(LayoutKind.Sequential, Pack = " + packsize + customsize + ")]") + customsize = ", Size = 1" + lines.append("\t[StructLayout(LayoutKind.Sequential, Pack = 8" + customsize + ")]") if struct.callbackid: lines.append("\t[CallbackIdentity(Constants." + struct.callbackid + ")]") @@ -182,18 +198,21 @@ def parse(struct, isMainStruct, marshalTableLines: list[str], packsizeAwareStruc break if isMainStruct: - lines.append("\tpublic struct " + structname ) - lines.append("\t#if STEAMWORKS_ANYCPU") - lines.append("\t\t: ICallbackIdentity") - lines.append("\t#endif") - lines.append("\t{") + if struct.callbackid: + lines.append("\tpublic struct " + structname ) + lines.append("\t#if STEAMWORKS_ANYCPU") + lines.append("\t\t: ICallbackIdentity") + lines.append("\t#endif") + lines.append("\t{") + else: + lines.append("\tpublic struct " + structname + " {" ) else: lines.append("\tinternal struct " + structname + " {") lines.extend(insert_constructors(structname)) - if struct.callbackid and not isMainStruct: + if struct.callbackid and isMainStruct: lines.append("\t\tpublic const int k_iCallback = Constants." + struct.callbackid + ";") lines.append("\t\tpublic static int CallbackIdentity { get; } = Constants." + struct.callbackid + ";") @@ -236,7 +255,7 @@ def parse(struct, isMainStruct, marshalTableLines: list[str], packsizeAwareStruc else: lines.append("\t" + comment) - # Generate Any CPU marshal helper + # Generate Any CPU marshal helper if isMainStruct and struct.name in packsizeAwareStructNames and not isExplicitStruct: marshalTableLines.append(f"if (typeof(T) == typeof({structname}) && Packsize.IsLargePack)") marshalTableLines.append(f"\tImpl<{structname}>.Marshaller = (unmanaged) =>") @@ -249,7 +268,7 @@ def parse(struct, isMainStruct, marshalTableLines: list[str], packsizeAwareStruc lines.append("\t}") lines.append("") - # Generate Any CPU struct variant for default pack-sized structs + # Generate Any CPU struct variant for default pack-sized structs if isMainStruct and not isExplicitStruct and struct.name in packsizeAwareStructNames: lines.append("\t#if STEAMWORKS_ANYCPU") @@ -271,7 +290,7 @@ def gen_fieldcopycode(field, structname, marshalTableLines): else: marshalTableLines.append(f"\t\t\tresult.{field.name} = value.{field.name};") -def parse_field(field, structname): +def parse_field(field: StructField, structname): lines = [] for comment in field.c.rawprecomments: if type(comment) is BlankLine: @@ -290,28 +309,29 @@ def parse_field(field, structname): if field.c.rawlinecomment: comment = field.c.rawlinecomment - if field.arraysize: + if field.arraysizeStr: constantsstr = "" - if not field.arraysize.isdigit(): + if not field.arraysizeStr.isdigit(): constantsstr = "Constants." if fieldtype == "byte[]": - lines.append("\t\t[MarshalAs(UnmanagedType.ByValArray, SizeConst = " + constantsstr + field.arraysize + ")]") + lines.append("\t\t[MarshalAs(UnmanagedType.ByValArray, SizeConst = " + constantsstr + field.arraysizeStr + ")]") if structname == "MatchMakingKeyValuePair_t": - lines.append("\t\t[MarshalAs(UnmanagedType.ByValTStr, SizeConst = " + constantsstr + field.arraysize + ")]") + lines.append("\t\t[MarshalAs(UnmanagedType.ByValTStr, SizeConst = " + constantsstr + field.arraysizeStr + ")]") else: - lines.append("\t\t[MarshalAs(UnmanagedType.ByValArray, SizeConst = " + constantsstr + field.arraysize + ")]") + lines.append("\t\t[MarshalAs(UnmanagedType.ByValArray, SizeConst = " + constantsstr + field.arraysizeStr + ")]") fieldtype += "[]" if fieldtype == "bool": lines.append("\t\t[MarshalAs(UnmanagedType.I1)]") - if field.arraysize and fieldtype == "string[]": + # HACK real type is `string`, `[]` is added by `fieldtype += "[]"` + if field.arraysizeStr and fieldtype == "string[]": lines.append("\t\tinternal byte[] " + field.name + "_;") - lines.append("\t\tpublic string " + field.name + comment) + lines.append("\t\tpublic string " + field.name + comment) lines.append("\t\t{") lines.append("\t\t\tget { return InteropHelp.ByteArrayToStringUTF8(" + field.name + "_); }") - lines.append("\t\t\tset { InteropHelp.StringToByteArrayUTF8(value, " + field.name + "_, " + constantsstr + field.arraysize + "); }") + lines.append("\t\t\tset { InteropHelp.StringToByteArrayUTF8(value, " + field.name + "_, " + constantsstr + field.arraysizeStr + "); }") lines.append("\t\t}") else: lines.append("\t\tpublic " + fieldtype + " " + field.name + ";" + comment) diff --git a/Standalone3.0/ConditionalMarshallerTable.g.cs b/Standalone3.0/ConditionalMarshallerTable.g.cs index ed1536d6..7ceef43d 100644 --- a/Standalone3.0/ConditionalMarshallerTable.g.cs +++ b/Standalone3.0/ConditionalMarshallerTable.g.cs @@ -182,10 +182,6 @@ static Impl() { Impl.Marshaller = (unmanaged) => System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (typeof(T) == typeof(SteamTimelineGamePhaseRecordingExists_t) && Packsize.IsLargePack) - Impl.Marshaller = (unmanaged) => - System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); - if (typeof(T) == typeof(SteamUGCDetails_t) && Packsize.IsLargePack) Impl.Marshaller = (unmanaged) => System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); diff --git a/Standalone3.0/ICallbackIdentity.cs b/Standalone3.0/ICallbackIdentity.cs index 588be526..31e520dd 100644 --- a/Standalone3.0/ICallbackIdentity.cs +++ b/Standalone3.0/ICallbackIdentity.cs @@ -8,5 +8,6 @@ namespace Steamworks { internal interface ICallbackIdentity { + public static int CallbackIdentity { get; } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs index 8155da7b..ee5c576e 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs @@ -26,6 +26,8 @@ public struct DlcInstalled_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamAppsCallbacks + 5; public AppId_t m_nAppID; // AppID of the DLC } @@ -42,6 +44,8 @@ public struct NewUrlLaunchParameters_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 14; + public static int CallbackIdentity { get; } = Constants.k_iSteamAppsCallbacks + 14; } //----------------------------------------------------------------------------- @@ -55,10 +59,18 @@ public struct AppProofOfPurchaseKeyResponse_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 21; + public static int CallbackIdentity { get; } = Constants.k_iSteamAppsCallbacks + 21; public EResult m_eResult; public uint m_nAppID; public uint m_cchKeyLength; - public string m_rgchKey; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cubAppProofOfPurchaseKeyMax)] + internal byte[] m_rgchKey_; + public string m_rgchKey + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchKey_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchKey_, Constants.k_cubAppProofOfPurchaseKeyMax); } + } } //----------------------------------------------------------------------------- @@ -71,9 +83,12 @@ public struct FileDetailsResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 23; + public static int CallbackIdentity { get; } = Constants.k_iSteamAppsCallbacks + 23; public EResult m_eResult; public ulong m_ulFileSize; // original file size in bytes - public byte m_FileSHA; // original file SHA1 hash + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] + public byte[] m_FileSHA; // original file SHA1 hash public uint m_unFlags; // } @@ -84,11 +99,10 @@ public struct FileDetailsResult_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamAppsCallbacks + 23)] internal struct FileDetailsResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 23; - public static int CallbackIdentity { get; } = Constants.k_iSteamAppsCallbacks + 23; public EResult m_eResult; public ulong m_ulFileSize; // original file size in bytes - public byte m_FileSHA; // original file SHA1 hash + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] + public byte[] m_FileSHA; // original file SHA1 hash public uint m_unFlags; // public static implicit operator FileDetailsResult_t(FileDetailsResult_t_LargePack value) { @@ -121,6 +135,8 @@ public struct TimedTrialStatus_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 30; + public static int CallbackIdentity { get; } = Constants.k_iSteamAppsCallbacks + 30; public AppId_t m_unAppID; // appID [MarshalAs(UnmanagedType.I1)] public bool m_bIsOffline; // if true, time allowed / played refers to offline time, not total time @@ -132,13 +148,15 @@ public struct TimedTrialStatus_t //----------------------------------------------------------------------------- // Purpose: called when a friends' status changes //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 4)] public struct PersonaStateChange_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 4; public ulong m_ulSteamID; // steamID of the friend who changed public EPersonaChange m_nChangeFlags; // what's changed @@ -148,13 +166,15 @@ public struct PersonaStateChange_t // Purpose: posted when game overlay activates or deactivates // the game can use this to be pause or resume single player games //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 31)] public struct GameOverlayActivated_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 31; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 31; public byte m_bActive; // true if it's just been activated, false otherwise [MarshalAs(UnmanagedType.I1)] public bool m_bUserInitiated; // true if the user asked for the overlay to be activated/deactivated @@ -166,28 +186,44 @@ public struct GameOverlayActivated_t // Purpose: called when the user tries to join a different game server from their friends list // game client should attempt to connect to specified server when this is received //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 32)] public struct GameServerChangeRequested_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { - public string m_rgchServer; // server address ("127.0.0.1:27015", "tf2.valvesoftware.com") - public string m_rgchPassword; // server password, if any + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 32; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 32; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] + internal byte[] m_rgchServer_; + public string m_rgchServer // server address ("127.0.0.1:27015", "tf2.valvesoftware.com") + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchServer_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchServer_, 64); } + } + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] + internal byte[] m_rgchPassword_; + public string m_rgchPassword // server password, if any + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchPassword_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchPassword_, 64); } + } } //----------------------------------------------------------------------------- // Purpose: called when the user tries to join a lobby from their friends list // game client should attempt to connect to specified lobby when this is received //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 33)] public struct GameLobbyJoinRequested_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 33; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 33; public CSteamID m_steamIDLobby; // The friend they did the join via (will be invalid if not directly via a friend) @@ -198,13 +234,15 @@ public struct GameLobbyJoinRequested_t // Purpose: called when an avatar is loaded in from a previous GetLargeFriendAvatar() call // if the image wasn't already available //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 34)] public struct AvatarImageLoaded_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 34; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 34; public CSteamID m_steamID; // steamid the avatar has been loaded for public int m_iImage; // the image index of the now loaded image public int m_iWide; // width of the loaded image @@ -214,13 +252,15 @@ public struct AvatarImageLoaded_t //----------------------------------------------------------------------------- // Purpose: marks the return of a request officer list call //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 35)] public struct ClanOfficerListResponse_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 35; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 35; public CSteamID m_steamIDClan; public int m_cOfficers; public byte m_bSuccess; @@ -229,13 +269,15 @@ public struct ClanOfficerListResponse_t //----------------------------------------------------------------------------- // Purpose: callback indicating updated data about friends rich presence information //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 36)] public struct FriendRichPresenceUpdate_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 36; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 36; public CSteamID m_steamIDFriend; // friend who's rich presence has changed public AppId_t m_nAppID; // the appID of the game (should always be the current game) } @@ -244,27 +286,37 @@ public struct FriendRichPresenceUpdate_t // Purpose: called when the user tries to join a game from their friends list // rich presence will have been set with the "connect" key which is set here //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 37)] public struct GameRichPresenceJoinRequested_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 37; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 37; public CSteamID m_steamIDFriend; // the friend they did the join via (will be invalid if not directly via a friend) - public string m_rgchConnect; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchMaxRichPresenceValueLength)] + internal byte[] m_rgchConnect_; + public string m_rgchConnect + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchConnect_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchConnect_, Constants.k_cchMaxRichPresenceValueLength); } + } } //----------------------------------------------------------------------------- // Purpose: a chat message has been received for a clan chat the game has joined //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 38)] public struct GameConnectedClanChatMsg_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 38; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 38; public CSteamID m_steamIDClanChat; public CSteamID m_steamIDUser; public int m_iMessageID; @@ -273,13 +325,15 @@ public struct GameConnectedClanChatMsg_t //----------------------------------------------------------------------------- // Purpose: a user has joined a clan chat //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 39)] public struct GameConnectedChatJoin_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 39; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 39; public CSteamID m_steamIDClanChat; public CSteamID m_steamIDUser; } @@ -287,13 +341,15 @@ public struct GameConnectedChatJoin_t //----------------------------------------------------------------------------- // Purpose: a user has left the chat we're in //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = 1)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 40)] public struct GameConnectedChatLeave_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 40; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 40; public CSteamID m_steamIDClanChat; public CSteamID m_steamIDUser; [MarshalAs(UnmanagedType.I1)] @@ -305,13 +361,15 @@ public struct GameConnectedChatLeave_t //----------------------------------------------------------------------------- // Purpose: a DownloadClanActivityCounts() call has finished //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 41)] public struct DownloadClanActivityCountsResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 41; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 41; [MarshalAs(UnmanagedType.I1)] public bool m_bSuccess; } @@ -319,13 +377,15 @@ public struct DownloadClanActivityCountsResult_t //----------------------------------------------------------------------------- // Purpose: a JoinClanChatRoom() call has finished //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 42)] public struct JoinClanChatRoomCompletionResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 42; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 42; public CSteamID m_steamIDClanChat; public EChatRoomEnterResponse m_eChatRoomEnterResponse; } @@ -333,51 +393,60 @@ public struct JoinClanChatRoomCompletionResult_t //----------------------------------------------------------------------------- // Purpose: a chat message has been received from a user //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 43)] public struct GameConnectedFriendChatMsg_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 43; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 43; public CSteamID m_steamIDUser; public int m_iMessageID; } - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 44)] public struct FriendsGetFollowerCount_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 44; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 44; public EResult m_eResult; public CSteamID m_steamID; public int m_nCount; } - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 45)] public struct FriendsIsFollowing_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 45; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 45; public EResult m_eResult; public CSteamID m_steamID; [MarshalAs(UnmanagedType.I1)] public bool m_bIsFollowing; } - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 46)] public struct FriendsEnumerateFollowingList_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 46; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 46; public EResult m_eResult; - public CSteamID m_rgSteamID; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cEnumerateFollowersMax)] + public CSteamID[] m_rgSteamID; public int m_nResultsReturned; public int m_nTotalResultCount; } @@ -385,51 +454,65 @@ public struct FriendsEnumerateFollowingList_t //----------------------------------------------------------------------------- // Purpose: Invoked when the status of unread messages changes //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 48)] public struct UnreadChatMessagesChanged_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 48; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 48; } //----------------------------------------------------------------------------- // Purpose: Dispatched when an overlay browser instance is navigated to a protocol/scheme registered by RegisterProtocolInOverlayBrowser() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 49)] public struct OverlayBrowserProtocolNavigation_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { - public string rgchURI; + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 49; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 49; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] + internal byte[] rgchURI_; + public string rgchURI + { + get { return InteropHelp.ByteArrayToStringUTF8(rgchURI_); } + set { InteropHelp.StringToByteArrayUTF8(value, rgchURI_, 1024); } + } } //----------------------------------------------------------------------------- // Purpose: A user's equipped profile items have changed //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 50)] public struct EquippedProfileItemsChanged_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 50; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 50; public CSteamID m_steamID; } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 51)] public struct EquippedProfileItems_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 51; + public static int CallbackIdentity { get; } = Constants.k_iSteamFriendsCallbacks + 51; public EResult m_eResult; public CSteamID m_steamID; [MarshalAs(UnmanagedType.I1)] @@ -455,6 +538,8 @@ public struct GCMessageAvailable_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameCoordinatorCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameCoordinatorCallbacks + 1; public uint m_nMessageSize; } @@ -466,6 +551,8 @@ public struct GCMessageFailed_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameCoordinatorCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameCoordinatorCallbacks + 2; } // callbacks @@ -477,6 +564,8 @@ public struct GSClientApprove_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerCallbacks + 1; public CSteamID m_SteamID; // SteamID of approved player public CSteamID m_OwnerSteamID; // SteamID of original owner for game license } @@ -489,9 +578,17 @@ public struct GSClientDeny_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerCallbacks + 2; public CSteamID m_SteamID; public EDenyReason m_eDenyReason; - public string m_rgchOptionalText; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] + internal byte[] m_rgchOptionalText_; + public string m_rgchOptionalText + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchOptionalText_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchOptionalText_, 128); } + } } // request the game server should kick the user @@ -502,6 +599,8 @@ public struct GSClientKick_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerCallbacks + 3; public CSteamID m_SteamID; public EDenyReason m_eDenyReason; } @@ -516,8 +615,16 @@ public struct GSClientAchievementStatus_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 6; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerCallbacks + 6; public ulong m_SteamID; - public string m_pchAchievement; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] + internal byte[] m_pchAchievement_; + public string m_pchAchievement + { + get { return InteropHelp.ByteArrayToStringUTF8(m_pchAchievement_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_pchAchievement_, 128); } + } [MarshalAs(UnmanagedType.I1)] public bool m_bUnlocked; } @@ -531,6 +638,8 @@ public struct GSPolicyResponse_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 15; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 15; public byte m_bSecure; } @@ -542,6 +651,8 @@ public struct GSGameplayStats_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 7; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerCallbacks + 7; public EResult m_eResult; // Result of the call public int m_nRank; // Overall rank of the server (0-based) public uint m_unTotalConnects; // Total number of clients who have ever connected to the server @@ -556,6 +667,8 @@ public struct GSClientGroupStatus_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 8; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerCallbacks + 8; public CSteamID m_SteamIDUser; public CSteamID m_SteamIDGroup; [MarshalAs(UnmanagedType.I1)] @@ -572,6 +685,8 @@ public struct GSReputation_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 9; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerCallbacks + 9; public EResult m_eResult; // Result of the call; public uint m_unReputationScore; // The reputation score for the game server [MarshalAs(UnmanagedType.I1)] @@ -594,8 +709,6 @@ public struct GSReputation_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameServerCallbacks + 9)] internal struct GSReputation_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 9; - public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerCallbacks + 9; public EResult m_eResult; // Result of the call; public uint m_unReputationScore; // The reputation score for the game server [MarshalAs(UnmanagedType.I1)] @@ -646,6 +759,8 @@ public struct AssociateWithClanResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 10; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerCallbacks + 10; public EResult m_eResult; // Result of the call; } @@ -657,6 +772,8 @@ public struct ComputeNewPlayerCompatibilityResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 11; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerCallbacks + 11; public EResult m_eResult; // Result of the call; public int m_cPlayersThatDontLikeCandidate; public int m_cPlayersThatCandidateDoesntLike; @@ -676,6 +793,8 @@ public struct GSStatsReceived_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameServerStatsCallbacks; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerStatsCallbacks; public EResult m_eResult; // Success / error fetching the stats public CSteamID m_steamIDUser; // The user for whom the stats are retrieved for } @@ -689,8 +808,6 @@ public struct GSStatsReceived_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameServerStatsCallbacks)] internal struct GSStatsReceived_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameServerStatsCallbacks; - public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerStatsCallbacks; public EResult m_eResult; // Success / error fetching the stats public CSteamID m_steamIDUser; // The user for whom the stats are retrieved for @@ -720,6 +837,8 @@ public struct GSStatsStored_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameServerStatsCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerStatsCallbacks + 1; public EResult m_eResult; // success / error public CSteamID m_steamIDUser; // The user for whom the stats were stored } @@ -731,8 +850,6 @@ public struct GSStatsStored_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameServerStatsCallbacks + 1)] internal struct GSStatsStored_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameServerStatsCallbacks + 1; - public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerStatsCallbacks + 1; public EResult m_eResult; // success / error public CSteamID m_steamIDUser; // The user for whom the stats were stored @@ -763,6 +880,8 @@ public struct GSStatsUnloaded_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 8; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserStatsCallbacks + 8; public CSteamID m_steamIDUser; // User whose stats have been unloaded } @@ -777,6 +896,8 @@ public struct HTML_BrowserReady_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 1; public HHTMLBrowser unBrowserHandle; // this browser is now fully created and ready to navigate to pages } @@ -790,6 +911,8 @@ public struct HTML_NeedsPaint_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 2; public HHTMLBrowser unBrowserHandle; // the browser that needs the paint public IntPtr pBGRA; // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called public uint unWide; // the total width of the pBGRA texture @@ -811,8 +934,6 @@ public struct HTML_NeedsPaint_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 2)] internal struct HTML_NeedsPaint_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 2; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 2; public HHTMLBrowser unBrowserHandle; // the browser that needs the paint public IntPtr pBGRA; // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called public uint unWide; // the total width of the pBGRA texture @@ -873,6 +994,8 @@ public struct HTML_StartRequest_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 3; public HHTMLBrowser unBrowserHandle; // the handle of the surface navigating public string pchURL; // the url they wish to navigate to public string pchTarget; // the html link target type (i.e _blank, _self, _parent, _top ) @@ -889,8 +1012,6 @@ public struct HTML_StartRequest_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 3)] internal struct HTML_StartRequest_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 3; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 3; public HHTMLBrowser unBrowserHandle; // the handle of the surface navigating public string pchURL; // the url they wish to navigate to public string pchTarget; // the html link target type (i.e _blank, _self, _parent, _top ) @@ -930,6 +1051,8 @@ public struct HTML_CloseBrowser_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 4; public HHTMLBrowser unBrowserHandle; // the handle of the surface } @@ -943,6 +1066,8 @@ public struct HTML_URLChanged_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 5; public HHTMLBrowser unBrowserHandle; // the handle of the surface navigating public string pchURL; // the url they wish to navigate to public string pchPostData; // any posted data for the request @@ -960,8 +1085,6 @@ public struct HTML_URLChanged_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 5)] internal struct HTML_URLChanged_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 5; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 5; public HHTMLBrowser unBrowserHandle; // the handle of the surface navigating public string pchURL; // the url they wish to navigate to public string pchPostData; // any posted data for the request @@ -1005,6 +1128,8 @@ public struct HTML_FinishedRequest_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 6; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 6; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchURL; // public string pchPageTitle; // @@ -1017,8 +1142,6 @@ public struct HTML_FinishedRequest_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 6)] internal struct HTML_FinishedRequest_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 6; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 6; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchURL; // public string pchPageTitle; // @@ -1051,6 +1174,8 @@ public struct HTML_OpenLinkInNewTab_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 7; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 7; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchURL; // } @@ -1062,8 +1187,6 @@ public struct HTML_OpenLinkInNewTab_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 7)] internal struct HTML_OpenLinkInNewTab_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 7; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 7; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchURL; // @@ -1093,6 +1216,8 @@ public struct HTML_ChangedTitle_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 8; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 8; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchTitle; // } @@ -1104,8 +1229,6 @@ public struct HTML_ChangedTitle_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 8)] internal struct HTML_ChangedTitle_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 8; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 8; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchTitle; // @@ -1135,6 +1258,8 @@ public struct HTML_SearchResults_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 9; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 9; public HHTMLBrowser unBrowserHandle; // the handle of the surface public uint unResults; // public uint unCurrentMatch; // @@ -1150,6 +1275,8 @@ public struct HTML_CanGoBackAndForward_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 10; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 10; public HHTMLBrowser unBrowserHandle; // the handle of the surface [MarshalAs(UnmanagedType.I1)] public bool bCanGoBack; // @@ -1167,6 +1294,8 @@ public struct HTML_HorizontalScroll_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 11; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 11; public HHTMLBrowser unBrowserHandle; // the handle of the surface public uint unScrollMax; // public uint unScrollCurrent; // @@ -1186,6 +1315,8 @@ public struct HTML_VerticalScroll_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 12; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 12; public HHTMLBrowser unBrowserHandle; // the handle of the surface public uint unScrollMax; // public uint unScrollCurrent; // @@ -1205,6 +1336,8 @@ public struct HTML_LinkAtPosition_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 13; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 13; public HHTMLBrowser unBrowserHandle; // the handle of the surface public uint x; // NOTE - Not currently set public uint y; // NOTE - Not currently set @@ -1222,8 +1355,6 @@ public struct HTML_LinkAtPosition_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 13)] internal struct HTML_LinkAtPosition_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 13; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 13; public HHTMLBrowser unBrowserHandle; // the handle of the surface public uint x; // NOTE - Not currently set public uint y; // NOTE - Not currently set @@ -1268,6 +1399,8 @@ public struct HTML_JSAlert_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 14; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 14; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMessage; // } @@ -1280,8 +1413,6 @@ public struct HTML_JSAlert_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 14)] internal struct HTML_JSAlert_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 14; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 14; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMessage; // @@ -1312,6 +1443,8 @@ public struct HTML_JSConfirm_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 15; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 15; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMessage; // } @@ -1324,8 +1457,6 @@ public struct HTML_JSConfirm_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 15)] internal struct HTML_JSConfirm_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 15; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 15; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMessage; // @@ -1356,6 +1487,8 @@ public struct HTML_FileOpenDialog_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 16; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 16; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchTitle; // public string pchInitialFile; // @@ -1369,8 +1502,6 @@ public struct HTML_FileOpenDialog_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 16)] internal struct HTML_FileOpenDialog_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 16; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 16; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchTitle; // public string pchInitialFile; // @@ -1409,6 +1540,8 @@ public struct HTML_NewWindow_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 21; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 21; public HHTMLBrowser unBrowserHandle; // the handle of the current surface public string pchURL; // the page to load public uint unX; // the x pos into the page to display the popup @@ -1431,8 +1564,6 @@ public struct HTML_NewWindow_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 21)] internal struct HTML_NewWindow_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 21; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 21; public HHTMLBrowser unBrowserHandle; // the handle of the current surface public string pchURL; // the page to load public uint unX; // the x pos into the page to display the popup @@ -1477,6 +1608,8 @@ public struct HTML_SetCursor_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 22; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 22; public HHTMLBrowser unBrowserHandle; // the handle of the surface public uint eMouseCursor; // the EHTMLMouseCursor to display } @@ -1491,6 +1624,8 @@ public struct HTML_StatusText_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 23; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 23; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMsg; // the message text } @@ -1502,8 +1637,6 @@ public struct HTML_StatusText_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 23)] internal struct HTML_StatusText_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 23; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 23; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMsg; // the message text @@ -1533,6 +1666,8 @@ public struct HTML_ShowToolTip_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 24; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 24; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMsg; // the tooltip text } @@ -1544,8 +1679,6 @@ public struct HTML_ShowToolTip_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 24)] internal struct HTML_ShowToolTip_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 24; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 24; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMsg; // the tooltip text @@ -1575,6 +1708,8 @@ public struct HTML_UpdateToolTip_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 25; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 25; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMsg; // the new tooltip text } @@ -1586,8 +1721,6 @@ public struct HTML_UpdateToolTip_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 25)] internal struct HTML_UpdateToolTip_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 25; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 25; public HHTMLBrowser unBrowserHandle; // the handle of the surface public string pchMsg; // the new tooltip text @@ -1617,6 +1750,8 @@ public struct HTML_HideToolTip_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 26; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 26; public HHTMLBrowser unBrowserHandle; // the handle of the surface } @@ -1630,6 +1765,8 @@ public struct HTML_BrowserRestarted_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTMLSurfaceCallbacks + 27; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTMLSurfaceCallbacks + 27; public HHTMLBrowser unBrowserHandle; // this is the new browser handle after the restart public HHTMLBrowser unOldBrowserHandle; // the handle for the browser before the restart, if your handle was this then switch to using unBrowserHandle for API calls } @@ -1642,6 +1779,8 @@ public struct HTTPRequestCompleted_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTTPCallbacks + 1; // Handle value for the request that has completed. public HTTPRequestHandle m_hRequest; @@ -1667,8 +1806,6 @@ public struct HTTPRequestCompleted_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTTPCallbacks + 1)] internal struct HTTPRequestCompleted_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 1; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTTPCallbacks + 1; // Handle value for the request that has completed. public HTTPRequestHandle m_hRequest; @@ -1717,6 +1854,8 @@ public struct HTTPRequestHeadersReceived_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTTPCallbacks + 2; // Handle value for the request that has received headers. public HTTPRequestHandle m_hRequest; @@ -1730,8 +1869,6 @@ public struct HTTPRequestHeadersReceived_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTTPCallbacks + 2)] internal struct HTTPRequestHeadersReceived_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 2; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTTPCallbacks + 2; // Handle value for the request that has received headers. public HTTPRequestHandle m_hRequest; @@ -1763,6 +1900,8 @@ public struct HTTPRequestDataReceived_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamHTTPCallbacks + 3; // Handle value for the request that has received data. public HTTPRequestHandle m_hRequest; @@ -1783,8 +1922,6 @@ public struct HTTPRequestDataReceived_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamHTTPCallbacks + 3)] internal struct HTTPRequestDataReceived_t_LargePack { - public const int k_iCallback = Constants.k_iSteamHTTPCallbacks + 3; - public static int CallbackIdentity { get; } = Constants.k_iSteamHTTPCallbacks + 3; // Handle value for the request that has received data. public HTTPRequestHandle m_hRequest; @@ -1831,6 +1968,8 @@ public struct SteamInputDeviceConnected_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamControllerCallbacks + 1; public InputHandle_t m_ulConnectedDeviceHandle; // Handle for device } @@ -1845,6 +1984,8 @@ public struct SteamInputDeviceDisconnected_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamControllerCallbacks + 2; public InputHandle_t m_ulDisconnectedDeviceHandle; // Handle for device } @@ -1859,6 +2000,8 @@ public struct SteamInputConfigurationLoaded_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamControllerCallbacks + 3; public AppId_t m_unAppID; public InputHandle_t m_ulDeviceHandle; // Handle for device public CSteamID m_ulMappingCreator; // May differ from local user when using @@ -1880,8 +2023,6 @@ public struct SteamInputConfigurationLoaded_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 3)] internal struct SteamInputConfigurationLoaded_t_LargePack { - public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 3; - public static int CallbackIdentity { get; } = Constants.k_iSteamControllerCallbacks + 3; public AppId_t m_unAppID; public InputHandle_t m_ulDeviceHandle; // Handle for device public CSteamID m_ulMappingCreator; // May differ from local user when using @@ -1931,6 +2072,8 @@ public struct SteamInputGamepadSlotChange_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamControllerCallbacks + 4; public AppId_t m_unAppID; public InputHandle_t m_ulDeviceHandle; // Handle for device public ESteamInputType m_eDeviceType; // Type of device @@ -1946,8 +2089,6 @@ public struct SteamInputGamepadSlotChange_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 4)] internal struct SteamInputGamepadSlotChange_t_LargePack { - public const int k_iCallback = Constants.k_iSteamControllerCallbacks + 4; - public static int CallbackIdentity { get; } = Constants.k_iSteamControllerCallbacks + 4; public AppId_t m_unAppID; public InputHandle_t m_ulDeviceHandle; // Handle for device public ESteamInputType m_eDeviceType; // Type of device @@ -1986,6 +2127,8 @@ public struct SteamInventoryResultReady_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 0; + public static int CallbackIdentity { get; } = Constants.k_iSteamInventoryCallbacks + 0; public SteamInventoryResult_t m_handle; public EResult m_result; } @@ -2004,6 +2147,8 @@ public struct SteamInventoryFullUpdate_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamInventoryCallbacks + 1; public SteamInventoryResult_t m_handle; } @@ -2018,6 +2163,8 @@ public struct SteamInventoryDefinitionUpdate_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamInventoryCallbacks + 2; } // Returned @@ -2028,6 +2175,8 @@ public struct SteamInventoryEligiblePromoItemDefIDs_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamInventoryCallbacks + 3; public EResult m_result; public CSteamID m_steamID; public int m_numEligiblePromoItemDefs; @@ -2040,8 +2189,6 @@ public struct SteamInventoryEligiblePromoItemDefIDs_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 3)] internal struct SteamInventoryEligiblePromoItemDefIDs_t_LargePack { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 3; - public static int CallbackIdentity { get; } = Constants.k_iSteamInventoryCallbacks + 3; public EResult m_result; public CSteamID m_steamID; public int m_numEligiblePromoItemDefs; @@ -2076,6 +2223,8 @@ public struct SteamInventoryStartPurchaseResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamInventoryCallbacks + 4; public EResult m_result; public ulong m_ulOrderID; public ulong m_ulTransID; @@ -2086,8 +2235,6 @@ public struct SteamInventoryStartPurchaseResult_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 4)] internal struct SteamInventoryStartPurchaseResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 4; - public static int CallbackIdentity { get; } = Constants.k_iSteamInventoryCallbacks + 4; public EResult m_result; public ulong m_ulOrderID; public ulong m_ulTransID; @@ -2118,8 +2265,16 @@ public struct SteamInventoryRequestPricesResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamInventoryCallbacks + 5; public EResult m_result; - public string m_rgchCurrency; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + internal byte[] m_rgchCurrency_; + public string m_rgchCurrency + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchCurrency_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchCurrency_, 4); } + } } //----------------------------------------------------------------------------- @@ -2134,6 +2289,8 @@ public struct FavoritesListChanged_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamMatchmakingCallbacks + 2; public uint m_nIP; // an IP of 0 means reload the whole list, any other value means just one server public uint m_nQueryPort; public uint m_nConnPort; @@ -2159,6 +2316,8 @@ public struct LobbyInvite_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamMatchmakingCallbacks + 3; public ulong m_ulSteamIDUser; // Steam ID of the person making the invite public ulong m_ulSteamIDLobby; // Steam ID of the Lobby @@ -2177,6 +2336,8 @@ public struct LobbyEnter_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamMatchmakingCallbacks + 4; public ulong m_ulSteamIDLobby; // SteamID of the Lobby you have entered public uint m_rgfChatPermissions; // Permissions of the current user @@ -2197,6 +2358,8 @@ public struct LobbyDataUpdate_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamMatchmakingCallbacks + 5; public ulong m_ulSteamIDLobby; // steamID of the Lobby public ulong m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself @@ -2215,6 +2378,8 @@ public struct LobbyChatUpdate_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 6; + public static int CallbackIdentity { get; } = Constants.k_iSteamMatchmakingCallbacks + 6; public ulong m_ulSteamIDLobby; // Lobby ID public ulong m_ulSteamIDUserChanged; // user who's status in the lobby just changed - can be recipient @@ -2234,6 +2399,8 @@ public struct LobbyChatMsg_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 7; + public static int CallbackIdentity { get; } = Constants.k_iSteamMatchmakingCallbacks + 7; public ulong m_ulSteamIDLobby; // the lobby id this is in public ulong m_ulSteamIDUser; // steamID of the user who has sent this message @@ -2254,6 +2421,8 @@ public struct LobbyGameCreated_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 9; + public static int CallbackIdentity { get; } = Constants.k_iSteamMatchmakingCallbacks + 9; public ulong m_ulSteamIDLobby; // the lobby we were in public ulong m_ulSteamIDGameServer; // the new game server that has been created or found for the lobby members @@ -2272,6 +2441,8 @@ public struct LobbyMatchList_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 10; + public static int CallbackIdentity { get; } = Constants.k_iSteamMatchmakingCallbacks + 10; public uint m_nLobbiesMatching; // Number of lobbies that matched search criteria and we have SteamIDs for } @@ -2286,6 +2457,8 @@ public struct LobbyKicked_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 12; + public static int CallbackIdentity { get; } = Constants.k_iSteamMatchmakingCallbacks + 12; public ulong m_ulSteamIDLobby; // Lobby public ulong m_ulSteamIDAdmin; // User who kicked you - possibly the ID of the lobby itself public byte m_bKickedDueToDisconnect; // true if you were kicked from the lobby due to the user losing connection to Steam (currently always true) @@ -2304,6 +2477,8 @@ public struct LobbyCreated_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 13; + public static int CallbackIdentity { get; } = Constants.k_iSteamMatchmakingCallbacks + 13; public EResult m_eResult; // k_EResultOK - the lobby was successfully created // k_EResultNoConnection - your Steam client doesn't have a connection to the back-end @@ -2325,8 +2500,6 @@ public struct LobbyCreated_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 13)] internal struct LobbyCreated_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 13; - public static int CallbackIdentity { get; } = Constants.k_iSteamMatchmakingCallbacks + 13; public EResult m_eResult; // k_EResultOK - the lobby was successfully created // k_EResultNoConnection - your Steam client doesn't have a connection to the back-end @@ -2370,6 +2543,8 @@ public struct FavoritesListAccountsUpdated_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 16; + public static int CallbackIdentity { get; } = Constants.k_iSteamMatchmakingCallbacks + 16; public EResult m_eResult; } @@ -2383,6 +2558,8 @@ public struct SearchForGameProgressCallback_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 1; public ulong m_ullSearchID; // all future callbacks referencing this search will include this Search ID @@ -2400,8 +2577,6 @@ public struct SearchForGameProgressCallback_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 1)] internal struct SearchForGameProgressCallback_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 1; - public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 1; public ulong m_ullSearchID; // all future callbacks referencing this search will include this Search ID @@ -2444,6 +2619,8 @@ public struct SearchForGameResultCallback_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 2; public ulong m_ullSearchID; @@ -2463,8 +2640,6 @@ public struct SearchForGameResultCallback_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 2)] internal struct SearchForGameResultCallback_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 2; - public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 2; public ulong m_ullSearchID; @@ -2513,6 +2688,8 @@ public struct RequestPlayersForGameProgressCallback_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 11; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 11; public EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK public ulong m_ullSearchID; // all future callbacks referencing this search will include this Search ID @@ -2526,8 +2703,6 @@ public struct RequestPlayersForGameProgressCallback_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 11)] internal struct RequestPlayersForGameProgressCallback_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 11; - public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 11; public EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK public ulong m_ullSearchID; // all future callbacks referencing this search will include this Search ID @@ -2558,6 +2733,8 @@ public struct RequestPlayersForGameResultCallback_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 12; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 12; public EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK public ulong m_ullSearchID; @@ -2573,8 +2750,6 @@ public struct RequestPlayersForGameResultCallback_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 12)] internal struct RequestPlayersForGameResultCallback_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 12; - public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 12; public EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK public ulong m_ullSearchID; @@ -2610,6 +2785,8 @@ public struct RequestPlayersForGameFinalResultCallback_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 13; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 13; public EResult m_eResult; public ulong m_ullSearchID; @@ -2621,8 +2798,6 @@ public struct RequestPlayersForGameFinalResultCallback_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 13)] internal struct RequestPlayersForGameFinalResultCallback_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 13; - public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 13; public EResult m_eResult; public ulong m_ullSearchID; @@ -2654,6 +2829,8 @@ public struct SubmitPlayerResultResultCallback_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 14; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 14; public EResult m_eResult; public ulong ullUniqueGameID; @@ -2665,8 +2842,6 @@ public struct SubmitPlayerResultResultCallback_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 14)] internal struct SubmitPlayerResultResultCallback_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 14; - public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 14; public EResult m_eResult; public ulong ullUniqueGameID; @@ -2699,6 +2874,8 @@ public struct EndGameResultCallback_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 15; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 15; public EResult m_eResult; public ulong ullUniqueGameID; @@ -2710,8 +2887,6 @@ public struct EndGameResultCallback_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 15)] internal struct EndGameResultCallback_t_LargePack { - public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 15; - public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 15; public EResult m_eResult; public ulong ullUniqueGameID; @@ -2742,11 +2917,19 @@ public struct JoinPartyCallback_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamPartiesCallbacks + 1; public EResult m_eResult; public PartyBeaconID_t m_ulBeaconID; public CSteamID m_SteamIDBeaconOwner; - public string m_rgchConnectString; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] + internal byte[] m_rgchConnectString_; + public string m_rgchConnectString + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchConnectString_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchConnectString_, 256); } + } } #if STEAMWORKS_ANYCPU @@ -2756,20 +2939,24 @@ public struct JoinPartyCallback_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 1)] internal struct JoinPartyCallback_t_LargePack { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 1; - public static int CallbackIdentity { get; } = Constants.k_iSteamPartiesCallbacks + 1; public EResult m_eResult; public PartyBeaconID_t m_ulBeaconID; public CSteamID m_SteamIDBeaconOwner; - public string m_rgchConnectString; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] + internal byte[] m_rgchConnectString_; + public string m_rgchConnectString + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchConnectString_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchConnectString_, 256); } + } public static implicit operator JoinPartyCallback_t(JoinPartyCallback_t_LargePack value) { JoinPartyCallback_t result = default; result.m_eResult = value.m_eResult; result.m_ulBeaconID = value.m_ulBeaconID; result.m_SteamIDBeaconOwner = value.m_SteamIDBeaconOwner; - result.m_rgchConnectString = value.m_rgchConnectString; + result.m_rgchConnectString_ = value.m_rgchConnectString_; return result; } @@ -2778,7 +2965,7 @@ public static implicit operator JoinPartyCallback_t_LargePack(JoinPartyCallback_ result.m_eResult = value.m_eResult; result.m_ulBeaconID = value.m_ulBeaconID; result.m_SteamIDBeaconOwner = value.m_SteamIDBeaconOwner; - result.m_rgchConnectString = value.m_rgchConnectString; + result.m_rgchConnectString_ = value.m_rgchConnectString_; return result; } } @@ -2792,6 +2979,8 @@ public struct CreateBeaconCallback_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamPartiesCallbacks + 2; public EResult m_eResult; public PartyBeaconID_t m_ulBeaconID; @@ -2802,8 +2991,6 @@ public struct CreateBeaconCallback_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamPartiesCallbacks + 2)] internal struct CreateBeaconCallback_t_LargePack { - public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 2; - public static int CallbackIdentity { get; } = Constants.k_iSteamPartiesCallbacks + 2; public EResult m_eResult; public PartyBeaconID_t m_ulBeaconID; @@ -2835,6 +3022,8 @@ public struct ReservationNotificationCallback_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamPartiesCallbacks + 3; public PartyBeaconID_t m_ulBeaconID; public CSteamID m_steamIDJoiner; @@ -2848,6 +3037,8 @@ public struct ChangeNumOpenSlotsCallback_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamPartiesCallbacks + 4; public EResult m_eResult; } @@ -2860,6 +3051,8 @@ public struct AvailableBeaconLocationsUpdated_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamPartiesCallbacks + 5; } // The list of active beacons may have changed @@ -2870,6 +3063,8 @@ public struct ActiveBeaconsUpdated_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 6; + public static int CallbackIdentity { get; } = Constants.k_iSteamPartiesCallbacks + 6; } // callbacks @@ -2880,6 +3075,8 @@ public struct PlaybackStatusHasChanged_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicCallbacks + 1; } [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] @@ -2889,6 +3086,8 @@ public struct VolumeHasChanged_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicCallbacks + 2; public float m_flNewVolume; } @@ -2900,6 +3099,8 @@ public struct MusicPlayerRemoteWillActivate_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 1; } [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] @@ -2909,6 +3110,8 @@ public struct MusicPlayerRemoteWillDeactivate_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 2; } [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] @@ -2918,6 +3121,8 @@ public struct MusicPlayerRemoteToFront_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 3; } [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] @@ -2927,6 +3132,8 @@ public struct MusicPlayerWillQuit_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 4; } [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] @@ -2936,6 +3143,8 @@ public struct MusicPlayerWantsPlay_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 5; } [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] @@ -2945,6 +3154,8 @@ public struct MusicPlayerWantsPause_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 6; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 6; } [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] @@ -2954,6 +3165,8 @@ public struct MusicPlayerWantsPlayPrevious_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 7; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 7; } [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] @@ -2963,6 +3176,8 @@ public struct MusicPlayerWantsPlayNext_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 8; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 8; } [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] @@ -2972,6 +3187,8 @@ public struct MusicPlayerWantsShuffled_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 9; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 9; [MarshalAs(UnmanagedType.I1)] public bool m_bShuffled; } @@ -2983,6 +3200,8 @@ public struct MusicPlayerWantsLooped_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 10; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 10; [MarshalAs(UnmanagedType.I1)] public bool m_bLooped; } @@ -2994,6 +3213,8 @@ public struct MusicPlayerWantsVolume_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 11; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicCallbacks + 11; public float m_flNewVolume; } @@ -3004,6 +3225,8 @@ public struct MusicPlayerSelectsQueueEntry_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 12; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicCallbacks + 12; public int nID; } @@ -3014,6 +3237,8 @@ public struct MusicPlayerSelectsPlaylistEntry_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 13; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicCallbacks + 13; public int nID; } @@ -3024,45 +3249,53 @@ public struct MusicPlayerWantsPlayingRepeatStatus_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 14; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 14; public int m_nPlayingRepeatStatus; } // callbacks // callback notification - a user wants to talk to us over the P2P channel via the SendP2PPacket() API // in response, a call to AcceptP2PPacketsFromUser() needs to be made, if you want to talk with them - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamNetworkingCallbacks + 2)] public struct P2PSessionRequest_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamNetworkingCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamNetworkingCallbacks + 2; public CSteamID m_steamIDRemote; // user who wants to talk to us } // callback notification - packets can't get through to the specified user via the SendP2PPacket() API // all packets queued packets unsent at this point will be dropped // further attempts to send will retry making the connection (but will be dropped if we fail again) - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = 1)] [CallbackIdentity(Constants.k_iSteamNetworkingCallbacks + 3)] public struct P2PSessionConnectFail_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamNetworkingCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamNetworkingCallbacks + 3; public CSteamID m_steamIDRemote; // user we were sending packets to public byte m_eP2PSessionError; // EP2PSessionError indicating why we're having trouble } // callback notification - status of a socket has changed // used as part of the CreateListenSocket() / CreateP2PConnectionSocket() - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamNetworkingCallbacks + 1)] public struct SocketStatusCallback_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamNetworkingCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamNetworkingCallbacks + 1; public SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host public SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection public CSteamID m_steamIDRemote; // remote steamID we have connected to, if it has one @@ -3073,13 +3306,15 @@ public struct SocketStatusCallback_t // Callbacks // /// Posted when a remote host is sending us a message, and we do not already have a session with them - [StructLayout(LayoutKind.Sequential, Pack = 1)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamNetworkingMessagesCallbacks + 1)] public struct SteamNetworkingMessagesSessionRequest_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamNetworkingMessagesCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamNetworkingMessagesCallbacks + 1; public SteamNetworkingIdentity m_identityRemote; // user who wants to talk to us } @@ -3094,13 +3329,15 @@ public struct SteamNetworkingMessagesSessionRequest_t /// Also, if a session times out due to inactivity, no callbacks will be posted. The only /// way to detect that this is happening is that querying the session state may return /// none, connecting, and findingroute again. - [StructLayout(LayoutKind.Sequential, Pack = 1)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamNetworkingMessagesCallbacks + 2)] public struct SteamNetworkingMessagesSessionFailed_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamNetworkingMessagesCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamNetworkingMessagesCallbacks + 2; /// Detailed info about the session that failed. /// SteamNetConnectionInfo_t::m_identityRemote indicates who this session @@ -3151,6 +3388,8 @@ public struct SteamNetConnectionStatusChangedCallback_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamNetworkingSocketsCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamNetworkingSocketsCallbacks + 1; /// Connection handle public HSteamNetConnection m_hConn; @@ -3202,8 +3441,6 @@ public struct SteamNetConnectionStatusChangedCallback_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamNetworkingSocketsCallbacks + 1)] internal struct SteamNetConnectionStatusChangedCallback_t_LargePack { - public const int k_iCallback = Constants.k_iSteamNetworkingSocketsCallbacks + 1; - public static int CallbackIdentity { get; } = Constants.k_iSteamNetworkingSocketsCallbacks + 1; /// Connection handle public HSteamNetConnection m_hConn; @@ -3247,13 +3484,21 @@ public struct SteamNetAuthenticationStatus_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamNetworkingSocketsCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamNetworkingSocketsCallbacks + 2; /// Status public ESteamNetworkingAvailability m_eAvail; /// Non-localized English language status. For diagnostic/debugging /// purposes only. - public string m_debugMsg; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] + internal byte[] m_debugMsg_; + public string m_debugMsg + { + get { return InteropHelp.ByteArrayToStringUTF8(m_debugMsg_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_debugMsg_, 256); } + } } /// A struct used to describe our readiness to use the relay network. @@ -3266,6 +3511,8 @@ public struct SteamRelayNetworkStatus_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamNetworkingUtilsCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamNetworkingUtilsCallbacks + 1; /// Summary status. When this is "current", initialization has /// completed. Anything else means you are not ready yet, or @@ -3292,7 +3539,13 @@ public struct SteamRelayNetworkStatus_t /// Non-localized English language status. For diagnostic/debugging /// purposes only. - public string m_debugMsg; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] + internal byte[] m_debugMsg_; + public string m_debugMsg + { + get { return InteropHelp.ByteArrayToStringUTF8(m_debugMsg_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_debugMsg_, 256); } + } } //----------------------------------------------------------------------------- @@ -3305,66 +3558,90 @@ public struct SteamParentalSettingsChanged_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_ISteamParentalSettingsCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_ISteamParentalSettingsCallbacks + 1; } // callbacks - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 1)] public struct SteamRemotePlaySessionConnected_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemotePlayCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemotePlayCallbacks + 1; public RemotePlaySessionID_t m_unSessionID; } - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 2)] public struct SteamRemotePlaySessionDisconnected_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemotePlayCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemotePlayCallbacks + 2; public RemotePlaySessionID_t m_unSessionID; } - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 3)] public struct SteamRemotePlayTogetherGuestInvite_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { - public string m_szConnectURL; + public const int k_iCallback = Constants.k_iSteamRemotePlayCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemotePlayCallbacks + 3; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] + internal byte[] m_szConnectURL_; + public string m_szConnectURL + { + get { return InteropHelp.ByteArrayToStringUTF8(m_szConnectURL_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_szConnectURL_, 1024); } + } } // callbacks //----------------------------------------------------------------------------- // Purpose: The result of a call to FileShare() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 7)] public struct RemoteStorageFileShareResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 7; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 7; public EResult m_eResult; // The result of the operation public UGCHandle_t m_hFile; // The handle that can be shared with users and features - public string m_rgchFilename; // The name of the file that was shared + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] + internal byte[] m_rgchFilename_; + public string m_rgchFilename // The name of the file that was shared + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchFilename_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchFilename_, Constants.k_cchFilenameMax); } + } } // k_iSteamRemoteStorageCallbacks + 8 is deprecated! Do not reuse //----------------------------------------------------------------------------- // Purpose: The result of a call to PublishFile() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 9)] public struct RemoteStoragePublishFileResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 9; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 9; public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; [MarshalAs(UnmanagedType.I1)] @@ -3375,13 +3652,15 @@ public struct RemoteStoragePublishFileResult_t //----------------------------------------------------------------------------- // Purpose: The result of a call to DeletePublishedFile() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 11)] public struct RemoteStorageDeletePublishedFileResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 11; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 11; public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; } @@ -3389,29 +3668,34 @@ public struct RemoteStorageDeletePublishedFileResult_t //----------------------------------------------------------------------------- // Purpose: The result of a call to EnumerateUserPublishedFiles() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 12)] public struct RemoteStorageEnumerateUserPublishedFilesResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 12; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 12; public EResult m_eResult; // The result of the operation. public int m_nResultsReturned; public int m_nTotalResultCount; - public PublishedFileId_t m_rgPublishedFileId; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] + public PublishedFileId_t[] m_rgPublishedFileId; } //----------------------------------------------------------------------------- // Purpose: The result of a call to SubscribePublishedFile() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 13)] public struct RemoteStorageSubscribePublishedFileResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 13; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 13; public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; } @@ -3419,30 +3703,36 @@ public struct RemoteStorageSubscribePublishedFileResult_t //----------------------------------------------------------------------------- // Purpose: The result of a call to EnumerateSubscribePublishedFiles() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 14)] public struct RemoteStorageEnumerateUserSubscribedFilesResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 14; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 14; public EResult m_eResult; // The result of the operation. public int m_nResultsReturned; public int m_nTotalResultCount; - public PublishedFileId_t m_rgPublishedFileId; - public uint m_rgRTimeSubscribed; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] + public PublishedFileId_t[] m_rgPublishedFileId; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] + public uint[] m_rgRTimeSubscribed; } //----------------------------------------------------------------------------- // Purpose: The result of a call to UnsubscribePublishedFile() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 15)] public struct RemoteStorageUnsubscribePublishedFileResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 15; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 15; public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; } @@ -3450,13 +3740,15 @@ public struct RemoteStorageUnsubscribePublishedFileResult_t //----------------------------------------------------------------------------- // Purpose: The result of a call to CommitPublishedFileUpdate() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 16)] public struct RemoteStorageUpdatePublishedFileResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 16; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 16; public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; [MarshalAs(UnmanagedType.I1)] @@ -3466,37 +3758,59 @@ public struct RemoteStorageUpdatePublishedFileResult_t //----------------------------------------------------------------------------- // Purpose: The result of a call to UGCDownload() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 17)] public struct RemoteStorageDownloadUGCResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 17; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 17; public EResult m_eResult; // The result of the operation. public UGCHandle_t m_hFile; // The handle to the file that was attempted to be downloaded. public AppId_t m_nAppID; // ID of the app that created this file. public int m_nSizeInBytes; // The size of the file that was downloaded, in bytes. - public string m_pchFileName; // The name of the file that was downloaded. + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] + internal byte[] m_pchFileName_; + public string m_pchFileName // The name of the file that was downloaded. + { + get { return InteropHelp.ByteArrayToStringUTF8(m_pchFileName_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } + } public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. } //----------------------------------------------------------------------------- // Purpose: The result of a call to GetPublishedFileDetails() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 18)] public struct RemoteStorageGetPublishedFileDetailsResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 18; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 18; public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nCreatorAppID; // ID of the app that created this file. public AppId_t m_nConsumerAppID; // ID of the app that will consume this file. - public string m_rgchTitle; // title of document - public string m_rgchDescription; // description of document + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentTitleMax)] + internal byte[] m_rgchTitle_; + public string m_rgchTitle // title of document + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTitle_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTitle_, Constants.k_cchPublishedDocumentTitleMax); } + } + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentDescriptionMax)] + internal byte[] m_rgchDescription_; + public string m_rgchDescription // description of document + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchDescription_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchDescription_, Constants.k_cchPublishedDocumentDescriptionMax); } + } public UGCHandle_t m_hFile; // The handle of the primary file public UGCHandle_t m_hPreviewFile; // The handle of the preview file public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. @@ -3505,30 +3819,52 @@ public struct RemoteStorageGetPublishedFileDetailsResult_t public ERemoteStoragePublishedFileVisibility m_eVisibility; [MarshalAs(UnmanagedType.I1)] public bool m_bBanned; - public string m_rgchTags; // comma separated list of all tags associated with this file + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchTagListMax)] + internal byte[] m_rgchTags_; + public string m_rgchTags // comma separated list of all tags associated with this file + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTags_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTags_, Constants.k_cchTagListMax); } + } [MarshalAs(UnmanagedType.I1)] public bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer - public string m_pchFileName; // The name of the primary file + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] + internal byte[] m_pchFileName_; + public string m_pchFileName // The name of the primary file + { + get { return InteropHelp.ByteArrayToStringUTF8(m_pchFileName_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } + } public int m_nFileSize; // Size of the primary file public int m_nPreviewFileSize; // Size of the preview file - public string m_rgchURL; // URL (for a video or a website) + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedFileURLMax)] + internal byte[] m_rgchURL_; + public string m_rgchURL // URL (for a video or a website) + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchURL_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchURL_, Constants.k_cchPublishedFileURLMax); } + } public EWorkshopFileType m_eFileType; // Type of the file [MarshalAs(UnmanagedType.I1)] public bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop } - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 19)] public struct RemoteStorageEnumerateWorkshopFilesResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 19; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 19; public EResult m_eResult; public int m_nResultsReturned; public int m_nTotalResultCount; - public PublishedFileId_t m_rgPublishedFileId; - public float m_rgScore; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] + public PublishedFileId_t[] m_rgPublishedFileId; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] + public float[] m_rgScore; public AppId_t m_nAppId; public uint m_unStartIndex; } @@ -3536,13 +3872,15 @@ public struct RemoteStorageEnumerateWorkshopFilesResult_t //----------------------------------------------------------------------------- // Purpose: The result of GetPublishedItemVoteDetails //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 20)] public struct RemoteStorageGetPublishedItemVoteDetailsResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 20; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 20; public EResult m_eResult; public PublishedFileId_t m_unPublishedFileId; public int m_nVotesFor; @@ -3554,13 +3892,15 @@ public struct RemoteStorageGetPublishedItemVoteDetailsResult_t //----------------------------------------------------------------------------- // Purpose: User subscribed to a file for the app (from within the app or on the web) //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 21)] public struct RemoteStoragePublishedFileSubscribed_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 21; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 21; public PublishedFileId_t m_nPublishedFileId; // The published file id public AppId_t m_nAppID; // ID of the app that will consume this file. } @@ -3568,13 +3908,15 @@ public struct RemoteStoragePublishedFileSubscribed_t //----------------------------------------------------------------------------- // Purpose: User unsubscribed from a file for the app (from within the app or on the web) //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 22)] public struct RemoteStoragePublishedFileUnsubscribed_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 22; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 22; public PublishedFileId_t m_nPublishedFileId; // The published file id public AppId_t m_nAppID; // ID of the app that will consume this file. } @@ -3582,13 +3924,15 @@ public struct RemoteStoragePublishedFileUnsubscribed_t //----------------------------------------------------------------------------- // Purpose: Published file that a user owns was deleted (from within the app or the web) //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 23)] public struct RemoteStoragePublishedFileDeleted_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 23; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 23; public PublishedFileId_t m_nPublishedFileId; // The published file id public AppId_t m_nAppID; // ID of the app that will consume this file. } @@ -3596,13 +3940,15 @@ public struct RemoteStoragePublishedFileDeleted_t //----------------------------------------------------------------------------- // Purpose: The result of a call to UpdateUserPublishedItemVote() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 24)] public struct RemoteStorageUpdateUserPublishedItemVoteResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 24; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 24; public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; // The published file id } @@ -3610,68 +3956,81 @@ public struct RemoteStorageUpdateUserPublishedItemVoteResult_t //----------------------------------------------------------------------------- // Purpose: The result of a call to GetUserPublishedItemVoteDetails() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 25)] public struct RemoteStorageUserVoteDetails_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 25; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 25; public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; // The published file id public EWorkshopVote m_eVote; // what the user voted } - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 26)] public struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 26; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 26; public EResult m_eResult; // The result of the operation. public int m_nResultsReturned; public int m_nTotalResultCount; - public PublishedFileId_t m_rgPublishedFileId; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] + public PublishedFileId_t[] m_rgPublishedFileId; } - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 27)] public struct RemoteStorageSetUserPublishedFileActionResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 27; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 27; public EResult m_eResult; // The result of the operation. public PublishedFileId_t m_nPublishedFileId; // The published file id public EWorkshopFileAction m_eAction; // the action that was attempted } - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 28)] public struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 28; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 28; public EResult m_eResult; // The result of the operation. public EWorkshopFileAction m_eAction; // the action that was filtered on public int m_nResultsReturned; public int m_nTotalResultCount; - public PublishedFileId_t m_rgPublishedFileId; - public uint m_rgRTimeUpdated; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] + public PublishedFileId_t[] m_rgPublishedFileId; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] + public uint[] m_rgRTimeUpdated; } //----------------------------------------------------------------------------- // Purpose: Called periodically while a PublishWorkshopFile is in progress //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 29)] public struct RemoteStoragePublishFileProgress_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 29; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 29; public double m_dPercentFile; [MarshalAs(UnmanagedType.I1)] public bool m_bPreview; @@ -3680,13 +4039,15 @@ public struct RemoteStoragePublishFileProgress_t //----------------------------------------------------------------------------- // Purpose: Called when the content for a published file is updated //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 30)] public struct RemoteStoragePublishedFileUpdated_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 30; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 30; public PublishedFileId_t m_nPublishedFileId; // The published file id public AppId_t m_nAppID; // ID of the app that will consume this file. public ulong m_ulUnused; // not used anymore @@ -3695,26 +4056,30 @@ public struct RemoteStoragePublishedFileUpdated_t //----------------------------------------------------------------------------- // Purpose: Called when a FileWriteAsync completes //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 31)] public struct RemoteStorageFileWriteAsyncComplete_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 31; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 31; public EResult m_eResult; // result } //----------------------------------------------------------------------------- // Purpose: Called when a FileReadAsync completes //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 32)] public struct RemoteStorageFileReadAsyncComplete_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 32; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 32; public SteamAPICall_t m_hFileReadAsync; // call handle of the async read which was made public EResult m_eResult; // result public uint m_nOffset; // offset in the file this read was at @@ -3726,13 +4091,15 @@ public struct RemoteStorageFileReadAsyncComplete_t // to remote session changes // Note: only posted if this happens DURING the local app session //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 33)] public struct RemoteStorageLocalFileChange_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 33; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 33; } // callbacks @@ -3747,6 +4114,8 @@ public struct ScreenshotReady_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamScreenshotsCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamScreenshotsCallbacks + 1; public ScreenshotHandle m_hLocal; public EResult m_eResult; } @@ -3763,6 +4132,8 @@ public struct ScreenshotRequested_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamScreenshotsCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamScreenshotsCallbacks + 2; } //----------------------------------------------------------------------------- @@ -3775,50 +4146,21 @@ public struct SteamTimelineGamePhaseRecordingExists_t : ICallbackIdentity #endif { - public string m_rgchPhaseID; - public ulong m_ulRecordingMS; - public ulong m_ulLongestClipMS; - public uint m_unClipCount; - public uint m_unScreenshotCount; - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Callback for querying UGC - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] - [CallbackIdentity(Constants.k_iSteamTimelineCallbacks + 1)] - internal struct SteamTimelineGamePhaseRecordingExists_t_LargePack { public const int k_iCallback = Constants.k_iSteamTimelineCallbacks + 1; public static int CallbackIdentity { get; } = Constants.k_iSteamTimelineCallbacks + 1; - public string m_rgchPhaseID; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchMaxPhaseIDLength)] + internal byte[] m_rgchPhaseID_; + public string m_rgchPhaseID + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchPhaseID_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchPhaseID_, Constants.k_cchMaxPhaseIDLength); } + } public ulong m_ulRecordingMS; public ulong m_ulLongestClipMS; public uint m_unClipCount; public uint m_unScreenshotCount; - - public static implicit operator SteamTimelineGamePhaseRecordingExists_t(SteamTimelineGamePhaseRecordingExists_t_LargePack value) { - SteamTimelineGamePhaseRecordingExists_t result = default; - result.m_rgchPhaseID = value.m_rgchPhaseID; - result.m_ulRecordingMS = value.m_ulRecordingMS; - result.m_ulLongestClipMS = value.m_ulLongestClipMS; - result.m_unClipCount = value.m_unClipCount; - result.m_unScreenshotCount = value.m_unScreenshotCount; - return result; - } - - public static implicit operator SteamTimelineGamePhaseRecordingExists_t_LargePack(SteamTimelineGamePhaseRecordingExists_t value) { - SteamTimelineGamePhaseRecordingExists_t_LargePack result = default; - result.m_rgchPhaseID = value.m_rgchPhaseID; - result.m_ulRecordingMS = value.m_ulRecordingMS; - result.m_ulLongestClipMS = value.m_ulLongestClipMS; - result.m_unClipCount = value.m_unClipCount; - result.m_unScreenshotCount = value.m_unScreenshotCount; - return result; - } } - #endif //----------------------------------------------------------------------------- // Purpose: Callback for querying UGC //----------------------------------------------------------------------------- @@ -3829,6 +4171,8 @@ public struct SteamTimelineEventRecordingExists_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamTimelineCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamTimelineCallbacks + 2; public ulong m_ulEventID; [MarshalAs(UnmanagedType.I1)] public bool m_bRecordingExists; @@ -3844,13 +4188,21 @@ public struct SteamUGCQueryCompleted_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 1; public UGCQueryHandle_t m_handle; public EResult m_eResult; public uint m_unNumResultsReturned; public uint m_unTotalMatchingResults; [MarshalAs(UnmanagedType.I1)] public bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache - public string m_rgchNextCursor; // If a paging cursor was used, then this will be the next cursor to get the next result set. + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedFileURLMax)] + internal byte[] m_rgchNextCursor_; + public string m_rgchNextCursor // If a paging cursor was used, then this will be the next cursor to get the next result set. + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchNextCursor_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchNextCursor_, Constants.k_cchPublishedFileURLMax); } + } } //----------------------------------------------------------------------------- @@ -3863,6 +4215,8 @@ public struct SteamUGCRequestUGCDetailsResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 2; public SteamUGCDetails_t m_details; [MarshalAs(UnmanagedType.I1)] public bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache @@ -3878,6 +4232,8 @@ public struct CreateItemResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 3; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID [MarshalAs(UnmanagedType.I1)] @@ -3891,8 +4247,6 @@ public struct CreateItemResult_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 3)] internal struct CreateItemResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 3; - public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 3; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID [MarshalAs(UnmanagedType.I1)] @@ -3926,6 +4280,8 @@ public struct SubmitItemUpdateResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 4; public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; @@ -3942,6 +4298,8 @@ public struct ItemInstalled_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 5; public AppId_t m_unAppID; public PublishedFileId_t m_nPublishedFileId; public UGCHandle_t m_hLegacyContent; @@ -3955,8 +4313,6 @@ public struct ItemInstalled_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 5)] internal struct ItemInstalled_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 5; - public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 5; public AppId_t m_unAppID; public PublishedFileId_t m_nPublishedFileId; public UGCHandle_t m_hLegacyContent; @@ -3992,6 +4348,8 @@ public struct DownloadItemResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 6; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 6; public AppId_t m_unAppID; public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; @@ -4004,8 +4362,6 @@ public struct DownloadItemResult_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 6)] internal struct DownloadItemResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 6; - public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 6; public AppId_t m_unAppID; public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; @@ -4038,6 +4394,8 @@ public struct UserFavoriteItemsListChanged_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 7; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 7; public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] @@ -4054,6 +4412,8 @@ public struct SetUserItemVoteResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 8; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 8; public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] @@ -4070,6 +4430,8 @@ public struct GetUserItemVoteResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 9; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 9; public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] @@ -4090,6 +4452,8 @@ public struct StartPlaytimeTrackingResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 10; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 10; public EResult m_eResult; } @@ -4103,6 +4467,8 @@ public struct StopPlaytimeTrackingResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 11; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 11; public EResult m_eResult; } @@ -4116,6 +4482,8 @@ public struct AddUGCDependencyResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 12; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 12; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public PublishedFileId_t m_nChildPublishedFileId; @@ -4128,8 +4496,6 @@ public struct AddUGCDependencyResult_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 12)] internal struct AddUGCDependencyResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 12; - public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 12; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public PublishedFileId_t m_nChildPublishedFileId; @@ -4162,6 +4528,8 @@ public struct RemoveUGCDependencyResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 13; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 13; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public PublishedFileId_t m_nChildPublishedFileId; @@ -4174,8 +4542,6 @@ public struct RemoveUGCDependencyResult_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 13)] internal struct RemoveUGCDependencyResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 13; - public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 13; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public PublishedFileId_t m_nChildPublishedFileId; @@ -4208,6 +4574,8 @@ public struct AddAppDependencyResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 14; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 14; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; @@ -4220,8 +4588,6 @@ public struct AddAppDependencyResult_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 14)] internal struct AddAppDependencyResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 14; - public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 14; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; @@ -4254,6 +4620,8 @@ public struct RemoveAppDependencyResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 15; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 15; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; @@ -4266,8 +4634,6 @@ public struct RemoveAppDependencyResult_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 15)] internal struct RemoveAppDependencyResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 15; - public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 15; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; @@ -4301,9 +4667,12 @@ public struct GetAppDependenciesResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 16; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 16; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; - public AppId_t m_rgAppIDs; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public AppId_t[] m_rgAppIDs; public uint m_nNumAppDependencies; // number returned in this struct public uint m_nTotalNumAppDependencies; // total found } @@ -4316,11 +4685,10 @@ public struct GetAppDependenciesResult_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 16)] internal struct GetAppDependenciesResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 16; - public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 16; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; - public AppId_t m_rgAppIDs; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public AppId_t[] m_rgAppIDs; public uint m_nNumAppDependencies; // number returned in this struct public uint m_nTotalNumAppDependencies; // total found @@ -4356,6 +4724,8 @@ public struct DeleteItemResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 17; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 17; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; } @@ -4367,8 +4737,6 @@ public struct DeleteItemResult_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 17)] internal struct DeleteItemResult_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 17; - public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 17; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; @@ -4398,6 +4766,8 @@ public struct UserSubscribedItemsListChanged_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 18; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 18; public AppId_t m_nAppID; } @@ -4411,6 +4781,8 @@ public struct WorkshopEULAStatus_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 20; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 20; public EResult m_eResult; public AppId_t m_nAppID; public uint m_unVersion; @@ -4436,6 +4808,8 @@ public struct SteamServersConnected_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 1; } //----------------------------------------------------------------------------- @@ -4450,6 +4824,8 @@ public struct SteamServerConnectFailure_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 2; public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] public bool m_bStillRetrying; @@ -4466,6 +4842,8 @@ public struct SteamServersDisconnected_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 3; public EResult m_eResult; } @@ -4482,6 +4860,8 @@ public struct ClientGameServerDeny_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 13; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 13; public uint m_uAppID; public uint m_unGameServerIP; @@ -4502,6 +4882,8 @@ public struct IPCFailure_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 17; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 17; } //----------------------------------------------------------------------------- @@ -4514,6 +4896,8 @@ public struct LicensesUpdated_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 25; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 25; } //----------------------------------------------------------------------------- @@ -4526,6 +4910,8 @@ public struct ValidateAuthTicketResponse_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 43; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 43; public CSteamID m_SteamID; public EAuthSessionResponse m_eAuthSessionResponse; public CSteamID m_OwnerSteamID; // different from m_SteamID if borrowed @@ -4538,8 +4924,6 @@ public struct ValidateAuthTicketResponse_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 43)] internal struct ValidateAuthTicketResponse_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 43; - public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 43; public CSteamID m_SteamID; public EAuthSessionResponse m_eAuthSessionResponse; public CSteamID m_OwnerSteamID; // different from m_SteamID if borrowed @@ -4572,6 +4956,8 @@ public struct MicroTxnAuthorizationResponse_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 52; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 52; public uint m_unAppID; // AppID for this microtransaction public ulong m_ulOrderID; // OrderID provided for the microtransaction @@ -4585,8 +4971,6 @@ public struct MicroTxnAuthorizationResponse_t [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 52)] internal struct MicroTxnAuthorizationResponse_t_LargePack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 52; - public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 52; public uint m_unAppID; // AppID for this microtransaction public ulong m_ulOrderID; // OrderID provided for the microtransaction @@ -4620,6 +5004,8 @@ public struct EncryptedAppTicketResponse_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 54; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 54; public EResult m_eResult; } @@ -4634,6 +5020,8 @@ public struct GetAuthSessionTicketResponse_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 63; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 63; public HAuthTicket m_hAuthTicket; public EResult m_eResult; } @@ -4648,7 +5036,15 @@ public struct GameWebCallback_t : ICallbackIdentity #endif { - public string m_szURL; + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 64; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 64; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] + internal byte[] m_szURL_; + public string m_szURL + { + get { return InteropHelp.ByteArrayToStringUTF8(m_szURL_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_szURL_, 256); } + } } //----------------------------------------------------------------------------- @@ -4661,7 +5057,15 @@ public struct StoreAuthURLResponse_t : ICallbackIdentity #endif { - public string m_szURL; + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 65; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 65; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] + internal byte[] m_szURL_; + public string m_szURL + { + get { return InteropHelp.ByteArrayToStringUTF8(m_szURL_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_szURL_, 512); } + } } //----------------------------------------------------------------------------- @@ -4674,6 +5078,8 @@ public struct MarketEligibilityResponse_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 66; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 66; [MarshalAs(UnmanagedType.I1)] public bool m_bAllowed; public EMarketNotAllowedReasonFlags m_eNotAllowedReason; @@ -4698,6 +5104,8 @@ public struct DurationControl_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 67; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 67; public EResult m_eResult; // result of call (always k_EResultOK for asynchronous timer-based notifications) public AppId_t m_appid; // appid generating playtime @@ -4723,10 +5131,13 @@ public struct GetTicketForWebApiResponse_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 68; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 68; public HAuthTicket m_hAuthTicket; public EResult m_eResult; public int m_cubTicket; - public byte m_rgubTicket; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_nCubTicketMaxLength)] + public byte[] m_rgubTicket; } // callbacks @@ -4741,6 +5152,8 @@ public struct UserStatsReceived_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserStatsCallbacks + 1; [FieldOffset(0)] public ulong m_nGameID; // Game these stats are for [FieldOffset(8)] @@ -4752,13 +5165,15 @@ public struct UserStatsReceived_t //----------------------------------------------------------------------------- // Purpose: result of a request to store the user stats for a game //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 2)] public struct UserStatsStored_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserStatsCallbacks + 2; public ulong m_nGameID; // Game these stats are for public EResult m_eResult; // success / error } @@ -4768,18 +5183,26 @@ public struct UserStatsStored_t // "indicate progress" call. If both m_nCurProgress and m_nMaxProgress // are zero, that means the achievement has been fully unlocked. //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 3)] public struct UserAchievementStored_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserStatsCallbacks + 3; public ulong m_nGameID; // Game this is for [MarshalAs(UnmanagedType.I1)] public bool m_bGroupAchievement; // if this is a "group" achievement - public string m_rgchAchievementName; // name of the achievement + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchStatNameMax)] + internal byte[] m_rgchAchievementName_; + public string m_rgchAchievementName // name of the achievement + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchAchievementName_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchAchievementName_, Constants.k_cchStatNameMax); } + } public uint m_nCurProgress; // current progress towards the achievement public uint m_nMaxProgress; // "out of" this many } @@ -4788,13 +5211,15 @@ public struct UserAchievementStored_t // Purpose: call result for finding a leaderboard, returned as a result of FindOrCreateLeaderboard() or FindLeaderboard() // use CCallResult<> to map this async result to a member function //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 4)] public struct LeaderboardFindResult_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserStatsCallbacks + 4; public SteamLeaderboard_t m_hSteamLeaderboard; // handle to the leaderboard serarched for, 0 if no leaderboard found public byte m_bLeaderboardFound; // 0 if no leaderboard found } @@ -4803,13 +5228,15 @@ public struct LeaderboardFindResult_t // Purpose: call result indicating scores for a leaderboard have been downloaded and are ready to be retrieved, returned as a result of DownloadLeaderboardEntries() // use CCallResult<> to map this async result to a member function //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 5)] public struct LeaderboardScoresDownloaded_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserStatsCallbacks + 5; public SteamLeaderboard_t m_hSteamLeaderboard; public SteamLeaderboardEntries_t m_hSteamLeaderboardEntries; // the handle to pass into GetDownloadedLeaderboardEntries() public int m_cEntryCount; // the number of entries downloaded @@ -4819,13 +5246,15 @@ public struct LeaderboardScoresDownloaded_t // Purpose: call result indicating scores has been uploaded, returned as a result of UploadLeaderboardScore() // use CCallResult<> to map this async result to a member function //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 6)] public struct LeaderboardScoreUploaded_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 6; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserStatsCallbacks + 6; public byte m_bSuccess; // 1 if the call was successful public SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was public int m_nScore; // the score that was attempted to set @@ -4834,13 +5263,15 @@ public struct LeaderboardScoreUploaded_t public int m_nGlobalRankPrevious; // the previous global rank of the user in this leaderboard; 0 if the user had no existing entry in the leaderboard } - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 7)] public struct NumberOfCurrentPlayers_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 7; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserStatsCallbacks + 7; public byte m_bSuccess; // 1 if the call was successful public int m_cPlayers; // Number of players currently playing } @@ -4849,29 +5280,39 @@ public struct NumberOfCurrentPlayers_t // Purpose: Callback indicating that a user's stats have been unloaded. // Call RequestUserStats again to access stats for this user //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 8)] public struct UserStatsUnloaded_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 8; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserStatsCallbacks + 8; public CSteamID m_steamIDUser; // User whose stats have been unloaded } //----------------------------------------------------------------------------- // Purpose: Callback indicating that an achievement icon has been fetched //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 9)] public struct UserAchievementIconFetched_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 9; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserStatsCallbacks + 9; public CGameID m_nGameID; // Game this is for - public string m_rgchAchievementName; // name of the achievement + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchStatNameMax)] + internal byte[] m_rgchAchievementName_; + public string m_rgchAchievementName // name of the achievement + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchAchievementName_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchAchievementName_, Constants.k_cchStatNameMax); } + } [MarshalAs(UnmanagedType.I1)] public bool m_bAchieved; // Is the icon for the achieved or not achieved version? public int m_nIconHandle; // Handle to the image, which can be used in SteamUtils()->GetImageRGBA(), 0 means no image is set for the achievement @@ -4880,13 +5321,15 @@ public struct UserAchievementIconFetched_t //----------------------------------------------------------------------------- // Purpose: Callback indicating that global achievement percentages are fetched //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 10)] public struct GlobalAchievementPercentagesReady_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 10; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserStatsCallbacks + 10; public ulong m_nGameID; // Game this is for public EResult m_eResult; // Result of the operation @@ -4895,13 +5338,15 @@ public struct GlobalAchievementPercentagesReady_t //----------------------------------------------------------------------------- // Purpose: call result indicating UGC has been uploaded, returned as a result of SetLeaderboardUGC() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 11)] public struct LeaderboardUGCSet_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 11; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserStatsCallbacks + 11; public EResult m_eResult; // The result of the operation public SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was } @@ -4910,13 +5355,15 @@ public struct LeaderboardUGCSet_t // Purpose: callback indicating global stats have been received. // Returned as a result of RequestGlobalStats() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = 8)] + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 12)] public struct GlobalStatsReceived_t #if STEAMWORKS_ANYCPU : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 12; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserStatsCallbacks + 12; public ulong m_nGameID; // Game global stats were requested for public EResult m_eResult; // The result of the request } @@ -4932,6 +5379,8 @@ public struct IPCountry_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamUtilsCallbacks + 1; } //----------------------------------------------------------------------------- @@ -4944,6 +5393,8 @@ public struct LowBatteryPower_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamUtilsCallbacks + 2; public byte m_nMinutesBatteryLeft; } @@ -4957,6 +5408,8 @@ public struct SteamAPICallCompleted_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamUtilsCallbacks + 3; public SteamAPICall_t m_hAsyncCall; public int m_iCallback; public uint m_cubParam; @@ -4972,6 +5425,8 @@ public struct SteamShutdown_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamUtilsCallbacks + 4; } //----------------------------------------------------------------------------- @@ -4984,6 +5439,8 @@ public struct CheckFileSignature_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamUtilsCallbacks + 5; public ECheckFileSignature m_eCheckFileSignature; } @@ -4998,6 +5455,8 @@ public struct GamepadTextInputDismissed_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 14; + public static int CallbackIdentity { get; } = Constants.k_iSteamUtilsCallbacks + 14; [MarshalAs(UnmanagedType.I1)] public bool m_bSubmitted; // true if user entered & accepted text (Call ISteamUtils::GetEnteredGamepadTextInput() for text), false if canceled input public uint m_unSubmittedText; @@ -5012,6 +5471,8 @@ public struct AppResumingFromSuspend_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 36; + public static int CallbackIdentity { get; } = Constants.k_iSteamUtilsCallbacks + 36; } // k_iSteamUtilsCallbacks + 37 is taken @@ -5025,6 +5486,8 @@ public struct FloatingGamepadTextInputDismissed_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 38; + public static int CallbackIdentity { get; } = Constants.k_iSteamUtilsCallbacks + 38; } //----------------------------------------------------------------------------- @@ -5037,6 +5500,8 @@ public struct FilterTextDictionaryChanged_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 39; + public static int CallbackIdentity { get; } = Constants.k_iSteamUtilsCallbacks + 39; public int m_eLanguage; // One of ELanguage, or k_LegallyRequiredFiltering } @@ -5047,9 +5512,17 @@ public struct GetVideoURLResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 11; + public static int CallbackIdentity { get; } = Constants.k_iSteamVideoCallbacks + 11; public EResult m_eResult; public AppId_t m_unVideoAppID; - public string m_rgchURL; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] + internal byte[] m_rgchURL_; + public string m_rgchURL + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchURL_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchURL_, 256); } + } } [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] @@ -5059,6 +5532,8 @@ public struct GetOPFSettingsResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 24; + public static int CallbackIdentity { get; } = Constants.k_iSteamVideoCallbacks + 24; public EResult m_eResult; public AppId_t m_unVideoAppID; } @@ -5070,6 +5545,8 @@ public struct BroadcastUploadStart_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamVideoCallbacks + 4; [MarshalAs(UnmanagedType.I1)] public bool m_bIsRTMP; } @@ -5081,6 +5558,8 @@ public struct BroadcastUploadStop_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamVideoCallbacks + 5; public EBroadcastUploadResult m_eResult; } @@ -5096,6 +5575,8 @@ public struct SteamNetworkingFakeIPResult_t : ICallbackIdentity #endif { + public const int k_iCallback = Constants.k_iSteamNetworkingSocketsCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamNetworkingSocketsCallbacks + 3; /// Status/result of the allocation request. Possible failure values are: /// - k_EResultBusy - you called GetFakeIP but the request has not completed. @@ -5122,7 +5603,8 @@ public struct SteamNetworkingFakeIPResult_t /// Steam tries to avoid reusing ports until they have not been in use for /// some time, but this may not always be possible. public uint m_unIP; - public ushort m_unPorts; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_nMaxReturnPorts)] + public ushort[] m_unPorts; } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs index 4ca6bad6..0d56740a 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs @@ -17,11 +17,7 @@ namespace Steamworks { // friend game played information [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct FriendGameInfo_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct FriendGameInfo_t { public CGameID m_gameID; public uint m_unGameIP; public ushort m_usGamePort; @@ -30,11 +26,7 @@ public struct FriendGameInfo_t } [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct InputAnalogActionData_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct InputAnalogActionData_t { // Type of data coming from this action, this will match what got specified in the action set public EInputSourceMode eMode; @@ -49,11 +41,7 @@ public struct InputAnalogActionData_t } [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct InputDigitalActionData_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct InputDigitalActionData_t { // The current state of this action; will be true if currently pressed public byte bState; @@ -61,12 +49,8 @@ public struct InputDigitalActionData_t public byte bActive; } - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct InputMotionData_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + public struct InputMotionData_t { // Gyro Quaternion: // Absolute rotation of the controller since wakeup, using the Accelerometer reading at startup to determine the first value. // This means real world "up" is know, but heading is not known. @@ -101,32 +85,8 @@ public struct InputMotionData_t public float rotVelZ; // Local Yaw } - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct AnalogAction_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { - public InputAnalogActionHandle_t actionHandle; - public InputAnalogActionData_t analogActionData; - } - - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct DigitalAction_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { - public InputDigitalActionHandle_t actionHandle; - public InputDigitalActionData_t digitalActionData; - } - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamItemDetails_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct SteamItemDetails_t { public SteamItemInstanceID_t m_itemId; public SteamItemDef_t m_iDefinition; public ushort m_unQuantity; @@ -134,11 +94,7 @@ public struct SteamItemDetails_t } [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamPartyBeaconLocation_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct SteamPartyBeaconLocation_t { public ESteamPartyBeaconLocationType m_eType; public ulong m_ulLocationID; } @@ -168,11 +124,7 @@ public static implicit operator SteamPartyBeaconLocation_t_LargePack(SteamPartyB // connection state to a specified user, returned by GetP2PSessionState() // this is under-the-hood info about what's going on with a SendP2PPacket(), shouldn't be needed except for debuggin [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct P2PSessionState_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct P2PSessionState_t { public byte m_bConnectionActive; // true if we've got an active open connection public byte m_bConnecting; // true if we're currently trying to establish a connection public byte m_eP2PSessionError; // last error recorded (see enum above) @@ -185,11 +137,7 @@ public struct P2PSessionState_t // Mouse motion event data, valid when m_eType is k_ERemotePlayInputMouseMotion [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct RemotePlayInputMouseMotion_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct RemotePlayInputMouseMotion_t { [MarshalAs(UnmanagedType.I1)] public bool m_bAbsolute; // True if this is absolute mouse motion and m_flNormalizedX and m_flNormalizedY are valid public float m_flNormalizedX; // The absolute X position of the mouse, normalized to the display, if m_bAbsolute is true @@ -200,22 +148,14 @@ public struct RemotePlayInputMouseMotion_t // Mouse wheel event data, valid when m_eType is k_ERemotePlayInputMouseWheel [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct RemotePlayInputMouseWheel_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct RemotePlayInputMouseWheel_t { public ERemotePlayMouseWheelDirection m_eDirection; public float m_flAmount; // 1.0f is a single click of the wheel, 120 units on Windows } // Key event data, valid when m_eType is k_ERemotePlayInputKeyDown or k_ERemotePlayInputKeyUp [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct RemotePlayInputKey_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct RemotePlayInputKey_t { public int m_eScancode; // Keyboard scancode, common values are defined in ERemotePlayScancode public uint m_unModifiers; // Mask of ERemotePlayKeyModifier active for this key event public uint m_unKeycode; // UCS-4 character generated by the keypress, or 0 if it wasn't a character key, e.g. Delete or Left Arrow @@ -225,28 +165,32 @@ public struct RemotePlayInputKey_t // Purpose: Structure that contains an array of const char * strings and the number of those strings //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamParamStringArray_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct SteamParamStringArray_t { public int m_nNumStrings; } // Details for a single published file/UGC [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamUGCDetails_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct SteamUGCDetails_t { public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; // The result of the operation. public EWorkshopFileType m_eFileType; // Type of the file public AppId_t m_nCreatorAppID; // ID of the app that created this file. public AppId_t m_nConsumerAppID; // ID of the app that will consume this file. - public string m_rgchTitle; // title of document - public string m_rgchDescription; // description of document + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentTitleMax)] + internal byte[] m_rgchTitle_; + public string m_rgchTitle // title of document + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTitle_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTitle_, Constants.k_cchPublishedDocumentTitleMax); } + } + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentDescriptionMax)] + internal byte[] m_rgchDescription_; + public string m_rgchDescription // description of document + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchDescription_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchDescription_, Constants.k_cchPublishedDocumentDescriptionMax); } + } public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. public uint m_rtimeCreated; // time when the published file was created public uint m_rtimeUpdated; // time when the published file was last updated @@ -258,14 +202,32 @@ public struct SteamUGCDetails_t public bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop [MarshalAs(UnmanagedType.I1)] public bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer - public string m_rgchTags; // comma separated list of all tags associated with this file + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchTagListMax)] + internal byte[] m_rgchTags_; + public string m_rgchTags // comma separated list of all tags associated with this file + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTags_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTags_, Constants.k_cchTagListMax); } + } // file/url information public UGCHandle_t m_hFile; // The handle of the primary file public UGCHandle_t m_hPreviewFile; // The handle of the preview file - public string m_pchFileName; // The cloud filename of the primary file + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] + internal byte[] m_pchFileName_; + public string m_pchFileName // The cloud filename of the primary file + { + get { return InteropHelp.ByteArrayToStringUTF8(m_pchFileName_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } + } public int m_nFileSize; // Size of the primary file (for legacy items which only support one file). This may not be accurate for non-legacy items which can be greater than 4gb in size. public int m_nPreviewFileSize; // Size of the preview file - public string m_rgchURL; // URL (for a video or a website) + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedFileURLMax)] + internal byte[] m_rgchURL_; + public string m_rgchURL // URL (for a video or a website) + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchURL_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchURL_, Constants.k_cchPublishedFileURLMax); } + } // voting information public uint m_unVotesUp; // number of votes up public uint m_unVotesDown; // number of votes down @@ -284,8 +246,20 @@ internal struct SteamUGCDetails_t_LargePack { public EWorkshopFileType m_eFileType; // Type of the file public AppId_t m_nCreatorAppID; // ID of the app that created this file. public AppId_t m_nConsumerAppID; // ID of the app that will consume this file. - public string m_rgchTitle; // title of document - public string m_rgchDescription; // description of document + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentTitleMax)] + internal byte[] m_rgchTitle_; + public string m_rgchTitle // title of document + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTitle_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTitle_, Constants.k_cchPublishedDocumentTitleMax); } + } + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedDocumentDescriptionMax)] + internal byte[] m_rgchDescription_; + public string m_rgchDescription // description of document + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchDescription_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchDescription_, Constants.k_cchPublishedDocumentDescriptionMax); } + } public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. public uint m_rtimeCreated; // time when the published file was created public uint m_rtimeUpdated; // time when the published file was last updated @@ -297,14 +271,32 @@ internal struct SteamUGCDetails_t_LargePack { public bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop [MarshalAs(UnmanagedType.I1)] public bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer - public string m_rgchTags; // comma separated list of all tags associated with this file + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchTagListMax)] + internal byte[] m_rgchTags_; + public string m_rgchTags // comma separated list of all tags associated with this file + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchTags_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchTags_, Constants.k_cchTagListMax); } + } // file/url information public UGCHandle_t m_hFile; // The handle of the primary file public UGCHandle_t m_hPreviewFile; // The handle of the preview file - public string m_pchFileName; // The cloud filename of the primary file + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] + internal byte[] m_pchFileName_; + public string m_pchFileName // The cloud filename of the primary file + { + get { return InteropHelp.ByteArrayToStringUTF8(m_pchFileName_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } + } public int m_nFileSize; // Size of the primary file (for legacy items which only support one file). This may not be accurate for non-legacy items which can be greater than 4gb in size. public int m_nPreviewFileSize; // Size of the preview file - public string m_rgchURL; // URL (for a video or a website) + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchPublishedFileURLMax)] + internal byte[] m_rgchURL_; + public string m_rgchURL // URL (for a video or a website) + { + get { return InteropHelp.ByteArrayToStringUTF8(m_rgchURL_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_rgchURL_, Constants.k_cchPublishedFileURLMax); } + } // voting information public uint m_unVotesUp; // number of votes up public uint m_unVotesDown; // number of votes down @@ -320,8 +312,8 @@ public static implicit operator SteamUGCDetails_t(SteamUGCDetails_t_LargePack va result.m_eFileType = value.m_eFileType; result.m_nCreatorAppID = value.m_nCreatorAppID; result.m_nConsumerAppID = value.m_nConsumerAppID; - result.m_rgchTitle = value.m_rgchTitle; - result.m_rgchDescription = value.m_rgchDescription; + result.m_rgchTitle_ = value.m_rgchTitle_; + result.m_rgchDescription_ = value.m_rgchDescription_; result.m_ulSteamIDOwner = value.m_ulSteamIDOwner; result.m_rtimeCreated = value.m_rtimeCreated; result.m_rtimeUpdated = value.m_rtimeUpdated; @@ -330,13 +322,13 @@ public static implicit operator SteamUGCDetails_t(SteamUGCDetails_t_LargePack va result.m_bBanned = value.m_bBanned; result.m_bAcceptedForUse = value.m_bAcceptedForUse; result.m_bTagsTruncated = value.m_bTagsTruncated; - result.m_rgchTags = value.m_rgchTags; + result.m_rgchTags_ = value.m_rgchTags_; result.m_hFile = value.m_hFile; result.m_hPreviewFile = value.m_hPreviewFile; - result.m_pchFileName = value.m_pchFileName; + result.m_pchFileName_ = value.m_pchFileName_; result.m_nFileSize = value.m_nFileSize; result.m_nPreviewFileSize = value.m_nPreviewFileSize; - result.m_rgchURL = value.m_rgchURL; + result.m_rgchURL_ = value.m_rgchURL_; result.m_unVotesUp = value.m_unVotesUp; result.m_unVotesDown = value.m_unVotesDown; result.m_flScore = value.m_flScore; @@ -352,8 +344,8 @@ public static implicit operator SteamUGCDetails_t_LargePack(SteamUGCDetails_t va result.m_eFileType = value.m_eFileType; result.m_nCreatorAppID = value.m_nCreatorAppID; result.m_nConsumerAppID = value.m_nConsumerAppID; - result.m_rgchTitle = value.m_rgchTitle; - result.m_rgchDescription = value.m_rgchDescription; + result.m_rgchTitle_ = value.m_rgchTitle_; + result.m_rgchDescription_ = value.m_rgchDescription_; result.m_ulSteamIDOwner = value.m_ulSteamIDOwner; result.m_rtimeCreated = value.m_rtimeCreated; result.m_rtimeUpdated = value.m_rtimeUpdated; @@ -362,13 +354,13 @@ public static implicit operator SteamUGCDetails_t_LargePack(SteamUGCDetails_t va result.m_bBanned = value.m_bBanned; result.m_bAcceptedForUse = value.m_bAcceptedForUse; result.m_bTagsTruncated = value.m_bTagsTruncated; - result.m_rgchTags = value.m_rgchTags; + result.m_rgchTags_ = value.m_rgchTags_; result.m_hFile = value.m_hFile; result.m_hPreviewFile = value.m_hPreviewFile; - result.m_pchFileName = value.m_pchFileName; + result.m_pchFileName_ = value.m_pchFileName_; result.m_nFileSize = value.m_nFileSize; result.m_nPreviewFileSize = value.m_nPreviewFileSize; - result.m_rgchURL = value.m_rgchURL; + result.m_rgchURL_ = value.m_rgchURL_; result.m_unVotesUp = value.m_unVotesUp; result.m_unVotesDown = value.m_unVotesDown; result.m_flScore = value.m_flScore; @@ -381,11 +373,7 @@ public static implicit operator SteamUGCDetails_t_LargePack(SteamUGCDetails_t va #endif // a single entry in a leaderboard, as returned by GetDownloadedLeaderboardEntry() [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct LeaderboardEntry_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct LeaderboardEntry_t { public CSteamID m_steamIDUser; // user with the entry - use SteamFriends()->GetFriendPersonaName() & SteamFriends()->GetFriendAvatar() to get more info public int m_nGlobalRank; // [1..N], where N is the number of users with an entry in the leaderboard public int m_nScore; // score as set in the leaderboard @@ -430,19 +418,16 @@ public static implicit operator LeaderboardEntry_t_LargePack(LeaderboardEntry_t /// Actually, the name Key/Value is a bit misleading. The "key" is better /// understood as "filter operation code" and the "value" is the operand to this /// filter operation. The meaning of the operand depends upon the filter. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [StructLayout(LayoutKind.Sequential)] - public struct MatchMakingKeyValuePair_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct MatchMakingKeyValuePair_t { MatchMakingKeyValuePair_t(string strKey, string strValue) { m_szKey = strKey; m_szValue = strValue; } + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_szKey; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_szValue; } @@ -450,95 +435,24 @@ public struct MatchMakingKeyValuePair_t // see callbacks documentation for more details /// Internal structure used in manual callback dispatch [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct CallbackMsg_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct CallbackMsg_t { public int m_hSteamUser; // Specific user to whom this callback applies. public int m_iCallback; // Callback identifier. (Corresponds to the k_iCallback enum in the callback structure.) public int m_cubParam; // Size of the data pointed to by m_pubParam } - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct SteamIDComponent_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { - - public ulong m_unAll64Bits; - public ulong m_unAll64Bits; - } - // each type has it's own invalid fixed point: // k_unMaxExpectedLocalAppId - shortcuts are pushed beyond that range // // Internal stuff. Use the accessors above if possible // - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] - public struct GameID_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { - } - - /// RFC4038, section 4.2 - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct IPv4MappedAddress - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { - public ulong m_8zeros; - public ushort m_0000; - public ushort m_ffff; - public byte m_ip; // NOTE: As bytes, i.e. network byte order - } - - /// Store an IP and port. IPv6 is always used; IPv4 is represented using - /// "IPv4-mapped" addresses: IPv4 aa.bb.cc.dd => IPv6 ::ffff:aabb:ccdd - /// (RFC 4291 section 2.5.5.2.) - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct SteamNetworkingIPAddr - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { - public byte m_ipv6; - public byte m_ipv6; - public IPv4MappedAddress m_ipv4; - public IPv4MappedAddress m_ipv4; - } - - // Host byte order - /// See if two addresses are identical - /// Classify address as FakeIP. This function never returns - /// k_ESteamNetworkingFakeIPType_Invalid. - /// Return true if we are a FakeIP - /// An abstract way to represent the identity of a network host. All identities can - /// be represented as simple string. Furthermore, this string representation is actually - /// used on the wire in several places, even though it is less efficient, in order to - /// facilitate forward compatibility. (Old client code can handle an identity type that - /// it doesn't understand.) - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct SteamNetworkingIdentity - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { - /// Type of identity. - public ESteamNetworkingIdentityType m_eType; + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] + public struct GameID_t { } /// Describe the state of a connection. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamNetConnectionInfo_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct SteamNetConnectionInfo_t { /// Who is on the other end? Depending on the connection type and phase of the connection, we might not know public SteamNetworkingIdentity m_identityRemote; @@ -572,7 +486,13 @@ public struct SteamNetConnectionInfo_t /// termination or problem. This is intended for debugging / /// diagnostic purposes only, not to display to users. It might /// have some details specific to the issue. - public string m_szEndDebug; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchSteamNetworkingMaxConnectionCloseReason)] + internal byte[] m_szEndDebug_; + public string m_szEndDebug + { + get { return InteropHelp.ByteArrayToStringUTF8(m_szEndDebug_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_szEndDebug_, Constants.k_cchSteamNetworkingMaxConnectionCloseReason); } + } /// Debug description. This includes the internal connection ID, /// connection type (and peer information), and any name @@ -581,13 +501,20 @@ public struct SteamNetConnectionInfo_t /// /// Note that the connection ID *usually* matches the HSteamNetConnection /// handle, but in certain cases with symmetric connections it might not. - public string m_szConnectionDescription; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchSteamNetworkingMaxConnectionDescription)] + internal byte[] m_szConnectionDescription_; + public string m_szConnectionDescription + { + get { return InteropHelp.ByteArrayToStringUTF8(m_szConnectionDescription_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_szConnectionDescription_, Constants.k_cchSteamNetworkingMaxConnectionDescription); } + } /// Misc flags. Bitmask of k_nSteamNetworkConnectionInfoFlags_Xxxx public int m_nFlags; /// Internal stuff, room to change API easily - public uint reserved; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 63)] + public uint[] reserved; } #if STEAMWORKS_ANYCPU @@ -627,7 +554,13 @@ internal struct SteamNetConnectionInfo_t_LargePack { /// termination or problem. This is intended for debugging / /// diagnostic purposes only, not to display to users. It might /// have some details specific to the issue. - public string m_szEndDebug; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchSteamNetworkingMaxConnectionCloseReason)] + internal byte[] m_szEndDebug_; + public string m_szEndDebug + { + get { return InteropHelp.ByteArrayToStringUTF8(m_szEndDebug_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_szEndDebug_, Constants.k_cchSteamNetworkingMaxConnectionCloseReason); } + } /// Debug description. This includes the internal connection ID, /// connection type (and peer information), and any name @@ -636,13 +569,20 @@ internal struct SteamNetConnectionInfo_t_LargePack { /// /// Note that the connection ID *usually* matches the HSteamNetConnection /// handle, but in certain cases with symmetric connections it might not. - public string m_szConnectionDescription; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchSteamNetworkingMaxConnectionDescription)] + internal byte[] m_szConnectionDescription_; + public string m_szConnectionDescription + { + get { return InteropHelp.ByteArrayToStringUTF8(m_szConnectionDescription_); } + set { InteropHelp.StringToByteArrayUTF8(value, m_szConnectionDescription_, Constants.k_cchSteamNetworkingMaxConnectionDescription); } + } /// Misc flags. Bitmask of k_nSteamNetworkConnectionInfoFlags_Xxxx public int m_nFlags; /// Internal stuff, room to change API easily - public uint reserved; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 63)] + public uint[] reserved; public static implicit operator SteamNetConnectionInfo_t(SteamNetConnectionInfo_t_LargePack value) { SteamNetConnectionInfo_t result = default; @@ -655,8 +595,8 @@ public static implicit operator SteamNetConnectionInfo_t(SteamNetConnectionInfo_ result.m_idPOPRelay = value.m_idPOPRelay; result.m_eState = value.m_eState; result.m_eEndReason = value.m_eEndReason; - result.m_szEndDebug = value.m_szEndDebug; - result.m_szConnectionDescription = value.m_szConnectionDescription; + result.m_szEndDebug_ = value.m_szEndDebug_; + result.m_szConnectionDescription_ = value.m_szConnectionDescription_; result.m_nFlags = value.m_nFlags; result.reserved = value.reserved; return result; @@ -673,8 +613,8 @@ public static implicit operator SteamNetConnectionInfo_t_LargePack(SteamNetConne result.m_idPOPRelay = value.m_idPOPRelay; result.m_eState = value.m_eState; result.m_eEndReason = value.m_eEndReason; - result.m_szEndDebug = value.m_szEndDebug; - result.m_szConnectionDescription = value.m_szConnectionDescription; + result.m_szEndDebug_ = value.m_szEndDebug_; + result.m_szConnectionDescription_ = value.m_szConnectionDescription_; result.m_nFlags = value.m_nFlags; result.reserved = value.reserved; return result; @@ -685,11 +625,7 @@ public static implicit operator SteamNetConnectionInfo_t_LargePack(SteamNetConne /// Quick connection state, pared down to something you could call /// more frequently without it being too big of a perf hit. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamNetConnectionRealTimeStatus_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct SteamNetConnectionRealTimeStatus_t { /// High level state of the connection public ESteamNetworkingConnectionState m_eState; @@ -761,16 +697,13 @@ public struct SteamNetConnectionRealTimeStatus_t public SteamNetworkingMicroseconds m_usecQueueTime; // Internal stuff, room to change API easily - public uint reserved; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public uint[] reserved; } /// Quick status of a particular lane [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - public struct SteamNetConnectionRealTimeLaneStatus_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { + public struct SteamNetConnectionRealTimeLaneStatus_t { // Counters for this particular lane. See the corresponding variables // in SteamNetConnectionRealTimeStatus_t public int m_cbPendingUnreliable; @@ -784,78 +717,8 @@ public struct SteamNetConnectionRealTimeLaneStatus_t public SteamNetworkingMicroseconds m_usecQueueTime; // Internal stuff, room to change API easily - public uint reserved; - } - - /// A message that has been received. - [StructLayout(LayoutKind.Sequential, Pack = 4)] - public struct SteamNetworkingMessage_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { - - /// Size of the payload. - public int m_cbSize; - - /// For messages received on connections: what connection did this come from? - /// For outgoing messages: what connection to send it to? - /// Not used when using the ISteamNetworkingMessages interface - public HSteamNetConnection m_conn; - - /// For inbound messages: Who sent this to us? - /// For outbound messages on connections: not used. - /// For outbound messages on the ad-hoc ISteamNetworkingMessages interface: who should we send this to? - public SteamNetworkingIdentity m_identityPeer; - - /// For messages received on connections, this is the user data - /// associated with the connection. - /// - /// This is *usually* the same as calling GetConnection() and then - /// fetching the user data associated with that connection, but for - /// the following subtle differences: - /// - /// - This user data will match the connection's user data at the time - /// is captured at the time the message is returned by the API. - /// If you subsequently change the userdata on the connection, - /// this won't be updated. - /// - This is an inline call, so it's *much* faster. - /// - You might have closed the connection, so fetching the user data - /// would not be possible. - /// - /// Not used when sending messages. - public long m_nConnUserData; - - /// Local timestamp when the message was received - /// Not used for outbound messages. - public SteamNetworkingMicroseconds m_usecTimeReceived; - - /// Message number assigned by the sender. This is not used for outbound - /// messages. Note that if multiple lanes are used, each lane has its own - /// message numbers, which are assigned sequentially, so messages from - /// different lanes will share the same numbers. - public long m_nMessageNumber; - - /// When using ISteamNetworkingMessages, the channel number the message was received on - /// (Not used for messages sent or received on "connections") - public int m_nChannel; - - /// Bitmask of k_nSteamNetworkingSend_xxx flags. - /// For received messages, only the k_nSteamNetworkingSend_Reliable bit is valid. - /// For outbound messages, all bits are relevant - public int m_nFlags; - - /// Arbitrary user data that you can use when sending messages using - /// ISteamNetworkingUtils::AllocateMessage and ISteamNetworkingSockets::SendMessage. - /// (The callback you set in m_pfnFreeData might use this field.) - /// - /// Not used for received messages. - public long m_nUserData; - - /// For outbound messages, which lane to use? See ISteamNetworkingSockets::ConfigureConnectionLanes. - /// For inbound messages, what lane was the message received on? - public ushort m_idxLane; - public ushort _pad1__; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] + public uint[] reserved; } // @@ -874,43 +737,10 @@ public struct SteamNetworkingMessage_t /// send it over the wire, or persist it in a file or database! If you need /// to do that, convert it to a string representation using the methods in /// ISteamNetworkingUtils(). - [StructLayout(LayoutKind.Sequential, Pack = 4)] - public struct SteamNetworkPingLocation_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { - public byte m_data; - } - - /// In a few places we need to set configuration options on listen sockets and connections, and - /// have them take effect *before* the listen socket or connection really starts doing anything. - /// Creating the object and then setting the options "immediately" after creation doesn't work - /// completely, because network packets could be received between the time the object is created and - /// when the options are applied. To set options at creation time in a reliable way, they must be - /// passed to the creation function. This structure is used to pass those options. - /// - /// For the meaning of these fields, see ISteamNetworkingUtils::SetConfigValue. Basically - /// when the object is created, we just iterate over the list of options and call - /// ISteamNetworkingUtils::SetConfigValueStruct, where the scope arguments are supplied by the - /// object being created. - [StructLayout(LayoutKind.Sequential, Pack = 4)] - public struct SteamNetworkingConfigValue_t - #if STEAMWORKS_ANYCPU - : ICallbackIdentity - #endif - { - /// Which option is being set - public ESteamNetworkingConfigValue m_eValue; - - /// Which field below did you fill in? - public ESteamNetworkingConfigDataType m_eDataType; - public int32_t m_int32; - public int32_t m_int32; - public int64_t m_int64; - public int64_t m_int64; - public float m_float; - public float m_float; + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + public struct SteamNetworkPingLocation_t { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] + public byte[] m_data; } } From 720e3e99dca053a2c89dbab2593052b9df8b4737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sun, 19 Oct 2025 03:16:38 +0800 Subject: [PATCH 51/82] Generated code not work, need fix. There is a conflict constant `k_cchMaxString` caused by `SteamNetworkingIdentity` and `SteamNetworkingIPAddr` defines same named field, in two different anonymous enum --- CodeGen/SteamworksParser/steamworksparser.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CodeGen/SteamworksParser/steamworksparser.py b/CodeGen/SteamworksParser/steamworksparser.py index e440ec14..0679b5b1 100644 --- a/CodeGen/SteamworksParser/steamworksparser.py +++ b/CodeGen/SteamworksParser/steamworksparser.py @@ -444,11 +444,15 @@ class Parser: typedefs = [] def __init__(self, folder): - self.files: list[SteamFile] = [SteamFile(f) for f in os.listdir(folder) if os.path.isfile(os.path.join(folder, f)) and f.endswith(".h") and f not in g_SkippedFiles] + self.files: list[SteamFile] = [SteamFile(f) for f in os.listdir(folder) + if os.path.isfile(os.path.join(folder, f)) + and f.endswith(".h") + and f not in g_SkippedFiles] self.files self.files.sort(key=lambda f: f.name) - self.typedefs:list[Typedef] = [] + self.typedefs:list[Typedef] = [ + ] for f in self.files: From b05bb82c41042d0d484ebe415b5562fcc40e4f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sun, 19 Oct 2025 03:26:32 +0800 Subject: [PATCH 52/82] Fixed constant value confliction by ignore a problemtic file. Types inside struct and `SteamParamStringArray_t` may get fixed today(in UTC+8) --- CodeGen/SteamworksParser/steamworksparser.py | 6 +- .../Runtime/autogen/SteamConstants.cs | 3 - .../ControllerActionSetHandle_t.cs | 64 +++++++++++++++++++ .../ControllerAnalogActionHandle_t.cs | 64 +++++++++++++++++++ .../ControllerDigitalActionHandle_t.cs | 64 +++++++++++++++++++ .../SteamController/ControllerHandle_t.cs | 64 +++++++++++++++++++ 6 files changed, 261 insertions(+), 4 deletions(-) create mode 100644 com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerActionSetHandle_t.cs create mode 100644 com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerAnalogActionHandle_t.cs create mode 100644 com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerDigitalActionHandle_t.cs create mode 100644 com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerHandle_t.cs diff --git a/CodeGen/SteamworksParser/steamworksparser.py b/CodeGen/SteamworksParser/steamworksparser.py index 0679b5b1..af7fd016 100644 --- a/CodeGen/SteamworksParser/steamworksparser.py +++ b/CodeGen/SteamworksParser/steamworksparser.py @@ -814,7 +814,11 @@ def parse_enums(self, s: ParserState): if "};" in s.linesplit: # Skips lines like: "enum { k_name1 = value, k_name2 = value };" # Currently only skips one enum in CCallbackBase - if "," in s.line: + # + # Also steamnetworkingtypes.h has + # two different anon enum defined same named field, + # broke our project. Skip it. + if "," in s.line or s.f.name == 'steamnetworkingtypes.h': return # Skips lines in macros diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamConstants.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamConstants.cs index ab1ba72a..3fa3ef82 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamConstants.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamConstants.cs @@ -181,9 +181,6 @@ public static class Constants { public const int k_nMaxReturnPorts = 8; /// Max length of diagnostic error message public const int k_cchMaxSteamNetworkingErrMsg = 1024; - // Max length of the buffer needed to hold IP formatted using ToString, including '\0' - // ([0123:4567:89ab:cdef:0123:4567:89ab:cdef]:12345) - public const int k_cchMaxString = 48; // Max sizes public const int k_cchMaxString = 128; // Max length of the buffer needed to hold any identity, formatted in string format by ToString public const int k_cchMaxGenericString = 32; // Max length of the string for generic string identities. Including terminating '\0' diff --git a/com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerActionSetHandle_t.cs b/com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerActionSetHandle_t.cs new file mode 100644 index 00000000..42e5275a --- /dev/null +++ b/com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerActionSetHandle_t.cs @@ -0,0 +1,64 @@ +// This file is provided under The MIT License as part of Steamworks.NET. +// Copyright (c) 2013-2022 Riley Labrecque +// Please see the included LICENSE.txt for additional information. + +// This file is automatically generated. +// Changes to this file will be reverted when you update Steamworks.NET + +#if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) + #define DISABLESTEAMWORKS +#endif + +#if !DISABLESTEAMWORKS + +using System.Runtime.InteropServices; +using IntPtr = System.IntPtr; + +namespace Steamworks { + [System.Serializable] + public struct ControllerActionSetHandle_t : System.IEquatable, System.IComparable { + public ulong m_ControllerActionSetHandle; + + public ControllerActionSetHandle_t(ulong value) { + m_ControllerActionSetHandle = value; + } + + public override string ToString() { + return m_ControllerActionSetHandle.ToString(); + } + + public override bool Equals(object other) { + return other is ControllerActionSetHandle_t && this == (ControllerActionSetHandle_t)other; + } + + public override int GetHashCode() { + return m_ControllerActionSetHandle.GetHashCode(); + } + + public static bool operator ==(ControllerActionSetHandle_t x, ControllerActionSetHandle_t y) { + return x.m_ControllerActionSetHandle == y.m_ControllerActionSetHandle; + } + + public static bool operator !=(ControllerActionSetHandle_t x, ControllerActionSetHandle_t y) { + return !(x == y); + } + + public static explicit operator ControllerActionSetHandle_t(ulong value) { + return new ControllerActionSetHandle_t(value); + } + + public static explicit operator ulong(ControllerActionSetHandle_t that) { + return that.m_ControllerActionSetHandle; + } + + public bool Equals(ControllerActionSetHandle_t other) { + return m_ControllerActionSetHandle == other.m_ControllerActionSetHandle; + } + + public int CompareTo(ControllerActionSetHandle_t other) { + return m_ControllerActionSetHandle.CompareTo(other.m_ControllerActionSetHandle); + } + } +} + +#endif // !DISABLESTEAMWORKS diff --git a/com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerAnalogActionHandle_t.cs b/com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerAnalogActionHandle_t.cs new file mode 100644 index 00000000..cdcf7788 --- /dev/null +++ b/com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerAnalogActionHandle_t.cs @@ -0,0 +1,64 @@ +// This file is provided under The MIT License as part of Steamworks.NET. +// Copyright (c) 2013-2022 Riley Labrecque +// Please see the included LICENSE.txt for additional information. + +// This file is automatically generated. +// Changes to this file will be reverted when you update Steamworks.NET + +#if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) + #define DISABLESTEAMWORKS +#endif + +#if !DISABLESTEAMWORKS + +using System.Runtime.InteropServices; +using IntPtr = System.IntPtr; + +namespace Steamworks { + [System.Serializable] + public struct ControllerAnalogActionHandle_t : System.IEquatable, System.IComparable { + public ulong m_ControllerAnalogActionHandle; + + public ControllerAnalogActionHandle_t(ulong value) { + m_ControllerAnalogActionHandle = value; + } + + public override string ToString() { + return m_ControllerAnalogActionHandle.ToString(); + } + + public override bool Equals(object other) { + return other is ControllerAnalogActionHandle_t && this == (ControllerAnalogActionHandle_t)other; + } + + public override int GetHashCode() { + return m_ControllerAnalogActionHandle.GetHashCode(); + } + + public static bool operator ==(ControllerAnalogActionHandle_t x, ControllerAnalogActionHandle_t y) { + return x.m_ControllerAnalogActionHandle == y.m_ControllerAnalogActionHandle; + } + + public static bool operator !=(ControllerAnalogActionHandle_t x, ControllerAnalogActionHandle_t y) { + return !(x == y); + } + + public static explicit operator ControllerAnalogActionHandle_t(ulong value) { + return new ControllerAnalogActionHandle_t(value); + } + + public static explicit operator ulong(ControllerAnalogActionHandle_t that) { + return that.m_ControllerAnalogActionHandle; + } + + public bool Equals(ControllerAnalogActionHandle_t other) { + return m_ControllerAnalogActionHandle == other.m_ControllerAnalogActionHandle; + } + + public int CompareTo(ControllerAnalogActionHandle_t other) { + return m_ControllerAnalogActionHandle.CompareTo(other.m_ControllerAnalogActionHandle); + } + } +} + +#endif // !DISABLESTEAMWORKS diff --git a/com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerDigitalActionHandle_t.cs b/com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerDigitalActionHandle_t.cs new file mode 100644 index 00000000..e7c44f01 --- /dev/null +++ b/com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerDigitalActionHandle_t.cs @@ -0,0 +1,64 @@ +// This file is provided under The MIT License as part of Steamworks.NET. +// Copyright (c) 2013-2022 Riley Labrecque +// Please see the included LICENSE.txt for additional information. + +// This file is automatically generated. +// Changes to this file will be reverted when you update Steamworks.NET + +#if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) + #define DISABLESTEAMWORKS +#endif + +#if !DISABLESTEAMWORKS + +using System.Runtime.InteropServices; +using IntPtr = System.IntPtr; + +namespace Steamworks { + [System.Serializable] + public struct ControllerDigitalActionHandle_t : System.IEquatable, System.IComparable { + public ulong m_ControllerDigitalActionHandle; + + public ControllerDigitalActionHandle_t(ulong value) { + m_ControllerDigitalActionHandle = value; + } + + public override string ToString() { + return m_ControllerDigitalActionHandle.ToString(); + } + + public override bool Equals(object other) { + return other is ControllerDigitalActionHandle_t && this == (ControllerDigitalActionHandle_t)other; + } + + public override int GetHashCode() { + return m_ControllerDigitalActionHandle.GetHashCode(); + } + + public static bool operator ==(ControllerDigitalActionHandle_t x, ControllerDigitalActionHandle_t y) { + return x.m_ControllerDigitalActionHandle == y.m_ControllerDigitalActionHandle; + } + + public static bool operator !=(ControllerDigitalActionHandle_t x, ControllerDigitalActionHandle_t y) { + return !(x == y); + } + + public static explicit operator ControllerDigitalActionHandle_t(ulong value) { + return new ControllerDigitalActionHandle_t(value); + } + + public static explicit operator ulong(ControllerDigitalActionHandle_t that) { + return that.m_ControllerDigitalActionHandle; + } + + public bool Equals(ControllerDigitalActionHandle_t other) { + return m_ControllerDigitalActionHandle == other.m_ControllerDigitalActionHandle; + } + + public int CompareTo(ControllerDigitalActionHandle_t other) { + return m_ControllerDigitalActionHandle.CompareTo(other.m_ControllerDigitalActionHandle); + } + } +} + +#endif // !DISABLESTEAMWORKS diff --git a/com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerHandle_t.cs b/com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerHandle_t.cs new file mode 100644 index 00000000..7fda5ad7 --- /dev/null +++ b/com.rlabrecque.steamworks.net/Runtime/types/SteamController/ControllerHandle_t.cs @@ -0,0 +1,64 @@ +// This file is provided under The MIT License as part of Steamworks.NET. +// Copyright (c) 2013-2022 Riley Labrecque +// Please see the included LICENSE.txt for additional information. + +// This file is automatically generated. +// Changes to this file will be reverted when you update Steamworks.NET + +#if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) + #define DISABLESTEAMWORKS +#endif + +#if !DISABLESTEAMWORKS + +using System.Runtime.InteropServices; +using IntPtr = System.IntPtr; + +namespace Steamworks { + [System.Serializable] + public struct ControllerHandle_t : System.IEquatable, System.IComparable { + public ulong m_ControllerHandle; + + public ControllerHandle_t(ulong value) { + m_ControllerHandle = value; + } + + public override string ToString() { + return m_ControllerHandle.ToString(); + } + + public override bool Equals(object other) { + return other is ControllerHandle_t && this == (ControllerHandle_t)other; + } + + public override int GetHashCode() { + return m_ControllerHandle.GetHashCode(); + } + + public static bool operator ==(ControllerHandle_t x, ControllerHandle_t y) { + return x.m_ControllerHandle == y.m_ControllerHandle; + } + + public static bool operator !=(ControllerHandle_t x, ControllerHandle_t y) { + return !(x == y); + } + + public static explicit operator ControllerHandle_t(ulong value) { + return new ControllerHandle_t(value); + } + + public static explicit operator ulong(ControllerHandle_t that) { + return that.m_ControllerHandle; + } + + public bool Equals(ControllerHandle_t other) { + return m_ControllerHandle == other.m_ControllerHandle; + } + + public int CompareTo(ControllerHandle_t other) { + return m_ControllerHandle.CompareTo(other.m_ControllerHandle); + } + } +} + +#endif // !DISABLESTEAMWORKS From 245f9347afb699ee3d577d570347e7cbcbf42c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sun, 19 Oct 2025 07:23:46 +0800 Subject: [PATCH 53/82] Fix steam headers parser for ignoring `SteamParamStringArray_t::m_ppStrings` --- CodeGen/SteamworksParser/steamworksparser.py | 6 ++++-- .../Runtime/autogen/SteamStructs.cs | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CodeGen/SteamworksParser/steamworksparser.py b/CodeGen/SteamworksParser/steamworksparser.py index af7fd016..c8822a83 100644 --- a/CodeGen/SteamworksParser/steamworksparser.py +++ b/CodeGen/SteamworksParser/steamworksparser.py @@ -148,7 +148,8 @@ def __init__(self, name: str, size: int, pack: int): "CGameID": PrimitiveType("CGameID", 8, 8), "SteamIPAddress_t": PrimitiveType("SteamIPAddress_t", 16 + 4, 1), "SteamNetworkingIdentity ": PrimitiveType("SteamNetworkingIdentity", 4 + 128, 1), - "SteamIDComponent_t": PrimitiveType("SteamIDComponent_t", 8, 8) # Contains bit fields that size can't be represented + # Contains bit fields that size can't be represented as bytes count + "SteamIDComponent_t": PrimitiveType("SteamIDComponent_t", 8, 8) } @@ -335,6 +336,7 @@ def calculate_offsets(self, defaultAlign: int): return self.size +'''Also used in Union''' class StructField: def __init__(self, name, typee, arraysize: str | None, comments): self.name = name @@ -977,7 +979,7 @@ def try_match(line, s: ParserState): # for example {type 'void' name: '(int a0, int a1)' if '(' in fieldname or '(' in fieldtype\ or ')' in fieldname or ')' in fieldtype\ - or '*' in fieldname or '*' in fieldtype\ + or '*' in fieldname\ or '{' in fieldtype or '}' in fieldtype\ or '{' in fieldname or '}' in fieldname: return diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs index 0d56740a..1e26a01a 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs @@ -166,6 +166,7 @@ public struct RemotePlayInputKey_t { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] public struct SteamParamStringArray_t { + public IntPtr m_ppStrings; public int m_nNumStrings; } @@ -438,6 +439,7 @@ public struct MatchMakingKeyValuePair_t { public struct CallbackMsg_t { public int m_hSteamUser; // Specific user to whom this callback applies. public int m_iCallback; // Callback identifier. (Corresponds to the k_iCallback enum in the callback structure.) + public IntPtr m_pubParam; // Points to the callback structure public int m_cubParam; // Size of the data pointed to by m_pubParam } From 43f1ceec22108ac4ee03ec8760852ec6af001483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sun, 19 Oct 2025 07:25:28 +0800 Subject: [PATCH 54/82] Fix `Callback` doesn't marshal Any CPU correctly. Interface parameter usage of struct still need work. --- .../Runtime/CallbackDispatcher.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/com.rlabrecque.steamworks.net/Runtime/CallbackDispatcher.cs b/com.rlabrecque.steamworks.net/Runtime/CallbackDispatcher.cs index 910b4706..bc24f36d 100644 --- a/com.rlabrecque.steamworks.net/Runtime/CallbackDispatcher.cs +++ b/com.rlabrecque.steamworks.net/Runtime/CallbackDispatcher.cs @@ -299,8 +299,12 @@ internal override Type GetCallbackType() { internal override void OnRunCallback(IntPtr pvParam) { try { - m_Func((T)Marshal.PtrToStructure(pvParam, typeof(T))); - } +#if !STEAMWORKS_ANYCPU + m_Func((T)Marshal.PtrToStructure(pvParam, typeof(T))); +#else + m_Func(ConditionalMarshallerTable.Marshal(pvParam)); +#endif + } catch (Exception e) { CallbackDispatcher.ExceptionHandler(e); } @@ -395,10 +399,10 @@ internal override void OnRunCallResult(IntPtr pvParam, bool bFailed, ulong hStea if (hSteamAPICall == m_hAPICall) { try { T result; -#if STEAMWORKS_ANYCPU - result = ConditionalMarshallerTable.Marshal(pvParam); -#else +#if !STEAMWORKS_ANYCPU result = (T)Marshal.PtrToStructure(pvParam, typeof(T)); +#else + result = ConditionalMarshallerTable.Marshal(pvParam); #endif m_Func(result, bFailed); } From a9a9c943946f11fe8711beade50a822be3e4504a Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Thu, 23 Oct 2025 20:36:06 +0800 Subject: [PATCH 55/82] Make SrcGen can generate Any CPU interface wrapper. Native methods are still in progress. First is LP/SP native function pair `ISteamParties_GetBeaconLocationData` has been duplicated twice, it seems same function generated twice. Secondly large pack `ISteamParties_GetAvailableBeaconLocations`'s second arg, `p_locationList_lp`, 's associated type is not properly generated. Array brackets is generated before `_LargePack`. I' ll try to find out why. --- CodeGen/Steamworks.NET_CodeGen.py | 2 +- CodeGen/src/interfaces.py | 228 ++++++++++++------ .../Runtime/autogen/NativeMethods.cs | 38 +++ .../Runtime/autogen/isteamgameserverclient.cs | 70 +++--- .../Runtime/autogen/isteamgameserverhttp.cs | 50 ++-- .../autogen/isteamgameserverinventory.cs | 76 +++--- .../autogen/isteamgameservernetworking.cs | 44 ++-- .../isteamgameservernetworkingmessages.cs | 18 +- .../isteamgameservernetworkingsockets.cs | 100 ++++---- .../isteamgameservernetworkingutils.cs | 54 ++--- .../Runtime/autogen/isteamgameserverugc.cs | 198 +++++++-------- .../Runtime/autogen/isteamgameserverutils.cs | 74 +++--- .../Runtime/autogen/isteammatchmaking.cs | 32 ++- .../autogen/isteamnetworkingmessages.cs | 8 +- .../autogen/isteamnetworkingsockets.cs | 8 +- .../Runtime/autogen/isteamugc.cs | 8 +- .../Runtime/autogen/isteamuserstats.cs | 8 +- 17 files changed, 605 insertions(+), 411 deletions(-) diff --git a/CodeGen/Steamworks.NET_CodeGen.py b/CodeGen/Steamworks.NET_CodeGen.py index e3ecf231..660dcd35 100644 --- a/CodeGen/Steamworks.NET_CodeGen.py +++ b/CodeGen/Steamworks.NET_CodeGen.py @@ -11,7 +11,7 @@ def main(): steamworksparser.Settings.fake_gameserver_interfaces = True ___parser = steamworksparser.parse(steam_path) - # TODO interfaces.main(___parser) + interfaces.main(___parser) constants.main(___parser) enums.main(___parser) structs.main(___parser) diff --git a/CodeGen/src/interfaces.py b/CodeGen/src/interfaces.py index be4f4680..736b8b64 100644 --- a/CodeGen/src/interfaces.py +++ b/CodeGen/src/interfaces.py @@ -1,6 +1,8 @@ import os +import re import sys from collections import OrderedDict +from SteamworksParser import steamworksparser from SteamworksParser.steamworksparser import Arg, Function, FunctionAttribute, Interface, Parser, Struct, ArgAttribute g_SkippedFiles = ( @@ -693,19 +695,19 @@ def parse_interface(f, interface: Interface, parser: Parser): strEntryPoint = interface.name + '_' + attr.value break - parsed_args = parse_args(strEntryPoint, func.args) - parse_func_native(f, interface, func, parsed_args, strEntryPoint, False, bGameServerVersion, parser) + parsed_args = parse_args(strEntryPoint, func.args, None, parser) + parse_func_native(f, interface, func, strEntryPoint, parsed_args, False, bGameServerVersion, parser) # Check if any args are pack-size aware structs # If so, we need to generate an alternate version of the function for arg in func.args: argType = parser.resolveTypeInfo(arg.type) if isinstance(argType, Struct) and argType.name in parser.packSizeAwareStructs: - parse_func_native(f, interface, parsed_args, func, True, bGameServerVersion, parser) + parse_func_native(f, interface, func, strEntryPoint, parsed_args, True, bGameServerVersion, parser) shouldGenerateLargePack = True break - generate_wrapper_function(f, interface, func, parsed_args, strEntryPoint, shouldGenerateLargePack) + generate_wrapper_function(f, interface, func, parsed_args, strEntryPoint, shouldGenerateLargePack, parser) # Remove last whitespace @@ -744,29 +746,42 @@ def parse_func_native(f, interface, func: Function, strEntryPoint: str, args, ge wrapperreturntype = returntype pinvokeargs = args[0] # TODO: NamedTuple - largePackPInvokeArgs = args[6] + isPacksizeAware = args[6] + largePackPInvokeArgs = args[9] if not bGameServerVersion: g_NativeMethods.append("\t\t[DllImport(NativeLibraryName, EntryPoint = \"SteamAPI_{0}\", CallingConvention = CallingConvention.Cdecl)]".format(strEntryPoint)) if returntype == "bool": g_NativeMethods.append("\t\t[return: MarshalAs(UnmanagedType.I1)]") - g_NativeMethods.append("\t\tpublic static extern {0} {1}({2});".format(returntype, strEntryPoint, - pinvokeargs if not generatingLargePack else largePackPInvokeArgs)) + g_NativeMethods.append("\t\tpublic static extern {0} {1}({2});".format(returntype, strEntryPoint, pinvokeargs)) g_NativeMethods.append("") + + if isPacksizeAware: + g_NativeMethods.append("\t\t[DllImport(NativeLibraryName, EntryPoint = \"SteamAPI_{0}\", CallingConvention = CallingConvention.Cdecl)]".format(strEntryPoint)) + + if returntype == "bool": + g_NativeMethods.append("\t\t[return: MarshalAs(UnmanagedType.I1)]") + + g_NativeMethods.append("\t\tpublic static extern {0} {1}({2});".format(returntype, strEntryPoint, largePackPInvokeArgs)) + g_NativeMethods.append("") pass def generate_wrapper_function(f, interface, func: Function, - args: tuple[str, str, str, list[str], tuple[list[str], list[Arg]], OrderedDict, str], - strEntryPoint: str, bGameServerVersion: bool): + args: tuple[str, str, str, list[str], tuple[list[str], list[Arg]], OrderedDict, str, bool, str], + strEntryPoint: str, bGameServerVersion: bool, parser: Parser): wrapperargs = args[1] argnames = args[2] stringargs = args[3] outstringargs = args[4][0] outstringsize = args[4][1] args_with_explicit_count = args[5] + isPacksizeAware = args[6] + largePackNativeArgs: str = args[7] + largePackArgTypeToName: list[(str, str)] = args[8] # (type,argname) strCast = "" + wrapperreturntype = None returntype = func.returntype returntype = g_SpecialReturnTypeDict.get(strEntryPoint, returntype) for t in g_Typedefs: @@ -815,36 +830,67 @@ def generate_wrapper_function(f, interface, func: Function, if returntype != "void": strReturnable = returntype + " ret = " - for i, a in enumerate(outstringargs): + for i, argName in enumerate(outstringargs): if not outstringsize: - functionBody.append("\t\t\tIntPtr " + a + "2;") + functionBody.append("\t\t\tIntPtr " + argName + "2;") continue cast = "" if outstringsize[i].type != "int": cast = "(int)" - functionBody.append("\t\t\tIntPtr " + a + "2 = Marshal.AllocHGlobal(" + cast + outstringsize[i].name + ");") + functionBody.append("\t\t\tIntPtr " + argName + "2 = Marshal.AllocHGlobal(" + cast + outstringsize[i].name + ");") + # TODO fix `ISteamGameServerClient_CreateSteamPipe` indentlevel = "\t\t\t" if stringargs: indentlevel += "\t" - for a in stringargs: - functionBody.append("\t\t\tusing (var " + a + "2 = new InteropHelp.UTF8StringHandle(" + a + "))") + for argName in stringargs: + functionBody.append("\t\t\tusing (var " + argName + "2 = new InteropHelp.UTF8StringHandle(" + argName + "))") functionBody[-1] += " {" if bGameServerVersion: - strEntryPoint2 = interface.name.replace("GameServer", "") + '_' + func.name + invokingNativeFunctionName = interface.name.replace("GameServer", "") + '_' + func.name for attr in func.attributes: if attr.name == "STEAM_FLAT_NAME": - strEntryPoint2 = interface.name.replace("GameServer", "") + '_' + attr.value + invokingNativeFunctionName = interface.name.replace("GameServer", "") + '_' + attr.value break else: - strEntryPoint2 = strEntryPoint + invokingNativeFunctionName = strEntryPoint - functionBody.append("{0}{1}{2}NativeMethods.{3}({4});".format(indentlevel, strReturnable, strCast, strEntryPoint2, argnames)) + if not isPacksizeAware: + functionBody.append("{0}{1}{2}NativeMethods.{3}({4});".format( + indentlevel, strReturnable, strCast, + invokingNativeFunctionName, argnames)) + else: + b:list[str] = [] + invocationTemplate = "{0}{1}{2}NativeMethods.{3}({4});" + prebuiltInvocationExpression = invocationTemplate.format( + "", "" if returntype == "void" else "anyCpuResult = ", strCast, + invokingNativeFunctionName, argnames) + + prebuiltInvocationExpressionLargePack = invocationTemplate.format( + "", "" if returntype == "void" else "anyCpuResult = ", strCast, + invokingNativeFunctionName, largePackNativeArgs + ) + + b.append(f"{returntype} anyCpuResult;") + b.append("if (!Packsize.IsLargePack) {") + b.append("\t" + prebuiltInvocationExpression) + b.append("} else {") + # generate large-pack byref intermediate struct variables + for lpArg in largePackArgTypeToName: + b.append(f"\t{lpArg[0]} {lpArg[1]}_lp;") + b.append("\t" + prebuiltInvocationExpressionLargePack) + # convert large pack form to managed form + for lpArg in largePackArgTypeToName: + b.append(f"\t{lpArg[1]} = {lpArg[1]}_lp;") + b.append("}") + b.append("return anyCpuResult;") + + functionBody.extend(map(lambda l: "\t\t\t" + l, b)) if outstringargs: retcmp = "ret != 0" @@ -853,14 +899,14 @@ def generate_wrapper_function(f, interface, func: Function, elif returntype == "int": retcmp = "ret != -1" retcmp = g_SpecialOutStringRetCmp.get(strEntryPoint, retcmp) - for a in outstringargs: + for argName in outstringargs: if returntype == "void": - functionBody.append(indentlevel + a + " = InteropHelp.PtrToStringUTF8(" + a + "2);") + functionBody.append(indentlevel + argName + " = InteropHelp.PtrToStringUTF8(" + argName + "2);") else: - functionBody.append(indentlevel + a + " = " + retcmp + " ? InteropHelp.PtrToStringUTF8(" + a + "2) : null;") + functionBody.append(indentlevel + argName + " = " + retcmp + " ? InteropHelp.PtrToStringUTF8(" + argName + "2) : null;") if strEntryPoint != "ISteamRemoteStorage_GetUGCDetails": - functionBody.append(indentlevel + "Marshal.FreeHGlobal(" + a + "2);") + functionBody.append(indentlevel + "Marshal.FreeHGlobal(" + argName + "2);") if returntype != "void": functionBody.append(indentlevel + "return ret;") @@ -887,46 +933,61 @@ def generate_wrapper_function(f, interface, func: Function, g_Output.append("") def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): + # Akarinnnnn: I think we should extract a result class pinvokeargs = "IntPtr instancePtr, " - largePackPInvokeArgs = "IntPtr instancePtr, " + pinvokeargsLargePack = pinvokeargs wrapperargs = "" - argnames = "" + nativeFunctionArgs = "" + nativeFunctionArgsLargePack = "" stringargs = [] outstringargs = [] outstringsize = [] + isMethodPacksizeAware = False args_with_explicit_count = OrderedDict() + largePackArgTypeToName: list[(str, str)] = [] ifacename = strEntryPoint[1:strEntryPoint.index('_')] + + #region init native function params string if "GameServer" in ifacename: if ifacename != "SteamGameServer" and ifacename != "SteamGameServerStats": ifacename = ifacename.replace("GameServer", "") - argnames = "CSteamGameServerAPIContext.Get" + ifacename + "(), " + nativeFunctionArgs = "CSteamGameServerAPIContext.Get" + ifacename + "(), " + nativeFunctionArgsLargePack = "CSteamGameServerAPIContext.Get" + ifacename + "(), " else: - argnames = "CSteamAPIContext.Get" + ifacename + "(), " + nativeFunctionArgs = "CSteamAPIContext.Get" + ifacename + "(), " + nativeFunctionArgsLargePack = "CSteamAPIContext.Get" + ifacename + "(), " getNextArgAsStringSize = False argNamesToAddAsStringSize = [] - packsizeAware = False - # Scan for packsize aware parameter first, duplicated from below + #region populate PInvoke params list and wrapper args (both LP and SP) for arg in args: - potentialtype = arg.type.rstrip("*").lstrip("const ").rstrip() - if potentialtype in parser.packSizeAwareStructs: - packsizeAware = True - for arg in args: potentialtype = arg.type.rstrip("*").lstrip("const ").rstrip() - argtype = g_TypeDict.get(arg.type, arg.type) - if argtype.endswith("*"): - argtype = "out " + g_TypeDict.get(potentialtype, potentialtype) - argtype = g_SpecialArgsDict.get(strEntryPoint, dict()).get(arg.name, argtype) - argTypeInfo = parser.resolveTypeInfo(arg.type) - + isThisArgPackAware = potentialtype in parser.packSizeAwareStructs + isMethodPacksizeAware = True if isThisArgPackAware else isMethodPacksizeAware + + pInvokeLargePackType = None + pInvokeArgType = g_TypeDict.get(arg.type, arg.type) + + isParamArray = False + if pInvokeArgType.endswith("*"): + wrapperParamType = g_TypeDict.get(potentialtype, potentialtype) + pInvokeArgType = "out " + wrapperParamType + if isThisArgPackAware: + pInvokeLargePackType = "out " + wrapperParamType + "_LargePack" + + + pInvokeArgType = g_SpecialArgsDict.get(strEntryPoint, dict()).get(arg.name, pInvokeArgType) argattribute = get_arg_attribute(strEntryPoint, arg) if argattribute: if argattribute.name == "STEAM_OUT_ARRAY" or argattribute.name == "STEAM_OUT_ARRAY_CALL" or argattribute.name == "STEAM_OUT_ARRAY_COUNT" or argattribute.name == "STEAM_ARRAY_COUNT" or argattribute.name == "STEAM_ARRAY_COUNT_D": - argtype = g_TypeDict.get(potentialtype, potentialtype) + "[]" + isParamArray = True + pInvokeArgType = g_TypeDict.get(potentialtype, potentialtype) + "[]" + if pInvokeLargePackType is not None: + pInvokeLargePackType = pInvokeLargePackType + "[]" if argattribute.name == "STEAM_OUT_ARRAY_COUNT": commaindex = argattribute.value.find(',') @@ -937,23 +998,29 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): if arg.type == "MatchMakingKeyValuePair_t **": # TODO: Fixme - Small Hack... We do this because MatchMakingKeyValuePair's have ARRAY_COUNT() and two **'s, things get broken :( - argtype = "IntPtr" + pInvokeArgType = "IntPtr" # We skip byte[] because it is a primitive type that C# can essentially mmap and get a great perf increase while marshalling. # We need to do this for other primitive types eventually but that will require more testing to make sure nothing breaks. - if argtype.endswith("[]") and argtype != "byte[]": - argtype = "[In, Out] " + argtype - elif argtype == "bool": - argtype = "[MarshalAs(UnmanagedType.I1)] " + argtype - - pinvokeargs += argtype + " " + arg.name + ", " - if packsizeAware: - largePackPInvokeArgs += f"{argtype}_LargePack {arg.name}," + if pInvokeArgType.endswith("[]") and pInvokeArgType != "byte[]": + pInvokeArgType = "[In, Out] " + pInvokeArgType + elif pInvokeArgType == "bool": + pInvokeArgType = "[MarshalAs(UnmanagedType.I1)] " + pInvokeArgType + + pinvokeargs += pInvokeArgType + " " + arg.name + ", " + if isThisArgPackAware: + if not pinvokeargsLargePack.endswith('[]'): + pinvokeargsLargePack += f"{pInvokeLargePackType} {arg.name}_lp, " + else: + pinvokeargsLargePack += f"{pInvokeArgType}_LargePack {arg.name}_lp, " + else: + pinvokeargsLargePack += pInvokeArgType + " " + arg.name + ", " - argtype = argtype.replace("[In, Out] ", "").replace("[MarshalAs(UnmanagedType.I1)] ", "") - wrapperargtype = g_WrapperArgsTypeDict.get(arg.type, argtype) + pInvokeArgType = pInvokeArgType.replace("[In, Out] ", "").replace("[MarshalAs(UnmanagedType.I1)] ", "") + wrapperargtype = g_WrapperArgsTypeDict.get(arg.type, pInvokeArgType) wrapperargtype = g_SpecialWrapperArgsDict.get(strEntryPoint, dict()).get(arg.name, wrapperargtype) + if wrapperargtype == "InteropHelp.UTF8StringHandle": wrapperargtype = "string" elif arg.type == "char *" or arg.type == "char*": @@ -964,28 +1031,38 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): if arg.default: wrapperargs += " = " + g_ArgDefaultLookup.get(arg.default, arg.default) wrapperargs += ", " + - if argtype.startswith("out"): - argnames += "out " + if pInvokeArgType.startswith("out"): + nativeFunctionArgs += "out " + nativeFunctionArgsLargePack += "out " elif wrapperargtype.startswith("ref"): - argnames += "ref " + nativeFunctionArgs += "ref " + nativeFunctionArgsLargePack += "ref " if wrapperargtype == "System.Collections.Generic.IList": - argnames += "new InteropHelp.SteamParamStringArray(" + arg.name + ")" + nativeFunctionArgs += "new InteropHelp.SteamParamStringArray(" + arg.name + ")" + nativeFunctionArgsLargePack += "new InteropHelp.SteamParamStringArray(" + arg.name + ")" elif wrapperargtype == "MatchMakingKeyValuePair_t[]": - argnames += "new MMKVPMarshaller(" + arg.name + ")" + nativeFunctionArgs += "new MMKVPMarshaller(" + arg.name + ")" + nativeFunctionArgsLargePack += "new MMKVPMarshaller(" + arg.name + ")" elif wrapperargtype.endswith("Response"): - argnames += "(IntPtr)" + arg.name + nativeFunctionArgs += "(IntPtr)" + arg.name + nativeFunctionArgsLargePack += "(IntPtr)" + arg.name elif arg.name.endswith("Deprecated"): - if argtype == "IntPtr": - argnames += "IntPtr.Zero" - elif argtype == "bool": - argnames += "false" + if pInvokeArgType == "IntPtr": + nativeFunctionArgs += "IntPtr.Zero" + nativeFunctionArgsLargePack += "IntPtr.Zero" + elif pInvokeArgType == "bool": + nativeFunctionArgs += "false" + nativeFunctionArgsLargePack += "false" else: - argnames += "0" + nativeFunctionArgs += "0" + nativeFunctionArgsLargePack += "0" else: - argnames += arg.name - + nativeFunctionArgs += arg.name + nativeFunctionArgsLargePack += arg.name + if getNextArgAsStringSize: getNextArgAsStringSize = False outstringsize.append(arg) @@ -996,10 +1073,12 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): if wrapperargtype == "string": stringargs.append(arg.name) - argnames += "2" + nativeFunctionArgs += "2" + nativeFunctionArgsLargePack += "2" elif wrapperargtype == "out string": outstringargs.append(arg.name) - argnames += "2" + nativeFunctionArgs += "2" + nativeFunctionArgsLargePack += "2" if argattribute: if argattribute.name == "STEAM_OUT_STRING_COUNT": argNamesToAddAsStringSize.append(argattribute.value) @@ -1007,14 +1086,25 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): pass else: getNextArgAsStringSize = True + + + + if isThisArgPackAware: + nativeFunctionArgsLargePack += "_lp" + + nativeFunctionArgs += ", " + nativeFunctionArgsLargePack += ", " - argnames += ", " pinvokeargs = pinvokeargs.rstrip(", ") - largePackPInvokeArgs = largePackPInvokeArgs.rstrip(", ") + pinvokeargsLargePack = pinvokeargsLargePack.rstrip(", ") + nativeFunctionArgsLargePack = nativeFunctionArgsLargePack.rstrip(", ") wrapperargs = wrapperargs.rstrip(", ") - argnames = argnames.rstrip(", ") - return (pinvokeargs, wrapperargs, argnames, stringargs, (outstringargs, outstringsize), args_with_explicit_count) + nativeFunctionArgs = nativeFunctionArgs.rstrip(", ") + nativeFunctionArgsLargePack = nativeFunctionArgsLargePack.rstrip(", ") + return (pinvokeargs, wrapperargs, nativeFunctionArgs, stringargs, (outstringargs, outstringsize), + args_with_explicit_count, isMethodPacksizeAware, nativeFunctionArgsLargePack, + largePackArgTypeToName, pinvokeargsLargePack if isMethodPacksizeAware else None) if __name__ == "__main__": diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs index 9f75e84f..5468698a 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs @@ -1748,6 +1748,10 @@ internal static class NativeMethods { [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetBeaconDetails(IntPtr instancePtr, PartyBeaconID_t ulBeaconID, out CSteamID pSteamIDBeaconOwner, out SteamPartyBeaconLocation_t pLocation, IntPtr pchMetadata, int cchMetadata); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconDetails", CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool ISteamParties_GetBeaconDetails(IntPtr instancePtr, PartyBeaconID_t ulBeaconID, out CSteamID pSteamIDBeaconOwner, out SteamPartyBeaconLocation_t_LargePack pLocation_lp, IntPtr pchMetadata, int cchMetadata); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_JoinParty", CallingConvention = CallingConvention.Cdecl)] public static extern ulong ISteamParties_JoinParty(IntPtr instancePtr, PartyBeaconID_t ulBeaconID); @@ -1759,9 +1763,16 @@ internal static class NativeMethods { [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetAvailableBeaconLocations(IntPtr instancePtr, [In, Out] SteamPartyBeaconLocation_t[] pLocationList, uint uMaxNumLocations); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_GetAvailableBeaconLocations", CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool ISteamParties_GetAvailableBeaconLocations(IntPtr instancePtr, SteamPartyBeaconLocation_t[]_LargePack pLocationList_lp, uint uMaxNumLocations); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_CreateBeacon", CallingConvention = CallingConvention.Cdecl)] public static extern ulong ISteamParties_CreateBeacon(IntPtr instancePtr, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, InteropHelp.UTF8StringHandle pchConnectString, InteropHelp.UTF8StringHandle pchMetadata); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_CreateBeacon", CallingConvention = CallingConvention.Cdecl)] + public static extern ulong ISteamParties_CreateBeacon(IntPtr instancePtr, uint unOpenSlots, ref SteamPartyBeaconLocation_t_LargePack pBeaconLocation_lp, InteropHelp.UTF8StringHandle pchConnectString, InteropHelp.UTF8StringHandle pchMetadata); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_OnReservationCompleted", CallingConvention = CallingConvention.Cdecl)] public static extern void ISteamParties_OnReservationCompleted(IntPtr instancePtr, PartyBeaconID_t ulBeacon, CSteamID steamIDUser); @@ -1778,6 +1789,18 @@ internal static class NativeMethods { [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconLocationData", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetBeaconLocationData(IntPtr instancePtr, SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut); + + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconLocationData", CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool ISteamParties_GetBeaconLocationData(IntPtr instancePtr, SteamPartyBeaconLocation_t_LargePack BeaconLocation_lp, ESteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut); + + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconLocationData", CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool ISteamParties_GetBeaconLocationData(IntPtr instancePtr, SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut); + + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconLocationData", CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool ISteamParties_GetBeaconLocationData(IntPtr instancePtr, SteamPartyBeaconLocation_t_LargePack BeaconLocation_lp, ESteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut); #endregion #region SteamMusic [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamMusic_BIsEnabled", CallingConvention = CallingConvention.Cdecl)] @@ -2043,6 +2066,9 @@ internal static class NativeMethods { [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingMessages_GetSessionConnectionInfo", CallingConvention = CallingConvention.Cdecl)] public static extern ESteamNetworkingConnectionState ISteamNetworkingMessages_GetSessionConnectionInfo(IntPtr instancePtr, ref SteamNetworkingIdentity identityRemote, out SteamNetConnectionInfo_t pConnectionInfo, out SteamNetConnectionRealTimeStatus_t pQuickStatus); + + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingMessages_GetSessionConnectionInfo", CallingConvention = CallingConvention.Cdecl)] + public static extern ESteamNetworkingConnectionState ISteamNetworkingMessages_GetSessionConnectionInfo(IntPtr instancePtr, ref SteamNetworkingIdentity identityRemote, out SteamNetConnectionInfo_t_LargePack pConnectionInfo_lp, out SteamNetConnectionRealTimeStatus_t pQuickStatus); #endregion #region SteamNetworkingSockets [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreateListenSocketIP", CallingConvention = CallingConvention.Cdecl)] @@ -2098,6 +2124,10 @@ internal static class NativeMethods { [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_GetConnectionInfo(IntPtr instancePtr, HSteamNetConnection hConn, out SteamNetConnectionInfo_t pInfo); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetConnectionInfo", CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool ISteamNetworkingSockets_GetConnectionInfo(IntPtr instancePtr, HSteamNetConnection hConn, out SteamNetConnectionInfo_t_LargePack pInfo_lp); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetConnectionRealTimeStatus", CallingConvention = CallingConvention.Cdecl)] public static extern EResult ISteamNetworkingSockets_GetConnectionRealTimeStatus(IntPtr instancePtr, HSteamNetConnection hConn, ref SteamNetConnectionRealTimeStatus_t pStatus, int nLanes, ref SteamNetConnectionRealTimeLaneStatus_t pLanes); @@ -2673,6 +2703,10 @@ internal static class NativeMethods { [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_GetQueryUGCResult(IntPtr instancePtr, UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCResult", CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool ISteamUGC_GetQueryUGCResult(IntPtr instancePtr, UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t_LargePack pDetails_lp); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCNumTags", CallingConvention = CallingConvention.Cdecl)] public static extern uint ISteamUGC_GetQueryUGCNumTags(IntPtr instancePtr, UGCQueryHandle_t handle, uint index); @@ -3219,6 +3253,10 @@ internal static class NativeMethods { [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetDownloadedLeaderboardEntry(IntPtr instancePtr, SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, out LeaderboardEntry_t pLeaderboardEntry, [In, Out] int[] pDetails, int cDetailsMax); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry", CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool ISteamUserStats_GetDownloadedLeaderboardEntry(IntPtr instancePtr, SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, out LeaderboardEntry_t_LargePack pLeaderboardEntry_lp, [In, Out] int[] pDetails, int cDetailsMax); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUserStats_UploadLeaderboardScore", CallingConvention = CallingConvention.Cdecl)] public static extern ulong ISteamUserStats_UploadLeaderboardScore(IntPtr instancePtr, SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In, Out] int[] pScoreDetails, int cScoreDetailsCount); diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverclient.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverclient.cs index 3449588f..fc6b1773 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverclient.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverclient.cs @@ -22,7 +22,7 @@ public static class SteamGameServerClient { /// public static HSteamPipe CreateSteamPipe() { InteropHelp.TestIfAvailableGameServer(); - return (HSteamPipe)NativeMethods.ISteamClient_CreateSteamPipe(CSteamGameServerAPIContext.GetSteamClient()); + return (HSteamPipe)NativeMethods.ISteamGameServerClient_CreateSteamPipe(CSteamGameServerAPIContext.GetSteamClient()); } /// @@ -31,7 +31,7 @@ public static HSteamPipe CreateSteamPipe() { /// public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamClient_BReleaseSteamPipe(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe); + return NativeMethods.ISteamGameServerClient_BReleaseSteamPipe(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe); } /// @@ -41,7 +41,7 @@ public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe) { /// public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamUser)NativeMethods.ISteamClient_ConnectToGlobalUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe); + return (HSteamUser)NativeMethods.ISteamGameServerClient_ConnectToGlobalUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe); } /// @@ -50,7 +50,7 @@ public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe) { /// public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(CSteamGameServerAPIContext.GetSteamClient(), out phSteamPipe, eAccountType); + return (HSteamUser)NativeMethods.ISteamGameServerClient_CreateLocalUser(CSteamGameServerAPIContext.GetSteamClient(), out phSteamPipe, eAccountType); } /// @@ -59,7 +59,7 @@ public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountTyp /// public static void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamClient_ReleaseUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, hUser); + NativeMethods.ISteamGameServerClient_ReleaseUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, hUser); } /// @@ -68,7 +68,7 @@ public static void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser) { public static IntPtr GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -78,7 +78,7 @@ public static IntPtr GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, public static IntPtr GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamGameServer(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamGameServer(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -88,7 +88,7 @@ public static IntPtr GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hStea /// public static void SetLocalIPBinding(ref SteamIPAddress_t unIP, ushort usPort) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamClient_SetLocalIPBinding(CSteamGameServerAPIContext.GetSteamClient(), ref unIP, usPort); + NativeMethods.ISteamGameServerClient_SetLocalIPBinding(CSteamGameServerAPIContext.GetSteamClient(), ref unIP, usPort); } /// @@ -97,7 +97,7 @@ public static void SetLocalIPBinding(ref SteamIPAddress_t unIP, ushort usPort) { public static IntPtr GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamFriends(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamFriends(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -107,7 +107,7 @@ public static IntPtr GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPi public static IntPtr GetISteamUtils(HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamUtils(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamUtils(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, pchVersion2); } } @@ -117,7 +117,7 @@ public static IntPtr GetISteamUtils(HSteamPipe hSteamPipe, string pchVersion) { public static IntPtr GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamMatchmaking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamMatchmaking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -127,7 +127,7 @@ public static IntPtr GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSte public static IntPtr GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamMatchmakingServers(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamMatchmakingServers(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -137,7 +137,7 @@ public static IntPtr GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPi public static IntPtr GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamGenericInterface(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamGenericInterface(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -147,7 +147,7 @@ public static IntPtr GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe public static IntPtr GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamUserStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamUserStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -157,7 +157,7 @@ public static IntPtr GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteam public static IntPtr GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamGameServerStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamGameServerStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -167,7 +167,7 @@ public static IntPtr GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe public static IntPtr GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamApps(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamApps(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -177,7 +177,7 @@ public static IntPtr GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, public static IntPtr GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamNetworking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamNetworking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -187,7 +187,7 @@ public static IntPtr GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hStea public static IntPtr GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamRemoteStorage(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamRemoteStorage(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -197,7 +197,7 @@ public static IntPtr GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hS public static IntPtr GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamScreenshots(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamScreenshots(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -207,7 +207,7 @@ public static IntPtr GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSte public static IntPtr GetISteamGameSearch(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamGameSearch(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamGameSearch(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -219,7 +219,7 @@ public static IntPtr GetISteamGameSearch(HSteamUser hSteamuser, HSteamPipe hStea /// public static uint GetIPCCallCount() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamClient_GetIPCCallCount(CSteamGameServerAPIContext.GetSteamClient()); + return NativeMethods.ISteamGameServerClient_GetIPCCallCount(CSteamGameServerAPIContext.GetSteamClient()); } /// @@ -230,7 +230,7 @@ public static uint GetIPCCallCount() { /// public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamClient_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamClient(), pFunction); + NativeMethods.ISteamGameServerClient_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamClient(), pFunction); } /// @@ -238,7 +238,7 @@ public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) /// public static bool BShutdownIfAllPipesClosed() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamClient_BShutdownIfAllPipesClosed(CSteamGameServerAPIContext.GetSteamClient()); + return NativeMethods.ISteamGameServerClient_BShutdownIfAllPipesClosed(CSteamGameServerAPIContext.GetSteamClient()); } /// @@ -247,7 +247,7 @@ public static bool BShutdownIfAllPipesClosed() { public static IntPtr GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamHTTP(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamHTTP(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -257,7 +257,7 @@ public static IntPtr GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, public static IntPtr GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamController(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamController(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -267,7 +267,7 @@ public static IntPtr GetISteamController(HSteamUser hSteamUser, HSteamPipe hStea public static IntPtr GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamUGC(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamUGC(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -277,7 +277,7 @@ public static IntPtr GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, public static IntPtr GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamMusic(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamMusic(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -287,7 +287,7 @@ public static IntPtr GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe public static IntPtr GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamMusicRemote(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamMusicRemote(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -297,7 +297,7 @@ public static IntPtr GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSte public static IntPtr GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamHTMLSurface(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamHTMLSurface(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -307,7 +307,7 @@ public static IntPtr GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSte public static IntPtr GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamInventory(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamInventory(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -317,7 +317,7 @@ public static IntPtr GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteam public static IntPtr GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamVideo(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamVideo(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -327,7 +327,7 @@ public static IntPtr GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe public static IntPtr GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamParentalSettings(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamParentalSettings(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -337,7 +337,7 @@ public static IntPtr GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe public static IntPtr GetISteamInput(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamInput(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamInput(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -347,7 +347,7 @@ public static IntPtr GetISteamInput(HSteamUser hSteamUser, HSteamPipe hSteamPipe public static IntPtr GetISteamParties(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamParties(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamParties(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -357,7 +357,7 @@ public static IntPtr GetISteamParties(HSteamUser hSteamUser, HSteamPipe hSteamPi public static IntPtr GetISteamRemotePlay(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamClient_GetISteamRemotePlay(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamGameServerClient_GetISteamRemotePlay(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverhttp.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverhttp.cs index 010fde26..f3c2a2f9 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverhttp.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverhttp.cs @@ -25,7 +25,7 @@ public static class SteamGameServerHTTP { public static HTTPRequestHandle CreateHTTPRequest(EHTTPMethod eHTTPRequestMethod, string pchAbsoluteURL) { InteropHelp.TestIfAvailableGameServer(); using (var pchAbsoluteURL2 = new InteropHelp.UTF8StringHandle(pchAbsoluteURL)) { - return (HTTPRequestHandle)NativeMethods.ISteamHTTP_CreateHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), eHTTPRequestMethod, pchAbsoluteURL2); + return (HTTPRequestHandle)NativeMethods.ISteamGameServerHTTP_CreateHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), eHTTPRequestMethod, pchAbsoluteURL2); } } @@ -35,7 +35,7 @@ public static HTTPRequestHandle CreateHTTPRequest(EHTTPMethod eHTTPRequestMethod /// public static bool SetHTTPRequestContextValue(HTTPRequestHandle hRequest, ulong ulContextValue) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_SetHTTPRequestContextValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, ulContextValue); + return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestContextValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, ulContextValue); } /// @@ -45,7 +45,7 @@ public static bool SetHTTPRequestContextValue(HTTPRequestHandle hRequest, ulong /// public static bool SetHTTPRequestNetworkActivityTimeout(HTTPRequestHandle hRequest, uint unTimeoutSeconds) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unTimeoutSeconds); + return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestNetworkActivityTimeout(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unTimeoutSeconds); } /// @@ -56,7 +56,7 @@ public static bool SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, string InteropHelp.TestIfAvailableGameServer(); using (var pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName)) using (var pchHeaderValue2 = new InteropHelp.UTF8StringHandle(pchHeaderValue)) { - return NativeMethods.ISteamHTTP_SetHTTPRequestHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pchHeaderValue2); + return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pchHeaderValue2); } } @@ -69,7 +69,7 @@ public static bool SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, InteropHelp.TestIfAvailableGameServer(); using (var pchParamName2 = new InteropHelp.UTF8StringHandle(pchParamName)) using (var pchParamValue2 = new InteropHelp.UTF8StringHandle(pchParamValue)) { - return NativeMethods.ISteamHTTP_SetHTTPRequestGetOrPostParameter(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchParamName2, pchParamValue2); + return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestGetOrPostParameter(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchParamName2, pchParamValue2); } } @@ -81,7 +81,7 @@ public static bool SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, /// public static bool SendHTTPRequest(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_SendHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle); + return NativeMethods.ISteamGameServerHTTP_SendHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle); } /// @@ -91,7 +91,7 @@ public static bool SendHTTPRequest(HTTPRequestHandle hRequest, out SteamAPICall_ /// public static bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_SendHTTPRequestAndStreamResponse(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle); + return NativeMethods.ISteamGameServerHTTP_SendHTTPRequestAndStreamResponse(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle); } /// @@ -100,7 +100,7 @@ public static bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, /// public static bool DeferHTTPRequest(HTTPRequestHandle hRequest) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_DeferHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); + return NativeMethods.ISteamGameServerHTTP_DeferHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); } /// @@ -109,7 +109,7 @@ public static bool DeferHTTPRequest(HTTPRequestHandle hRequest) { /// public static bool PrioritizeHTTPRequest(HTTPRequestHandle hRequest) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_PrioritizeHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); + return NativeMethods.ISteamGameServerHTTP_PrioritizeHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); } /// @@ -120,7 +120,7 @@ public static bool PrioritizeHTTPRequest(HTTPRequestHandle hRequest) { public static bool GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, string pchHeaderName, out uint unResponseHeaderSize) { InteropHelp.TestIfAvailableGameServer(); using (var pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName)) { - return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderSize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, out unResponseHeaderSize); + return NativeMethods.ISteamGameServerHTTP_GetHTTPResponseHeaderSize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, out unResponseHeaderSize); } } @@ -132,7 +132,7 @@ public static bool GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, string public static bool GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, byte[] pHeaderValueBuffer, uint unBufferSize) { InteropHelp.TestIfAvailableGameServer(); using (var pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName)) { - return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pHeaderValueBuffer, unBufferSize); + return NativeMethods.ISteamGameServerHTTP_GetHTTPResponseHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pHeaderValueBuffer, unBufferSize); } } @@ -142,7 +142,7 @@ public static bool GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, string /// public static bool GetHTTPResponseBodySize(HTTPRequestHandle hRequest, out uint unBodySize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_GetHTTPResponseBodySize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out unBodySize); + return NativeMethods.ISteamGameServerHTTP_GetHTTPResponseBodySize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out unBodySize); } /// @@ -152,7 +152,7 @@ public static bool GetHTTPResponseBodySize(HTTPRequestHandle hRequest, out uint /// public static bool GetHTTPResponseBodyData(HTTPRequestHandle hRequest, byte[] pBodyDataBuffer, uint unBufferSize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_GetHTTPResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pBodyDataBuffer, unBufferSize); + return NativeMethods.ISteamGameServerHTTP_GetHTTPResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pBodyDataBuffer, unBufferSize); } /// @@ -162,7 +162,7 @@ public static bool GetHTTPResponseBodyData(HTTPRequestHandle hRequest, byte[] pB /// public static bool GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint cOffset, byte[] pBodyDataBuffer, uint unBufferSize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_GetHTTPStreamingResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, cOffset, pBodyDataBuffer, unBufferSize); + return NativeMethods.ISteamGameServerHTTP_GetHTTPStreamingResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, cOffset, pBodyDataBuffer, unBufferSize); } /// @@ -171,7 +171,7 @@ public static bool GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, /// public static bool ReleaseHTTPRequest(HTTPRequestHandle hRequest) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_ReleaseHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); + return NativeMethods.ISteamGameServerHTTP_ReleaseHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); } /// @@ -181,7 +181,7 @@ public static bool ReleaseHTTPRequest(HTTPRequestHandle hRequest) { /// public static bool GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, out float pflPercentOut) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_GetHTTPDownloadProgressPct(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pflPercentOut); + return NativeMethods.ISteamGameServerHTTP_GetHTTPDownloadProgressPct(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pflPercentOut); } /// @@ -192,7 +192,7 @@ public static bool GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, out fl public static bool SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, string pchContentType, byte[] pubBody, uint unBodyLen) { InteropHelp.TestIfAvailableGameServer(); using (var pchContentType2 = new InteropHelp.UTF8StringHandle(pchContentType)) { - return NativeMethods.ISteamHTTP_SetHTTPRequestRawPostBody(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchContentType2, pubBody, unBodyLen); + return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestRawPostBody(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchContentType2, pubBody, unBodyLen); } } @@ -205,7 +205,7 @@ public static bool SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, string /// public static HTTPCookieContainerHandle CreateCookieContainer(bool bAllowResponsesToModify) { InteropHelp.TestIfAvailableGameServer(); - return (HTTPCookieContainerHandle)NativeMethods.ISteamHTTP_CreateCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), bAllowResponsesToModify); + return (HTTPCookieContainerHandle)NativeMethods.ISteamGameServerHTTP_CreateCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), bAllowResponsesToModify); } /// @@ -213,7 +213,7 @@ public static HTTPCookieContainerHandle CreateCookieContainer(bool bAllowRespons /// public static bool ReleaseCookieContainer(HTTPCookieContainerHandle hCookieContainer) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_ReleaseCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer); + return NativeMethods.ISteamGameServerHTTP_ReleaseCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer); } /// @@ -224,7 +224,7 @@ public static bool SetCookie(HTTPCookieContainerHandle hCookieContainer, string using (var pchHost2 = new InteropHelp.UTF8StringHandle(pchHost)) using (var pchUrl2 = new InteropHelp.UTF8StringHandle(pchUrl)) using (var pchCookie2 = new InteropHelp.UTF8StringHandle(pchCookie)) { - return NativeMethods.ISteamHTTP_SetCookie(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer, pchHost2, pchUrl2, pchCookie2); + return NativeMethods.ISteamGameServerHTTP_SetCookie(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer, pchHost2, pchUrl2, pchCookie2); } } @@ -233,7 +233,7 @@ public static bool SetCookie(HTTPCookieContainerHandle hCookieContainer, string /// public static bool SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_SetHTTPRequestCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, hCookieContainer); + return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, hCookieContainer); } /// @@ -242,7 +242,7 @@ public static bool SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTT public static bool SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, string pchUserAgentInfo) { InteropHelp.TestIfAvailableGameServer(); using (var pchUserAgentInfo2 = new InteropHelp.UTF8StringHandle(pchUserAgentInfo)) { - return NativeMethods.ISteamHTTP_SetHTTPRequestUserAgentInfo(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchUserAgentInfo2); + return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestUserAgentInfo(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchUserAgentInfo2); } } @@ -252,7 +252,7 @@ public static bool SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, strin /// public static bool SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, bRequireVerifiedCertificate); + return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestRequiresVerifiedCertificate(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, bRequireVerifiedCertificate); } /// @@ -261,7 +261,7 @@ public static bool SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle h /// public static bool SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, uint unMilliseconds) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unMilliseconds); + return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestAbsoluteTimeoutMS(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unMilliseconds); } /// @@ -269,7 +269,7 @@ public static bool SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, u /// public static bool GetHTTPRequestWasTimedOut(HTTPRequestHandle hRequest, out bool pbWasTimedOut) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamHTTP_GetHTTPRequestWasTimedOut(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pbWasTimedOut); + return NativeMethods.ISteamGameServerHTTP_GetHTTPRequestWasTimedOut(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pbWasTimedOut); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverinventory.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverinventory.cs index 608216bd..dc03f25c 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverinventory.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverinventory.cs @@ -32,7 +32,7 @@ public static class SteamGameServerInventory { /// public static EResult GetResultStatus(SteamInventoryResult_t resultHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_GetResultStatus(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); + return NativeMethods.ISteamGameServerInventory_GetResultStatus(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); } /// @@ -44,7 +44,7 @@ public static bool GetResultItems(SteamInventoryResult_t resultHandle, SteamItem if (pOutItemsArray != null && pOutItemsArray.Length != punOutItemsArraySize) { throw new System.ArgumentException("pOutItemsArray must be the same size as punOutItemsArraySize!"); } - return NativeMethods.ISteamInventory_GetResultItems(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutItemsArray, ref punOutItemsArraySize); + return NativeMethods.ISteamGameServerInventory_GetResultItems(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutItemsArray, ref punOutItemsArraySize); } /// @@ -62,7 +62,7 @@ public static bool GetResultItemProperty(SteamInventoryResult_t resultHandle, ui InteropHelp.TestIfAvailableGameServer(); IntPtr pchValueBuffer2 = Marshal.AllocHGlobal((int)punValueBufferSizeOut); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) { - bool ret = NativeMethods.ISteamInventory_GetResultItemProperty(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, unItemIndex, pchPropertyName2, pchValueBuffer2, ref punValueBufferSizeOut); + bool ret = NativeMethods.ISteamGameServerInventory_GetResultItemProperty(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, unItemIndex, pchPropertyName2, pchValueBuffer2, ref punValueBufferSizeOut); pchValueBuffer = ret ? InteropHelp.PtrToStringUTF8(pchValueBuffer2) : null; Marshal.FreeHGlobal(pchValueBuffer2); return ret; @@ -75,7 +75,7 @@ public static bool GetResultItemProperty(SteamInventoryResult_t resultHandle, ui /// public static uint GetResultTimestamp(SteamInventoryResult_t resultHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_GetResultTimestamp(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); + return NativeMethods.ISteamGameServerInventory_GetResultTimestamp(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); } /// @@ -85,7 +85,7 @@ public static uint GetResultTimestamp(SteamInventoryResult_t resultHandle) { /// public static bool CheckResultSteamID(SteamInventoryResult_t resultHandle, CSteamID steamIDExpected) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_CheckResultSteamID(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, steamIDExpected); + return NativeMethods.ISteamGameServerInventory_CheckResultSteamID(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, steamIDExpected); } /// @@ -93,7 +93,7 @@ public static bool CheckResultSteamID(SteamInventoryResult_t resultHandle, CStea /// public static void DestroyResult(SteamInventoryResult_t resultHandle) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamInventory_DestroyResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); + NativeMethods.ISteamGameServerInventory_DestroyResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); } /// @@ -108,7 +108,7 @@ public static void DestroyResult(SteamInventoryResult_t resultHandle) { /// public static bool GetAllItems(out SteamInventoryResult_t pResultHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_GetAllItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle); + return NativeMethods.ISteamGameServerInventory_GetAllItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle); } /// @@ -122,7 +122,7 @@ public static bool GetAllItems(out SteamInventoryResult_t pResultHandle) { /// public static bool GetItemsByID(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t[] pInstanceIDs, uint unCountInstanceIDs) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_GetItemsByID(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pInstanceIDs, unCountInstanceIDs); + return NativeMethods.ISteamGameServerInventory_GetItemsByID(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pInstanceIDs, unCountInstanceIDs); } /// @@ -142,7 +142,7 @@ public static bool GetItemsByID(out SteamInventoryResult_t pResultHandle, SteamI /// public static bool SerializeResult(SteamInventoryResult_t resultHandle, byte[] pOutBuffer, out uint punOutBufferSize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_SerializeResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutBuffer, out punOutBufferSize); + return NativeMethods.ISteamGameServerInventory_SerializeResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutBuffer, out punOutBufferSize); } /// @@ -163,7 +163,7 @@ public static bool SerializeResult(SteamInventoryResult_t resultHandle, byte[] p /// public static bool DeserializeResult(out SteamInventoryResult_t pOutResultHandle, byte[] pBuffer, uint unBufferSize, bool bRESERVED_MUST_BE_FALSE = false) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_DeserializeResult(CSteamGameServerAPIContext.GetSteamInventory(), out pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE); + return NativeMethods.ISteamGameServerInventory_DeserializeResult(CSteamGameServerAPIContext.GetSteamInventory(), out pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE); } /// @@ -177,7 +177,7 @@ public static bool DeserializeResult(out SteamInventoryResult_t pOutResultHandle /// public static bool GenerateItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_GenerateItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength); + return NativeMethods.ISteamGameServerInventory_GenerateItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength); } /// @@ -188,7 +188,7 @@ public static bool GenerateItems(out SteamInventoryResult_t pResultHandle, Steam /// public static bool GrantPromoItems(out SteamInventoryResult_t pResultHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_GrantPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle); + return NativeMethods.ISteamGameServerInventory_GrantPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle); } /// @@ -199,12 +199,12 @@ public static bool GrantPromoItems(out SteamInventoryResult_t pResultHandle) { /// public static bool AddPromoItem(out SteamInventoryResult_t pResultHandle, SteamItemDef_t itemDef) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_AddPromoItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemDef); + return NativeMethods.ISteamGameServerInventory_AddPromoItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemDef); } public static bool AddPromoItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint unArrayLength) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_AddPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, unArrayLength); + return NativeMethods.ISteamGameServerInventory_AddPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, unArrayLength); } /// @@ -214,7 +214,7 @@ public static bool AddPromoItems(out SteamInventoryResult_t pResultHandle, Steam /// public static bool ConsumeItem(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemConsume, uint unQuantity) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_ConsumeItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemConsume, unQuantity); + return NativeMethods.ISteamGameServerInventory_ConsumeItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemConsume, unQuantity); } /// @@ -229,7 +229,7 @@ public static bool ConsumeItem(out SteamInventoryResult_t pResultHandle, SteamIt /// public static bool ExchangeItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayGenerate, uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, SteamItemInstanceID_t[] pArrayDestroy, uint[] punArrayDestroyQuantity, uint unArrayDestroyLength) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_ExchangeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength); + return NativeMethods.ISteamGameServerInventory_ExchangeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength); } /// @@ -240,7 +240,7 @@ public static bool ExchangeItems(out SteamInventoryResult_t pResultHandle, Steam /// public static bool TransferItemQuantity(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemIdSource, uint unQuantity, SteamItemInstanceID_t itemIdDest) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_TransferItemQuantity(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemIdSource, unQuantity, itemIdDest); + return NativeMethods.ISteamGameServerInventory_TransferItemQuantity(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemIdSource, unQuantity, itemIdDest); } /// @@ -249,7 +249,7 @@ public static bool TransferItemQuantity(out SteamInventoryResult_t pResultHandle /// public static void SendItemDropHeartbeat() { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamInventory_SendItemDropHeartbeat(CSteamGameServerAPIContext.GetSteamInventory()); + NativeMethods.ISteamGameServerInventory_SendItemDropHeartbeat(CSteamGameServerAPIContext.GetSteamInventory()); } /// @@ -265,7 +265,7 @@ public static void SendItemDropHeartbeat() { /// public static bool TriggerItemDrop(out SteamInventoryResult_t pResultHandle, SteamItemDef_t dropListDefinition) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_TriggerItemDrop(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, dropListDefinition); + return NativeMethods.ISteamGameServerInventory_TriggerItemDrop(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, dropListDefinition); } /// @@ -273,7 +273,7 @@ public static bool TriggerItemDrop(out SteamInventoryResult_t pResultHandle, Ste /// public static bool TradeItems(out SteamInventoryResult_t pResultHandle, CSteamID steamIDTradePartner, SteamItemInstanceID_t[] pArrayGive, uint[] pArrayGiveQuantity, uint nArrayGiveLength, SteamItemInstanceID_t[] pArrayGet, uint[] pArrayGetQuantity, uint nArrayGetLength) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_TradeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength); + return NativeMethods.ISteamGameServerInventory_TradeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength); } /// @@ -291,7 +291,7 @@ public static bool TradeItems(out SteamInventoryResult_t pResultHandle, CSteamID /// public static bool LoadItemDefinitions() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_LoadItemDefinitions(CSteamGameServerAPIContext.GetSteamInventory()); + return NativeMethods.ISteamGameServerInventory_LoadItemDefinitions(CSteamGameServerAPIContext.GetSteamInventory()); } /// @@ -306,7 +306,7 @@ public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, ref uint p if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize) { throw new System.ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!"); } - return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), pItemDefIDs, ref punItemDefIDsArraySize); + return NativeMethods.ISteamGameServerInventory_GetItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), pItemDefIDs, ref punItemDefIDsArraySize); } /// @@ -324,7 +324,7 @@ public static bool GetItemDefinitionProperty(SteamItemDef_t iDefinition, string InteropHelp.TestIfAvailableGameServer(); IntPtr pchValueBuffer2 = Marshal.AllocHGlobal((int)punValueBufferSizeOut); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) { - bool ret = NativeMethods.ISteamInventory_GetItemDefinitionProperty(CSteamGameServerAPIContext.GetSteamInventory(), iDefinition, pchPropertyName2, pchValueBuffer2, ref punValueBufferSizeOut); + bool ret = NativeMethods.ISteamGameServerInventory_GetItemDefinitionProperty(CSteamGameServerAPIContext.GetSteamInventory(), iDefinition, pchPropertyName2, pchValueBuffer2, ref punValueBufferSizeOut); pchValueBuffer = ret ? InteropHelp.PtrToStringUTF8(pchValueBuffer2) : null; Marshal.FreeHGlobal(pchValueBuffer2); return ret; @@ -338,7 +338,7 @@ public static bool GetItemDefinitionProperty(SteamItemDef_t iDefinition, string /// public static SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs(CSteamID steamID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID); + return (SteamAPICall_t)NativeMethods.ISteamGameServerInventory_RequestEligiblePromoItemDefinitionsIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID); } /// @@ -351,7 +351,7 @@ public static bool GetEligiblePromoItemDefinitionIDs(CSteamID steamID, SteamItem if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize) { throw new System.ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!"); } - return NativeMethods.ISteamInventory_GetEligiblePromoItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID, pItemDefIDs, ref punItemDefIDsArraySize); + return NativeMethods.ISteamGameServerInventory_GetEligiblePromoItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID, pItemDefIDs, ref punItemDefIDsArraySize); } /// @@ -362,7 +362,7 @@ public static bool GetEligiblePromoItemDefinitionIDs(CSteamID steamID, SteamItem /// public static SteamAPICall_t StartPurchase(SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamInventory_StartPurchase(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, punArrayQuantity, unArrayLength); + return (SteamAPICall_t)NativeMethods.ISteamGameServerInventory_StartPurchase(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, punArrayQuantity, unArrayLength); } /// @@ -370,7 +370,7 @@ public static SteamAPICall_t StartPurchase(SteamItemDef_t[] pArrayItemDefs, uint /// public static SteamAPICall_t RequestPrices() { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamInventory_RequestPrices(CSteamGameServerAPIContext.GetSteamInventory()); + return (SteamAPICall_t)NativeMethods.ISteamGameServerInventory_RequestPrices(CSteamGameServerAPIContext.GetSteamInventory()); } /// @@ -378,7 +378,7 @@ public static SteamAPICall_t RequestPrices() { /// public static uint GetNumItemsWithPrices() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_GetNumItemsWithPrices(CSteamGameServerAPIContext.GetSteamInventory()); + return NativeMethods.ISteamGameServerInventory_GetNumItemsWithPrices(CSteamGameServerAPIContext.GetSteamInventory()); } /// @@ -396,7 +396,7 @@ public static bool GetItemsWithPrices(SteamItemDef_t[] pArrayItemDefs, ulong[] p if (pBasePrices != null && pBasePrices.Length != unArrayLength) { throw new System.ArgumentException("pBasePrices must be the same size as unArrayLength!"); } - return NativeMethods.ISteamInventory_GetItemsWithPrices(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, pCurrentPrices, pBasePrices, unArrayLength); + return NativeMethods.ISteamGameServerInventory_GetItemsWithPrices(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, pCurrentPrices, pBasePrices, unArrayLength); } /// @@ -405,7 +405,7 @@ public static bool GetItemsWithPrices(SteamItemDef_t[] pArrayItemDefs, ulong[] p /// public static bool GetItemPrice(SteamItemDef_t iDefinition, out ulong pCurrentPrice, out ulong pBasePrice) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_GetItemPrice(CSteamGameServerAPIContext.GetSteamInventory(), iDefinition, out pCurrentPrice, out pBasePrice); + return NativeMethods.ISteamGameServerInventory_GetItemPrice(CSteamGameServerAPIContext.GetSteamInventory(), iDefinition, out pCurrentPrice, out pBasePrice); } /// @@ -413,7 +413,7 @@ public static bool GetItemPrice(SteamItemDef_t iDefinition, out ulong pCurrentPr /// public static SteamInventoryUpdateHandle_t StartUpdateProperties() { InteropHelp.TestIfAvailableGameServer(); - return (SteamInventoryUpdateHandle_t)NativeMethods.ISteamInventory_StartUpdateProperties(CSteamGameServerAPIContext.GetSteamInventory()); + return (SteamInventoryUpdateHandle_t)NativeMethods.ISteamGameServerInventory_StartUpdateProperties(CSteamGameServerAPIContext.GetSteamInventory()); } /// @@ -422,7 +422,7 @@ public static SteamInventoryUpdateHandle_t StartUpdateProperties() { public static bool RemoveProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName) { InteropHelp.TestIfAvailableGameServer(); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) { - return NativeMethods.ISteamInventory_RemoveProperty(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2); + return NativeMethods.ISteamGameServerInventory_RemoveProperty(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2); } } @@ -433,28 +433,28 @@ public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemIns InteropHelp.TestIfAvailableGameServer(); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) using (var pchPropertyValue2 = new InteropHelp.UTF8StringHandle(pchPropertyValue)) { - return NativeMethods.ISteamInventory_SetPropertyString(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, pchPropertyValue2); + return NativeMethods.ISteamGameServerInventory_SetPropertyString(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, pchPropertyValue2); } } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, bool bValue) { InteropHelp.TestIfAvailableGameServer(); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) { - return NativeMethods.ISteamInventory_SetPropertyBool(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, bValue); + return NativeMethods.ISteamGameServerInventory_SetPropertyBool(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, bValue); } } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, long nValue) { InteropHelp.TestIfAvailableGameServer(); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) { - return NativeMethods.ISteamInventory_SetPropertyInt64(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, nValue); + return NativeMethods.ISteamGameServerInventory_SetPropertyInt64(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, nValue); } } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, float flValue) { InteropHelp.TestIfAvailableGameServer(); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) { - return NativeMethods.ISteamInventory_SetPropertyFloat(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, flValue); + return NativeMethods.ISteamGameServerInventory_SetPropertyFloat(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, flValue); } } @@ -463,13 +463,13 @@ public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemIns /// public static bool SubmitUpdateProperties(SteamInventoryUpdateHandle_t handle, out SteamInventoryResult_t pResultHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamInventory_SubmitUpdateProperties(CSteamGameServerAPIContext.GetSteamInventory(), handle, out pResultHandle); + return NativeMethods.ISteamGameServerInventory_SubmitUpdateProperties(CSteamGameServerAPIContext.GetSteamInventory(), handle, out pResultHandle); } public static bool InspectItem(out SteamInventoryResult_t pResultHandle, string pchItemToken) { InteropHelp.TestIfAvailableGameServer(); using (var pchItemToken2 = new InteropHelp.UTF8StringHandle(pchItemToken)) { - return NativeMethods.ISteamInventory_InspectItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pchItemToken2); + return NativeMethods.ISteamGameServerInventory_InspectItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pchItemToken2); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworking.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworking.cs index 5a8f3410..6f355173 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworking.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworking.cs @@ -36,7 +36,7 @@ public static class SteamGameServerNetworking { /// public static bool SendP2PPacket(CSteamID steamIDRemote, byte[] pubData, uint cubData, EP2PSend eP2PSendType, int nChannel = 0) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_SendP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, pubData, cubData, eP2PSendType, nChannel); + return NativeMethods.ISteamGameServerNetworking_SendP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, pubData, cubData, eP2PSendType, nChannel); } /// @@ -44,7 +44,7 @@ public static bool SendP2PPacket(CSteamID steamIDRemote, byte[] pubData, uint cu /// public static bool IsP2PPacketAvailable(out uint pcubMsgSize, int nChannel = 0) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_IsP2PPacketAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), out pcubMsgSize, nChannel); + return NativeMethods.ISteamGameServerNetworking_IsP2PPacketAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), out pcubMsgSize, nChannel); } /// @@ -55,7 +55,7 @@ public static bool IsP2PPacketAvailable(out uint pcubMsgSize, int nChannel = 0) /// public static bool ReadP2PPacket(byte[] pubDest, uint cubDest, out uint pcubMsgSize, out CSteamID psteamIDRemote, int nChannel = 0) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_ReadP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel); + return NativeMethods.ISteamGameServerNetworking_ReadP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel); } /// @@ -68,7 +68,7 @@ public static bool ReadP2PPacket(byte[] pubDest, uint cubDest, out uint pcubMsgS /// public static bool AcceptP2PSessionWithUser(CSteamID steamIDRemote) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_AcceptP2PSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote); + return NativeMethods.ISteamGameServerNetworking_AcceptP2PSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote); } /// @@ -77,7 +77,7 @@ public static bool AcceptP2PSessionWithUser(CSteamID steamIDRemote) { /// public static bool CloseP2PSessionWithUser(CSteamID steamIDRemote) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_CloseP2PSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote); + return NativeMethods.ISteamGameServerNetworking_CloseP2PSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote); } /// @@ -87,7 +87,7 @@ public static bool CloseP2PSessionWithUser(CSteamID steamIDRemote) { /// public static bool CloseP2PChannelWithUser(CSteamID steamIDRemote, int nChannel) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_CloseP2PChannelWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, nChannel); + return NativeMethods.ISteamGameServerNetworking_CloseP2PChannelWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, nChannel); } /// @@ -97,7 +97,7 @@ public static bool CloseP2PChannelWithUser(CSteamID steamIDRemote, int nChannel) /// public static bool GetP2PSessionState(CSteamID steamIDRemote, out P2PSessionState_t pConnectionState) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_GetP2PSessionState(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, out pConnectionState); + return NativeMethods.ISteamGameServerNetworking_GetP2PSessionState(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, out pConnectionState); } /// @@ -111,7 +111,7 @@ public static bool GetP2PSessionState(CSteamID steamIDRemote, out P2PSessionStat /// public static bool AllowP2PPacketRelay(bool bAllow) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_AllowP2PPacketRelay(CSteamGameServerAPIContext.GetSteamNetworking(), bAllow); + return NativeMethods.ISteamGameServerNetworking_AllowP2PPacketRelay(CSteamGameServerAPIContext.GetSteamNetworking(), bAllow); } /// @@ -138,7 +138,7 @@ public static bool AllowP2PPacketRelay(bool bAllow) { /// public static SNetListenSocket_t CreateListenSocket(int nVirtualP2PPort, SteamIPAddress_t nIP, ushort nPort, bool bAllowUseOfPacketRelay) { InteropHelp.TestIfAvailableGameServer(); - return (SNetListenSocket_t)NativeMethods.ISteamNetworking_CreateListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay); + return (SNetListenSocket_t)NativeMethods.ISteamGameServerNetworking_CreateListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay); } /// @@ -149,12 +149,12 @@ public static SNetListenSocket_t CreateListenSocket(int nVirtualP2PPort, SteamIP /// public static SNetSocket_t CreateP2PConnectionSocket(CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay) { InteropHelp.TestIfAvailableGameServer(); - return (SNetSocket_t)NativeMethods.ISteamNetworking_CreateP2PConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay); + return (SNetSocket_t)NativeMethods.ISteamGameServerNetworking_CreateP2PConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay); } public static SNetSocket_t CreateConnectionSocket(SteamIPAddress_t nIP, ushort nPort, int nTimeoutSec) { InteropHelp.TestIfAvailableGameServer(); - return (SNetSocket_t)NativeMethods.ISteamNetworking_CreateConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nIP, nPort, nTimeoutSec); + return (SNetSocket_t)NativeMethods.ISteamGameServerNetworking_CreateConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nIP, nPort, nTimeoutSec); } /// @@ -164,7 +164,7 @@ public static SNetSocket_t CreateConnectionSocket(SteamIPAddress_t nIP, ushort n /// public static bool DestroySocket(SNetSocket_t hSocket, bool bNotifyRemoteEnd) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_DestroySocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd); + return NativeMethods.ISteamGameServerNetworking_DestroySocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd); } /// @@ -172,7 +172,7 @@ public static bool DestroySocket(SNetSocket_t hSocket, bool bNotifyRemoteEnd) { /// public static bool DestroyListenSocket(SNetListenSocket_t hSocket, bool bNotifyRemoteEnd) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_DestroyListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd); + return NativeMethods.ISteamGameServerNetworking_DestroyListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd); } /// @@ -184,7 +184,7 @@ public static bool DestroyListenSocket(SNetListenSocket_t hSocket, bool bNotifyR /// public static bool SendDataOnSocket(SNetSocket_t hSocket, byte[] pubData, uint cubData, bool bReliable) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_SendDataOnSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, pubData, cubData, bReliable); + return NativeMethods.ISteamGameServerNetworking_SendDataOnSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, pubData, cubData, bReliable); } /// @@ -194,7 +194,7 @@ public static bool SendDataOnSocket(SNetSocket_t hSocket, byte[] pubData, uint c /// public static bool IsDataAvailableOnSocket(SNetSocket_t hSocket, out uint pcubMsgSize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_IsDataAvailableOnSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, out pcubMsgSize); + return NativeMethods.ISteamGameServerNetworking_IsDataAvailableOnSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, out pcubMsgSize); } /// @@ -205,7 +205,7 @@ public static bool IsDataAvailableOnSocket(SNetSocket_t hSocket, out uint pcubMs /// public static bool RetrieveDataFromSocket(SNetSocket_t hSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_RetrieveDataFromSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, pubDest, cubDest, out pcubMsgSize); + return NativeMethods.ISteamGameServerNetworking_RetrieveDataFromSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, pubDest, cubDest, out pcubMsgSize); } /// @@ -216,7 +216,7 @@ public static bool RetrieveDataFromSocket(SNetSocket_t hSocket, byte[] pubDest, /// public static bool IsDataAvailable(SNetListenSocket_t hListenSocket, out uint pcubMsgSize, out SNetSocket_t phSocket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_IsDataAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pcubMsgSize, out phSocket); + return NativeMethods.ISteamGameServerNetworking_IsDataAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pcubMsgSize, out phSocket); } /// @@ -229,7 +229,7 @@ public static bool IsDataAvailable(SNetListenSocket_t hListenSocket, out uint pc /// public static bool RetrieveData(SNetListenSocket_t hListenSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize, out SNetSocket_t phSocket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_RetrieveData(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, pubDest, cubDest, out pcubMsgSize, out phSocket); + return NativeMethods.ISteamGameServerNetworking_RetrieveData(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, pubDest, cubDest, out pcubMsgSize, out phSocket); } /// @@ -237,7 +237,7 @@ public static bool RetrieveData(SNetListenSocket_t hListenSocket, byte[] pubDest /// public static bool GetSocketInfo(SNetSocket_t hSocket, out CSteamID pSteamIDRemote, out int peSocketStatus, out SteamIPAddress_t punIPRemote, out ushort punPortRemote) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_GetSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, out pSteamIDRemote, out peSocketStatus, out punIPRemote, out punPortRemote); + return NativeMethods.ISteamGameServerNetworking_GetSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, out pSteamIDRemote, out peSocketStatus, out punIPRemote, out punPortRemote); } /// @@ -246,7 +246,7 @@ public static bool GetSocketInfo(SNetSocket_t hSocket, out CSteamID pSteamIDRemo /// public static bool GetListenSocketInfo(SNetListenSocket_t hListenSocket, out SteamIPAddress_t pnIP, out ushort pnPort) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_GetListenSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pnIP, out pnPort); + return NativeMethods.ISteamGameServerNetworking_GetListenSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pnIP, out pnPort); } /// @@ -254,7 +254,7 @@ public static bool GetListenSocketInfo(SNetListenSocket_t hListenSocket, out Ste /// public static ESNetSocketConnectionType GetSocketConnectionType(SNetSocket_t hSocket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_GetSocketConnectionType(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket); + return NativeMethods.ISteamGameServerNetworking_GetSocketConnectionType(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket); } /// @@ -262,7 +262,7 @@ public static ESNetSocketConnectionType GetSocketConnectionType(SNetSocket_t hSo /// public static int GetMaxPacketSize(SNetSocket_t hSocket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworking_GetMaxPacketSize(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket); + return NativeMethods.ISteamGameServerNetworking_GetMaxPacketSize(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs index 589d4996..0637e9fa 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs @@ -64,7 +64,7 @@ public static class SteamGameServerNetworkingMessages { /// public static EResult SendMessageToUser(ref SteamNetworkingIdentity identityRemote, IntPtr pubData, uint cubData, int nSendFlags, int nRemoteChannel) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingMessages_SendMessageToUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, pubData, cubData, nSendFlags, nRemoteChannel); + return NativeMethods.ISteamGameServerNetworkingMessages_SendMessageToUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, pubData, cubData, nSendFlags, nRemoteChannel); } /// @@ -78,7 +78,7 @@ public static int ReceiveMessagesOnChannel(int nLocalChannel, IntPtr[] ppOutMess if (ppOutMessages != null && ppOutMessages.Length != nMaxMessages) { throw new System.ArgumentException("ppOutMessages must be the same size as nMaxMessages!"); } - return NativeMethods.ISteamNetworkingMessages_ReceiveMessagesOnChannel(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), nLocalChannel, ppOutMessages, nMaxMessages); + return NativeMethods.ISteamGameServerNetworkingMessages_ReceiveMessagesOnChannel(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), nLocalChannel, ppOutMessages, nMaxMessages); } /// @@ -95,7 +95,7 @@ public static int ReceiveMessagesOnChannel(int nLocalChannel, IntPtr[] ppOutMess /// public static bool AcceptSessionWithUser(ref SteamNetworkingIdentity identityRemote) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingMessages_AcceptSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote); + return NativeMethods.ISteamGameServerNetworkingMessages_AcceptSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote); } /// @@ -107,7 +107,7 @@ public static bool AcceptSessionWithUser(ref SteamNetworkingIdentity identityRem /// public static bool CloseSessionWithUser(ref SteamNetworkingIdentity identityRemote) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingMessages_CloseSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote); + return NativeMethods.ISteamGameServerNetworkingMessages_CloseSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote); } /// @@ -118,7 +118,7 @@ public static bool CloseSessionWithUser(ref SteamNetworkingIdentity identityRemo /// public static bool CloseChannelWithUser(ref SteamNetworkingIdentity identityRemote, int nLocalChannel) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingMessages_CloseChannelWithUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, nLocalChannel); + return NativeMethods.ISteamGameServerNetworkingMessages_CloseChannelWithUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, nLocalChannel); } /// @@ -134,7 +134,13 @@ public static bool CloseChannelWithUser(ref SteamNetworkingIdentity identityRemo /// public static ESteamNetworkingConnectionState GetSessionConnectionInfo(ref SteamNetworkingIdentity identityRemote, out SteamNetConnectionInfo_t pConnectionInfo, out SteamNetConnectionRealTimeStatus_t pQuickStatus) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo, out pQuickStatus); + ESteamNetworkingConnectionState anyCpuResult; + if (!Packsize.IsLargePack) { + anyCpuResult = NativeMethods.ISteamGameServerNetworkingMessages_GetSessionConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo, out pQuickStatus); + } else { + anyCpuResult = NativeMethods.ISteamGameServerNetworkingMessages_GetSessionConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo_lp, out pQuickStatus); + } + return anyCpuResult; } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs index c51b9f88..daf0e96c 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs @@ -39,7 +39,7 @@ public static class SteamGameServerNetworkingSockets { /// public static HSteamListenSocket CreateListenSocketIP(ref SteamNetworkingIPAddr localAddress, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateListenSocketIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref localAddress, nOptions, pOptions); + return (HSteamListenSocket)NativeMethods.ISteamGameServerNetworkingSockets_CreateListenSocketIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref localAddress, nOptions, pOptions); } /// @@ -68,7 +68,7 @@ public static HSteamListenSocket CreateListenSocketIP(ref SteamNetworkingIPAddr /// public static HSteamNetConnection ConnectByIPAddress(ref SteamNetworkingIPAddr address, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectByIPAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref address, nOptions, pOptions); + return (HSteamNetConnection)NativeMethods.ISteamGameServerNetworkingSockets_ConnectByIPAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref address, nOptions, pOptions); } /// @@ -98,7 +98,7 @@ public static HSteamNetConnection ConnectByIPAddress(ref SteamNetworkingIPAddr a /// public static HSteamListenSocket CreateListenSocketP2P(int nLocalVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateListenSocketP2P(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nLocalVirtualPort, nOptions, pOptions); + return (HSteamListenSocket)NativeMethods.ISteamGameServerNetworkingSockets_CreateListenSocketP2P(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nLocalVirtualPort, nOptions, pOptions); } /// @@ -116,7 +116,7 @@ public static HSteamListenSocket CreateListenSocketP2P(int nLocalVirtualPort, in /// public static HSteamNetConnection ConnectP2P(ref SteamNetworkingIdentity identityRemote, int nRemoteVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectP2P(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityRemote, nRemoteVirtualPort, nOptions, pOptions); + return (HSteamNetConnection)NativeMethods.ISteamGameServerNetworkingSockets_ConnectP2P(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityRemote, nRemoteVirtualPort, nOptions, pOptions); } /// @@ -162,7 +162,7 @@ public static HSteamNetConnection ConnectP2P(ref SteamNetworkingIdentity identit /// public static EResult AcceptConnection(HSteamNetConnection hConn) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_AcceptConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn); + return NativeMethods.ISteamGameServerNetworkingSockets_AcceptConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn); } /// @@ -191,7 +191,7 @@ public static EResult AcceptConnection(HSteamNetConnection hConn) { public static bool CloseConnection(HSteamNetConnection hPeer, int nReason, string pszDebug, bool bEnableLinger) { InteropHelp.TestIfAvailableGameServer(); using (var pszDebug2 = new InteropHelp.UTF8StringHandle(pszDebug)) { - return NativeMethods.ISteamNetworkingSockets_CloseConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, nReason, pszDebug2, bEnableLinger); + return NativeMethods.ISteamGameServerNetworkingSockets_CloseConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, nReason, pszDebug2, bEnableLinger); } } @@ -201,7 +201,7 @@ public static bool CloseConnection(HSteamNetConnection hPeer, int nReason, strin /// public static bool CloseListenSocket(HSteamListenSocket hSocket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_CloseListenSocket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hSocket); + return NativeMethods.ISteamGameServerNetworkingSockets_CloseListenSocket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hSocket); } /// @@ -230,7 +230,7 @@ public static bool CloseListenSocket(HSteamListenSocket hSocket) { /// public static bool SetConnectionUserData(HSteamNetConnection hPeer, long nUserData) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_SetConnectionUserData(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, nUserData); + return NativeMethods.ISteamGameServerNetworkingSockets_SetConnectionUserData(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, nUserData); } /// @@ -239,7 +239,7 @@ public static bool SetConnectionUserData(HSteamNetConnection hPeer, long nUserDa /// public static long GetConnectionUserData(HSteamNetConnection hPeer) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_GetConnectionUserData(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer); + return NativeMethods.ISteamGameServerNetworkingSockets_GetConnectionUserData(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer); } /// @@ -248,7 +248,7 @@ public static long GetConnectionUserData(HSteamNetConnection hPeer) { public static void SetConnectionName(HSteamNetConnection hPeer, string pszName) { InteropHelp.TestIfAvailableGameServer(); using (var pszName2 = new InteropHelp.UTF8StringHandle(pszName)) { - NativeMethods.ISteamNetworkingSockets_SetConnectionName(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, pszName2); + NativeMethods.ISteamGameServerNetworkingSockets_SetConnectionName(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, pszName2); } } @@ -258,7 +258,7 @@ public static void SetConnectionName(HSteamNetConnection hPeer, string pszName) public static bool GetConnectionName(HSteamNetConnection hPeer, out string pszName, int nMaxLen) { InteropHelp.TestIfAvailableGameServer(); IntPtr pszName2 = Marshal.AllocHGlobal(nMaxLen); - bool ret = NativeMethods.ISteamNetworkingSockets_GetConnectionName(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, pszName2, nMaxLen); + bool ret = NativeMethods.ISteamGameServerNetworkingSockets_GetConnectionName(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, pszName2, nMaxLen); pszName = ret ? InteropHelp.PtrToStringUTF8(pszName2) : null; Marshal.FreeHGlobal(pszName2); return ret; @@ -305,7 +305,7 @@ public static bool GetConnectionName(HSteamNetConnection hPeer, out string pszNa /// public static EResult SendMessageToConnection(HSteamNetConnection hConn, IntPtr pData, uint cbData, int nSendFlags, out long pOutMessageNumber) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_SendMessageToConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, pData, cbData, nSendFlags, out pOutMessageNumber); + return NativeMethods.ISteamGameServerNetworkingSockets_SendMessageToConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, pData, cbData, nSendFlags, out pOutMessageNumber); } /// @@ -344,7 +344,7 @@ public static EResult SendMessageToConnection(HSteamNetConnection hConn, IntPtr /// public static void SendMessages(int nMessages, IntPtr[] pMessages, long[] pOutMessageNumberOrResult) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamNetworkingSockets_SendMessages(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nMessages, pMessages, pOutMessageNumberOrResult); + NativeMethods.ISteamGameServerNetworkingSockets_SendMessages(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nMessages, pMessages, pOutMessageNumberOrResult); } /// @@ -364,7 +364,7 @@ public static void SendMessages(int nMessages, IntPtr[] pMessages, long[] pOutMe /// public static EResult FlushMessagesOnConnection(HSteamNetConnection hConn) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_FlushMessagesOnConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn); + return NativeMethods.ISteamGameServerNetworkingSockets_FlushMessagesOnConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn); } /// @@ -389,7 +389,7 @@ public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, IntPtr[ if (ppOutMessages != null && ppOutMessages.Length != nMaxMessages) { throw new System.ArgumentException("ppOutMessages must be the same size as nMaxMessages!"); } - return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, ppOutMessages, nMaxMessages); + return NativeMethods.ISteamGameServerNetworkingSockets_ReceiveMessagesOnConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, ppOutMessages, nMaxMessages); } /// @@ -397,7 +397,13 @@ public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, IntPtr[ /// public static bool GetConnectionInfo(HSteamNetConnection hConn, out SteamNetConnectionInfo_t pInfo) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); + bool anyCpuResult; + if (!Packsize.IsLargePack) { + anyCpuResult = NativeMethods.ISteamGameServerNetworkingSockets_GetConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); + } else { + anyCpuResult = NativeMethods.ISteamGameServerNetworkingSockets_GetConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo_lp); + } + return anyCpuResult; } /// @@ -418,7 +424,7 @@ public static bool GetConnectionInfo(HSteamNetConnection hConn, out SteamNetConn /// public static EResult GetConnectionRealTimeStatus(HSteamNetConnection hConn, ref SteamNetConnectionRealTimeStatus_t pStatus, int nLanes, ref SteamNetConnectionRealTimeLaneStatus_t pLanes) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_GetConnectionRealTimeStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, ref pStatus, nLanes, ref pLanes); + return NativeMethods.ISteamGameServerNetworkingSockets_GetConnectionRealTimeStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, ref pStatus, nLanes, ref pLanes); } /// @@ -434,7 +440,7 @@ public static EResult GetConnectionRealTimeStatus(HSteamNetConnection hConn, ref public static int GetDetailedConnectionStatus(HSteamNetConnection hConn, out string pszBuf, int cbBuf) { InteropHelp.TestIfAvailableGameServer(); IntPtr pszBuf2 = Marshal.AllocHGlobal(cbBuf); - int ret = NativeMethods.ISteamNetworkingSockets_GetDetailedConnectionStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, pszBuf2, cbBuf); + int ret = NativeMethods.ISteamGameServerNetworkingSockets_GetDetailedConnectionStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, pszBuf2, cbBuf); pszBuf = ret != -1 ? InteropHelp.PtrToStringUTF8(pszBuf2) : null; Marshal.FreeHGlobal(pszBuf2); return ret; @@ -448,7 +454,7 @@ public static int GetDetailedConnectionStatus(HSteamNetConnection hConn, out str /// public static bool GetListenSocketAddress(HSteamListenSocket hSocket, out SteamNetworkingIPAddr address) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_GetListenSocketAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hSocket, out address); + return NativeMethods.ISteamGameServerNetworkingSockets_GetListenSocketAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hSocket, out address); } /// @@ -475,7 +481,7 @@ public static bool GetListenSocketAddress(HSteamListenSocket hSocket, out SteamN /// public static bool CreateSocketPair(out HSteamNetConnection pOutConnection1, out HSteamNetConnection pOutConnection2, bool bUseNetworkLoopback, ref SteamNetworkingIdentity pIdentity1, ref SteamNetworkingIdentity pIdentity2) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_CreateSocketPair(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pOutConnection1, out pOutConnection2, bUseNetworkLoopback, ref pIdentity1, ref pIdentity2); + return NativeMethods.ISteamGameServerNetworkingSockets_CreateSocketPair(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pOutConnection1, out pOutConnection2, bUseNetworkLoopback, ref pIdentity1, ref pIdentity2); } /// @@ -549,7 +555,7 @@ public static bool CreateSocketPair(out HSteamNetConnection pOutConnection1, out /// public static EResult ConfigureConnectionLanes(HSteamNetConnection hConn, int nNumLanes, int[] pLanePriorities, ushort[] pLaneWeights) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_ConfigureConnectionLanes(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, nNumLanes, pLanePriorities, pLaneWeights); + return NativeMethods.ISteamGameServerNetworkingSockets_ConfigureConnectionLanes(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, nNumLanes, pLanePriorities, pLaneWeights); } /// @@ -562,7 +568,7 @@ public static EResult ConfigureConnectionLanes(HSteamNetConnection hConn, int nN /// public static bool GetIdentity(out SteamNetworkingIdentity pIdentity) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_GetIdentity(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pIdentity); + return NativeMethods.ISteamGameServerNetworkingSockets_GetIdentity(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pIdentity); } /// @@ -592,7 +598,7 @@ public static bool GetIdentity(out SteamNetworkingIdentity pIdentity) { /// public static ESteamNetworkingAvailability InitAuthentication() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_InitAuthentication(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); + return NativeMethods.ISteamGameServerNetworkingSockets_InitAuthentication(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } /// @@ -606,7 +612,7 @@ public static ESteamNetworkingAvailability InitAuthentication() { /// public static ESteamNetworkingAvailability GetAuthenticationStatus(out SteamNetAuthenticationStatus_t pDetails) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_GetAuthenticationStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pDetails); + return NativeMethods.ISteamGameServerNetworkingSockets_GetAuthenticationStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pDetails); } /// @@ -619,7 +625,7 @@ public static ESteamNetworkingAvailability GetAuthenticationStatus(out SteamNetA /// public static HSteamNetPollGroup CreatePollGroup() { InteropHelp.TestIfAvailableGameServer(); - return (HSteamNetPollGroup)NativeMethods.ISteamNetworkingSockets_CreatePollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); + return (HSteamNetPollGroup)NativeMethods.ISteamGameServerNetworkingSockets_CreatePollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } /// @@ -631,7 +637,7 @@ public static HSteamNetPollGroup CreatePollGroup() { /// public static bool DestroyPollGroup(HSteamNetPollGroup hPollGroup) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_DestroyPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPollGroup); + return NativeMethods.ISteamGameServerNetworkingSockets_DestroyPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPollGroup); } /// @@ -652,7 +658,7 @@ public static bool DestroyPollGroup(HSteamNetPollGroup hPollGroup) { /// public static bool SetConnectionPollGroup(HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_SetConnectionPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, hPollGroup); + return NativeMethods.ISteamGameServerNetworkingSockets_SetConnectionPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, hPollGroup); } /// @@ -677,7 +683,7 @@ public static int ReceiveMessagesOnPollGroup(HSteamNetPollGroup hPollGroup, IntP if (ppOutMessages != null && ppOutMessages.Length != nMaxMessages) { throw new System.ArgumentException("ppOutMessages must be the same size as nMaxMessages!"); } - return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPollGroup, ppOutMessages, nMaxMessages); + return NativeMethods.ISteamGameServerNetworkingSockets_ReceiveMessagesOnPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPollGroup, ppOutMessages, nMaxMessages); } /// @@ -692,7 +698,7 @@ public static int ReceiveMessagesOnPollGroup(HSteamNetPollGroup hPollGroup, IntP /// public static bool ReceivedRelayAuthTicket(IntPtr pvTicket, int cbTicket, out SteamDatagramRelayAuthTicket pOutParsedTicket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_ReceivedRelayAuthTicket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pvTicket, cbTicket, out pOutParsedTicket); + return NativeMethods.ISteamGameServerNetworkingSockets_ReceivedRelayAuthTicket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pvTicket, cbTicket, out pOutParsedTicket); } /// @@ -705,7 +711,7 @@ public static bool ReceivedRelayAuthTicket(IntPtr pvTicket, int cbTicket, out St /// public static int FindRelayAuthTicketForServer(ref SteamNetworkingIdentity identityGameServer, int nRemoteVirtualPort, out SteamDatagramRelayAuthTicket pOutParsedTicket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_FindRelayAuthTicketForServer(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityGameServer, nRemoteVirtualPort, out pOutParsedTicket); + return NativeMethods.ISteamGameServerNetworkingSockets_FindRelayAuthTicketForServer(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityGameServer, nRemoteVirtualPort, out pOutParsedTicket); } /// @@ -728,7 +734,7 @@ public static int FindRelayAuthTicketForServer(ref SteamNetworkingIdentity ident /// public static HSteamNetConnection ConnectToHostedDedicatedServer(ref SteamNetworkingIdentity identityTarget, int nRemoteVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectToHostedDedicatedServer(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityTarget, nRemoteVirtualPort, nOptions, pOptions); + return (HSteamNetConnection)NativeMethods.ISteamGameServerNetworkingSockets_ConnectToHostedDedicatedServer(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityTarget, nRemoteVirtualPort, nOptions, pOptions); } /// @@ -743,7 +749,7 @@ public static HSteamNetConnection ConnectToHostedDedicatedServer(ref SteamNetwor /// public static ushort GetHostedDedicatedServerPort() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_GetHostedDedicatedServerPort(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); + return NativeMethods.ISteamGameServerNetworkingSockets_GetHostedDedicatedServerPort(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } /// @@ -752,7 +758,7 @@ public static ushort GetHostedDedicatedServerPort() { /// public static SteamNetworkingPOPID GetHostedDedicatedServerPOPID() { InteropHelp.TestIfAvailableGameServer(); - return (SteamNetworkingPOPID)NativeMethods.ISteamNetworkingSockets_GetHostedDedicatedServerPOPID(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); + return (SteamNetworkingPOPID)NativeMethods.ISteamGameServerNetworkingSockets_GetHostedDedicatedServerPOPID(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } /// @@ -785,7 +791,7 @@ public static SteamNetworkingPOPID GetHostedDedicatedServerPOPID() { /// public static EResult GetHostedDedicatedServerAddress(out SteamDatagramHostedAddress pRouting) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_GetHostedDedicatedServerAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pRouting); + return NativeMethods.ISteamGameServerNetworkingSockets_GetHostedDedicatedServerAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pRouting); } /// @@ -805,7 +811,7 @@ public static EResult GetHostedDedicatedServerAddress(out SteamDatagramHostedAdd /// public static HSteamListenSocket CreateHostedDedicatedServerListenSocket(int nLocalVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateHostedDedicatedServerListenSocket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nLocalVirtualPort, nOptions, pOptions); + return (HSteamListenSocket)NativeMethods.ISteamGameServerNetworkingSockets_CreateHostedDedicatedServerListenSocket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nLocalVirtualPort, nOptions, pOptions); } /// @@ -842,7 +848,7 @@ public static HSteamListenSocket CreateHostedDedicatedServerListenSocket(int nLo /// public static EResult GetGameCoordinatorServerLogin(IntPtr pLoginInfo, out int pcbSignedBlob, IntPtr pBlob) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_GetGameCoordinatorServerLogin(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pLoginInfo, out pcbSignedBlob, pBlob); + return NativeMethods.ISteamGameServerNetworkingSockets_GetGameCoordinatorServerLogin(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pLoginInfo, out pcbSignedBlob, pBlob); } /// @@ -885,7 +891,7 @@ public static EResult GetGameCoordinatorServerLogin(IntPtr pLoginInfo, out int p /// public static HSteamNetConnection ConnectP2PCustomSignaling(out ISteamNetworkingConnectionSignaling pSignaling, ref SteamNetworkingIdentity pPeerIdentity, int nRemoteVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectP2PCustomSignaling(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pSignaling, ref pPeerIdentity, nRemoteVirtualPort, nOptions, pOptions); + return (HSteamNetConnection)NativeMethods.ISteamGameServerNetworkingSockets_ConnectP2PCustomSignaling(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pSignaling, ref pPeerIdentity, nRemoteVirtualPort, nOptions, pOptions); } /// @@ -921,7 +927,7 @@ public static HSteamNetConnection ConnectP2PCustomSignaling(out ISteamNetworking /// public static bool ReceivedP2PCustomSignal(IntPtr pMsg, int cbMsg, out ISteamNetworkingSignalingRecvContext pContext) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_ReceivedP2PCustomSignal(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pMsg, cbMsg, out pContext); + return NativeMethods.ISteamGameServerNetworkingSockets_ReceivedP2PCustomSignal(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pMsg, cbMsg, out pContext); } /// @@ -936,7 +942,7 @@ public static bool ReceivedP2PCustomSignal(IntPtr pMsg, int cbMsg, out ISteamNet /// public static bool GetCertificateRequest(out int pcbBlob, IntPtr pBlob, out SteamNetworkingErrMsg errMsg) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_GetCertificateRequest(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pcbBlob, pBlob, out errMsg); + return NativeMethods.ISteamGameServerNetworkingSockets_GetCertificateRequest(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pcbBlob, pBlob, out errMsg); } /// @@ -945,7 +951,7 @@ public static bool GetCertificateRequest(out int pcbBlob, IntPtr pBlob, out Stea /// public static bool SetCertificate(IntPtr pCertificate, int cbCertificate, out SteamNetworkingErrMsg errMsg) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_SetCertificate(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pCertificate, cbCertificate, out errMsg); + return NativeMethods.ISteamGameServerNetworkingSockets_SetCertificate(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pCertificate, cbCertificate, out errMsg); } /// @@ -960,7 +966,7 @@ public static bool SetCertificate(IntPtr pCertificate, int cbCertificate, out St /// public static void ResetIdentity(ref SteamNetworkingIdentity pIdentity) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamNetworkingSockets_ResetIdentity(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref pIdentity); + NativeMethods.ISteamGameServerNetworkingSockets_ResetIdentity(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref pIdentity); } /// @@ -973,7 +979,7 @@ public static void ResetIdentity(ref SteamNetworkingIdentity pIdentity) { /// public static void RunCallbacks() { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamNetworkingSockets_RunCallbacks(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); + NativeMethods.ISteamGameServerNetworkingSockets_RunCallbacks(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } /// @@ -1035,7 +1041,7 @@ public static void RunCallbacks() { /// public static bool BeginAsyncRequestFakeIP(int nNumPorts) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_BeginAsyncRequestFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nNumPorts); + return NativeMethods.ISteamGameServerNetworkingSockets_BeginAsyncRequestFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nNumPorts); } /// @@ -1045,7 +1051,7 @@ public static bool BeginAsyncRequestFakeIP(int nNumPorts) { /// public static void GetFakeIP(int idxFirstPort, out SteamNetworkingFakeIPResult_t pInfo) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamNetworkingSockets_GetFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), idxFirstPort, out pInfo); + NativeMethods.ISteamGameServerNetworkingSockets_GetFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), idxFirstPort, out pInfo); } /// @@ -1061,7 +1067,7 @@ public static void GetFakeIP(int idxFirstPort, out SteamNetworkingFakeIPResult_t /// public static HSteamListenSocket CreateListenSocketP2PFakeIP(int idxFakePort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateListenSocketP2PFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), idxFakePort, nOptions, pOptions); + return (HSteamListenSocket)NativeMethods.ISteamGameServerNetworkingSockets_CreateListenSocketP2PFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), idxFakePort, nOptions, pOptions); } /// @@ -1083,7 +1089,7 @@ public static HSteamListenSocket CreateListenSocketP2PFakeIP(int idxFakePort, in /// public static EResult GetRemoteFakeIPForConnection(HSteamNetConnection hConn, out SteamNetworkingIPAddr pOutAddr) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_GetRemoteFakeIPForConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pOutAddr); + return NativeMethods.ISteamGameServerNetworkingSockets_GetRemoteFakeIPForConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pOutAddr); } /// @@ -1107,7 +1113,7 @@ public static EResult GetRemoteFakeIPForConnection(HSteamNetConnection hConn, ou /// public static IntPtr CreateFakeUDPPort(int idxFakeServerPort) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingSockets_CreateFakeUDPPort(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), idxFakeServerPort); + return NativeMethods.ISteamGameServerNetworkingSockets_CreateFakeUDPPort(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), idxFakeServerPort); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingutils.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingutils.cs index 305ed939..daab4235 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingutils.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingutils.cs @@ -35,7 +35,7 @@ public static class SteamGameServerNetworkingUtils { /// public static IntPtr AllocateMessage(int cbAllocateBuffer) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_AllocateMessage(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), cbAllocateBuffer); + return NativeMethods.ISteamGameServerNetworkingUtils_AllocateMessage(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), cbAllocateBuffer); } /// @@ -64,7 +64,7 @@ public static IntPtr AllocateMessage(int cbAllocateBuffer) { /// public static void InitRelayNetworkAccess() { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamNetworkingUtils_InitRelayNetworkAccess(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); + NativeMethods.ISteamGameServerNetworkingUtils_InitRelayNetworkAccess(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); } /// @@ -79,7 +79,7 @@ public static void InitRelayNetworkAccess() { /// public static ESteamNetworkingAvailability GetRelayNetworkStatus(out SteamRelayNetworkStatus_t pDetails) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_GetRelayNetworkStatus(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pDetails); + return NativeMethods.ISteamGameServerNetworkingUtils_GetRelayNetworkStatus(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pDetails); } /// @@ -108,7 +108,7 @@ public static ESteamNetworkingAvailability GetRelayNetworkStatus(out SteamRelayN /// public static float GetLocalPingLocation(out SteamNetworkPingLocation_t result) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_GetLocalPingLocation(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out result); + return NativeMethods.ISteamGameServerNetworkingUtils_GetLocalPingLocation(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out result); } /// @@ -137,7 +137,7 @@ public static float GetLocalPingLocation(out SteamNetworkPingLocation_t result) /// public static int EstimatePingTimeBetweenTwoLocations(ref SteamNetworkPingLocation_t location1, ref SteamNetworkPingLocation_t location2) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_EstimatePingTimeBetweenTwoLocations(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref location1, ref location2); + return NativeMethods.ISteamGameServerNetworkingUtils_EstimatePingTimeBetweenTwoLocations(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref location1, ref location2); } /// @@ -152,7 +152,7 @@ public static int EstimatePingTimeBetweenTwoLocations(ref SteamNetworkPingLocati /// public static int EstimatePingTimeFromLocalHost(ref SteamNetworkPingLocation_t remoteLocation) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_EstimatePingTimeFromLocalHost(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref remoteLocation); + return NativeMethods.ISteamGameServerNetworkingUtils_EstimatePingTimeFromLocalHost(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref remoteLocation); } /// @@ -164,7 +164,7 @@ public static int EstimatePingTimeFromLocalHost(ref SteamNetworkPingLocation_t r public static void ConvertPingLocationToString(ref SteamNetworkPingLocation_t location, out string pszBuf, int cchBufSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pszBuf2 = Marshal.AllocHGlobal(cchBufSize); - NativeMethods.ISteamNetworkingUtils_ConvertPingLocationToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref location, pszBuf2, cchBufSize); + NativeMethods.ISteamGameServerNetworkingUtils_ConvertPingLocationToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref location, pszBuf2, cchBufSize); pszBuf = InteropHelp.PtrToStringUTF8(pszBuf2); Marshal.FreeHGlobal(pszBuf2); } @@ -176,7 +176,7 @@ public static void ConvertPingLocationToString(ref SteamNetworkPingLocation_t lo public static bool ParsePingLocationString(string pszString, out SteamNetworkPingLocation_t result) { InteropHelp.TestIfAvailableGameServer(); using (var pszString2 = new InteropHelp.UTF8StringHandle(pszString)) { - return NativeMethods.ISteamNetworkingUtils_ParsePingLocationString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), pszString2, out result); + return NativeMethods.ISteamGameServerNetworkingUtils_ParsePingLocationString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), pszString2, out result); } } @@ -202,7 +202,7 @@ public static bool ParsePingLocationString(string pszString, out SteamNetworkPin /// public static bool CheckPingDataUpToDate(float flMaxAgeSeconds) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_CheckPingDataUpToDate(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), flMaxAgeSeconds); + return NativeMethods.ISteamGameServerNetworkingUtils_CheckPingDataUpToDate(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), flMaxAgeSeconds); } /// @@ -214,7 +214,7 @@ public static bool CheckPingDataUpToDate(float flMaxAgeSeconds) { /// public static int GetPingToDataCenter(SteamNetworkingPOPID popID, out SteamNetworkingPOPID pViaRelayPoP) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_GetPingToDataCenter(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), popID, out pViaRelayPoP); + return NativeMethods.ISteamGameServerNetworkingUtils_GetPingToDataCenter(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), popID, out pViaRelayPoP); } /// @@ -222,7 +222,7 @@ public static int GetPingToDataCenter(SteamNetworkingPOPID popID, out SteamNetwo /// public static int GetDirectPingToPOP(SteamNetworkingPOPID popID) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_GetDirectPingToPOP(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), popID); + return NativeMethods.ISteamGameServerNetworkingUtils_GetDirectPingToPOP(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), popID); } /// @@ -230,7 +230,7 @@ public static int GetDirectPingToPOP(SteamNetworkingPOPID popID) { /// public static int GetPOPCount() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_GetPOPCount(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); + return NativeMethods.ISteamGameServerNetworkingUtils_GetPOPCount(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); } /// @@ -239,7 +239,7 @@ public static int GetPOPCount() { /// public static int GetPOPList(out SteamNetworkingPOPID list, int nListSz) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_GetPOPList(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out list, nListSz); + return NativeMethods.ISteamGameServerNetworkingUtils_GetPOPList(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out list, nListSz); } /// @@ -264,7 +264,7 @@ public static int GetPOPList(out SteamNetworkingPOPID list, int nListSz) { /// public static SteamNetworkingMicroseconds GetLocalTimestamp() { InteropHelp.TestIfAvailableGameServer(); - return (SteamNetworkingMicroseconds)NativeMethods.ISteamNetworkingUtils_GetLocalTimestamp(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); + return (SteamNetworkingMicroseconds)NativeMethods.ISteamGameServerNetworkingUtils_GetLocalTimestamp(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); } /// @@ -294,7 +294,7 @@ public static SteamNetworkingMicroseconds GetLocalTimestamp() { /// public static void SetDebugOutputFunction(ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamNetworkingUtils_SetDebugOutputFunction(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eDetailLevel, pfnFunc); + NativeMethods.ISteamGameServerNetworkingUtils_SetDebugOutputFunction(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eDetailLevel, pfnFunc); } /// @@ -306,12 +306,12 @@ public static void SetDebugOutputFunction(ESteamNetworkingSocketsDebugOutputType /// public static bool IsFakeIPv4(uint nIPv4) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_IsFakeIPv4(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), nIPv4); + return NativeMethods.ISteamGameServerNetworkingUtils_IsFakeIPv4(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), nIPv4); } public static ESteamNetworkingFakeIPType GetIPv4FakeIPType(uint nIPv4) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_GetIPv4FakeIPType(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), nIPv4); + return NativeMethods.ISteamGameServerNetworkingUtils_GetIPv4FakeIPType(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), nIPv4); } /// @@ -330,7 +330,7 @@ public static ESteamNetworkingFakeIPType GetIPv4FakeIPType(uint nIPv4) { /// public static EResult GetRealIdentityForFakeIP(ref SteamNetworkingIPAddr fakeIP, out SteamNetworkingIdentity pOutRealIdentity) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_GetRealIdentityForFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref fakeIP, out pOutRealIdentity); + return NativeMethods.ISteamGameServerNetworkingUtils_GetRealIdentityForFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref fakeIP, out pOutRealIdentity); } /// @@ -353,7 +353,7 @@ public static EResult GetRealIdentityForFakeIP(ref SteamNetworkingIPAddr fakeIP, /// public static bool SetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, ESteamNetworkingConfigDataType eDataType, IntPtr pArg) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_SetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, eDataType, pArg); + return NativeMethods.ISteamGameServerNetworkingUtils_SetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, eDataType, pArg); } /// @@ -371,7 +371,7 @@ public static bool SetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetw /// public static ESteamNetworkingGetConfigValueResult GetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, out ESteamNetworkingConfigDataType pOutDataType, IntPtr pResult, ref ulong cbResult) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_GetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, out pOutDataType, pResult, ref cbResult); + return NativeMethods.ISteamGameServerNetworkingUtils_GetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, out pOutDataType, pResult, ref cbResult); } /// @@ -381,7 +381,7 @@ public static ESteamNetworkingGetConfigValueResult GetConfigValue(ESteamNetworki /// public static string GetConfigValueInfo(ESteamNetworkingConfigValue eValue, out ESteamNetworkingConfigDataType pOutDataType, out ESteamNetworkingConfigScope pOutScope) { InteropHelp.TestIfAvailableGameServer(); - return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamNetworkingUtils_GetConfigValueInfo(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, out pOutDataType, out pOutScope)); + return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamGameServerNetworkingUtils_GetConfigValueInfo(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, out pOutDataType, out pOutScope)); } /// @@ -396,7 +396,7 @@ public static string GetConfigValueInfo(ESteamNetworkingConfigValue eValue, out /// public static ESteamNetworkingConfigValue IterateGenericEditableConfigValues(ESteamNetworkingConfigValue eCurrent, bool bEnumerateDevVars) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_IterateGenericEditableConfigValues(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eCurrent, bEnumerateDevVars); + return NativeMethods.ISteamGameServerNetworkingUtils_IterateGenericEditableConfigValues(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eCurrent, bEnumerateDevVars); } /// @@ -406,7 +406,7 @@ public static ESteamNetworkingConfigValue IterateGenericEditableConfigValues(ESt public static void SteamNetworkingIPAddr_ToString(ref SteamNetworkingIPAddr addr, out string buf, uint cbBuf, bool bWithPort) { InteropHelp.TestIfAvailableGameServer(); IntPtr buf2 = Marshal.AllocHGlobal((int)cbBuf); - NativeMethods.ISteamNetworkingUtils_SteamNetworkingIPAddr_ToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref addr, buf2, cbBuf, bWithPort); + NativeMethods.ISteamGameServerNetworkingUtils_SteamNetworkingIPAddr_ToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref addr, buf2, cbBuf, bWithPort); buf = InteropHelp.PtrToStringUTF8(buf2); Marshal.FreeHGlobal(buf2); } @@ -414,19 +414,19 @@ public static void SteamNetworkingIPAddr_ToString(ref SteamNetworkingIPAddr addr public static bool SteamNetworkingIPAddr_ParseString(out SteamNetworkingIPAddr pAddr, string pszStr) { InteropHelp.TestIfAvailableGameServer(); using (var pszStr2 = new InteropHelp.UTF8StringHandle(pszStr)) { - return NativeMethods.ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pAddr, pszStr2); + return NativeMethods.ISteamGameServerNetworkingUtils_SteamNetworkingIPAddr_ParseString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pAddr, pszStr2); } } public static ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType(ref SteamNetworkingIPAddr addr) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamNetworkingUtils_SteamNetworkingIPAddr_GetFakeIPType(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref addr); + return NativeMethods.ISteamGameServerNetworkingUtils_SteamNetworkingIPAddr_GetFakeIPType(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref addr); } public static void SteamNetworkingIdentity_ToString(ref SteamNetworkingIdentity identity, out string buf, uint cbBuf) { InteropHelp.TestIfAvailableGameServer(); IntPtr buf2 = Marshal.AllocHGlobal((int)cbBuf); - NativeMethods.ISteamNetworkingUtils_SteamNetworkingIdentity_ToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref identity, buf2, cbBuf); + NativeMethods.ISteamGameServerNetworkingUtils_SteamNetworkingIdentity_ToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref identity, buf2, cbBuf); buf = InteropHelp.PtrToStringUTF8(buf2); Marshal.FreeHGlobal(buf2); } @@ -434,7 +434,7 @@ public static void SteamNetworkingIdentity_ToString(ref SteamNetworkingIdentity public static bool SteamNetworkingIdentity_ParseString(out SteamNetworkingIdentity pIdentity, string pszStr) { InteropHelp.TestIfAvailableGameServer(); using (var pszStr2 = new InteropHelp.UTF8StringHandle(pszStr)) { - return NativeMethods.ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pIdentity, pszStr2); + return NativeMethods.ISteamGameServerNetworkingUtils_SteamNetworkingIdentity_ParseString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pIdentity, pszStr2); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs index e9638e55..ddc8521c 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs @@ -21,7 +21,7 @@ public static class SteamGameServerUGC { /// public static UGCQueryHandle_t CreateQueryUserUGCRequest(AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage) { InteropHelp.TestIfAvailableGameServer(); - return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryUserUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage); + return (UGCQueryHandle_t)NativeMethods.ISteamGameServerUGC_CreateQueryUserUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage); } /// @@ -29,7 +29,7 @@ public static UGCQueryHandle_t CreateQueryUserUGCRequest(AccountID_t unAccountID /// public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage) { InteropHelp.TestIfAvailableGameServer(); - return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryAllUGCRequestPage(CSteamGameServerAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage); + return (UGCQueryHandle_t)NativeMethods.ISteamGameServerUGC_CreateQueryAllUGCRequestPage(CSteamGameServerAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage); } /// @@ -38,7 +38,7 @@ public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EU public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, string pchCursor = null) { InteropHelp.TestIfAvailableGameServer(); using (var pchCursor2 = new InteropHelp.UTF8StringHandle(pchCursor)) { - return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryAllUGCRequestCursor(CSteamGameServerAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, pchCursor2); + return (UGCQueryHandle_t)NativeMethods.ISteamGameServerUGC_CreateQueryAllUGCRequestCursor(CSteamGameServerAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, pchCursor2); } } @@ -47,7 +47,7 @@ public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EU /// public static UGCQueryHandle_t CreateQueryUGCDetailsRequest(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableGameServer(); - return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryUGCDetailsRequest(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); + return (UGCQueryHandle_t)NativeMethods.ISteamGameServerUGC_CreateQueryUGCDetailsRequest(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); } /// @@ -55,7 +55,7 @@ public static UGCQueryHandle_t CreateQueryUGCDetailsRequest(PublishedFileId_t[] /// public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_SendQueryUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), handle); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_SendQueryUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), handle); } /// @@ -63,18 +63,24 @@ public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) { /// public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, out pDetails); + bool anyCpuResult; + if (!Packsize.IsLargePack) { + anyCpuResult = NativeMethods.ISteamGameServerUGC_GetQueryUGCResult(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, out pDetails); + } else { + anyCpuResult = NativeMethods.ISteamGameServerUGC_GetQueryUGCResult(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, out pDetails_lp); + } + return anyCpuResult; } public static uint GetQueryUGCNumTags(UGCQueryHandle_t handle, uint index) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_GetQueryUGCNumTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); + return NativeMethods.ISteamGameServerUGC_GetQueryUGCNumTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); } public static bool GetQueryUGCTag(UGCQueryHandle_t handle, uint index, uint indexTag, out string pchValue, uint cchValueSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchValue2 = Marshal.AllocHGlobal((int)cchValueSize); - bool ret = NativeMethods.ISteamUGC_GetQueryUGCTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, indexTag, pchValue2, cchValueSize); + bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, indexTag, pchValue2, cchValueSize); pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null; Marshal.FreeHGlobal(pchValue2); return ret; @@ -83,7 +89,7 @@ public static bool GetQueryUGCTag(UGCQueryHandle_t handle, uint index, uint inde public static bool GetQueryUGCTagDisplayName(UGCQueryHandle_t handle, uint index, uint indexTag, out string pchValue, uint cchValueSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchValue2 = Marshal.AllocHGlobal((int)cchValueSize); - bool ret = NativeMethods.ISteamUGC_GetQueryUGCTagDisplayName(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, indexTag, pchValue2, cchValueSize); + bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCTagDisplayName(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, indexTag, pchValue2, cchValueSize); pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null; Marshal.FreeHGlobal(pchValue2); return ret; @@ -92,7 +98,7 @@ public static bool GetQueryUGCTagDisplayName(UGCQueryHandle_t handle, uint index public static bool GetQueryUGCPreviewURL(UGCQueryHandle_t handle, uint index, out string pchURL, uint cchURLSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchURL2 = Marshal.AllocHGlobal((int)cchURLSize); - bool ret = NativeMethods.ISteamUGC_GetQueryUGCPreviewURL(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchURL2, cchURLSize); + bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCPreviewURL(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchURL2, cchURLSize); pchURL = ret ? InteropHelp.PtrToStringUTF8(pchURL2) : null; Marshal.FreeHGlobal(pchURL2); return ret; @@ -101,7 +107,7 @@ public static bool GetQueryUGCPreviewURL(UGCQueryHandle_t handle, uint index, ou public static bool GetQueryUGCMetadata(UGCQueryHandle_t handle, uint index, out string pchMetadata, uint cchMetadatasize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchMetadata2 = Marshal.AllocHGlobal((int)cchMetadatasize); - bool ret = NativeMethods.ISteamUGC_GetQueryUGCMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchMetadata2, cchMetadatasize); + bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchMetadata2, cchMetadatasize); pchMetadata = ret ? InteropHelp.PtrToStringUTF8(pchMetadata2) : null; Marshal.FreeHGlobal(pchMetadata2); return ret; @@ -109,24 +115,24 @@ public static bool GetQueryUGCMetadata(UGCQueryHandle_t handle, uint index, out public static bool GetQueryUGCChildren(UGCQueryHandle_t handle, uint index, PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_GetQueryUGCChildren(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pvecPublishedFileID, cMaxEntries); + return NativeMethods.ISteamGameServerUGC_GetQueryUGCChildren(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pvecPublishedFileID, cMaxEntries); } public static bool GetQueryUGCStatistic(UGCQueryHandle_t handle, uint index, EItemStatistic eStatType, out ulong pStatValue) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_GetQueryUGCStatistic(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, eStatType, out pStatValue); + return NativeMethods.ISteamGameServerUGC_GetQueryUGCStatistic(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, eStatType, out pStatValue); } public static uint GetQueryUGCNumAdditionalPreviews(UGCQueryHandle_t handle, uint index) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_GetQueryUGCNumAdditionalPreviews(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); + return NativeMethods.ISteamGameServerUGC_GetQueryUGCNumAdditionalPreviews(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); } public static bool GetQueryUGCAdditionalPreview(UGCQueryHandle_t handle, uint index, uint previewIndex, out string pchURLOrVideoID, uint cchURLSize, out string pchOriginalFileName, uint cchOriginalFileNameSize, out EItemPreviewType pPreviewType) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchURLOrVideoID2 = Marshal.AllocHGlobal((int)cchURLSize); IntPtr pchOriginalFileName2 = Marshal.AllocHGlobal((int)cchOriginalFileNameSize); - bool ret = NativeMethods.ISteamUGC_GetQueryUGCAdditionalPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, previewIndex, pchURLOrVideoID2, cchURLSize, pchOriginalFileName2, cchOriginalFileNameSize, out pPreviewType); + bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCAdditionalPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, previewIndex, pchURLOrVideoID2, cchURLSize, pchOriginalFileName2, cchOriginalFileNameSize, out pPreviewType); pchURLOrVideoID = ret ? InteropHelp.PtrToStringUTF8(pchURLOrVideoID2) : null; Marshal.FreeHGlobal(pchURLOrVideoID2); pchOriginalFileName = ret ? InteropHelp.PtrToStringUTF8(pchOriginalFileName2) : null; @@ -136,14 +142,14 @@ public static bool GetQueryUGCAdditionalPreview(UGCQueryHandle_t handle, uint in public static uint GetQueryUGCNumKeyValueTags(UGCQueryHandle_t handle, uint index) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_GetQueryUGCNumKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); + return NativeMethods.ISteamGameServerUGC_GetQueryUGCNumKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); } public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, out string pchKey, uint cchKeySize, out string pchValue, uint cchValueSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchKey2 = Marshal.AllocHGlobal((int)cchKeySize); IntPtr pchValue2 = Marshal.AllocHGlobal((int)cchValueSize); - bool ret = NativeMethods.ISteamUGC_GetQueryUGCKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, keyValueTagIndex, pchKey2, cchKeySize, pchValue2, cchValueSize); + bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, keyValueTagIndex, pchKey2, cchKeySize, pchValue2, cchValueSize); pchKey = ret ? InteropHelp.PtrToStringUTF8(pchKey2) : null; Marshal.FreeHGlobal(pchKey2); pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null; @@ -158,7 +164,7 @@ public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, s InteropHelp.TestIfAvailableGameServer(); IntPtr pchValue2 = Marshal.AllocHGlobal((int)cchValueSize); using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) { - bool ret = NativeMethods.ISteamUGC_GetQueryFirstUGCKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchKey2, pchValue2, cchValueSize); + bool ret = NativeMethods.ISteamGameServerUGC_GetQueryFirstUGCKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchKey2, pchValue2, cchValueSize); pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null; Marshal.FreeHGlobal(pchValue2); return ret; @@ -170,14 +176,14 @@ public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, s /// public static uint GetNumSupportedGameVersions(UGCQueryHandle_t handle, uint index) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_GetNumSupportedGameVersions(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); + return NativeMethods.ISteamGameServerUGC_GetNumSupportedGameVersions(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); } public static bool GetSupportedGameVersionData(UGCQueryHandle_t handle, uint index, uint versionIndex, out string pchGameBranchMin, out string pchGameBranchMax, uint cchGameBranchSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchGameBranchMin2 = Marshal.AllocHGlobal((int)cchGameBranchSize); IntPtr pchGameBranchMax2 = Marshal.AllocHGlobal((int)cchGameBranchSize); - bool ret = NativeMethods.ISteamUGC_GetSupportedGameVersionData(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, versionIndex, pchGameBranchMin2, pchGameBranchMax2, cchGameBranchSize); + bool ret = NativeMethods.ISteamGameServerUGC_GetSupportedGameVersionData(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, versionIndex, pchGameBranchMin2, pchGameBranchMax2, cchGameBranchSize); pchGameBranchMin = ret ? InteropHelp.PtrToStringUTF8(pchGameBranchMin2) : null; Marshal.FreeHGlobal(pchGameBranchMin2); pchGameBranchMax = ret ? InteropHelp.PtrToStringUTF8(pchGameBranchMax2) : null; @@ -190,7 +196,7 @@ public static uint GetQueryUGCContentDescriptors(UGCQueryHandle_t handle, uint i if (pvecDescriptors != null && pvecDescriptors.Length != cMaxEntries) { throw new System.ArgumentException("pvecDescriptors must be the same size as cMaxEntries!"); } - return NativeMethods.ISteamUGC_GetQueryUGCContentDescriptors(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pvecDescriptors, cMaxEntries); + return NativeMethods.ISteamGameServerUGC_GetQueryUGCContentDescriptors(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pvecDescriptors, cMaxEntries); } /// @@ -198,7 +204,7 @@ public static uint GetQueryUGCContentDescriptors(UGCQueryHandle_t handle, uint i /// public static bool ReleaseQueryUGCRequest(UGCQueryHandle_t handle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_ReleaseQueryUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), handle); + return NativeMethods.ISteamGameServerUGC_ReleaseQueryUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), handle); } /// @@ -207,7 +213,7 @@ public static bool ReleaseQueryUGCRequest(UGCQueryHandle_t handle) { public static bool AddRequiredTag(UGCQueryHandle_t handle, string pTagName) { InteropHelp.TestIfAvailableGameServer(); using (var pTagName2 = new InteropHelp.UTF8StringHandle(pTagName)) { - return NativeMethods.ISteamUGC_AddRequiredTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pTagName2); + return NativeMethods.ISteamGameServerUGC_AddRequiredTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pTagName2); } } @@ -216,66 +222,66 @@ public static bool AddRequiredTag(UGCQueryHandle_t handle, string pTagName) { /// public static bool AddRequiredTagGroup(UGCQueryHandle_t handle, System.Collections.Generic.IList pTagGroups) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_AddRequiredTagGroup(CSteamGameServerAPIContext.GetSteamUGC(), handle, new InteropHelp.SteamParamStringArray(pTagGroups)); + return NativeMethods.ISteamGameServerUGC_AddRequiredTagGroup(CSteamGameServerAPIContext.GetSteamUGC(), handle, new InteropHelp.SteamParamStringArray(pTagGroups)); } public static bool AddExcludedTag(UGCQueryHandle_t handle, string pTagName) { InteropHelp.TestIfAvailableGameServer(); using (var pTagName2 = new InteropHelp.UTF8StringHandle(pTagName)) { - return NativeMethods.ISteamUGC_AddExcludedTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pTagName2); + return NativeMethods.ISteamGameServerUGC_AddExcludedTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pTagName2); } } public static bool SetReturnOnlyIDs(UGCQueryHandle_t handle, bool bReturnOnlyIDs) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetReturnOnlyIDs(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnOnlyIDs); + return NativeMethods.ISteamGameServerUGC_SetReturnOnlyIDs(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnOnlyIDs); } public static bool SetReturnKeyValueTags(UGCQueryHandle_t handle, bool bReturnKeyValueTags) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetReturnKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnKeyValueTags); + return NativeMethods.ISteamGameServerUGC_SetReturnKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnKeyValueTags); } public static bool SetReturnLongDescription(UGCQueryHandle_t handle, bool bReturnLongDescription) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetReturnLongDescription(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnLongDescription); + return NativeMethods.ISteamGameServerUGC_SetReturnLongDescription(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnLongDescription); } public static bool SetReturnMetadata(UGCQueryHandle_t handle, bool bReturnMetadata) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetReturnMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnMetadata); + return NativeMethods.ISteamGameServerUGC_SetReturnMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnMetadata); } public static bool SetReturnChildren(UGCQueryHandle_t handle, bool bReturnChildren) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetReturnChildren(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnChildren); + return NativeMethods.ISteamGameServerUGC_SetReturnChildren(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnChildren); } public static bool SetReturnAdditionalPreviews(UGCQueryHandle_t handle, bool bReturnAdditionalPreviews) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetReturnAdditionalPreviews(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnAdditionalPreviews); + return NativeMethods.ISteamGameServerUGC_SetReturnAdditionalPreviews(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnAdditionalPreviews); } public static bool SetReturnTotalOnly(UGCQueryHandle_t handle, bool bReturnTotalOnly) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetReturnTotalOnly(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnTotalOnly); + return NativeMethods.ISteamGameServerUGC_SetReturnTotalOnly(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnTotalOnly); } public static bool SetReturnPlaytimeStats(UGCQueryHandle_t handle, uint unDays) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetReturnPlaytimeStats(CSteamGameServerAPIContext.GetSteamUGC(), handle, unDays); + return NativeMethods.ISteamGameServerUGC_SetReturnPlaytimeStats(CSteamGameServerAPIContext.GetSteamUGC(), handle, unDays); } public static bool SetLanguage(UGCQueryHandle_t handle, string pchLanguage) { InteropHelp.TestIfAvailableGameServer(); using (var pchLanguage2 = new InteropHelp.UTF8StringHandle(pchLanguage)) { - return NativeMethods.ISteamUGC_SetLanguage(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchLanguage2); + return NativeMethods.ISteamGameServerUGC_SetLanguage(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchLanguage2); } } public static bool SetAllowCachedResponse(UGCQueryHandle_t handle, uint unMaxAgeSeconds) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetAllowCachedResponse(CSteamGameServerAPIContext.GetSteamUGC(), handle, unMaxAgeSeconds); + return NativeMethods.ISteamGameServerUGC_SetAllowCachedResponse(CSteamGameServerAPIContext.GetSteamUGC(), handle, unMaxAgeSeconds); } /// @@ -283,7 +289,7 @@ public static bool SetAllowCachedResponse(UGCQueryHandle_t handle, uint unMaxAge /// public static bool SetAdminQuery(UGCUpdateHandle_t handle, bool bAdminQuery) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetAdminQuery(CSteamGameServerAPIContext.GetSteamUGC(), handle, bAdminQuery); + return NativeMethods.ISteamGameServerUGC_SetAdminQuery(CSteamGameServerAPIContext.GetSteamUGC(), handle, bAdminQuery); } /// @@ -292,7 +298,7 @@ public static bool SetAdminQuery(UGCUpdateHandle_t handle, bool bAdminQuery) { public static bool SetCloudFileNameFilter(UGCQueryHandle_t handle, string pMatchCloudFileName) { InteropHelp.TestIfAvailableGameServer(); using (var pMatchCloudFileName2 = new InteropHelp.UTF8StringHandle(pMatchCloudFileName)) { - return NativeMethods.ISteamUGC_SetCloudFileNameFilter(CSteamGameServerAPIContext.GetSteamUGC(), handle, pMatchCloudFileName2); + return NativeMethods.ISteamGameServerUGC_SetCloudFileNameFilter(CSteamGameServerAPIContext.GetSteamUGC(), handle, pMatchCloudFileName2); } } @@ -301,36 +307,36 @@ public static bool SetCloudFileNameFilter(UGCQueryHandle_t handle, string pMatch /// public static bool SetMatchAnyTag(UGCQueryHandle_t handle, bool bMatchAnyTag) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetMatchAnyTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, bMatchAnyTag); + return NativeMethods.ISteamGameServerUGC_SetMatchAnyTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, bMatchAnyTag); } public static bool SetSearchText(UGCQueryHandle_t handle, string pSearchText) { InteropHelp.TestIfAvailableGameServer(); using (var pSearchText2 = new InteropHelp.UTF8StringHandle(pSearchText)) { - return NativeMethods.ISteamUGC_SetSearchText(CSteamGameServerAPIContext.GetSteamUGC(), handle, pSearchText2); + return NativeMethods.ISteamGameServerUGC_SetSearchText(CSteamGameServerAPIContext.GetSteamUGC(), handle, pSearchText2); } } public static bool SetRankedByTrendDays(UGCQueryHandle_t handle, uint unDays) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetRankedByTrendDays(CSteamGameServerAPIContext.GetSteamUGC(), handle, unDays); + return NativeMethods.ISteamGameServerUGC_SetRankedByTrendDays(CSteamGameServerAPIContext.GetSteamUGC(), handle, unDays); } public static bool SetTimeCreatedDateRange(UGCQueryHandle_t handle, uint rtStart, uint rtEnd) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetTimeCreatedDateRange(CSteamGameServerAPIContext.GetSteamUGC(), handle, rtStart, rtEnd); + return NativeMethods.ISteamGameServerUGC_SetTimeCreatedDateRange(CSteamGameServerAPIContext.GetSteamUGC(), handle, rtStart, rtEnd); } public static bool SetTimeUpdatedDateRange(UGCQueryHandle_t handle, uint rtStart, uint rtEnd) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetTimeUpdatedDateRange(CSteamGameServerAPIContext.GetSteamUGC(), handle, rtStart, rtEnd); + return NativeMethods.ISteamGameServerUGC_SetTimeUpdatedDateRange(CSteamGameServerAPIContext.GetSteamUGC(), handle, rtStart, rtEnd); } public static bool AddRequiredKeyValueTag(UGCQueryHandle_t handle, string pKey, string pValue) { InteropHelp.TestIfAvailableGameServer(); using (var pKey2 = new InteropHelp.UTF8StringHandle(pKey)) using (var pValue2 = new InteropHelp.UTF8StringHandle(pValue)) { - return NativeMethods.ISteamUGC_AddRequiredKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pKey2, pValue2); + return NativeMethods.ISteamGameServerUGC_AddRequiredKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pKey2, pValue2); } } @@ -339,7 +345,7 @@ public static bool AddRequiredKeyValueTag(UGCQueryHandle_t handle, string pKey, /// public static SteamAPICall_t RequestUGCDetails(PublishedFileId_t nPublishedFileID, uint unMaxAgeSeconds) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_RequestUGCDetails(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, unMaxAgeSeconds); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_RequestUGCDetails(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, unMaxAgeSeconds); } /// @@ -348,7 +354,7 @@ public static SteamAPICall_t RequestUGCDetails(PublishedFileId_t nPublishedFileI /// public static SteamAPICall_t CreateItem(AppId_t nConsumerAppId, EWorkshopFileType eFileType) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_CreateItem(CSteamGameServerAPIContext.GetSteamUGC(), nConsumerAppId, eFileType); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_CreateItem(CSteamGameServerAPIContext.GetSteamUGC(), nConsumerAppId, eFileType); } /// @@ -356,7 +362,7 @@ public static SteamAPICall_t CreateItem(AppId_t nConsumerAppId, EWorkshopFileTyp /// public static UGCUpdateHandle_t StartItemUpdate(AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (UGCUpdateHandle_t)NativeMethods.ISteamUGC_StartItemUpdate(CSteamGameServerAPIContext.GetSteamUGC(), nConsumerAppId, nPublishedFileID); + return (UGCUpdateHandle_t)NativeMethods.ISteamGameServerUGC_StartItemUpdate(CSteamGameServerAPIContext.GetSteamUGC(), nConsumerAppId, nPublishedFileID); } /// @@ -365,7 +371,7 @@ public static UGCUpdateHandle_t StartItemUpdate(AppId_t nConsumerAppId, Publishe public static bool SetItemTitle(UGCUpdateHandle_t handle, string pchTitle) { InteropHelp.TestIfAvailableGameServer(); using (var pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle)) { - return NativeMethods.ISteamUGC_SetItemTitle(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchTitle2); + return NativeMethods.ISteamGameServerUGC_SetItemTitle(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchTitle2); } } @@ -375,7 +381,7 @@ public static bool SetItemTitle(UGCUpdateHandle_t handle, string pchTitle) { public static bool SetItemDescription(UGCUpdateHandle_t handle, string pchDescription) { InteropHelp.TestIfAvailableGameServer(); using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription)) { - return NativeMethods.ISteamUGC_SetItemDescription(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchDescription2); + return NativeMethods.ISteamGameServerUGC_SetItemDescription(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchDescription2); } } @@ -385,7 +391,7 @@ public static bool SetItemDescription(UGCUpdateHandle_t handle, string pchDescri public static bool SetItemUpdateLanguage(UGCUpdateHandle_t handle, string pchLanguage) { InteropHelp.TestIfAvailableGameServer(); using (var pchLanguage2 = new InteropHelp.UTF8StringHandle(pchLanguage)) { - return NativeMethods.ISteamUGC_SetItemUpdateLanguage(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchLanguage2); + return NativeMethods.ISteamGameServerUGC_SetItemUpdateLanguage(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchLanguage2); } } @@ -395,7 +401,7 @@ public static bool SetItemUpdateLanguage(UGCUpdateHandle_t handle, string pchLan public static bool SetItemMetadata(UGCUpdateHandle_t handle, string pchMetaData) { InteropHelp.TestIfAvailableGameServer(); using (var pchMetaData2 = new InteropHelp.UTF8StringHandle(pchMetaData)) { - return NativeMethods.ISteamUGC_SetItemMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchMetaData2); + return NativeMethods.ISteamGameServerUGC_SetItemMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchMetaData2); } } @@ -404,7 +410,7 @@ public static bool SetItemMetadata(UGCUpdateHandle_t handle, string pchMetaData) /// public static bool SetItemVisibility(UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetItemVisibility(CSteamGameServerAPIContext.GetSteamUGC(), handle, eVisibility); + return NativeMethods.ISteamGameServerUGC_SetItemVisibility(CSteamGameServerAPIContext.GetSteamUGC(), handle, eVisibility); } /// @@ -412,7 +418,7 @@ public static bool SetItemVisibility(UGCUpdateHandle_t handle, ERemoteStoragePub /// public static bool SetItemTags(UGCUpdateHandle_t updateHandle, System.Collections.Generic.IList pTags, bool bAllowAdminTags = false) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetItemTags(CSteamGameServerAPIContext.GetSteamUGC(), updateHandle, new InteropHelp.SteamParamStringArray(pTags), bAllowAdminTags); + return NativeMethods.ISteamGameServerUGC_SetItemTags(CSteamGameServerAPIContext.GetSteamUGC(), updateHandle, new InteropHelp.SteamParamStringArray(pTags), bAllowAdminTags); } /// @@ -421,7 +427,7 @@ public static bool SetItemTags(UGCUpdateHandle_t updateHandle, System.Collection public static bool SetItemContent(UGCUpdateHandle_t handle, string pszContentFolder) { InteropHelp.TestIfAvailableGameServer(); using (var pszContentFolder2 = new InteropHelp.UTF8StringHandle(pszContentFolder)) { - return NativeMethods.ISteamUGC_SetItemContent(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszContentFolder2); + return NativeMethods.ISteamGameServerUGC_SetItemContent(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszContentFolder2); } } @@ -431,7 +437,7 @@ public static bool SetItemContent(UGCUpdateHandle_t handle, string pszContentFol public static bool SetItemPreview(UGCUpdateHandle_t handle, string pszPreviewFile) { InteropHelp.TestIfAvailableGameServer(); using (var pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile)) { - return NativeMethods.ISteamUGC_SetItemPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszPreviewFile2); + return NativeMethods.ISteamGameServerUGC_SetItemPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszPreviewFile2); } } @@ -440,7 +446,7 @@ public static bool SetItemPreview(UGCUpdateHandle_t handle, string pszPreviewFil /// public static bool SetAllowLegacyUpload(UGCUpdateHandle_t handle, bool bAllowLegacyUpload) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetAllowLegacyUpload(CSteamGameServerAPIContext.GetSteamUGC(), handle, bAllowLegacyUpload); + return NativeMethods.ISteamGameServerUGC_SetAllowLegacyUpload(CSteamGameServerAPIContext.GetSteamUGC(), handle, bAllowLegacyUpload); } /// @@ -448,7 +454,7 @@ public static bool SetAllowLegacyUpload(UGCUpdateHandle_t handle, bool bAllowLeg /// public static bool RemoveAllItemKeyValueTags(UGCUpdateHandle_t handle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_RemoveAllItemKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle); + return NativeMethods.ISteamGameServerUGC_RemoveAllItemKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle); } /// @@ -457,7 +463,7 @@ public static bool RemoveAllItemKeyValueTags(UGCUpdateHandle_t handle) { public static bool RemoveItemKeyValueTags(UGCUpdateHandle_t handle, string pchKey) { InteropHelp.TestIfAvailableGameServer(); using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) { - return NativeMethods.ISteamUGC_RemoveItemKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchKey2); + return NativeMethods.ISteamGameServerUGC_RemoveItemKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchKey2); } } @@ -468,7 +474,7 @@ public static bool AddItemKeyValueTag(UGCUpdateHandle_t handle, string pchKey, s InteropHelp.TestIfAvailableGameServer(); using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) using (var pchValue2 = new InteropHelp.UTF8StringHandle(pchValue)) { - return NativeMethods.ISteamUGC_AddItemKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchKey2, pchValue2); + return NativeMethods.ISteamGameServerUGC_AddItemKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchKey2, pchValue2); } } @@ -478,7 +484,7 @@ public static bool AddItemKeyValueTag(UGCUpdateHandle_t handle, string pchKey, s public static bool AddItemPreviewFile(UGCUpdateHandle_t handle, string pszPreviewFile, EItemPreviewType type) { InteropHelp.TestIfAvailableGameServer(); using (var pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile)) { - return NativeMethods.ISteamUGC_AddItemPreviewFile(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszPreviewFile2, type); + return NativeMethods.ISteamGameServerUGC_AddItemPreviewFile(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszPreviewFile2, type); } } @@ -488,7 +494,7 @@ public static bool AddItemPreviewFile(UGCUpdateHandle_t handle, string pszPrevie public static bool AddItemPreviewVideo(UGCUpdateHandle_t handle, string pszVideoID) { InteropHelp.TestIfAvailableGameServer(); using (var pszVideoID2 = new InteropHelp.UTF8StringHandle(pszVideoID)) { - return NativeMethods.ISteamUGC_AddItemPreviewVideo(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszVideoID2); + return NativeMethods.ISteamGameServerUGC_AddItemPreviewVideo(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszVideoID2); } } @@ -498,7 +504,7 @@ public static bool AddItemPreviewVideo(UGCUpdateHandle_t handle, string pszVideo public static bool UpdateItemPreviewFile(UGCUpdateHandle_t handle, uint index, string pszPreviewFile) { InteropHelp.TestIfAvailableGameServer(); using (var pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile)) { - return NativeMethods.ISteamUGC_UpdateItemPreviewFile(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pszPreviewFile2); + return NativeMethods.ISteamGameServerUGC_UpdateItemPreviewFile(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pszPreviewFile2); } } @@ -508,7 +514,7 @@ public static bool UpdateItemPreviewFile(UGCUpdateHandle_t handle, uint index, s public static bool UpdateItemPreviewVideo(UGCUpdateHandle_t handle, uint index, string pszVideoID) { InteropHelp.TestIfAvailableGameServer(); using (var pszVideoID2 = new InteropHelp.UTF8StringHandle(pszVideoID)) { - return NativeMethods.ISteamUGC_UpdateItemPreviewVideo(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pszVideoID2); + return NativeMethods.ISteamGameServerUGC_UpdateItemPreviewVideo(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pszVideoID2); } } @@ -517,17 +523,17 @@ public static bool UpdateItemPreviewVideo(UGCUpdateHandle_t handle, uint index, /// public static bool RemoveItemPreview(UGCUpdateHandle_t handle, uint index) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_RemoveItemPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); + return NativeMethods.ISteamGameServerUGC_RemoveItemPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); } public static bool AddContentDescriptor(UGCUpdateHandle_t handle, EUGCContentDescriptorID descid) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_AddContentDescriptor(CSteamGameServerAPIContext.GetSteamUGC(), handle, descid); + return NativeMethods.ISteamGameServerUGC_AddContentDescriptor(CSteamGameServerAPIContext.GetSteamUGC(), handle, descid); } public static bool RemoveContentDescriptor(UGCUpdateHandle_t handle, EUGCContentDescriptorID descid) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_RemoveContentDescriptor(CSteamGameServerAPIContext.GetSteamUGC(), handle, descid); + return NativeMethods.ISteamGameServerUGC_RemoveContentDescriptor(CSteamGameServerAPIContext.GetSteamUGC(), handle, descid); } /// @@ -537,7 +543,7 @@ public static bool SetRequiredGameVersions(UGCUpdateHandle_t handle, string pszG InteropHelp.TestIfAvailableGameServer(); using (var pszGameBranchMin2 = new InteropHelp.UTF8StringHandle(pszGameBranchMin)) using (var pszGameBranchMax2 = new InteropHelp.UTF8StringHandle(pszGameBranchMax)) { - return NativeMethods.ISteamUGC_SetRequiredGameVersions(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszGameBranchMin2, pszGameBranchMax2); + return NativeMethods.ISteamGameServerUGC_SetRequiredGameVersions(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszGameBranchMin2, pszGameBranchMax2); } } @@ -547,13 +553,13 @@ public static bool SetRequiredGameVersions(UGCUpdateHandle_t handle, string pszG public static SteamAPICall_t SubmitItemUpdate(UGCUpdateHandle_t handle, string pchChangeNote) { InteropHelp.TestIfAvailableGameServer(); using (var pchChangeNote2 = new InteropHelp.UTF8StringHandle(pchChangeNote)) { - return (SteamAPICall_t)NativeMethods.ISteamUGC_SubmitItemUpdate(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchChangeNote2); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_SubmitItemUpdate(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchChangeNote2); } } public static EItemUpdateStatus GetItemUpdateProgress(UGCUpdateHandle_t handle, out ulong punBytesProcessed, out ulong punBytesTotal) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_GetItemUpdateProgress(CSteamGameServerAPIContext.GetSteamUGC(), handle, out punBytesProcessed, out punBytesTotal); + return NativeMethods.ISteamGameServerUGC_GetItemUpdateProgress(CSteamGameServerAPIContext.GetSteamUGC(), handle, out punBytesProcessed, out punBytesTotal); } /// @@ -561,22 +567,22 @@ public static EItemUpdateStatus GetItemUpdateProgress(UGCUpdateHandle_t handle, /// public static SteamAPICall_t SetUserItemVote(PublishedFileId_t nPublishedFileID, bool bVoteUp) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_SetUserItemVote(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, bVoteUp); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_SetUserItemVote(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, bVoteUp); } public static SteamAPICall_t GetUserItemVote(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_GetUserItemVote(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_GetUserItemVote(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } public static SteamAPICall_t AddItemToFavorites(AppId_t nAppId, PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_AddItemToFavorites(CSteamGameServerAPIContext.GetSteamUGC(), nAppId, nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_AddItemToFavorites(CSteamGameServerAPIContext.GetSteamUGC(), nAppId, nPublishedFileID); } public static SteamAPICall_t RemoveItemFromFavorites(AppId_t nAppId, PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveItemFromFavorites(CSteamGameServerAPIContext.GetSteamUGC(), nAppId, nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_RemoveItemFromFavorites(CSteamGameServerAPIContext.GetSteamUGC(), nAppId, nPublishedFileID); } /// @@ -584,7 +590,7 @@ public static SteamAPICall_t RemoveItemFromFavorites(AppId_t nAppId, PublishedFi /// public static SteamAPICall_t SubscribeItem(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_SubscribeItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_SubscribeItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } /// @@ -592,7 +598,7 @@ public static SteamAPICall_t SubscribeItem(PublishedFileId_t nPublishedFileID) { /// public static SteamAPICall_t UnsubscribeItem(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_UnsubscribeItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_UnsubscribeItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } /// @@ -600,7 +606,7 @@ public static SteamAPICall_t UnsubscribeItem(PublishedFileId_t nPublishedFileID) /// public static uint GetNumSubscribedItems(bool bIncludeLocallyDisabled = false) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_GetNumSubscribedItems(CSteamGameServerAPIContext.GetSteamUGC(), bIncludeLocallyDisabled); + return NativeMethods.ISteamGameServerUGC_GetNumSubscribedItems(CSteamGameServerAPIContext.GetSteamUGC(), bIncludeLocallyDisabled); } /// @@ -608,7 +614,7 @@ public static uint GetNumSubscribedItems(bool bIncludeLocallyDisabled = false) { /// public static uint GetSubscribedItems(PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries, bool bIncludeLocallyDisabled = false) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_GetSubscribedItems(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, cMaxEntries, bIncludeLocallyDisabled); + return NativeMethods.ISteamGameServerUGC_GetSubscribedItems(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, cMaxEntries, bIncludeLocallyDisabled); } /// @@ -616,7 +622,7 @@ public static uint GetSubscribedItems(PublishedFileId_t[] pvecPublishedFileID, u /// public static uint GetItemState(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_GetItemState(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); + return NativeMethods.ISteamGameServerUGC_GetItemState(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } /// @@ -626,7 +632,7 @@ public static uint GetItemState(PublishedFileId_t nPublishedFileID) { public static bool GetItemInstallInfo(PublishedFileId_t nPublishedFileID, out ulong punSizeOnDisk, out string pchFolder, uint cchFolderSize, out uint punTimeStamp) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchFolder2 = Marshal.AllocHGlobal((int)cchFolderSize); - bool ret = NativeMethods.ISteamUGC_GetItemInstallInfo(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, out punSizeOnDisk, pchFolder2, cchFolderSize, out punTimeStamp); + bool ret = NativeMethods.ISteamGameServerUGC_GetItemInstallInfo(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, out punSizeOnDisk, pchFolder2, cchFolderSize, out punTimeStamp); pchFolder = ret ? InteropHelp.PtrToStringUTF8(pchFolder2) : null; Marshal.FreeHGlobal(pchFolder2); return ret; @@ -637,7 +643,7 @@ public static bool GetItemInstallInfo(PublishedFileId_t nPublishedFileID, out ul /// public static bool GetItemDownloadInfo(PublishedFileId_t nPublishedFileID, out ulong punBytesDownloaded, out ulong punBytesTotal) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_GetItemDownloadInfo(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, out punBytesDownloaded, out punBytesTotal); + return NativeMethods.ISteamGameServerUGC_GetItemDownloadInfo(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, out punBytesDownloaded, out punBytesTotal); } /// @@ -647,7 +653,7 @@ public static bool GetItemDownloadInfo(PublishedFileId_t nPublishedFileID, out u /// public static bool DownloadItem(PublishedFileId_t nPublishedFileID, bool bHighPriority) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_DownloadItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, bHighPriority); + return NativeMethods.ISteamGameServerUGC_DownloadItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, bHighPriority); } /// @@ -657,7 +663,7 @@ public static bool DownloadItem(PublishedFileId_t nPublishedFileID, bool bHighPr public static bool BInitWorkshopForGameServer(DepotId_t unWorkshopDepotID, string pszFolder) { InteropHelp.TestIfAvailableGameServer(); using (var pszFolder2 = new InteropHelp.UTF8StringHandle(pszFolder)) { - return NativeMethods.ISteamUGC_BInitWorkshopForGameServer(CSteamGameServerAPIContext.GetSteamUGC(), unWorkshopDepotID, pszFolder2); + return NativeMethods.ISteamGameServerUGC_BInitWorkshopForGameServer(CSteamGameServerAPIContext.GetSteamUGC(), unWorkshopDepotID, pszFolder2); } } @@ -666,7 +672,7 @@ public static bool BInitWorkshopForGameServer(DepotId_t unWorkshopDepotID, strin /// public static void SuspendDownloads(bool bSuspend) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamUGC_SuspendDownloads(CSteamGameServerAPIContext.GetSteamUGC(), bSuspend); + NativeMethods.ISteamGameServerUGC_SuspendDownloads(CSteamGameServerAPIContext.GetSteamUGC(), bSuspend); } /// @@ -674,17 +680,17 @@ public static void SuspendDownloads(bool bSuspend) { /// public static SteamAPICall_t StartPlaytimeTracking(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_StartPlaytimeTracking(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_StartPlaytimeTracking(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); } public static SteamAPICall_t StopPlaytimeTracking(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_StopPlaytimeTracking(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_StopPlaytimeTracking(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); } public static SteamAPICall_t StopPlaytimeTrackingForAllItems() { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_StopPlaytimeTrackingForAllItems(CSteamGameServerAPIContext.GetSteamUGC()); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_StopPlaytimeTrackingForAllItems(CSteamGameServerAPIContext.GetSteamUGC()); } /// @@ -692,12 +698,12 @@ public static SteamAPICall_t StopPlaytimeTrackingForAllItems() { /// public static SteamAPICall_t AddDependency(PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_AddDependency(CSteamGameServerAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_AddDependency(CSteamGameServerAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID); } public static SteamAPICall_t RemoveDependency(PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveDependency(CSteamGameServerAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_RemoveDependency(CSteamGameServerAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID); } /// @@ -705,12 +711,12 @@ public static SteamAPICall_t RemoveDependency(PublishedFileId_t nParentPublished /// public static SteamAPICall_t AddAppDependency(PublishedFileId_t nPublishedFileID, AppId_t nAppID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_AddAppDependency(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, nAppID); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_AddAppDependency(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, nAppID); } public static SteamAPICall_t RemoveAppDependency(PublishedFileId_t nPublishedFileID, AppId_t nAppID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveAppDependency(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, nAppID); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_RemoveAppDependency(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, nAppID); } /// @@ -719,7 +725,7 @@ public static SteamAPICall_t RemoveAppDependency(PublishedFileId_t nPublishedFil /// public static SteamAPICall_t GetAppDependencies(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_GetAppDependencies(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_GetAppDependencies(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } /// @@ -727,7 +733,7 @@ public static SteamAPICall_t GetAppDependencies(PublishedFileId_t nPublishedFile /// public static SteamAPICall_t DeleteItem(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_DeleteItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_DeleteItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } /// @@ -735,7 +741,7 @@ public static SteamAPICall_t DeleteItem(PublishedFileId_t nPublishedFileID) { /// public static bool ShowWorkshopEULA() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_ShowWorkshopEULA(CSteamGameServerAPIContext.GetSteamUGC()); + return NativeMethods.ISteamGameServerUGC_ShowWorkshopEULA(CSteamGameServerAPIContext.GetSteamUGC()); } /// @@ -743,7 +749,7 @@ public static bool ShowWorkshopEULA() { /// public static SteamAPICall_t GetWorkshopEULAStatus() { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamUGC_GetWorkshopEULAStatus(CSteamGameServerAPIContext.GetSteamUGC()); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_GetWorkshopEULAStatus(CSteamGameServerAPIContext.GetSteamUGC()); } /// @@ -751,7 +757,7 @@ public static SteamAPICall_t GetWorkshopEULAStatus() { /// public static uint GetUserContentDescriptorPreferences(EUGCContentDescriptorID[] pvecDescriptors, uint cMaxEntries) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_GetUserContentDescriptorPreferences(CSteamGameServerAPIContext.GetSteamUGC(), pvecDescriptors, cMaxEntries); + return NativeMethods.ISteamGameServerUGC_GetUserContentDescriptorPreferences(CSteamGameServerAPIContext.GetSteamUGC(), pvecDescriptors, cMaxEntries); } /// @@ -759,7 +765,7 @@ public static uint GetUserContentDescriptorPreferences(EUGCContentDescriptorID[] /// public static bool SetItemsDisabledLocally(PublishedFileId_t[] pvecPublishedFileIDs, uint unNumPublishedFileIDs, bool bDisabledLocally) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetItemsDisabledLocally(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileIDs, unNumPublishedFileIDs, bDisabledLocally); + return NativeMethods.ISteamGameServerUGC_SetItemsDisabledLocally(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileIDs, unNumPublishedFileIDs, bDisabledLocally); } /// @@ -767,7 +773,7 @@ public static bool SetItemsDisabledLocally(PublishedFileId_t[] pvecPublishedFile /// public static bool SetSubscriptionsLoadOrder(PublishedFileId_t[] pvecPublishedFileIDs, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUGC_SetSubscriptionsLoadOrder(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileIDs, unNumPublishedFileIDs); + return NativeMethods.ISteamGameServerUGC_SetSubscriptionsLoadOrder(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileIDs, unNumPublishedFileIDs); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverutils.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverutils.cs index 378006e2..483defa4 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverutils.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverutils.cs @@ -21,12 +21,12 @@ public static class SteamGameServerUtils { /// public static uint GetSecondsSinceAppActive() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_GetSecondsSinceAppActive(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_GetSecondsSinceAppActive(CSteamGameServerAPIContext.GetSteamUtils()); } public static uint GetSecondsSinceComputerActive() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_GetSecondsSinceComputerActive(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_GetSecondsSinceComputerActive(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -34,7 +34,7 @@ public static uint GetSecondsSinceComputerActive() { /// public static EUniverse GetConnectedUniverse() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_GetConnectedUniverse(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_GetConnectedUniverse(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -42,7 +42,7 @@ public static EUniverse GetConnectedUniverse() { /// public static uint GetServerRealTime() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_GetServerRealTime(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_GetServerRealTime(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -51,7 +51,7 @@ public static uint GetServerRealTime() { /// public static string GetIPCountry() { InteropHelp.TestIfAvailableGameServer(); - return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUtils_GetIPCountry(CSteamGameServerAPIContext.GetSteamUtils())); + return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamGameServerUtils_GetIPCountry(CSteamGameServerAPIContext.GetSteamUtils())); } /// @@ -59,7 +59,7 @@ public static string GetIPCountry() { /// public static bool GetImageSize(int iImage, out uint pnWidth, out uint pnHeight) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_GetImageSize(CSteamGameServerAPIContext.GetSteamUtils(), iImage, out pnWidth, out pnHeight); + return NativeMethods.ISteamGameServerUtils_GetImageSize(CSteamGameServerAPIContext.GetSteamUtils(), iImage, out pnWidth, out pnHeight); } /// @@ -69,7 +69,7 @@ public static bool GetImageSize(int iImage, out uint pnWidth, out uint pnHeight) /// public static bool GetImageRGBA(int iImage, byte[] pubDest, int nDestBufferSize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_GetImageRGBA(CSteamGameServerAPIContext.GetSteamUtils(), iImage, pubDest, nDestBufferSize); + return NativeMethods.ISteamGameServerUtils_GetImageRGBA(CSteamGameServerAPIContext.GetSteamUtils(), iImage, pubDest, nDestBufferSize); } /// @@ -77,7 +77,7 @@ public static bool GetImageRGBA(int iImage, byte[] pubDest, int nDestBufferSize) /// public static byte GetCurrentBatteryPower() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_GetCurrentBatteryPower(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_GetCurrentBatteryPower(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -85,7 +85,7 @@ public static byte GetCurrentBatteryPower() { /// public static AppId_t GetAppID() { InteropHelp.TestIfAvailableGameServer(); - return (AppId_t)NativeMethods.ISteamUtils_GetAppID(CSteamGameServerAPIContext.GetSteamUtils()); + return (AppId_t)NativeMethods.ISteamGameServerUtils_GetAppID(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -94,7 +94,7 @@ public static AppId_t GetAppID() { /// public static void SetOverlayNotificationPosition(ENotificationPosition eNotificationPosition) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamUtils_SetOverlayNotificationPosition(CSteamGameServerAPIContext.GetSteamUtils(), eNotificationPosition); + NativeMethods.ISteamGameServerUtils_SetOverlayNotificationPosition(CSteamGameServerAPIContext.GetSteamUtils(), eNotificationPosition); } /// @@ -103,17 +103,17 @@ public static void SetOverlayNotificationPosition(ENotificationPosition eNotific /// public static bool IsAPICallCompleted(SteamAPICall_t hSteamAPICall, out bool pbFailed) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_IsAPICallCompleted(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall, out pbFailed); + return NativeMethods.ISteamGameServerUtils_IsAPICallCompleted(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall, out pbFailed); } public static ESteamAPICallFailure GetAPICallFailureReason(SteamAPICall_t hSteamAPICall) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_GetAPICallFailureReason(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall); + return NativeMethods.ISteamGameServerUtils_GetAPICallFailureReason(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall); } public static bool GetAPICallResult(SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, out bool pbFailed) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_GetAPICallResult(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall, pCallback, cubCallback, iCallbackExpected, out pbFailed); + return NativeMethods.ISteamGameServerUtils_GetAPICallResult(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall, pCallback, cubCallback, iCallbackExpected, out pbFailed); } /// @@ -124,7 +124,7 @@ public static bool GetAPICallResult(SteamAPICall_t hSteamAPICall, IntPtr pCallba /// public static uint GetIPCCallCount() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_GetIPCCallCount(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_GetIPCCallCount(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -135,7 +135,7 @@ public static uint GetIPCCallCount() { /// public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamUtils_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamUtils(), pFunction); + NativeMethods.ISteamGameServerUtils_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamUtils(), pFunction); } /// @@ -144,7 +144,7 @@ public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) /// public static bool IsOverlayEnabled() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_IsOverlayEnabled(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_IsOverlayEnabled(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -159,7 +159,7 @@ public static bool IsOverlayEnabled() { /// public static bool BOverlayNeedsPresent() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_BOverlayNeedsPresent(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_BOverlayNeedsPresent(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -175,7 +175,7 @@ public static bool BOverlayNeedsPresent() { public static SteamAPICall_t CheckFileSignature(string szFileName) { InteropHelp.TestIfAvailableGameServer(); using (var szFileName2 = new InteropHelp.UTF8StringHandle(szFileName)) { - return (SteamAPICall_t)NativeMethods.ISteamUtils_CheckFileSignature(CSteamGameServerAPIContext.GetSteamUtils(), szFileName2); + return (SteamAPICall_t)NativeMethods.ISteamGameServerUtils_CheckFileSignature(CSteamGameServerAPIContext.GetSteamUtils(), szFileName2); } } @@ -186,7 +186,7 @@ public static bool ShowGamepadTextInput(EGamepadTextInputMode eInputMode, EGamep InteropHelp.TestIfAvailableGameServer(); using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription)) using (var pchExistingText2 = new InteropHelp.UTF8StringHandle(pchExistingText)) { - return NativeMethods.ISteamUtils_ShowGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), eInputMode, eLineInputMode, pchDescription2, unCharMax, pchExistingText2); + return NativeMethods.ISteamGameServerUtils_ShowGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), eInputMode, eLineInputMode, pchDescription2, unCharMax, pchExistingText2); } } @@ -195,13 +195,13 @@ public static bool ShowGamepadTextInput(EGamepadTextInputMode eInputMode, EGamep /// public static uint GetEnteredGamepadTextLength() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_GetEnteredGamepadTextLength(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_GetEnteredGamepadTextLength(CSteamGameServerAPIContext.GetSteamUtils()); } public static bool GetEnteredGamepadTextInput(out string pchText, uint cchText) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchText2 = Marshal.AllocHGlobal((int)cchText); - bool ret = NativeMethods.ISteamUtils_GetEnteredGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), pchText2, cchText); + bool ret = NativeMethods.ISteamGameServerUtils_GetEnteredGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), pchText2, cchText); pchText = ret ? InteropHelp.PtrToStringUTF8(pchText2) : null; Marshal.FreeHGlobal(pchText2); return ret; @@ -212,7 +212,7 @@ public static bool GetEnteredGamepadTextInput(out string pchText, uint cchText) /// public static string GetSteamUILanguage() { InteropHelp.TestIfAvailableGameServer(); - return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUtils_GetSteamUILanguage(CSteamGameServerAPIContext.GetSteamUtils())); + return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamGameServerUtils_GetSteamUILanguage(CSteamGameServerAPIContext.GetSteamUtils())); } /// @@ -220,7 +220,7 @@ public static string GetSteamUILanguage() { /// public static bool IsSteamRunningInVR() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_IsSteamRunningInVR(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_IsSteamRunningInVR(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -228,7 +228,7 @@ public static bool IsSteamRunningInVR() { /// public static void SetOverlayNotificationInset(int nHorizontalInset, int nVerticalInset) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamUtils_SetOverlayNotificationInset(CSteamGameServerAPIContext.GetSteamUtils(), nHorizontalInset, nVerticalInset); + NativeMethods.ISteamGameServerUtils_SetOverlayNotificationInset(CSteamGameServerAPIContext.GetSteamUtils(), nHorizontalInset, nVerticalInset); } /// @@ -238,7 +238,7 @@ public static void SetOverlayNotificationInset(int nHorizontalInset, int nVertic /// public static bool IsSteamInBigPictureMode() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_IsSteamInBigPictureMode(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_IsSteamInBigPictureMode(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -246,7 +246,7 @@ public static bool IsSteamInBigPictureMode() { /// public static void StartVRDashboard() { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamUtils_StartVRDashboard(CSteamGameServerAPIContext.GetSteamUtils()); + NativeMethods.ISteamGameServerUtils_StartVRDashboard(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -254,7 +254,7 @@ public static void StartVRDashboard() { /// public static bool IsVRHeadsetStreamingEnabled() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_IsVRHeadsetStreamingEnabled(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_IsVRHeadsetStreamingEnabled(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -266,7 +266,7 @@ public static bool IsVRHeadsetStreamingEnabled() { /// public static void SetVRHeadsetStreamingEnabled(bool bEnabled) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamUtils_SetVRHeadsetStreamingEnabled(CSteamGameServerAPIContext.GetSteamUtils(), bEnabled); + NativeMethods.ISteamGameServerUtils_SetVRHeadsetStreamingEnabled(CSteamGameServerAPIContext.GetSteamUtils(), bEnabled); } /// @@ -274,7 +274,7 @@ public static void SetVRHeadsetStreamingEnabled(bool bEnabled) { /// public static bool IsSteamChinaLauncher() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_IsSteamChinaLauncher(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_IsSteamChinaLauncher(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -286,7 +286,7 @@ public static bool IsSteamChinaLauncher() { /// public static bool InitFilterText(uint unFilterOptions = 0) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_InitFilterText(CSteamGameServerAPIContext.GetSteamUtils(), unFilterOptions); + return NativeMethods.ISteamGameServerUtils_InitFilterText(CSteamGameServerAPIContext.GetSteamUtils(), unFilterOptions); } /// @@ -302,7 +302,7 @@ public static int FilterText(ETextFilteringContext eContext, CSteamID sourceStea InteropHelp.TestIfAvailableGameServer(); IntPtr pchOutFilteredText2 = Marshal.AllocHGlobal((int)nByteSizeOutFilteredText); using (var pchInputMessage2 = new InteropHelp.UTF8StringHandle(pchInputMessage)) { - int ret = NativeMethods.ISteamUtils_FilterText(CSteamGameServerAPIContext.GetSteamUtils(), eContext, sourceSteamID, pchInputMessage2, pchOutFilteredText2, nByteSizeOutFilteredText); + int ret = NativeMethods.ISteamGameServerUtils_FilterText(CSteamGameServerAPIContext.GetSteamUtils(), eContext, sourceSteamID, pchInputMessage2, pchOutFilteredText2, nByteSizeOutFilteredText); pchOutFilteredText = ret != -1 ? InteropHelp.PtrToStringUTF8(pchOutFilteredText2) : null; Marshal.FreeHGlobal(pchOutFilteredText2); return ret; @@ -315,7 +315,7 @@ public static int FilterText(ETextFilteringContext eContext, CSteamID sourceStea /// public static ESteamIPv6ConnectivityState GetIPv6ConnectivityState(ESteamIPv6ConnectivityProtocol eProtocol) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_GetIPv6ConnectivityState(CSteamGameServerAPIContext.GetSteamUtils(), eProtocol); + return NativeMethods.ISteamGameServerUtils_GetIPv6ConnectivityState(CSteamGameServerAPIContext.GetSteamUtils(), eProtocol); } /// @@ -323,7 +323,7 @@ public static ESteamIPv6ConnectivityState GetIPv6ConnectivityState(ESteamIPv6Con /// public static bool IsSteamRunningOnSteamDeck() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_IsSteamRunningOnSteamDeck(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_IsSteamRunningOnSteamDeck(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -332,7 +332,7 @@ public static bool IsSteamRunningOnSteamDeck() { /// public static bool ShowFloatingGamepadTextInput(EFloatingGamepadTextInputMode eKeyboardMode, int nTextFieldXPosition, int nTextFieldYPosition, int nTextFieldWidth, int nTextFieldHeight) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_ShowFloatingGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), eKeyboardMode, nTextFieldXPosition, nTextFieldYPosition, nTextFieldWidth, nTextFieldHeight); + return NativeMethods.ISteamGameServerUtils_ShowFloatingGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), eKeyboardMode, nTextFieldXPosition, nTextFieldYPosition, nTextFieldWidth, nTextFieldHeight); } /// @@ -340,7 +340,7 @@ public static bool ShowFloatingGamepadTextInput(EFloatingGamepadTextInputMode eK /// public static void SetGameLauncherMode(bool bLauncherMode) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamUtils_SetGameLauncherMode(CSteamGameServerAPIContext.GetSteamUtils(), bLauncherMode); + NativeMethods.ISteamGameServerUtils_SetGameLauncherMode(CSteamGameServerAPIContext.GetSteamUtils(), bLauncherMode); } /// @@ -348,7 +348,7 @@ public static void SetGameLauncherMode(bool bLauncherMode) { /// public static bool DismissFloatingGamepadTextInput() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_DismissFloatingGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_DismissFloatingGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -356,7 +356,7 @@ public static bool DismissFloatingGamepadTextInput() { /// public static bool DismissGamepadTextInput() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamUtils_DismissGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamGameServerUtils_DismissGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils()); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs index bbd2186c..7b1cf9b5 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs @@ -783,7 +783,13 @@ public static PartyBeaconID_t GetBeaconByIndex(uint unIndex) { public static bool GetBeaconDetails(PartyBeaconID_t ulBeaconID, out CSteamID pSteamIDBeaconOwner, out SteamPartyBeaconLocation_t pLocation, out string pchMetadata, int cchMetadata) { InteropHelp.TestIfAvailableClient(); IntPtr pchMetadata2 = Marshal.AllocHGlobal(cchMetadata); - bool ret = NativeMethods.ISteamParties_GetBeaconDetails(CSteamAPIContext.GetSteamParties(), ulBeaconID, out pSteamIDBeaconOwner, out pLocation, pchMetadata2, cchMetadata); + bool anyCpuResult; + if (!Packsize.IsLargePack) { + anyCpuResult = NativeMethods.ISteamParties_GetBeaconDetails(CSteamAPIContext.GetSteamParties(), ulBeaconID, out pSteamIDBeaconOwner, out pLocation, pchMetadata2, cchMetadata); + } else { + anyCpuResult = NativeMethods.ISteamParties_GetBeaconDetails(CSteamAPIContext.GetSteamParties(), ulBeaconID, out pSteamIDBeaconOwner, out pLocation_lp, pchMetadata2, cchMetadata); + } + return anyCpuResult; pchMetadata = ret ? InteropHelp.PtrToStringUTF8(pchMetadata2) : null; Marshal.FreeHGlobal(pchMetadata2); return ret; @@ -810,7 +816,13 @@ public static bool GetNumAvailableBeaconLocations(out uint puNumLocations) { public static bool GetAvailableBeaconLocations(SteamPartyBeaconLocation_t[] pLocationList, uint uMaxNumLocations) { InteropHelp.TestIfAvailableClient(); - return NativeMethods.ISteamParties_GetAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), pLocationList, uMaxNumLocations); + bool anyCpuResult; + if (!Packsize.IsLargePack) { + anyCpuResult = NativeMethods.ISteamParties_GetAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), pLocationList, uMaxNumLocations); + } else { + anyCpuResult = NativeMethods.ISteamParties_GetAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), pLocationList_lp, uMaxNumLocations); + } + return anyCpuResult; } /// @@ -823,7 +835,13 @@ public static SteamAPICall_t CreateBeacon(uint unOpenSlots, ref SteamPartyBeacon InteropHelp.TestIfAvailableClient(); using (var pchConnectString2 = new InteropHelp.UTF8StringHandle(pchConnectString)) using (var pchMetadata2 = new InteropHelp.UTF8StringHandle(pchMetadata)) { - return (SteamAPICall_t)NativeMethods.ISteamParties_CreateBeacon(CSteamAPIContext.GetSteamParties(), unOpenSlots, ref pBeaconLocation, pchConnectString2, pchMetadata2); + ulong anyCpuResult; + if (!Packsize.IsLargePack) { + anyCpuResult = (SteamAPICall_t)NativeMethods.ISteamParties_CreateBeacon(CSteamAPIContext.GetSteamParties(), unOpenSlots, ref pBeaconLocation, pchConnectString2, pchMetadata2); + } else { + anyCpuResult = (SteamAPICall_t)NativeMethods.ISteamParties_CreateBeacon(CSteamAPIContext.GetSteamParties(), unOpenSlots, ref pBeaconLocation_lp, pchConnectString2, pchMetadata2); + } + return anyCpuResult; } } @@ -870,7 +888,13 @@ public static bool DestroyBeacon(PartyBeaconID_t ulBeacon) { public static bool GetBeaconLocationData(SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, out string pchDataStringOut, int cchDataStringOut) { InteropHelp.TestIfAvailableClient(); IntPtr pchDataStringOut2 = Marshal.AllocHGlobal(cchDataStringOut); - bool ret = NativeMethods.ISteamParties_GetBeaconLocationData(CSteamAPIContext.GetSteamParties(), BeaconLocation, eData, pchDataStringOut2, cchDataStringOut); + bool anyCpuResult; + if (!Packsize.IsLargePack) { + anyCpuResult = NativeMethods.ISteamParties_GetBeaconLocationData(CSteamAPIContext.GetSteamParties(), BeaconLocation, eData, pchDataStringOut2, cchDataStringOut); + } else { + anyCpuResult = NativeMethods.ISteamParties_GetBeaconLocationData(CSteamAPIContext.GetSteamParties(), BeaconLocation_lp, eData, pchDataStringOut2, cchDataStringOut); + } + return anyCpuResult; pchDataStringOut = ret ? InteropHelp.PtrToStringUTF8(pchDataStringOut2) : null; Marshal.FreeHGlobal(pchDataStringOut2); return ret; diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs index 5125d493..ba3b0206 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs @@ -134,7 +134,13 @@ public static bool CloseChannelWithUser(ref SteamNetworkingIdentity identityRemo /// public static ESteamNetworkingConnectionState GetSessionConnectionInfo(ref SteamNetworkingIdentity identityRemote, out SteamNetConnectionInfo_t pConnectionInfo, out SteamNetConnectionRealTimeStatus_t pQuickStatus) { InteropHelp.TestIfAvailableClient(); - return NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo, out pQuickStatus); + ESteamNetworkingConnectionState anyCpuResult; + if (!Packsize.IsLargePack) { + anyCpuResult = NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo, out pQuickStatus); + } else { + anyCpuResult = NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo_lp, out pQuickStatus); + } + return anyCpuResult; } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs index a94dd7a4..f56bb2f3 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs @@ -397,7 +397,13 @@ public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, IntPtr[ /// public static bool GetConnectionInfo(HSteamNetConnection hConn, out SteamNetConnectionInfo_t pInfo) { InteropHelp.TestIfAvailableClient(); - return NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); + bool anyCpuResult; + if (!Packsize.IsLargePack) { + anyCpuResult = NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); + } else { + anyCpuResult = NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo_lp); + } + return anyCpuResult; } /// diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs index a555e91a..b3f5c644 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs @@ -63,7 +63,13 @@ public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) { /// public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails) { InteropHelp.TestIfAvailableClient(); - return NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamAPIContext.GetSteamUGC(), handle, index, out pDetails); + bool anyCpuResult; + if (!Packsize.IsLargePack) { + anyCpuResult = NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamAPIContext.GetSteamUGC(), handle, index, out pDetails); + } else { + anyCpuResult = NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamAPIContext.GetSteamUGC(), handle, index, out pDetails_lp); + } + return anyCpuResult; } public static uint GetQueryUGCNumTags(UGCQueryHandle_t handle, uint index) { diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs index 2a8811e6..6197cc4c 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs @@ -317,7 +317,13 @@ public static SteamAPICall_t DownloadLeaderboardEntriesForUsers(SteamLeaderboard /// public static bool GetDownloadedLeaderboardEntry(SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, out LeaderboardEntry_t pLeaderboardEntry, int[] pDetails, int cDetailsMax) { InteropHelp.TestIfAvailableClient(); - return NativeMethods.ISteamUserStats_GetDownloadedLeaderboardEntry(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboardEntries, index, out pLeaderboardEntry, pDetails, cDetailsMax); + bool anyCpuResult; + if (!Packsize.IsLargePack) { + anyCpuResult = NativeMethods.ISteamUserStats_GetDownloadedLeaderboardEntry(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboardEntries, index, out pLeaderboardEntry, pDetails, cDetailsMax); + } else { + anyCpuResult = NativeMethods.ISteamUserStats_GetDownloadedLeaderboardEntry(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboardEntries, index, out pLeaderboardEntry_lp, pDetails, cDetailsMax); + } + return anyCpuResult; } /// From 7e3f73bd60b04620f5bd9f46756864d44aaf7495 Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Sun, 26 Oct 2025 21:42:34 +0800 Subject: [PATCH 56/82] Fixed pack-size aware typed parameter array generation. --- CodeGen/SteamworksParser/steamworksparser.py | 7 +++++-- CodeGen/src/interfaces.py | 21 ++++++-------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/CodeGen/SteamworksParser/steamworksparser.py b/CodeGen/SteamworksParser/steamworksparser.py index c8822a83..c6493a31 100644 --- a/CodeGen/SteamworksParser/steamworksparser.py +++ b/CodeGen/SteamworksParser/steamworksparser.py @@ -144,8 +144,8 @@ def __init__(self, name: str, size: int, pack: int): } g_SpecialStructs = { - "CSteamID": PrimitiveType("CSteamID", 8, 8), - "CGameID": PrimitiveType("CGameID", 8, 8), + "CSteamID": PrimitiveType("unsigned long long", 8, 8), + "CGameID": PrimitiveType("unsigned long long", 8, 8), "SteamIPAddress_t": PrimitiveType("SteamIPAddress_t", 16 + 4, 1), "SteamNetworkingIdentity ": PrimitiveType("SteamNetworkingIdentity", 4 + 128, 1), # Contains bit fields that size can't be represented as bytes count @@ -907,6 +907,9 @@ def parse_structs(self, s: ParserState): if len(s.complexTypeStack) >= 2 and s.complexTypeStack[-2] == 'struct': currentStruct.outer_type.nested_struct.append(currentStruct) + if s.struct.name in g_SpecialStructs: + s.struct.packsize_aware = False # HACK hope so + s.struct = currentStruct.outer_type else: self.parse_struct_fields(s) diff --git a/CodeGen/src/interfaces.py b/CodeGen/src/interfaces.py index 736b8b64..edb8dbe0 100644 --- a/CodeGen/src/interfaces.py +++ b/CodeGen/src/interfaces.py @@ -698,15 +698,6 @@ def parse_interface(f, interface: Interface, parser: Parser): parsed_args = parse_args(strEntryPoint, func.args, None, parser) parse_func_native(f, interface, func, strEntryPoint, parsed_args, False, bGameServerVersion, parser) - # Check if any args are pack-size aware structs - # If so, we need to generate an alternate version of the function - for arg in func.args: - argType = parser.resolveTypeInfo(arg.type) - if isinstance(argType, Struct) and argType.name in parser.packSizeAwareStructs: - parse_func_native(f, interface, func, strEntryPoint, parsed_args, True, bGameServerVersion, parser) - shouldGenerateLargePack = True - break - generate_wrapper_function(f, interface, func, parsed_args, strEntryPoint, shouldGenerateLargePack, parser) @@ -968,7 +959,7 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): isThisArgPackAware = potentialtype in parser.packSizeAwareStructs isMethodPacksizeAware = True if isThisArgPackAware else isMethodPacksizeAware - pInvokeLargePackType = None + pInvokeLargePackType = g_TypeDict.get(arg.type, arg.type) pInvokeArgType = g_TypeDict.get(arg.type, arg.type) isParamArray = False @@ -983,11 +974,11 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): argattribute = get_arg_attribute(strEntryPoint, arg) if argattribute: - if argattribute.name == "STEAM_OUT_ARRAY" or argattribute.name == "STEAM_OUT_ARRAY_CALL" or argattribute.name == "STEAM_OUT_ARRAY_COUNT" or argattribute.name == "STEAM_ARRAY_COUNT" or argattribute.name == "STEAM_ARRAY_COUNT_D": + if argattribute.name in ("STEAM_OUT_ARRAY", "STEAM_OUT_ARRAY_CALL", "STEAM_OUT_ARRAY_COUNT", "STEAM_ARRAY_COUNT","STEAM_ARRAY_COUNT_D"): isParamArray = True pInvokeArgType = g_TypeDict.get(potentialtype, potentialtype) + "[]" - if pInvokeLargePackType is not None: - pInvokeLargePackType = pInvokeLargePackType + "[]" + if isMethodPacksizeAware: + pInvokeLargePackType = g_TypeDict.get(potentialtype, potentialtype) + "_LargePack[]" if argattribute.name == "STEAM_OUT_ARRAY_COUNT": commaindex = argattribute.value.find(',') @@ -1009,8 +1000,8 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): pinvokeargs += pInvokeArgType + " " + arg.name + ", " if isThisArgPackAware: - if not pinvokeargsLargePack.endswith('[]'): - pinvokeargsLargePack += f"{pInvokeLargePackType} {arg.name}_lp, " + if pInvokeArgType.endswith('[]'): + pinvokeargsLargePack += f"{pInvokeArgType[:-2]}_LargePack[] {arg.name}_lp, " else: pinvokeargsLargePack += f"{pInvokeArgType}_LargePack {arg.name}_lp, " From 45735fa4d9f1f891fd897455e8faab8c3ee64a84 Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Sun, 26 Oct 2025 21:43:47 +0800 Subject: [PATCH 57/82] Regenerate native imports with array fix. --- .../Runtime/autogen/NativeMethods.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs index 5468698a..6f458bf4 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs @@ -1765,7 +1765,7 @@ internal static class NativeMethods { [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_GetAvailableBeaconLocations", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] - public static extern bool ISteamParties_GetAvailableBeaconLocations(IntPtr instancePtr, SteamPartyBeaconLocation_t[]_LargePack pLocationList_lp, uint uMaxNumLocations); + public static extern bool ISteamParties_GetAvailableBeaconLocations(IntPtr instancePtr, [In, Out] SteamPartyBeaconLocation_t_LargePack[] pLocationList_lp, uint uMaxNumLocations); [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_CreateBeacon", CallingConvention = CallingConvention.Cdecl)] public static extern ulong ISteamParties_CreateBeacon(IntPtr instancePtr, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, InteropHelp.UTF8StringHandle pchConnectString, InteropHelp.UTF8StringHandle pchMetadata); @@ -1793,14 +1793,6 @@ internal static class NativeMethods { [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconLocationData", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetBeaconLocationData(IntPtr instancePtr, SteamPartyBeaconLocation_t_LargePack BeaconLocation_lp, ESteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut); - - [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconLocationData", CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool ISteamParties_GetBeaconLocationData(IntPtr instancePtr, SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut); - - [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconLocationData", CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool ISteamParties_GetBeaconLocationData(IntPtr instancePtr, SteamPartyBeaconLocation_t_LargePack BeaconLocation_lp, ESteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut); #endregion #region SteamMusic [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamMusic_BIsEnabled", CallingConvention = CallingConvention.Cdecl)] From 144b9981c40c434e92d66ef3780020b003b1b6be Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Sun, 26 Oct 2025 22:23:44 +0800 Subject: [PATCH 58/82] Fix gameserver interfaces generation --- CodeGen/src/interfaces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeGen/src/interfaces.py b/CodeGen/src/interfaces.py index edb8dbe0..6553161d 100644 --- a/CodeGen/src/interfaces.py +++ b/CodeGen/src/interfaces.py @@ -698,7 +698,7 @@ def parse_interface(f, interface: Interface, parser: Parser): parsed_args = parse_args(strEntryPoint, func.args, None, parser) parse_func_native(f, interface, func, strEntryPoint, parsed_args, False, bGameServerVersion, parser) - generate_wrapper_function(f, interface, func, parsed_args, strEntryPoint, shouldGenerateLargePack, parser) + generate_wrapper_function(f, interface, func, parsed_args, strEntryPoint, bGameServerVersion, parser) # Remove last whitespace From a2b4d15fdea3956f2d8df0a1a463d3da8ed24a61 Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Mon, 27 Oct 2025 19:55:59 +0800 Subject: [PATCH 59/82] All Steam interface wrappers seems work. --- CodeGen/src/interfaces.py | 55 ++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/CodeGen/src/interfaces.py b/CodeGen/src/interfaces.py index 6553161d..f5e4dca3 100644 --- a/CodeGen/src/interfaces.py +++ b/CodeGen/src/interfaces.py @@ -769,7 +769,7 @@ def generate_wrapper_function(f, interface, func: Function, args_with_explicit_count = args[5] isPacksizeAware = args[6] largePackNativeArgs: str = args[7] - largePackArgTypeToName: list[(str, str)] = args[8] # (type,argname) + largePackMarshalInfo: list[(str, str, bool)] = args[8] # (typeName, argName, shouldAssignInput) strCast = "" wrapperreturntype = None @@ -857,29 +857,33 @@ def generate_wrapper_function(f, interface, func: Function, invokingNativeFunctionName, argnames)) else: b:list[str] = [] + + if returntype != "void": + b.append(f"{wrapperreturntype} ret;") + invocationTemplate = "{0}{1}{2}NativeMethods.{3}({4});" prebuiltInvocationExpression = invocationTemplate.format( - "", "" if returntype == "void" else "anyCpuResult = ", strCast, + "", "" if returntype == "void" else "ret = ", strCast, invokingNativeFunctionName, argnames) prebuiltInvocationExpressionLargePack = invocationTemplate.format( - "", "" if returntype == "void" else "anyCpuResult = ", strCast, + "", "" if returntype == "void" else "ret = ", strCast, invokingNativeFunctionName, largePackNativeArgs ) - b.append(f"{returntype} anyCpuResult;") + # b.append(f"{returntype} anyCpuResult;") b.append("if (!Packsize.IsLargePack) {") b.append("\t" + prebuiltInvocationExpression) b.append("} else {") # generate large-pack byref intermediate struct variables - for lpArg in largePackArgTypeToName: - b.append(f"\t{lpArg[0]} {lpArg[1]}_lp;") + for lpArg in largePackMarshalInfo: + assignByRefManaged = "" if not lpArg[2] else f" = {lpArg[1]}" + b.append(f"\t{lpArg[0]} {lpArg[1]}_lp{assignByRefManaged};") b.append("\t" + prebuiltInvocationExpressionLargePack) # convert large pack form to managed form - for lpArg in largePackArgTypeToName: + for lpArg in largePackMarshalInfo: b.append(f"\t{lpArg[1]} = {lpArg[1]}_lp;") b.append("}") - b.append("return anyCpuResult;") functionBody.extend(map(lambda l: "\t\t\t" + l, b)) @@ -899,12 +903,13 @@ def generate_wrapper_function(f, interface, func: Function, if strEntryPoint != "ISteamRemoteStorage_GetUGCDetails": functionBody.append(indentlevel + "Marshal.FreeHGlobal(" + argName + "2);") - if returntype != "void": - functionBody.append(indentlevel + "return ret;") + if (returntype != "void" and isPacksizeAware) or (returntype != "void" and outstringargs): + functionBody.append(indentlevel + "return ret;") if stringargs: functionBody.append("\t\t\t}") + comments = func.comments if func.linecomment: comments.append(func.linecomment) @@ -935,7 +940,7 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): outstringsize = [] isMethodPacksizeAware = False args_with_explicit_count = OrderedDict() - largePackArgTypeToName: list[(str, str)] = [] + largePackArgMarshalInfo: list[(str, str, bool)] = [] ifacename = strEntryPoint[1:strEntryPoint.index('_')] @@ -952,22 +957,25 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): getNextArgAsStringSize = False argNamesToAddAsStringSize = [] - #region populate PInvoke params list and wrapper args (both LP and SP) for arg in args: + #region populate PInvoke params list and wrapper args (both LP and SP) potentialtype = arg.type.rstrip("*").lstrip("const ").rstrip() isThisArgPackAware = potentialtype in parser.packSizeAwareStructs + isMethodPacksizeAware = True if isThisArgPackAware else isMethodPacksizeAware - pInvokeLargePackType = g_TypeDict.get(arg.type, arg.type) pInvokeArgType = g_TypeDict.get(arg.type, arg.type) isParamArray = False + largePackArgMarshalRecord = None if pInvokeArgType.endswith("*"): wrapperParamType = g_TypeDict.get(potentialtype, potentialtype) pInvokeArgType = "out " + wrapperParamType - if isThisArgPackAware: - pInvokeLargePackType = "out " + wrapperParamType + "_LargePack" + + if isThisArgPackAware: + # add this arg to marshal list + largePackArgMarshalRecord = (potentialtype, arg.name, True) pInvokeArgType = g_SpecialArgsDict.get(strEntryPoint, dict()).get(arg.name, pInvokeArgType) @@ -1002,6 +1010,9 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): if isThisArgPackAware: if pInvokeArgType.endswith('[]'): pinvokeargsLargePack += f"{pInvokeArgType[:-2]}_LargePack[] {arg.name}_lp, " + if isThisArgPackAware: + (t, n, b) = largePackArgMarshalRecord + largePackArgMarshalRecord = (f"{t}[]", n, b) else: pinvokeargsLargePack += f"{pInvokeArgType}_LargePack {arg.name}_lp, " @@ -1027,9 +1038,16 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): if pInvokeArgType.startswith("out"): nativeFunctionArgs += "out " nativeFunctionArgsLargePack += "out " + if isThisArgPackAware: + (t, n, _) = largePackArgMarshalRecord + largePackArgMarshalRecord = (t, n, False) elif wrapperargtype.startswith("ref"): nativeFunctionArgs += "ref " nativeFunctionArgsLargePack += "ref " + if isThisArgPackAware: + # make original value passing in + (t, n, _) = (largePackArgMarshalRecord) + largePackArgMarshalRecord = (t, n, True) if wrapperargtype == "System.Collections.Generic.IList": nativeFunctionArgs += "new InteropHelp.SteamParamStringArray(" + arg.name + ")" @@ -1081,8 +1099,9 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): if isThisArgPackAware: - nativeFunctionArgsLargePack += "_lp" - + nativeFunctionArgsLargePack += "_lp" + largePackArgMarshalInfo.append(largePackArgMarshalRecord) + nativeFunctionArgs += ", " nativeFunctionArgsLargePack += ", " @@ -1095,7 +1114,7 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): nativeFunctionArgsLargePack = nativeFunctionArgsLargePack.rstrip(", ") return (pinvokeargs, wrapperargs, nativeFunctionArgs, stringargs, (outstringargs, outstringsize), args_with_explicit_count, isMethodPacksizeAware, nativeFunctionArgsLargePack, - largePackArgTypeToName, pinvokeargsLargePack if isMethodPacksizeAware else None) + largePackArgMarshalInfo, pinvokeargsLargePack if isMethodPacksizeAware else None) if __name__ == "__main__": From c3e001b69a44fbdc73459748e56b5742a71d1678 Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Mon, 27 Oct 2025 20:06:38 +0800 Subject: [PATCH 60/82] Regenerate steam interface wrappers. --- .../Runtime/autogen/isteamgameserverclient.cs | 70 +++--- .../Runtime/autogen/isteamgameserverhttp.cs | 50 ++--- .../autogen/isteamgameserverinventory.cs | 76 +++---- .../autogen/isteamgameservernetworking.cs | 44 ++-- .../isteamgameservernetworkingmessages.cs | 20 +- .../isteamgameservernetworkingsockets.cs | 102 ++++----- .../isteamgameservernetworkingutils.cs | 54 ++--- .../Runtime/autogen/isteamgameserverugc.cs | 200 +++++++++--------- .../Runtime/autogen/isteamgameserverutils.cs | 74 +++---- .../Runtime/autogen/isteammatchmaking.cs | 38 ++-- .../autogen/isteamnetworkingmessages.cs | 10 +- .../autogen/isteamnetworkingsockets.cs | 10 +- .../Runtime/autogen/isteamugc.cs | 10 +- .../Runtime/autogen/isteamuserstats.cs | 10 +- 14 files changed, 394 insertions(+), 374 deletions(-) diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverclient.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverclient.cs index fc6b1773..3449588f 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverclient.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverclient.cs @@ -22,7 +22,7 @@ public static class SteamGameServerClient { /// public static HSteamPipe CreateSteamPipe() { InteropHelp.TestIfAvailableGameServer(); - return (HSteamPipe)NativeMethods.ISteamGameServerClient_CreateSteamPipe(CSteamGameServerAPIContext.GetSteamClient()); + return (HSteamPipe)NativeMethods.ISteamClient_CreateSteamPipe(CSteamGameServerAPIContext.GetSteamClient()); } /// @@ -31,7 +31,7 @@ public static HSteamPipe CreateSteamPipe() { /// public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerClient_BReleaseSteamPipe(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe); + return NativeMethods.ISteamClient_BReleaseSteamPipe(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe); } /// @@ -41,7 +41,7 @@ public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe) { /// public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamUser)NativeMethods.ISteamGameServerClient_ConnectToGlobalUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe); + return (HSteamUser)NativeMethods.ISteamClient_ConnectToGlobalUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe); } /// @@ -50,7 +50,7 @@ public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe) { /// public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamUser)NativeMethods.ISteamGameServerClient_CreateLocalUser(CSteamGameServerAPIContext.GetSteamClient(), out phSteamPipe, eAccountType); + return (HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(CSteamGameServerAPIContext.GetSteamClient(), out phSteamPipe, eAccountType); } /// @@ -59,7 +59,7 @@ public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountTyp /// public static void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerClient_ReleaseUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, hUser); + NativeMethods.ISteamClient_ReleaseUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, hUser); } /// @@ -68,7 +68,7 @@ public static void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser) { public static IntPtr GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -78,7 +78,7 @@ public static IntPtr GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, public static IntPtr GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamGameServer(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamGameServer(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -88,7 +88,7 @@ public static IntPtr GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hStea /// public static void SetLocalIPBinding(ref SteamIPAddress_t unIP, ushort usPort) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerClient_SetLocalIPBinding(CSteamGameServerAPIContext.GetSteamClient(), ref unIP, usPort); + NativeMethods.ISteamClient_SetLocalIPBinding(CSteamGameServerAPIContext.GetSteamClient(), ref unIP, usPort); } /// @@ -97,7 +97,7 @@ public static void SetLocalIPBinding(ref SteamIPAddress_t unIP, ushort usPort) { public static IntPtr GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamFriends(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamFriends(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -107,7 +107,7 @@ public static IntPtr GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPi public static IntPtr GetISteamUtils(HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamUtils(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamUtils(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, pchVersion2); } } @@ -117,7 +117,7 @@ public static IntPtr GetISteamUtils(HSteamPipe hSteamPipe, string pchVersion) { public static IntPtr GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamMatchmaking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamMatchmaking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -127,7 +127,7 @@ public static IntPtr GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSte public static IntPtr GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamMatchmakingServers(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamMatchmakingServers(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -137,7 +137,7 @@ public static IntPtr GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPi public static IntPtr GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamGenericInterface(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamGenericInterface(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -147,7 +147,7 @@ public static IntPtr GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe public static IntPtr GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamUserStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamUserStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -157,7 +157,7 @@ public static IntPtr GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteam public static IntPtr GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamGameServerStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamGameServerStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -167,7 +167,7 @@ public static IntPtr GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe public static IntPtr GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamApps(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamApps(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -177,7 +177,7 @@ public static IntPtr GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, public static IntPtr GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamNetworking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamNetworking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -187,7 +187,7 @@ public static IntPtr GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hStea public static IntPtr GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamRemoteStorage(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamRemoteStorage(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -197,7 +197,7 @@ public static IntPtr GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hS public static IntPtr GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamScreenshots(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamScreenshots(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -207,7 +207,7 @@ public static IntPtr GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSte public static IntPtr GetISteamGameSearch(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamGameSearch(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamGameSearch(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -219,7 +219,7 @@ public static IntPtr GetISteamGameSearch(HSteamUser hSteamuser, HSteamPipe hStea /// public static uint GetIPCCallCount() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerClient_GetIPCCallCount(CSteamGameServerAPIContext.GetSteamClient()); + return NativeMethods.ISteamClient_GetIPCCallCount(CSteamGameServerAPIContext.GetSteamClient()); } /// @@ -230,7 +230,7 @@ public static uint GetIPCCallCount() { /// public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerClient_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamClient(), pFunction); + NativeMethods.ISteamClient_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamClient(), pFunction); } /// @@ -238,7 +238,7 @@ public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) /// public static bool BShutdownIfAllPipesClosed() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerClient_BShutdownIfAllPipesClosed(CSteamGameServerAPIContext.GetSteamClient()); + return NativeMethods.ISteamClient_BShutdownIfAllPipesClosed(CSteamGameServerAPIContext.GetSteamClient()); } /// @@ -247,7 +247,7 @@ public static bool BShutdownIfAllPipesClosed() { public static IntPtr GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamHTTP(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamHTTP(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -257,7 +257,7 @@ public static IntPtr GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, public static IntPtr GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamController(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamController(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -267,7 +267,7 @@ public static IntPtr GetISteamController(HSteamUser hSteamUser, HSteamPipe hStea public static IntPtr GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamUGC(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamUGC(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -277,7 +277,7 @@ public static IntPtr GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, public static IntPtr GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamMusic(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamMusic(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -287,7 +287,7 @@ public static IntPtr GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe public static IntPtr GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamMusicRemote(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamMusicRemote(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -297,7 +297,7 @@ public static IntPtr GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSte public static IntPtr GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamHTMLSurface(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamHTMLSurface(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -307,7 +307,7 @@ public static IntPtr GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSte public static IntPtr GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamInventory(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamInventory(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -317,7 +317,7 @@ public static IntPtr GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteam public static IntPtr GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamVideo(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamVideo(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -327,7 +327,7 @@ public static IntPtr GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe public static IntPtr GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamParentalSettings(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamParentalSettings(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } @@ -337,7 +337,7 @@ public static IntPtr GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe public static IntPtr GetISteamInput(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamInput(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamInput(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -347,7 +347,7 @@ public static IntPtr GetISteamInput(HSteamUser hSteamUser, HSteamPipe hSteamPipe public static IntPtr GetISteamParties(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamParties(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamParties(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } @@ -357,7 +357,7 @@ public static IntPtr GetISteamParties(HSteamUser hSteamUser, HSteamPipe hSteamPi public static IntPtr GetISteamRemotePlay(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { - return NativeMethods.ISteamGameServerClient_GetISteamRemotePlay(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); + return NativeMethods.ISteamClient_GetISteamRemotePlay(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverhttp.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverhttp.cs index f3c2a2f9..010fde26 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverhttp.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverhttp.cs @@ -25,7 +25,7 @@ public static class SteamGameServerHTTP { public static HTTPRequestHandle CreateHTTPRequest(EHTTPMethod eHTTPRequestMethod, string pchAbsoluteURL) { InteropHelp.TestIfAvailableGameServer(); using (var pchAbsoluteURL2 = new InteropHelp.UTF8StringHandle(pchAbsoluteURL)) { - return (HTTPRequestHandle)NativeMethods.ISteamGameServerHTTP_CreateHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), eHTTPRequestMethod, pchAbsoluteURL2); + return (HTTPRequestHandle)NativeMethods.ISteamHTTP_CreateHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), eHTTPRequestMethod, pchAbsoluteURL2); } } @@ -35,7 +35,7 @@ public static HTTPRequestHandle CreateHTTPRequest(EHTTPMethod eHTTPRequestMethod /// public static bool SetHTTPRequestContextValue(HTTPRequestHandle hRequest, ulong ulContextValue) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestContextValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, ulContextValue); + return NativeMethods.ISteamHTTP_SetHTTPRequestContextValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, ulContextValue); } /// @@ -45,7 +45,7 @@ public static bool SetHTTPRequestContextValue(HTTPRequestHandle hRequest, ulong /// public static bool SetHTTPRequestNetworkActivityTimeout(HTTPRequestHandle hRequest, uint unTimeoutSeconds) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestNetworkActivityTimeout(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unTimeoutSeconds); + return NativeMethods.ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unTimeoutSeconds); } /// @@ -56,7 +56,7 @@ public static bool SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, string InteropHelp.TestIfAvailableGameServer(); using (var pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName)) using (var pchHeaderValue2 = new InteropHelp.UTF8StringHandle(pchHeaderValue)) { - return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pchHeaderValue2); + return NativeMethods.ISteamHTTP_SetHTTPRequestHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pchHeaderValue2); } } @@ -69,7 +69,7 @@ public static bool SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, InteropHelp.TestIfAvailableGameServer(); using (var pchParamName2 = new InteropHelp.UTF8StringHandle(pchParamName)) using (var pchParamValue2 = new InteropHelp.UTF8StringHandle(pchParamValue)) { - return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestGetOrPostParameter(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchParamName2, pchParamValue2); + return NativeMethods.ISteamHTTP_SetHTTPRequestGetOrPostParameter(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchParamName2, pchParamValue2); } } @@ -81,7 +81,7 @@ public static bool SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, /// public static bool SendHTTPRequest(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_SendHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle); + return NativeMethods.ISteamHTTP_SendHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle); } /// @@ -91,7 +91,7 @@ public static bool SendHTTPRequest(HTTPRequestHandle hRequest, out SteamAPICall_ /// public static bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_SendHTTPRequestAndStreamResponse(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle); + return NativeMethods.ISteamHTTP_SendHTTPRequestAndStreamResponse(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle); } /// @@ -100,7 +100,7 @@ public static bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, /// public static bool DeferHTTPRequest(HTTPRequestHandle hRequest) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_DeferHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); + return NativeMethods.ISteamHTTP_DeferHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); } /// @@ -109,7 +109,7 @@ public static bool DeferHTTPRequest(HTTPRequestHandle hRequest) { /// public static bool PrioritizeHTTPRequest(HTTPRequestHandle hRequest) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_PrioritizeHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); + return NativeMethods.ISteamHTTP_PrioritizeHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); } /// @@ -120,7 +120,7 @@ public static bool PrioritizeHTTPRequest(HTTPRequestHandle hRequest) { public static bool GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, string pchHeaderName, out uint unResponseHeaderSize) { InteropHelp.TestIfAvailableGameServer(); using (var pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName)) { - return NativeMethods.ISteamGameServerHTTP_GetHTTPResponseHeaderSize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, out unResponseHeaderSize); + return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderSize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, out unResponseHeaderSize); } } @@ -132,7 +132,7 @@ public static bool GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, string public static bool GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, byte[] pHeaderValueBuffer, uint unBufferSize) { InteropHelp.TestIfAvailableGameServer(); using (var pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName)) { - return NativeMethods.ISteamGameServerHTTP_GetHTTPResponseHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pHeaderValueBuffer, unBufferSize); + return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pHeaderValueBuffer, unBufferSize); } } @@ -142,7 +142,7 @@ public static bool GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, string /// public static bool GetHTTPResponseBodySize(HTTPRequestHandle hRequest, out uint unBodySize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_GetHTTPResponseBodySize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out unBodySize); + return NativeMethods.ISteamHTTP_GetHTTPResponseBodySize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out unBodySize); } /// @@ -152,7 +152,7 @@ public static bool GetHTTPResponseBodySize(HTTPRequestHandle hRequest, out uint /// public static bool GetHTTPResponseBodyData(HTTPRequestHandle hRequest, byte[] pBodyDataBuffer, uint unBufferSize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_GetHTTPResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pBodyDataBuffer, unBufferSize); + return NativeMethods.ISteamHTTP_GetHTTPResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pBodyDataBuffer, unBufferSize); } /// @@ -162,7 +162,7 @@ public static bool GetHTTPResponseBodyData(HTTPRequestHandle hRequest, byte[] pB /// public static bool GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint cOffset, byte[] pBodyDataBuffer, uint unBufferSize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_GetHTTPStreamingResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, cOffset, pBodyDataBuffer, unBufferSize); + return NativeMethods.ISteamHTTP_GetHTTPStreamingResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, cOffset, pBodyDataBuffer, unBufferSize); } /// @@ -171,7 +171,7 @@ public static bool GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, /// public static bool ReleaseHTTPRequest(HTTPRequestHandle hRequest) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_ReleaseHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); + return NativeMethods.ISteamHTTP_ReleaseHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); } /// @@ -181,7 +181,7 @@ public static bool ReleaseHTTPRequest(HTTPRequestHandle hRequest) { /// public static bool GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, out float pflPercentOut) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_GetHTTPDownloadProgressPct(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pflPercentOut); + return NativeMethods.ISteamHTTP_GetHTTPDownloadProgressPct(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pflPercentOut); } /// @@ -192,7 +192,7 @@ public static bool GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, out fl public static bool SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, string pchContentType, byte[] pubBody, uint unBodyLen) { InteropHelp.TestIfAvailableGameServer(); using (var pchContentType2 = new InteropHelp.UTF8StringHandle(pchContentType)) { - return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestRawPostBody(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchContentType2, pubBody, unBodyLen); + return NativeMethods.ISteamHTTP_SetHTTPRequestRawPostBody(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchContentType2, pubBody, unBodyLen); } } @@ -205,7 +205,7 @@ public static bool SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, string /// public static HTTPCookieContainerHandle CreateCookieContainer(bool bAllowResponsesToModify) { InteropHelp.TestIfAvailableGameServer(); - return (HTTPCookieContainerHandle)NativeMethods.ISteamGameServerHTTP_CreateCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), bAllowResponsesToModify); + return (HTTPCookieContainerHandle)NativeMethods.ISteamHTTP_CreateCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), bAllowResponsesToModify); } /// @@ -213,7 +213,7 @@ public static HTTPCookieContainerHandle CreateCookieContainer(bool bAllowRespons /// public static bool ReleaseCookieContainer(HTTPCookieContainerHandle hCookieContainer) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_ReleaseCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer); + return NativeMethods.ISteamHTTP_ReleaseCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer); } /// @@ -224,7 +224,7 @@ public static bool SetCookie(HTTPCookieContainerHandle hCookieContainer, string using (var pchHost2 = new InteropHelp.UTF8StringHandle(pchHost)) using (var pchUrl2 = new InteropHelp.UTF8StringHandle(pchUrl)) using (var pchCookie2 = new InteropHelp.UTF8StringHandle(pchCookie)) { - return NativeMethods.ISteamGameServerHTTP_SetCookie(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer, pchHost2, pchUrl2, pchCookie2); + return NativeMethods.ISteamHTTP_SetCookie(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer, pchHost2, pchUrl2, pchCookie2); } } @@ -233,7 +233,7 @@ public static bool SetCookie(HTTPCookieContainerHandle hCookieContainer, string /// public static bool SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, hCookieContainer); + return NativeMethods.ISteamHTTP_SetHTTPRequestCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, hCookieContainer); } /// @@ -242,7 +242,7 @@ public static bool SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTT public static bool SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, string pchUserAgentInfo) { InteropHelp.TestIfAvailableGameServer(); using (var pchUserAgentInfo2 = new InteropHelp.UTF8StringHandle(pchUserAgentInfo)) { - return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestUserAgentInfo(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchUserAgentInfo2); + return NativeMethods.ISteamHTTP_SetHTTPRequestUserAgentInfo(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchUserAgentInfo2); } } @@ -252,7 +252,7 @@ public static bool SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, strin /// public static bool SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestRequiresVerifiedCertificate(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, bRequireVerifiedCertificate); + return NativeMethods.ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, bRequireVerifiedCertificate); } /// @@ -261,7 +261,7 @@ public static bool SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle h /// public static bool SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, uint unMilliseconds) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_SetHTTPRequestAbsoluteTimeoutMS(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unMilliseconds); + return NativeMethods.ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unMilliseconds); } /// @@ -269,7 +269,7 @@ public static bool SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, u /// public static bool GetHTTPRequestWasTimedOut(HTTPRequestHandle hRequest, out bool pbWasTimedOut) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerHTTP_GetHTTPRequestWasTimedOut(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pbWasTimedOut); + return NativeMethods.ISteamHTTP_GetHTTPRequestWasTimedOut(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pbWasTimedOut); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverinventory.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverinventory.cs index dc03f25c..608216bd 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverinventory.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverinventory.cs @@ -32,7 +32,7 @@ public static class SteamGameServerInventory { /// public static EResult GetResultStatus(SteamInventoryResult_t resultHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_GetResultStatus(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); + return NativeMethods.ISteamInventory_GetResultStatus(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); } /// @@ -44,7 +44,7 @@ public static bool GetResultItems(SteamInventoryResult_t resultHandle, SteamItem if (pOutItemsArray != null && pOutItemsArray.Length != punOutItemsArraySize) { throw new System.ArgumentException("pOutItemsArray must be the same size as punOutItemsArraySize!"); } - return NativeMethods.ISteamGameServerInventory_GetResultItems(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutItemsArray, ref punOutItemsArraySize); + return NativeMethods.ISteamInventory_GetResultItems(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutItemsArray, ref punOutItemsArraySize); } /// @@ -62,7 +62,7 @@ public static bool GetResultItemProperty(SteamInventoryResult_t resultHandle, ui InteropHelp.TestIfAvailableGameServer(); IntPtr pchValueBuffer2 = Marshal.AllocHGlobal((int)punValueBufferSizeOut); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) { - bool ret = NativeMethods.ISteamGameServerInventory_GetResultItemProperty(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, unItemIndex, pchPropertyName2, pchValueBuffer2, ref punValueBufferSizeOut); + bool ret = NativeMethods.ISteamInventory_GetResultItemProperty(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, unItemIndex, pchPropertyName2, pchValueBuffer2, ref punValueBufferSizeOut); pchValueBuffer = ret ? InteropHelp.PtrToStringUTF8(pchValueBuffer2) : null; Marshal.FreeHGlobal(pchValueBuffer2); return ret; @@ -75,7 +75,7 @@ public static bool GetResultItemProperty(SteamInventoryResult_t resultHandle, ui /// public static uint GetResultTimestamp(SteamInventoryResult_t resultHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_GetResultTimestamp(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); + return NativeMethods.ISteamInventory_GetResultTimestamp(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); } /// @@ -85,7 +85,7 @@ public static uint GetResultTimestamp(SteamInventoryResult_t resultHandle) { /// public static bool CheckResultSteamID(SteamInventoryResult_t resultHandle, CSteamID steamIDExpected) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_CheckResultSteamID(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, steamIDExpected); + return NativeMethods.ISteamInventory_CheckResultSteamID(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, steamIDExpected); } /// @@ -93,7 +93,7 @@ public static bool CheckResultSteamID(SteamInventoryResult_t resultHandle, CStea /// public static void DestroyResult(SteamInventoryResult_t resultHandle) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerInventory_DestroyResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); + NativeMethods.ISteamInventory_DestroyResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); } /// @@ -108,7 +108,7 @@ public static void DestroyResult(SteamInventoryResult_t resultHandle) { /// public static bool GetAllItems(out SteamInventoryResult_t pResultHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_GetAllItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle); + return NativeMethods.ISteamInventory_GetAllItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle); } /// @@ -122,7 +122,7 @@ public static bool GetAllItems(out SteamInventoryResult_t pResultHandle) { /// public static bool GetItemsByID(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t[] pInstanceIDs, uint unCountInstanceIDs) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_GetItemsByID(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pInstanceIDs, unCountInstanceIDs); + return NativeMethods.ISteamInventory_GetItemsByID(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pInstanceIDs, unCountInstanceIDs); } /// @@ -142,7 +142,7 @@ public static bool GetItemsByID(out SteamInventoryResult_t pResultHandle, SteamI /// public static bool SerializeResult(SteamInventoryResult_t resultHandle, byte[] pOutBuffer, out uint punOutBufferSize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_SerializeResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutBuffer, out punOutBufferSize); + return NativeMethods.ISteamInventory_SerializeResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutBuffer, out punOutBufferSize); } /// @@ -163,7 +163,7 @@ public static bool SerializeResult(SteamInventoryResult_t resultHandle, byte[] p /// public static bool DeserializeResult(out SteamInventoryResult_t pOutResultHandle, byte[] pBuffer, uint unBufferSize, bool bRESERVED_MUST_BE_FALSE = false) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_DeserializeResult(CSteamGameServerAPIContext.GetSteamInventory(), out pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE); + return NativeMethods.ISteamInventory_DeserializeResult(CSteamGameServerAPIContext.GetSteamInventory(), out pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE); } /// @@ -177,7 +177,7 @@ public static bool DeserializeResult(out SteamInventoryResult_t pOutResultHandle /// public static bool GenerateItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_GenerateItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength); + return NativeMethods.ISteamInventory_GenerateItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength); } /// @@ -188,7 +188,7 @@ public static bool GenerateItems(out SteamInventoryResult_t pResultHandle, Steam /// public static bool GrantPromoItems(out SteamInventoryResult_t pResultHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_GrantPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle); + return NativeMethods.ISteamInventory_GrantPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle); } /// @@ -199,12 +199,12 @@ public static bool GrantPromoItems(out SteamInventoryResult_t pResultHandle) { /// public static bool AddPromoItem(out SteamInventoryResult_t pResultHandle, SteamItemDef_t itemDef) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_AddPromoItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemDef); + return NativeMethods.ISteamInventory_AddPromoItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemDef); } public static bool AddPromoItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint unArrayLength) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_AddPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, unArrayLength); + return NativeMethods.ISteamInventory_AddPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, unArrayLength); } /// @@ -214,7 +214,7 @@ public static bool AddPromoItems(out SteamInventoryResult_t pResultHandle, Steam /// public static bool ConsumeItem(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemConsume, uint unQuantity) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_ConsumeItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemConsume, unQuantity); + return NativeMethods.ISteamInventory_ConsumeItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemConsume, unQuantity); } /// @@ -229,7 +229,7 @@ public static bool ConsumeItem(out SteamInventoryResult_t pResultHandle, SteamIt /// public static bool ExchangeItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayGenerate, uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, SteamItemInstanceID_t[] pArrayDestroy, uint[] punArrayDestroyQuantity, uint unArrayDestroyLength) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_ExchangeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength); + return NativeMethods.ISteamInventory_ExchangeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength); } /// @@ -240,7 +240,7 @@ public static bool ExchangeItems(out SteamInventoryResult_t pResultHandle, Steam /// public static bool TransferItemQuantity(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemIdSource, uint unQuantity, SteamItemInstanceID_t itemIdDest) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_TransferItemQuantity(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemIdSource, unQuantity, itemIdDest); + return NativeMethods.ISteamInventory_TransferItemQuantity(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemIdSource, unQuantity, itemIdDest); } /// @@ -249,7 +249,7 @@ public static bool TransferItemQuantity(out SteamInventoryResult_t pResultHandle /// public static void SendItemDropHeartbeat() { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerInventory_SendItemDropHeartbeat(CSteamGameServerAPIContext.GetSteamInventory()); + NativeMethods.ISteamInventory_SendItemDropHeartbeat(CSteamGameServerAPIContext.GetSteamInventory()); } /// @@ -265,7 +265,7 @@ public static void SendItemDropHeartbeat() { /// public static bool TriggerItemDrop(out SteamInventoryResult_t pResultHandle, SteamItemDef_t dropListDefinition) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_TriggerItemDrop(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, dropListDefinition); + return NativeMethods.ISteamInventory_TriggerItemDrop(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, dropListDefinition); } /// @@ -273,7 +273,7 @@ public static bool TriggerItemDrop(out SteamInventoryResult_t pResultHandle, Ste /// public static bool TradeItems(out SteamInventoryResult_t pResultHandle, CSteamID steamIDTradePartner, SteamItemInstanceID_t[] pArrayGive, uint[] pArrayGiveQuantity, uint nArrayGiveLength, SteamItemInstanceID_t[] pArrayGet, uint[] pArrayGetQuantity, uint nArrayGetLength) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_TradeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength); + return NativeMethods.ISteamInventory_TradeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength); } /// @@ -291,7 +291,7 @@ public static bool TradeItems(out SteamInventoryResult_t pResultHandle, CSteamID /// public static bool LoadItemDefinitions() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_LoadItemDefinitions(CSteamGameServerAPIContext.GetSteamInventory()); + return NativeMethods.ISteamInventory_LoadItemDefinitions(CSteamGameServerAPIContext.GetSteamInventory()); } /// @@ -306,7 +306,7 @@ public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, ref uint p if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize) { throw new System.ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!"); } - return NativeMethods.ISteamGameServerInventory_GetItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), pItemDefIDs, ref punItemDefIDsArraySize); + return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), pItemDefIDs, ref punItemDefIDsArraySize); } /// @@ -324,7 +324,7 @@ public static bool GetItemDefinitionProperty(SteamItemDef_t iDefinition, string InteropHelp.TestIfAvailableGameServer(); IntPtr pchValueBuffer2 = Marshal.AllocHGlobal((int)punValueBufferSizeOut); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) { - bool ret = NativeMethods.ISteamGameServerInventory_GetItemDefinitionProperty(CSteamGameServerAPIContext.GetSteamInventory(), iDefinition, pchPropertyName2, pchValueBuffer2, ref punValueBufferSizeOut); + bool ret = NativeMethods.ISteamInventory_GetItemDefinitionProperty(CSteamGameServerAPIContext.GetSteamInventory(), iDefinition, pchPropertyName2, pchValueBuffer2, ref punValueBufferSizeOut); pchValueBuffer = ret ? InteropHelp.PtrToStringUTF8(pchValueBuffer2) : null; Marshal.FreeHGlobal(pchValueBuffer2); return ret; @@ -338,7 +338,7 @@ public static bool GetItemDefinitionProperty(SteamItemDef_t iDefinition, string /// public static SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs(CSteamID steamID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerInventory_RequestEligiblePromoItemDefinitionsIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID); + return (SteamAPICall_t)NativeMethods.ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID); } /// @@ -351,7 +351,7 @@ public static bool GetEligiblePromoItemDefinitionIDs(CSteamID steamID, SteamItem if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize) { throw new System.ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!"); } - return NativeMethods.ISteamGameServerInventory_GetEligiblePromoItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID, pItemDefIDs, ref punItemDefIDsArraySize); + return NativeMethods.ISteamInventory_GetEligiblePromoItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID, pItemDefIDs, ref punItemDefIDsArraySize); } /// @@ -362,7 +362,7 @@ public static bool GetEligiblePromoItemDefinitionIDs(CSteamID steamID, SteamItem /// public static SteamAPICall_t StartPurchase(SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerInventory_StartPurchase(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, punArrayQuantity, unArrayLength); + return (SteamAPICall_t)NativeMethods.ISteamInventory_StartPurchase(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, punArrayQuantity, unArrayLength); } /// @@ -370,7 +370,7 @@ public static SteamAPICall_t StartPurchase(SteamItemDef_t[] pArrayItemDefs, uint /// public static SteamAPICall_t RequestPrices() { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerInventory_RequestPrices(CSteamGameServerAPIContext.GetSteamInventory()); + return (SteamAPICall_t)NativeMethods.ISteamInventory_RequestPrices(CSteamGameServerAPIContext.GetSteamInventory()); } /// @@ -378,7 +378,7 @@ public static SteamAPICall_t RequestPrices() { /// public static uint GetNumItemsWithPrices() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_GetNumItemsWithPrices(CSteamGameServerAPIContext.GetSteamInventory()); + return NativeMethods.ISteamInventory_GetNumItemsWithPrices(CSteamGameServerAPIContext.GetSteamInventory()); } /// @@ -396,7 +396,7 @@ public static bool GetItemsWithPrices(SteamItemDef_t[] pArrayItemDefs, ulong[] p if (pBasePrices != null && pBasePrices.Length != unArrayLength) { throw new System.ArgumentException("pBasePrices must be the same size as unArrayLength!"); } - return NativeMethods.ISteamGameServerInventory_GetItemsWithPrices(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, pCurrentPrices, pBasePrices, unArrayLength); + return NativeMethods.ISteamInventory_GetItemsWithPrices(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, pCurrentPrices, pBasePrices, unArrayLength); } /// @@ -405,7 +405,7 @@ public static bool GetItemsWithPrices(SteamItemDef_t[] pArrayItemDefs, ulong[] p /// public static bool GetItemPrice(SteamItemDef_t iDefinition, out ulong pCurrentPrice, out ulong pBasePrice) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_GetItemPrice(CSteamGameServerAPIContext.GetSteamInventory(), iDefinition, out pCurrentPrice, out pBasePrice); + return NativeMethods.ISteamInventory_GetItemPrice(CSteamGameServerAPIContext.GetSteamInventory(), iDefinition, out pCurrentPrice, out pBasePrice); } /// @@ -413,7 +413,7 @@ public static bool GetItemPrice(SteamItemDef_t iDefinition, out ulong pCurrentPr /// public static SteamInventoryUpdateHandle_t StartUpdateProperties() { InteropHelp.TestIfAvailableGameServer(); - return (SteamInventoryUpdateHandle_t)NativeMethods.ISteamGameServerInventory_StartUpdateProperties(CSteamGameServerAPIContext.GetSteamInventory()); + return (SteamInventoryUpdateHandle_t)NativeMethods.ISteamInventory_StartUpdateProperties(CSteamGameServerAPIContext.GetSteamInventory()); } /// @@ -422,7 +422,7 @@ public static SteamInventoryUpdateHandle_t StartUpdateProperties() { public static bool RemoveProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName) { InteropHelp.TestIfAvailableGameServer(); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) { - return NativeMethods.ISteamGameServerInventory_RemoveProperty(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2); + return NativeMethods.ISteamInventory_RemoveProperty(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2); } } @@ -433,28 +433,28 @@ public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemIns InteropHelp.TestIfAvailableGameServer(); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) using (var pchPropertyValue2 = new InteropHelp.UTF8StringHandle(pchPropertyValue)) { - return NativeMethods.ISteamGameServerInventory_SetPropertyString(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, pchPropertyValue2); + return NativeMethods.ISteamInventory_SetPropertyString(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, pchPropertyValue2); } } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, bool bValue) { InteropHelp.TestIfAvailableGameServer(); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) { - return NativeMethods.ISteamGameServerInventory_SetPropertyBool(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, bValue); + return NativeMethods.ISteamInventory_SetPropertyBool(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, bValue); } } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, long nValue) { InteropHelp.TestIfAvailableGameServer(); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) { - return NativeMethods.ISteamGameServerInventory_SetPropertyInt64(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, nValue); + return NativeMethods.ISteamInventory_SetPropertyInt64(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, nValue); } } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, float flValue) { InteropHelp.TestIfAvailableGameServer(); using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) { - return NativeMethods.ISteamGameServerInventory_SetPropertyFloat(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, flValue); + return NativeMethods.ISteamInventory_SetPropertyFloat(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, flValue); } } @@ -463,13 +463,13 @@ public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemIns /// public static bool SubmitUpdateProperties(SteamInventoryUpdateHandle_t handle, out SteamInventoryResult_t pResultHandle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerInventory_SubmitUpdateProperties(CSteamGameServerAPIContext.GetSteamInventory(), handle, out pResultHandle); + return NativeMethods.ISteamInventory_SubmitUpdateProperties(CSteamGameServerAPIContext.GetSteamInventory(), handle, out pResultHandle); } public static bool InspectItem(out SteamInventoryResult_t pResultHandle, string pchItemToken) { InteropHelp.TestIfAvailableGameServer(); using (var pchItemToken2 = new InteropHelp.UTF8StringHandle(pchItemToken)) { - return NativeMethods.ISteamGameServerInventory_InspectItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pchItemToken2); + return NativeMethods.ISteamInventory_InspectItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pchItemToken2); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworking.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworking.cs index 6f355173..5a8f3410 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworking.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworking.cs @@ -36,7 +36,7 @@ public static class SteamGameServerNetworking { /// public static bool SendP2PPacket(CSteamID steamIDRemote, byte[] pubData, uint cubData, EP2PSend eP2PSendType, int nChannel = 0) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_SendP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, pubData, cubData, eP2PSendType, nChannel); + return NativeMethods.ISteamNetworking_SendP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, pubData, cubData, eP2PSendType, nChannel); } /// @@ -44,7 +44,7 @@ public static bool SendP2PPacket(CSteamID steamIDRemote, byte[] pubData, uint cu /// public static bool IsP2PPacketAvailable(out uint pcubMsgSize, int nChannel = 0) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_IsP2PPacketAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), out pcubMsgSize, nChannel); + return NativeMethods.ISteamNetworking_IsP2PPacketAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), out pcubMsgSize, nChannel); } /// @@ -55,7 +55,7 @@ public static bool IsP2PPacketAvailable(out uint pcubMsgSize, int nChannel = 0) /// public static bool ReadP2PPacket(byte[] pubDest, uint cubDest, out uint pcubMsgSize, out CSteamID psteamIDRemote, int nChannel = 0) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_ReadP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel); + return NativeMethods.ISteamNetworking_ReadP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel); } /// @@ -68,7 +68,7 @@ public static bool ReadP2PPacket(byte[] pubDest, uint cubDest, out uint pcubMsgS /// public static bool AcceptP2PSessionWithUser(CSteamID steamIDRemote) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_AcceptP2PSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote); + return NativeMethods.ISteamNetworking_AcceptP2PSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote); } /// @@ -77,7 +77,7 @@ public static bool AcceptP2PSessionWithUser(CSteamID steamIDRemote) { /// public static bool CloseP2PSessionWithUser(CSteamID steamIDRemote) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_CloseP2PSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote); + return NativeMethods.ISteamNetworking_CloseP2PSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote); } /// @@ -87,7 +87,7 @@ public static bool CloseP2PSessionWithUser(CSteamID steamIDRemote) { /// public static bool CloseP2PChannelWithUser(CSteamID steamIDRemote, int nChannel) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_CloseP2PChannelWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, nChannel); + return NativeMethods.ISteamNetworking_CloseP2PChannelWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, nChannel); } /// @@ -97,7 +97,7 @@ public static bool CloseP2PChannelWithUser(CSteamID steamIDRemote, int nChannel) /// public static bool GetP2PSessionState(CSteamID steamIDRemote, out P2PSessionState_t pConnectionState) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_GetP2PSessionState(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, out pConnectionState); + return NativeMethods.ISteamNetworking_GetP2PSessionState(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, out pConnectionState); } /// @@ -111,7 +111,7 @@ public static bool GetP2PSessionState(CSteamID steamIDRemote, out P2PSessionStat /// public static bool AllowP2PPacketRelay(bool bAllow) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_AllowP2PPacketRelay(CSteamGameServerAPIContext.GetSteamNetworking(), bAllow); + return NativeMethods.ISteamNetworking_AllowP2PPacketRelay(CSteamGameServerAPIContext.GetSteamNetworking(), bAllow); } /// @@ -138,7 +138,7 @@ public static bool AllowP2PPacketRelay(bool bAllow) { /// public static SNetListenSocket_t CreateListenSocket(int nVirtualP2PPort, SteamIPAddress_t nIP, ushort nPort, bool bAllowUseOfPacketRelay) { InteropHelp.TestIfAvailableGameServer(); - return (SNetListenSocket_t)NativeMethods.ISteamGameServerNetworking_CreateListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay); + return (SNetListenSocket_t)NativeMethods.ISteamNetworking_CreateListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay); } /// @@ -149,12 +149,12 @@ public static SNetListenSocket_t CreateListenSocket(int nVirtualP2PPort, SteamIP /// public static SNetSocket_t CreateP2PConnectionSocket(CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay) { InteropHelp.TestIfAvailableGameServer(); - return (SNetSocket_t)NativeMethods.ISteamGameServerNetworking_CreateP2PConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay); + return (SNetSocket_t)NativeMethods.ISteamNetworking_CreateP2PConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay); } public static SNetSocket_t CreateConnectionSocket(SteamIPAddress_t nIP, ushort nPort, int nTimeoutSec) { InteropHelp.TestIfAvailableGameServer(); - return (SNetSocket_t)NativeMethods.ISteamGameServerNetworking_CreateConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nIP, nPort, nTimeoutSec); + return (SNetSocket_t)NativeMethods.ISteamNetworking_CreateConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nIP, nPort, nTimeoutSec); } /// @@ -164,7 +164,7 @@ public static SNetSocket_t CreateConnectionSocket(SteamIPAddress_t nIP, ushort n /// public static bool DestroySocket(SNetSocket_t hSocket, bool bNotifyRemoteEnd) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_DestroySocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd); + return NativeMethods.ISteamNetworking_DestroySocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd); } /// @@ -172,7 +172,7 @@ public static bool DestroySocket(SNetSocket_t hSocket, bool bNotifyRemoteEnd) { /// public static bool DestroyListenSocket(SNetListenSocket_t hSocket, bool bNotifyRemoteEnd) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_DestroyListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd); + return NativeMethods.ISteamNetworking_DestroyListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd); } /// @@ -184,7 +184,7 @@ public static bool DestroyListenSocket(SNetListenSocket_t hSocket, bool bNotifyR /// public static bool SendDataOnSocket(SNetSocket_t hSocket, byte[] pubData, uint cubData, bool bReliable) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_SendDataOnSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, pubData, cubData, bReliable); + return NativeMethods.ISteamNetworking_SendDataOnSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, pubData, cubData, bReliable); } /// @@ -194,7 +194,7 @@ public static bool SendDataOnSocket(SNetSocket_t hSocket, byte[] pubData, uint c /// public static bool IsDataAvailableOnSocket(SNetSocket_t hSocket, out uint pcubMsgSize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_IsDataAvailableOnSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, out pcubMsgSize); + return NativeMethods.ISteamNetworking_IsDataAvailableOnSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, out pcubMsgSize); } /// @@ -205,7 +205,7 @@ public static bool IsDataAvailableOnSocket(SNetSocket_t hSocket, out uint pcubMs /// public static bool RetrieveDataFromSocket(SNetSocket_t hSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_RetrieveDataFromSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, pubDest, cubDest, out pcubMsgSize); + return NativeMethods.ISteamNetworking_RetrieveDataFromSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, pubDest, cubDest, out pcubMsgSize); } /// @@ -216,7 +216,7 @@ public static bool RetrieveDataFromSocket(SNetSocket_t hSocket, byte[] pubDest, /// public static bool IsDataAvailable(SNetListenSocket_t hListenSocket, out uint pcubMsgSize, out SNetSocket_t phSocket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_IsDataAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pcubMsgSize, out phSocket); + return NativeMethods.ISteamNetworking_IsDataAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pcubMsgSize, out phSocket); } /// @@ -229,7 +229,7 @@ public static bool IsDataAvailable(SNetListenSocket_t hListenSocket, out uint pc /// public static bool RetrieveData(SNetListenSocket_t hListenSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize, out SNetSocket_t phSocket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_RetrieveData(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, pubDest, cubDest, out pcubMsgSize, out phSocket); + return NativeMethods.ISteamNetworking_RetrieveData(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, pubDest, cubDest, out pcubMsgSize, out phSocket); } /// @@ -237,7 +237,7 @@ public static bool RetrieveData(SNetListenSocket_t hListenSocket, byte[] pubDest /// public static bool GetSocketInfo(SNetSocket_t hSocket, out CSteamID pSteamIDRemote, out int peSocketStatus, out SteamIPAddress_t punIPRemote, out ushort punPortRemote) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_GetSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, out pSteamIDRemote, out peSocketStatus, out punIPRemote, out punPortRemote); + return NativeMethods.ISteamNetworking_GetSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, out pSteamIDRemote, out peSocketStatus, out punIPRemote, out punPortRemote); } /// @@ -246,7 +246,7 @@ public static bool GetSocketInfo(SNetSocket_t hSocket, out CSteamID pSteamIDRemo /// public static bool GetListenSocketInfo(SNetListenSocket_t hListenSocket, out SteamIPAddress_t pnIP, out ushort pnPort) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_GetListenSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pnIP, out pnPort); + return NativeMethods.ISteamNetworking_GetListenSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pnIP, out pnPort); } /// @@ -254,7 +254,7 @@ public static bool GetListenSocketInfo(SNetListenSocket_t hListenSocket, out Ste /// public static ESNetSocketConnectionType GetSocketConnectionType(SNetSocket_t hSocket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_GetSocketConnectionType(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket); + return NativeMethods.ISteamNetworking_GetSocketConnectionType(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket); } /// @@ -262,7 +262,7 @@ public static ESNetSocketConnectionType GetSocketConnectionType(SNetSocket_t hSo /// public static int GetMaxPacketSize(SNetSocket_t hSocket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworking_GetMaxPacketSize(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket); + return NativeMethods.ISteamNetworking_GetMaxPacketSize(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs index 0637e9fa..0b5711f3 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs @@ -64,7 +64,7 @@ public static class SteamGameServerNetworkingMessages { /// public static EResult SendMessageToUser(ref SteamNetworkingIdentity identityRemote, IntPtr pubData, uint cubData, int nSendFlags, int nRemoteChannel) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingMessages_SendMessageToUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, pubData, cubData, nSendFlags, nRemoteChannel); + return NativeMethods.ISteamNetworkingMessages_SendMessageToUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, pubData, cubData, nSendFlags, nRemoteChannel); } /// @@ -78,7 +78,7 @@ public static int ReceiveMessagesOnChannel(int nLocalChannel, IntPtr[] ppOutMess if (ppOutMessages != null && ppOutMessages.Length != nMaxMessages) { throw new System.ArgumentException("ppOutMessages must be the same size as nMaxMessages!"); } - return NativeMethods.ISteamGameServerNetworkingMessages_ReceiveMessagesOnChannel(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), nLocalChannel, ppOutMessages, nMaxMessages); + return NativeMethods.ISteamNetworkingMessages_ReceiveMessagesOnChannel(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), nLocalChannel, ppOutMessages, nMaxMessages); } /// @@ -95,7 +95,7 @@ public static int ReceiveMessagesOnChannel(int nLocalChannel, IntPtr[] ppOutMess /// public static bool AcceptSessionWithUser(ref SteamNetworkingIdentity identityRemote) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingMessages_AcceptSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote); + return NativeMethods.ISteamNetworkingMessages_AcceptSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote); } /// @@ -107,7 +107,7 @@ public static bool AcceptSessionWithUser(ref SteamNetworkingIdentity identityRem /// public static bool CloseSessionWithUser(ref SteamNetworkingIdentity identityRemote) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingMessages_CloseSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote); + return NativeMethods.ISteamNetworkingMessages_CloseSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote); } /// @@ -118,7 +118,7 @@ public static bool CloseSessionWithUser(ref SteamNetworkingIdentity identityRemo /// public static bool CloseChannelWithUser(ref SteamNetworkingIdentity identityRemote, int nLocalChannel) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingMessages_CloseChannelWithUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, nLocalChannel); + return NativeMethods.ISteamNetworkingMessages_CloseChannelWithUser(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, nLocalChannel); } /// @@ -134,13 +134,15 @@ public static bool CloseChannelWithUser(ref SteamNetworkingIdentity identityRemo /// public static ESteamNetworkingConnectionState GetSessionConnectionInfo(ref SteamNetworkingIdentity identityRemote, out SteamNetConnectionInfo_t pConnectionInfo, out SteamNetConnectionRealTimeStatus_t pQuickStatus) { InteropHelp.TestIfAvailableGameServer(); - ESteamNetworkingConnectionState anyCpuResult; + ESteamNetworkingConnectionState ret; if (!Packsize.IsLargePack) { - anyCpuResult = NativeMethods.ISteamGameServerNetworkingMessages_GetSessionConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo, out pQuickStatus); + ret = NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo, out pQuickStatus); } else { - anyCpuResult = NativeMethods.ISteamGameServerNetworkingMessages_GetSessionConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo_lp, out pQuickStatus); + SteamNetConnectionInfo_t pConnectionInfo_lp; + ret = NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo_lp, out pQuickStatus); + pConnectionInfo = pConnectionInfo_lp; } - return anyCpuResult; + return ret; } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs index daf0e96c..29c1dbee 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs @@ -39,7 +39,7 @@ public static class SteamGameServerNetworkingSockets { /// public static HSteamListenSocket CreateListenSocketIP(ref SteamNetworkingIPAddr localAddress, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamListenSocket)NativeMethods.ISteamGameServerNetworkingSockets_CreateListenSocketIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref localAddress, nOptions, pOptions); + return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateListenSocketIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref localAddress, nOptions, pOptions); } /// @@ -68,7 +68,7 @@ public static HSteamListenSocket CreateListenSocketIP(ref SteamNetworkingIPAddr /// public static HSteamNetConnection ConnectByIPAddress(ref SteamNetworkingIPAddr address, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamNetConnection)NativeMethods.ISteamGameServerNetworkingSockets_ConnectByIPAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref address, nOptions, pOptions); + return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectByIPAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref address, nOptions, pOptions); } /// @@ -98,7 +98,7 @@ public static HSteamNetConnection ConnectByIPAddress(ref SteamNetworkingIPAddr a /// public static HSteamListenSocket CreateListenSocketP2P(int nLocalVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamListenSocket)NativeMethods.ISteamGameServerNetworkingSockets_CreateListenSocketP2P(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nLocalVirtualPort, nOptions, pOptions); + return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateListenSocketP2P(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nLocalVirtualPort, nOptions, pOptions); } /// @@ -116,7 +116,7 @@ public static HSteamListenSocket CreateListenSocketP2P(int nLocalVirtualPort, in /// public static HSteamNetConnection ConnectP2P(ref SteamNetworkingIdentity identityRemote, int nRemoteVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamNetConnection)NativeMethods.ISteamGameServerNetworkingSockets_ConnectP2P(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityRemote, nRemoteVirtualPort, nOptions, pOptions); + return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectP2P(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityRemote, nRemoteVirtualPort, nOptions, pOptions); } /// @@ -162,7 +162,7 @@ public static HSteamNetConnection ConnectP2P(ref SteamNetworkingIdentity identit /// public static EResult AcceptConnection(HSteamNetConnection hConn) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_AcceptConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn); + return NativeMethods.ISteamNetworkingSockets_AcceptConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn); } /// @@ -191,7 +191,7 @@ public static EResult AcceptConnection(HSteamNetConnection hConn) { public static bool CloseConnection(HSteamNetConnection hPeer, int nReason, string pszDebug, bool bEnableLinger) { InteropHelp.TestIfAvailableGameServer(); using (var pszDebug2 = new InteropHelp.UTF8StringHandle(pszDebug)) { - return NativeMethods.ISteamGameServerNetworkingSockets_CloseConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, nReason, pszDebug2, bEnableLinger); + return NativeMethods.ISteamNetworkingSockets_CloseConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, nReason, pszDebug2, bEnableLinger); } } @@ -201,7 +201,7 @@ public static bool CloseConnection(HSteamNetConnection hPeer, int nReason, strin /// public static bool CloseListenSocket(HSteamListenSocket hSocket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_CloseListenSocket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hSocket); + return NativeMethods.ISteamNetworkingSockets_CloseListenSocket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hSocket); } /// @@ -230,7 +230,7 @@ public static bool CloseListenSocket(HSteamListenSocket hSocket) { /// public static bool SetConnectionUserData(HSteamNetConnection hPeer, long nUserData) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_SetConnectionUserData(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, nUserData); + return NativeMethods.ISteamNetworkingSockets_SetConnectionUserData(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, nUserData); } /// @@ -239,7 +239,7 @@ public static bool SetConnectionUserData(HSteamNetConnection hPeer, long nUserDa /// public static long GetConnectionUserData(HSteamNetConnection hPeer) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_GetConnectionUserData(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer); + return NativeMethods.ISteamNetworkingSockets_GetConnectionUserData(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer); } /// @@ -248,7 +248,7 @@ public static long GetConnectionUserData(HSteamNetConnection hPeer) { public static void SetConnectionName(HSteamNetConnection hPeer, string pszName) { InteropHelp.TestIfAvailableGameServer(); using (var pszName2 = new InteropHelp.UTF8StringHandle(pszName)) { - NativeMethods.ISteamGameServerNetworkingSockets_SetConnectionName(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, pszName2); + NativeMethods.ISteamNetworkingSockets_SetConnectionName(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, pszName2); } } @@ -258,7 +258,7 @@ public static void SetConnectionName(HSteamNetConnection hPeer, string pszName) public static bool GetConnectionName(HSteamNetConnection hPeer, out string pszName, int nMaxLen) { InteropHelp.TestIfAvailableGameServer(); IntPtr pszName2 = Marshal.AllocHGlobal(nMaxLen); - bool ret = NativeMethods.ISteamGameServerNetworkingSockets_GetConnectionName(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, pszName2, nMaxLen); + bool ret = NativeMethods.ISteamNetworkingSockets_GetConnectionName(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, pszName2, nMaxLen); pszName = ret ? InteropHelp.PtrToStringUTF8(pszName2) : null; Marshal.FreeHGlobal(pszName2); return ret; @@ -305,7 +305,7 @@ public static bool GetConnectionName(HSteamNetConnection hPeer, out string pszNa /// public static EResult SendMessageToConnection(HSteamNetConnection hConn, IntPtr pData, uint cbData, int nSendFlags, out long pOutMessageNumber) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_SendMessageToConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, pData, cbData, nSendFlags, out pOutMessageNumber); + return NativeMethods.ISteamNetworkingSockets_SendMessageToConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, pData, cbData, nSendFlags, out pOutMessageNumber); } /// @@ -344,7 +344,7 @@ public static EResult SendMessageToConnection(HSteamNetConnection hConn, IntPtr /// public static void SendMessages(int nMessages, IntPtr[] pMessages, long[] pOutMessageNumberOrResult) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerNetworkingSockets_SendMessages(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nMessages, pMessages, pOutMessageNumberOrResult); + NativeMethods.ISteamNetworkingSockets_SendMessages(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nMessages, pMessages, pOutMessageNumberOrResult); } /// @@ -364,7 +364,7 @@ public static void SendMessages(int nMessages, IntPtr[] pMessages, long[] pOutMe /// public static EResult FlushMessagesOnConnection(HSteamNetConnection hConn) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_FlushMessagesOnConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn); + return NativeMethods.ISteamNetworkingSockets_FlushMessagesOnConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn); } /// @@ -389,7 +389,7 @@ public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, IntPtr[ if (ppOutMessages != null && ppOutMessages.Length != nMaxMessages) { throw new System.ArgumentException("ppOutMessages must be the same size as nMaxMessages!"); } - return NativeMethods.ISteamGameServerNetworkingSockets_ReceiveMessagesOnConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, ppOutMessages, nMaxMessages); + return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, ppOutMessages, nMaxMessages); } /// @@ -397,13 +397,15 @@ public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, IntPtr[ /// public static bool GetConnectionInfo(HSteamNetConnection hConn, out SteamNetConnectionInfo_t pInfo) { InteropHelp.TestIfAvailableGameServer(); - bool anyCpuResult; + bool ret; if (!Packsize.IsLargePack) { - anyCpuResult = NativeMethods.ISteamGameServerNetworkingSockets_GetConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); + ret = NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); } else { - anyCpuResult = NativeMethods.ISteamGameServerNetworkingSockets_GetConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo_lp); + SteamNetConnectionInfo_t pInfo_lp; + ret = NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo_lp); + pInfo = pInfo_lp; } - return anyCpuResult; + return ret; } /// @@ -424,7 +426,7 @@ public static bool GetConnectionInfo(HSteamNetConnection hConn, out SteamNetConn /// public static EResult GetConnectionRealTimeStatus(HSteamNetConnection hConn, ref SteamNetConnectionRealTimeStatus_t pStatus, int nLanes, ref SteamNetConnectionRealTimeLaneStatus_t pLanes) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_GetConnectionRealTimeStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, ref pStatus, nLanes, ref pLanes); + return NativeMethods.ISteamNetworkingSockets_GetConnectionRealTimeStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, ref pStatus, nLanes, ref pLanes); } /// @@ -440,7 +442,7 @@ public static EResult GetConnectionRealTimeStatus(HSteamNetConnection hConn, ref public static int GetDetailedConnectionStatus(HSteamNetConnection hConn, out string pszBuf, int cbBuf) { InteropHelp.TestIfAvailableGameServer(); IntPtr pszBuf2 = Marshal.AllocHGlobal(cbBuf); - int ret = NativeMethods.ISteamGameServerNetworkingSockets_GetDetailedConnectionStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, pszBuf2, cbBuf); + int ret = NativeMethods.ISteamNetworkingSockets_GetDetailedConnectionStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, pszBuf2, cbBuf); pszBuf = ret != -1 ? InteropHelp.PtrToStringUTF8(pszBuf2) : null; Marshal.FreeHGlobal(pszBuf2); return ret; @@ -454,7 +456,7 @@ public static int GetDetailedConnectionStatus(HSteamNetConnection hConn, out str /// public static bool GetListenSocketAddress(HSteamListenSocket hSocket, out SteamNetworkingIPAddr address) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_GetListenSocketAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hSocket, out address); + return NativeMethods.ISteamNetworkingSockets_GetListenSocketAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hSocket, out address); } /// @@ -481,7 +483,7 @@ public static bool GetListenSocketAddress(HSteamListenSocket hSocket, out SteamN /// public static bool CreateSocketPair(out HSteamNetConnection pOutConnection1, out HSteamNetConnection pOutConnection2, bool bUseNetworkLoopback, ref SteamNetworkingIdentity pIdentity1, ref SteamNetworkingIdentity pIdentity2) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_CreateSocketPair(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pOutConnection1, out pOutConnection2, bUseNetworkLoopback, ref pIdentity1, ref pIdentity2); + return NativeMethods.ISteamNetworkingSockets_CreateSocketPair(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pOutConnection1, out pOutConnection2, bUseNetworkLoopback, ref pIdentity1, ref pIdentity2); } /// @@ -555,7 +557,7 @@ public static bool CreateSocketPair(out HSteamNetConnection pOutConnection1, out /// public static EResult ConfigureConnectionLanes(HSteamNetConnection hConn, int nNumLanes, int[] pLanePriorities, ushort[] pLaneWeights) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_ConfigureConnectionLanes(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, nNumLanes, pLanePriorities, pLaneWeights); + return NativeMethods.ISteamNetworkingSockets_ConfigureConnectionLanes(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, nNumLanes, pLanePriorities, pLaneWeights); } /// @@ -568,7 +570,7 @@ public static EResult ConfigureConnectionLanes(HSteamNetConnection hConn, int nN /// public static bool GetIdentity(out SteamNetworkingIdentity pIdentity) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_GetIdentity(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pIdentity); + return NativeMethods.ISteamNetworkingSockets_GetIdentity(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pIdentity); } /// @@ -598,7 +600,7 @@ public static bool GetIdentity(out SteamNetworkingIdentity pIdentity) { /// public static ESteamNetworkingAvailability InitAuthentication() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_InitAuthentication(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); + return NativeMethods.ISteamNetworkingSockets_InitAuthentication(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } /// @@ -612,7 +614,7 @@ public static ESteamNetworkingAvailability InitAuthentication() { /// public static ESteamNetworkingAvailability GetAuthenticationStatus(out SteamNetAuthenticationStatus_t pDetails) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_GetAuthenticationStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pDetails); + return NativeMethods.ISteamNetworkingSockets_GetAuthenticationStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pDetails); } /// @@ -625,7 +627,7 @@ public static ESteamNetworkingAvailability GetAuthenticationStatus(out SteamNetA /// public static HSteamNetPollGroup CreatePollGroup() { InteropHelp.TestIfAvailableGameServer(); - return (HSteamNetPollGroup)NativeMethods.ISteamGameServerNetworkingSockets_CreatePollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); + return (HSteamNetPollGroup)NativeMethods.ISteamNetworkingSockets_CreatePollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } /// @@ -637,7 +639,7 @@ public static HSteamNetPollGroup CreatePollGroup() { /// public static bool DestroyPollGroup(HSteamNetPollGroup hPollGroup) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_DestroyPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPollGroup); + return NativeMethods.ISteamNetworkingSockets_DestroyPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPollGroup); } /// @@ -658,7 +660,7 @@ public static bool DestroyPollGroup(HSteamNetPollGroup hPollGroup) { /// public static bool SetConnectionPollGroup(HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_SetConnectionPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, hPollGroup); + return NativeMethods.ISteamNetworkingSockets_SetConnectionPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, hPollGroup); } /// @@ -683,7 +685,7 @@ public static int ReceiveMessagesOnPollGroup(HSteamNetPollGroup hPollGroup, IntP if (ppOutMessages != null && ppOutMessages.Length != nMaxMessages) { throw new System.ArgumentException("ppOutMessages must be the same size as nMaxMessages!"); } - return NativeMethods.ISteamGameServerNetworkingSockets_ReceiveMessagesOnPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPollGroup, ppOutMessages, nMaxMessages); + return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPollGroup, ppOutMessages, nMaxMessages); } /// @@ -698,7 +700,7 @@ public static int ReceiveMessagesOnPollGroup(HSteamNetPollGroup hPollGroup, IntP /// public static bool ReceivedRelayAuthTicket(IntPtr pvTicket, int cbTicket, out SteamDatagramRelayAuthTicket pOutParsedTicket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_ReceivedRelayAuthTicket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pvTicket, cbTicket, out pOutParsedTicket); + return NativeMethods.ISteamNetworkingSockets_ReceivedRelayAuthTicket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pvTicket, cbTicket, out pOutParsedTicket); } /// @@ -711,7 +713,7 @@ public static bool ReceivedRelayAuthTicket(IntPtr pvTicket, int cbTicket, out St /// public static int FindRelayAuthTicketForServer(ref SteamNetworkingIdentity identityGameServer, int nRemoteVirtualPort, out SteamDatagramRelayAuthTicket pOutParsedTicket) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_FindRelayAuthTicketForServer(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityGameServer, nRemoteVirtualPort, out pOutParsedTicket); + return NativeMethods.ISteamNetworkingSockets_FindRelayAuthTicketForServer(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityGameServer, nRemoteVirtualPort, out pOutParsedTicket); } /// @@ -734,7 +736,7 @@ public static int FindRelayAuthTicketForServer(ref SteamNetworkingIdentity ident /// public static HSteamNetConnection ConnectToHostedDedicatedServer(ref SteamNetworkingIdentity identityTarget, int nRemoteVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamNetConnection)NativeMethods.ISteamGameServerNetworkingSockets_ConnectToHostedDedicatedServer(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityTarget, nRemoteVirtualPort, nOptions, pOptions); + return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectToHostedDedicatedServer(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityTarget, nRemoteVirtualPort, nOptions, pOptions); } /// @@ -749,7 +751,7 @@ public static HSteamNetConnection ConnectToHostedDedicatedServer(ref SteamNetwor /// public static ushort GetHostedDedicatedServerPort() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_GetHostedDedicatedServerPort(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); + return NativeMethods.ISteamNetworkingSockets_GetHostedDedicatedServerPort(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } /// @@ -758,7 +760,7 @@ public static ushort GetHostedDedicatedServerPort() { /// public static SteamNetworkingPOPID GetHostedDedicatedServerPOPID() { InteropHelp.TestIfAvailableGameServer(); - return (SteamNetworkingPOPID)NativeMethods.ISteamGameServerNetworkingSockets_GetHostedDedicatedServerPOPID(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); + return (SteamNetworkingPOPID)NativeMethods.ISteamNetworkingSockets_GetHostedDedicatedServerPOPID(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } /// @@ -791,7 +793,7 @@ public static SteamNetworkingPOPID GetHostedDedicatedServerPOPID() { /// public static EResult GetHostedDedicatedServerAddress(out SteamDatagramHostedAddress pRouting) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_GetHostedDedicatedServerAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pRouting); + return NativeMethods.ISteamNetworkingSockets_GetHostedDedicatedServerAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pRouting); } /// @@ -811,7 +813,7 @@ public static EResult GetHostedDedicatedServerAddress(out SteamDatagramHostedAdd /// public static HSteamListenSocket CreateHostedDedicatedServerListenSocket(int nLocalVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamListenSocket)NativeMethods.ISteamGameServerNetworkingSockets_CreateHostedDedicatedServerListenSocket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nLocalVirtualPort, nOptions, pOptions); + return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateHostedDedicatedServerListenSocket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nLocalVirtualPort, nOptions, pOptions); } /// @@ -848,7 +850,7 @@ public static HSteamListenSocket CreateHostedDedicatedServerListenSocket(int nLo /// public static EResult GetGameCoordinatorServerLogin(IntPtr pLoginInfo, out int pcbSignedBlob, IntPtr pBlob) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_GetGameCoordinatorServerLogin(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pLoginInfo, out pcbSignedBlob, pBlob); + return NativeMethods.ISteamNetworkingSockets_GetGameCoordinatorServerLogin(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pLoginInfo, out pcbSignedBlob, pBlob); } /// @@ -891,7 +893,7 @@ public static EResult GetGameCoordinatorServerLogin(IntPtr pLoginInfo, out int p /// public static HSteamNetConnection ConnectP2PCustomSignaling(out ISteamNetworkingConnectionSignaling pSignaling, ref SteamNetworkingIdentity pPeerIdentity, int nRemoteVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamNetConnection)NativeMethods.ISteamGameServerNetworkingSockets_ConnectP2PCustomSignaling(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pSignaling, ref pPeerIdentity, nRemoteVirtualPort, nOptions, pOptions); + return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectP2PCustomSignaling(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pSignaling, ref pPeerIdentity, nRemoteVirtualPort, nOptions, pOptions); } /// @@ -927,7 +929,7 @@ public static HSteamNetConnection ConnectP2PCustomSignaling(out ISteamNetworking /// public static bool ReceivedP2PCustomSignal(IntPtr pMsg, int cbMsg, out ISteamNetworkingSignalingRecvContext pContext) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_ReceivedP2PCustomSignal(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pMsg, cbMsg, out pContext); + return NativeMethods.ISteamNetworkingSockets_ReceivedP2PCustomSignal(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pMsg, cbMsg, out pContext); } /// @@ -942,7 +944,7 @@ public static bool ReceivedP2PCustomSignal(IntPtr pMsg, int cbMsg, out ISteamNet /// public static bool GetCertificateRequest(out int pcbBlob, IntPtr pBlob, out SteamNetworkingErrMsg errMsg) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_GetCertificateRequest(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pcbBlob, pBlob, out errMsg); + return NativeMethods.ISteamNetworkingSockets_GetCertificateRequest(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pcbBlob, pBlob, out errMsg); } /// @@ -951,7 +953,7 @@ public static bool GetCertificateRequest(out int pcbBlob, IntPtr pBlob, out Stea /// public static bool SetCertificate(IntPtr pCertificate, int cbCertificate, out SteamNetworkingErrMsg errMsg) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_SetCertificate(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pCertificate, cbCertificate, out errMsg); + return NativeMethods.ISteamNetworkingSockets_SetCertificate(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pCertificate, cbCertificate, out errMsg); } /// @@ -966,7 +968,7 @@ public static bool SetCertificate(IntPtr pCertificate, int cbCertificate, out St /// public static void ResetIdentity(ref SteamNetworkingIdentity pIdentity) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerNetworkingSockets_ResetIdentity(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref pIdentity); + NativeMethods.ISteamNetworkingSockets_ResetIdentity(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref pIdentity); } /// @@ -979,7 +981,7 @@ public static void ResetIdentity(ref SteamNetworkingIdentity pIdentity) { /// public static void RunCallbacks() { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerNetworkingSockets_RunCallbacks(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); + NativeMethods.ISteamNetworkingSockets_RunCallbacks(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } /// @@ -1041,7 +1043,7 @@ public static void RunCallbacks() { /// public static bool BeginAsyncRequestFakeIP(int nNumPorts) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_BeginAsyncRequestFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nNumPorts); + return NativeMethods.ISteamNetworkingSockets_BeginAsyncRequestFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nNumPorts); } /// @@ -1051,7 +1053,7 @@ public static bool BeginAsyncRequestFakeIP(int nNumPorts) { /// public static void GetFakeIP(int idxFirstPort, out SteamNetworkingFakeIPResult_t pInfo) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerNetworkingSockets_GetFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), idxFirstPort, out pInfo); + NativeMethods.ISteamNetworkingSockets_GetFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), idxFirstPort, out pInfo); } /// @@ -1067,7 +1069,7 @@ public static void GetFakeIP(int idxFirstPort, out SteamNetworkingFakeIPResult_t /// public static HSteamListenSocket CreateListenSocketP2PFakeIP(int idxFakePort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); - return (HSteamListenSocket)NativeMethods.ISteamGameServerNetworkingSockets_CreateListenSocketP2PFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), idxFakePort, nOptions, pOptions); + return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateListenSocketP2PFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), idxFakePort, nOptions, pOptions); } /// @@ -1089,7 +1091,7 @@ public static HSteamListenSocket CreateListenSocketP2PFakeIP(int idxFakePort, in /// public static EResult GetRemoteFakeIPForConnection(HSteamNetConnection hConn, out SteamNetworkingIPAddr pOutAddr) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_GetRemoteFakeIPForConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pOutAddr); + return NativeMethods.ISteamNetworkingSockets_GetRemoteFakeIPForConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pOutAddr); } /// @@ -1113,7 +1115,7 @@ public static EResult GetRemoteFakeIPForConnection(HSteamNetConnection hConn, ou /// public static IntPtr CreateFakeUDPPort(int idxFakeServerPort) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingSockets_CreateFakeUDPPort(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), idxFakeServerPort); + return NativeMethods.ISteamNetworkingSockets_CreateFakeUDPPort(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), idxFakeServerPort); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingutils.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingutils.cs index daab4235..305ed939 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingutils.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingutils.cs @@ -35,7 +35,7 @@ public static class SteamGameServerNetworkingUtils { /// public static IntPtr AllocateMessage(int cbAllocateBuffer) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_AllocateMessage(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), cbAllocateBuffer); + return NativeMethods.ISteamNetworkingUtils_AllocateMessage(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), cbAllocateBuffer); } /// @@ -64,7 +64,7 @@ public static IntPtr AllocateMessage(int cbAllocateBuffer) { /// public static void InitRelayNetworkAccess() { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerNetworkingUtils_InitRelayNetworkAccess(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); + NativeMethods.ISteamNetworkingUtils_InitRelayNetworkAccess(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); } /// @@ -79,7 +79,7 @@ public static void InitRelayNetworkAccess() { /// public static ESteamNetworkingAvailability GetRelayNetworkStatus(out SteamRelayNetworkStatus_t pDetails) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_GetRelayNetworkStatus(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pDetails); + return NativeMethods.ISteamNetworkingUtils_GetRelayNetworkStatus(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pDetails); } /// @@ -108,7 +108,7 @@ public static ESteamNetworkingAvailability GetRelayNetworkStatus(out SteamRelayN /// public static float GetLocalPingLocation(out SteamNetworkPingLocation_t result) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_GetLocalPingLocation(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out result); + return NativeMethods.ISteamNetworkingUtils_GetLocalPingLocation(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out result); } /// @@ -137,7 +137,7 @@ public static float GetLocalPingLocation(out SteamNetworkPingLocation_t result) /// public static int EstimatePingTimeBetweenTwoLocations(ref SteamNetworkPingLocation_t location1, ref SteamNetworkPingLocation_t location2) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_EstimatePingTimeBetweenTwoLocations(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref location1, ref location2); + return NativeMethods.ISteamNetworkingUtils_EstimatePingTimeBetweenTwoLocations(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref location1, ref location2); } /// @@ -152,7 +152,7 @@ public static int EstimatePingTimeBetweenTwoLocations(ref SteamNetworkPingLocati /// public static int EstimatePingTimeFromLocalHost(ref SteamNetworkPingLocation_t remoteLocation) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_EstimatePingTimeFromLocalHost(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref remoteLocation); + return NativeMethods.ISteamNetworkingUtils_EstimatePingTimeFromLocalHost(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref remoteLocation); } /// @@ -164,7 +164,7 @@ public static int EstimatePingTimeFromLocalHost(ref SteamNetworkPingLocation_t r public static void ConvertPingLocationToString(ref SteamNetworkPingLocation_t location, out string pszBuf, int cchBufSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pszBuf2 = Marshal.AllocHGlobal(cchBufSize); - NativeMethods.ISteamGameServerNetworkingUtils_ConvertPingLocationToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref location, pszBuf2, cchBufSize); + NativeMethods.ISteamNetworkingUtils_ConvertPingLocationToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref location, pszBuf2, cchBufSize); pszBuf = InteropHelp.PtrToStringUTF8(pszBuf2); Marshal.FreeHGlobal(pszBuf2); } @@ -176,7 +176,7 @@ public static void ConvertPingLocationToString(ref SteamNetworkPingLocation_t lo public static bool ParsePingLocationString(string pszString, out SteamNetworkPingLocation_t result) { InteropHelp.TestIfAvailableGameServer(); using (var pszString2 = new InteropHelp.UTF8StringHandle(pszString)) { - return NativeMethods.ISteamGameServerNetworkingUtils_ParsePingLocationString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), pszString2, out result); + return NativeMethods.ISteamNetworkingUtils_ParsePingLocationString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), pszString2, out result); } } @@ -202,7 +202,7 @@ public static bool ParsePingLocationString(string pszString, out SteamNetworkPin /// public static bool CheckPingDataUpToDate(float flMaxAgeSeconds) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_CheckPingDataUpToDate(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), flMaxAgeSeconds); + return NativeMethods.ISteamNetworkingUtils_CheckPingDataUpToDate(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), flMaxAgeSeconds); } /// @@ -214,7 +214,7 @@ public static bool CheckPingDataUpToDate(float flMaxAgeSeconds) { /// public static int GetPingToDataCenter(SteamNetworkingPOPID popID, out SteamNetworkingPOPID pViaRelayPoP) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_GetPingToDataCenter(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), popID, out pViaRelayPoP); + return NativeMethods.ISteamNetworkingUtils_GetPingToDataCenter(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), popID, out pViaRelayPoP); } /// @@ -222,7 +222,7 @@ public static int GetPingToDataCenter(SteamNetworkingPOPID popID, out SteamNetwo /// public static int GetDirectPingToPOP(SteamNetworkingPOPID popID) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_GetDirectPingToPOP(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), popID); + return NativeMethods.ISteamNetworkingUtils_GetDirectPingToPOP(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), popID); } /// @@ -230,7 +230,7 @@ public static int GetDirectPingToPOP(SteamNetworkingPOPID popID) { /// public static int GetPOPCount() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_GetPOPCount(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); + return NativeMethods.ISteamNetworkingUtils_GetPOPCount(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); } /// @@ -239,7 +239,7 @@ public static int GetPOPCount() { /// public static int GetPOPList(out SteamNetworkingPOPID list, int nListSz) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_GetPOPList(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out list, nListSz); + return NativeMethods.ISteamNetworkingUtils_GetPOPList(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out list, nListSz); } /// @@ -264,7 +264,7 @@ public static int GetPOPList(out SteamNetworkingPOPID list, int nListSz) { /// public static SteamNetworkingMicroseconds GetLocalTimestamp() { InteropHelp.TestIfAvailableGameServer(); - return (SteamNetworkingMicroseconds)NativeMethods.ISteamGameServerNetworkingUtils_GetLocalTimestamp(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); + return (SteamNetworkingMicroseconds)NativeMethods.ISteamNetworkingUtils_GetLocalTimestamp(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); } /// @@ -294,7 +294,7 @@ public static SteamNetworkingMicroseconds GetLocalTimestamp() { /// public static void SetDebugOutputFunction(ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerNetworkingUtils_SetDebugOutputFunction(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eDetailLevel, pfnFunc); + NativeMethods.ISteamNetworkingUtils_SetDebugOutputFunction(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eDetailLevel, pfnFunc); } /// @@ -306,12 +306,12 @@ public static void SetDebugOutputFunction(ESteamNetworkingSocketsDebugOutputType /// public static bool IsFakeIPv4(uint nIPv4) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_IsFakeIPv4(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), nIPv4); + return NativeMethods.ISteamNetworkingUtils_IsFakeIPv4(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), nIPv4); } public static ESteamNetworkingFakeIPType GetIPv4FakeIPType(uint nIPv4) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_GetIPv4FakeIPType(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), nIPv4); + return NativeMethods.ISteamNetworkingUtils_GetIPv4FakeIPType(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), nIPv4); } /// @@ -330,7 +330,7 @@ public static ESteamNetworkingFakeIPType GetIPv4FakeIPType(uint nIPv4) { /// public static EResult GetRealIdentityForFakeIP(ref SteamNetworkingIPAddr fakeIP, out SteamNetworkingIdentity pOutRealIdentity) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_GetRealIdentityForFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref fakeIP, out pOutRealIdentity); + return NativeMethods.ISteamNetworkingUtils_GetRealIdentityForFakeIP(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref fakeIP, out pOutRealIdentity); } /// @@ -353,7 +353,7 @@ public static EResult GetRealIdentityForFakeIP(ref SteamNetworkingIPAddr fakeIP, /// public static bool SetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, ESteamNetworkingConfigDataType eDataType, IntPtr pArg) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_SetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, eDataType, pArg); + return NativeMethods.ISteamNetworkingUtils_SetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, eDataType, pArg); } /// @@ -371,7 +371,7 @@ public static bool SetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetw /// public static ESteamNetworkingGetConfigValueResult GetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, out ESteamNetworkingConfigDataType pOutDataType, IntPtr pResult, ref ulong cbResult) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_GetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, out pOutDataType, pResult, ref cbResult); + return NativeMethods.ISteamNetworkingUtils_GetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, out pOutDataType, pResult, ref cbResult); } /// @@ -381,7 +381,7 @@ public static ESteamNetworkingGetConfigValueResult GetConfigValue(ESteamNetworki /// public static string GetConfigValueInfo(ESteamNetworkingConfigValue eValue, out ESteamNetworkingConfigDataType pOutDataType, out ESteamNetworkingConfigScope pOutScope) { InteropHelp.TestIfAvailableGameServer(); - return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamGameServerNetworkingUtils_GetConfigValueInfo(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, out pOutDataType, out pOutScope)); + return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamNetworkingUtils_GetConfigValueInfo(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, out pOutDataType, out pOutScope)); } /// @@ -396,7 +396,7 @@ public static string GetConfigValueInfo(ESteamNetworkingConfigValue eValue, out /// public static ESteamNetworkingConfigValue IterateGenericEditableConfigValues(ESteamNetworkingConfigValue eCurrent, bool bEnumerateDevVars) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_IterateGenericEditableConfigValues(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eCurrent, bEnumerateDevVars); + return NativeMethods.ISteamNetworkingUtils_IterateGenericEditableConfigValues(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eCurrent, bEnumerateDevVars); } /// @@ -406,7 +406,7 @@ public static ESteamNetworkingConfigValue IterateGenericEditableConfigValues(ESt public static void SteamNetworkingIPAddr_ToString(ref SteamNetworkingIPAddr addr, out string buf, uint cbBuf, bool bWithPort) { InteropHelp.TestIfAvailableGameServer(); IntPtr buf2 = Marshal.AllocHGlobal((int)cbBuf); - NativeMethods.ISteamGameServerNetworkingUtils_SteamNetworkingIPAddr_ToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref addr, buf2, cbBuf, bWithPort); + NativeMethods.ISteamNetworkingUtils_SteamNetworkingIPAddr_ToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref addr, buf2, cbBuf, bWithPort); buf = InteropHelp.PtrToStringUTF8(buf2); Marshal.FreeHGlobal(buf2); } @@ -414,19 +414,19 @@ public static void SteamNetworkingIPAddr_ToString(ref SteamNetworkingIPAddr addr public static bool SteamNetworkingIPAddr_ParseString(out SteamNetworkingIPAddr pAddr, string pszStr) { InteropHelp.TestIfAvailableGameServer(); using (var pszStr2 = new InteropHelp.UTF8StringHandle(pszStr)) { - return NativeMethods.ISteamGameServerNetworkingUtils_SteamNetworkingIPAddr_ParseString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pAddr, pszStr2); + return NativeMethods.ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pAddr, pszStr2); } } public static ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType(ref SteamNetworkingIPAddr addr) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerNetworkingUtils_SteamNetworkingIPAddr_GetFakeIPType(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref addr); + return NativeMethods.ISteamNetworkingUtils_SteamNetworkingIPAddr_GetFakeIPType(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref addr); } public static void SteamNetworkingIdentity_ToString(ref SteamNetworkingIdentity identity, out string buf, uint cbBuf) { InteropHelp.TestIfAvailableGameServer(); IntPtr buf2 = Marshal.AllocHGlobal((int)cbBuf); - NativeMethods.ISteamGameServerNetworkingUtils_SteamNetworkingIdentity_ToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref identity, buf2, cbBuf); + NativeMethods.ISteamNetworkingUtils_SteamNetworkingIdentity_ToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref identity, buf2, cbBuf); buf = InteropHelp.PtrToStringUTF8(buf2); Marshal.FreeHGlobal(buf2); } @@ -434,7 +434,7 @@ public static void SteamNetworkingIdentity_ToString(ref SteamNetworkingIdentity public static bool SteamNetworkingIdentity_ParseString(out SteamNetworkingIdentity pIdentity, string pszStr) { InteropHelp.TestIfAvailableGameServer(); using (var pszStr2 = new InteropHelp.UTF8StringHandle(pszStr)) { - return NativeMethods.ISteamGameServerNetworkingUtils_SteamNetworkingIdentity_ParseString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pIdentity, pszStr2); + return NativeMethods.ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pIdentity, pszStr2); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs index ddc8521c..58d4c3a9 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs @@ -21,7 +21,7 @@ public static class SteamGameServerUGC { /// public static UGCQueryHandle_t CreateQueryUserUGCRequest(AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage) { InteropHelp.TestIfAvailableGameServer(); - return (UGCQueryHandle_t)NativeMethods.ISteamGameServerUGC_CreateQueryUserUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage); + return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryUserUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage); } /// @@ -29,7 +29,7 @@ public static UGCQueryHandle_t CreateQueryUserUGCRequest(AccountID_t unAccountID /// public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage) { InteropHelp.TestIfAvailableGameServer(); - return (UGCQueryHandle_t)NativeMethods.ISteamGameServerUGC_CreateQueryAllUGCRequestPage(CSteamGameServerAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage); + return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryAllUGCRequestPage(CSteamGameServerAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage); } /// @@ -38,7 +38,7 @@ public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EU public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, string pchCursor = null) { InteropHelp.TestIfAvailableGameServer(); using (var pchCursor2 = new InteropHelp.UTF8StringHandle(pchCursor)) { - return (UGCQueryHandle_t)NativeMethods.ISteamGameServerUGC_CreateQueryAllUGCRequestCursor(CSteamGameServerAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, pchCursor2); + return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryAllUGCRequestCursor(CSteamGameServerAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, pchCursor2); } } @@ -47,7 +47,7 @@ public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EU /// public static UGCQueryHandle_t CreateQueryUGCDetailsRequest(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableGameServer(); - return (UGCQueryHandle_t)NativeMethods.ISteamGameServerUGC_CreateQueryUGCDetailsRequest(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); + return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryUGCDetailsRequest(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); } /// @@ -55,7 +55,7 @@ public static UGCQueryHandle_t CreateQueryUGCDetailsRequest(PublishedFileId_t[] /// public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_SendQueryUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), handle); + return (SteamAPICall_t)NativeMethods.ISteamUGC_SendQueryUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), handle); } /// @@ -63,24 +63,26 @@ public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) { /// public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails) { InteropHelp.TestIfAvailableGameServer(); - bool anyCpuResult; + bool ret; if (!Packsize.IsLargePack) { - anyCpuResult = NativeMethods.ISteamGameServerUGC_GetQueryUGCResult(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, out pDetails); + ret = NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, out pDetails); } else { - anyCpuResult = NativeMethods.ISteamGameServerUGC_GetQueryUGCResult(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, out pDetails_lp); + SteamUGCDetails_t pDetails_lp; + ret = NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, out pDetails_lp); + pDetails = pDetails_lp; } - return anyCpuResult; + return ret; } public static uint GetQueryUGCNumTags(UGCQueryHandle_t handle, uint index) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_GetQueryUGCNumTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); + return NativeMethods.ISteamUGC_GetQueryUGCNumTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); } public static bool GetQueryUGCTag(UGCQueryHandle_t handle, uint index, uint indexTag, out string pchValue, uint cchValueSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchValue2 = Marshal.AllocHGlobal((int)cchValueSize); - bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, indexTag, pchValue2, cchValueSize); + bool ret = NativeMethods.ISteamUGC_GetQueryUGCTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, indexTag, pchValue2, cchValueSize); pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null; Marshal.FreeHGlobal(pchValue2); return ret; @@ -89,7 +91,7 @@ public static bool GetQueryUGCTag(UGCQueryHandle_t handle, uint index, uint inde public static bool GetQueryUGCTagDisplayName(UGCQueryHandle_t handle, uint index, uint indexTag, out string pchValue, uint cchValueSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchValue2 = Marshal.AllocHGlobal((int)cchValueSize); - bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCTagDisplayName(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, indexTag, pchValue2, cchValueSize); + bool ret = NativeMethods.ISteamUGC_GetQueryUGCTagDisplayName(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, indexTag, pchValue2, cchValueSize); pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null; Marshal.FreeHGlobal(pchValue2); return ret; @@ -98,7 +100,7 @@ public static bool GetQueryUGCTagDisplayName(UGCQueryHandle_t handle, uint index public static bool GetQueryUGCPreviewURL(UGCQueryHandle_t handle, uint index, out string pchURL, uint cchURLSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchURL2 = Marshal.AllocHGlobal((int)cchURLSize); - bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCPreviewURL(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchURL2, cchURLSize); + bool ret = NativeMethods.ISteamUGC_GetQueryUGCPreviewURL(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchURL2, cchURLSize); pchURL = ret ? InteropHelp.PtrToStringUTF8(pchURL2) : null; Marshal.FreeHGlobal(pchURL2); return ret; @@ -107,7 +109,7 @@ public static bool GetQueryUGCPreviewURL(UGCQueryHandle_t handle, uint index, ou public static bool GetQueryUGCMetadata(UGCQueryHandle_t handle, uint index, out string pchMetadata, uint cchMetadatasize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchMetadata2 = Marshal.AllocHGlobal((int)cchMetadatasize); - bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchMetadata2, cchMetadatasize); + bool ret = NativeMethods.ISteamUGC_GetQueryUGCMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchMetadata2, cchMetadatasize); pchMetadata = ret ? InteropHelp.PtrToStringUTF8(pchMetadata2) : null; Marshal.FreeHGlobal(pchMetadata2); return ret; @@ -115,24 +117,24 @@ public static bool GetQueryUGCMetadata(UGCQueryHandle_t handle, uint index, out public static bool GetQueryUGCChildren(UGCQueryHandle_t handle, uint index, PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_GetQueryUGCChildren(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pvecPublishedFileID, cMaxEntries); + return NativeMethods.ISteamUGC_GetQueryUGCChildren(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pvecPublishedFileID, cMaxEntries); } public static bool GetQueryUGCStatistic(UGCQueryHandle_t handle, uint index, EItemStatistic eStatType, out ulong pStatValue) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_GetQueryUGCStatistic(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, eStatType, out pStatValue); + return NativeMethods.ISteamUGC_GetQueryUGCStatistic(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, eStatType, out pStatValue); } public static uint GetQueryUGCNumAdditionalPreviews(UGCQueryHandle_t handle, uint index) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_GetQueryUGCNumAdditionalPreviews(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); + return NativeMethods.ISteamUGC_GetQueryUGCNumAdditionalPreviews(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); } public static bool GetQueryUGCAdditionalPreview(UGCQueryHandle_t handle, uint index, uint previewIndex, out string pchURLOrVideoID, uint cchURLSize, out string pchOriginalFileName, uint cchOriginalFileNameSize, out EItemPreviewType pPreviewType) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchURLOrVideoID2 = Marshal.AllocHGlobal((int)cchURLSize); IntPtr pchOriginalFileName2 = Marshal.AllocHGlobal((int)cchOriginalFileNameSize); - bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCAdditionalPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, previewIndex, pchURLOrVideoID2, cchURLSize, pchOriginalFileName2, cchOriginalFileNameSize, out pPreviewType); + bool ret = NativeMethods.ISteamUGC_GetQueryUGCAdditionalPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, previewIndex, pchURLOrVideoID2, cchURLSize, pchOriginalFileName2, cchOriginalFileNameSize, out pPreviewType); pchURLOrVideoID = ret ? InteropHelp.PtrToStringUTF8(pchURLOrVideoID2) : null; Marshal.FreeHGlobal(pchURLOrVideoID2); pchOriginalFileName = ret ? InteropHelp.PtrToStringUTF8(pchOriginalFileName2) : null; @@ -142,14 +144,14 @@ public static bool GetQueryUGCAdditionalPreview(UGCQueryHandle_t handle, uint in public static uint GetQueryUGCNumKeyValueTags(UGCQueryHandle_t handle, uint index) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_GetQueryUGCNumKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); + return NativeMethods.ISteamUGC_GetQueryUGCNumKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); } public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, out string pchKey, uint cchKeySize, out string pchValue, uint cchValueSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchKey2 = Marshal.AllocHGlobal((int)cchKeySize); IntPtr pchValue2 = Marshal.AllocHGlobal((int)cchValueSize); - bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, keyValueTagIndex, pchKey2, cchKeySize, pchValue2, cchValueSize); + bool ret = NativeMethods.ISteamUGC_GetQueryUGCKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, keyValueTagIndex, pchKey2, cchKeySize, pchValue2, cchValueSize); pchKey = ret ? InteropHelp.PtrToStringUTF8(pchKey2) : null; Marshal.FreeHGlobal(pchKey2); pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null; @@ -164,7 +166,7 @@ public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, s InteropHelp.TestIfAvailableGameServer(); IntPtr pchValue2 = Marshal.AllocHGlobal((int)cchValueSize); using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) { - bool ret = NativeMethods.ISteamGameServerUGC_GetQueryFirstUGCKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchKey2, pchValue2, cchValueSize); + bool ret = NativeMethods.ISteamUGC_GetQueryFirstUGCKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchKey2, pchValue2, cchValueSize); pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null; Marshal.FreeHGlobal(pchValue2); return ret; @@ -176,14 +178,14 @@ public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, s /// public static uint GetNumSupportedGameVersions(UGCQueryHandle_t handle, uint index) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_GetNumSupportedGameVersions(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); + return NativeMethods.ISteamUGC_GetNumSupportedGameVersions(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); } public static bool GetSupportedGameVersionData(UGCQueryHandle_t handle, uint index, uint versionIndex, out string pchGameBranchMin, out string pchGameBranchMax, uint cchGameBranchSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchGameBranchMin2 = Marshal.AllocHGlobal((int)cchGameBranchSize); IntPtr pchGameBranchMax2 = Marshal.AllocHGlobal((int)cchGameBranchSize); - bool ret = NativeMethods.ISteamGameServerUGC_GetSupportedGameVersionData(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, versionIndex, pchGameBranchMin2, pchGameBranchMax2, cchGameBranchSize); + bool ret = NativeMethods.ISteamUGC_GetSupportedGameVersionData(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, versionIndex, pchGameBranchMin2, pchGameBranchMax2, cchGameBranchSize); pchGameBranchMin = ret ? InteropHelp.PtrToStringUTF8(pchGameBranchMin2) : null; Marshal.FreeHGlobal(pchGameBranchMin2); pchGameBranchMax = ret ? InteropHelp.PtrToStringUTF8(pchGameBranchMax2) : null; @@ -196,7 +198,7 @@ public static uint GetQueryUGCContentDescriptors(UGCQueryHandle_t handle, uint i if (pvecDescriptors != null && pvecDescriptors.Length != cMaxEntries) { throw new System.ArgumentException("pvecDescriptors must be the same size as cMaxEntries!"); } - return NativeMethods.ISteamGameServerUGC_GetQueryUGCContentDescriptors(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pvecDescriptors, cMaxEntries); + return NativeMethods.ISteamUGC_GetQueryUGCContentDescriptors(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pvecDescriptors, cMaxEntries); } /// @@ -204,7 +206,7 @@ public static uint GetQueryUGCContentDescriptors(UGCQueryHandle_t handle, uint i /// public static bool ReleaseQueryUGCRequest(UGCQueryHandle_t handle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_ReleaseQueryUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), handle); + return NativeMethods.ISteamUGC_ReleaseQueryUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), handle); } /// @@ -213,7 +215,7 @@ public static bool ReleaseQueryUGCRequest(UGCQueryHandle_t handle) { public static bool AddRequiredTag(UGCQueryHandle_t handle, string pTagName) { InteropHelp.TestIfAvailableGameServer(); using (var pTagName2 = new InteropHelp.UTF8StringHandle(pTagName)) { - return NativeMethods.ISteamGameServerUGC_AddRequiredTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pTagName2); + return NativeMethods.ISteamUGC_AddRequiredTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pTagName2); } } @@ -222,66 +224,66 @@ public static bool AddRequiredTag(UGCQueryHandle_t handle, string pTagName) { /// public static bool AddRequiredTagGroup(UGCQueryHandle_t handle, System.Collections.Generic.IList pTagGroups) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_AddRequiredTagGroup(CSteamGameServerAPIContext.GetSteamUGC(), handle, new InteropHelp.SteamParamStringArray(pTagGroups)); + return NativeMethods.ISteamUGC_AddRequiredTagGroup(CSteamGameServerAPIContext.GetSteamUGC(), handle, new InteropHelp.SteamParamStringArray(pTagGroups)); } public static bool AddExcludedTag(UGCQueryHandle_t handle, string pTagName) { InteropHelp.TestIfAvailableGameServer(); using (var pTagName2 = new InteropHelp.UTF8StringHandle(pTagName)) { - return NativeMethods.ISteamGameServerUGC_AddExcludedTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pTagName2); + return NativeMethods.ISteamUGC_AddExcludedTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pTagName2); } } public static bool SetReturnOnlyIDs(UGCQueryHandle_t handle, bool bReturnOnlyIDs) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetReturnOnlyIDs(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnOnlyIDs); + return NativeMethods.ISteamUGC_SetReturnOnlyIDs(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnOnlyIDs); } public static bool SetReturnKeyValueTags(UGCQueryHandle_t handle, bool bReturnKeyValueTags) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetReturnKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnKeyValueTags); + return NativeMethods.ISteamUGC_SetReturnKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnKeyValueTags); } public static bool SetReturnLongDescription(UGCQueryHandle_t handle, bool bReturnLongDescription) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetReturnLongDescription(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnLongDescription); + return NativeMethods.ISteamUGC_SetReturnLongDescription(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnLongDescription); } public static bool SetReturnMetadata(UGCQueryHandle_t handle, bool bReturnMetadata) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetReturnMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnMetadata); + return NativeMethods.ISteamUGC_SetReturnMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnMetadata); } public static bool SetReturnChildren(UGCQueryHandle_t handle, bool bReturnChildren) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetReturnChildren(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnChildren); + return NativeMethods.ISteamUGC_SetReturnChildren(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnChildren); } public static bool SetReturnAdditionalPreviews(UGCQueryHandle_t handle, bool bReturnAdditionalPreviews) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetReturnAdditionalPreviews(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnAdditionalPreviews); + return NativeMethods.ISteamUGC_SetReturnAdditionalPreviews(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnAdditionalPreviews); } public static bool SetReturnTotalOnly(UGCQueryHandle_t handle, bool bReturnTotalOnly) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetReturnTotalOnly(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnTotalOnly); + return NativeMethods.ISteamUGC_SetReturnTotalOnly(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnTotalOnly); } public static bool SetReturnPlaytimeStats(UGCQueryHandle_t handle, uint unDays) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetReturnPlaytimeStats(CSteamGameServerAPIContext.GetSteamUGC(), handle, unDays); + return NativeMethods.ISteamUGC_SetReturnPlaytimeStats(CSteamGameServerAPIContext.GetSteamUGC(), handle, unDays); } public static bool SetLanguage(UGCQueryHandle_t handle, string pchLanguage) { InteropHelp.TestIfAvailableGameServer(); using (var pchLanguage2 = new InteropHelp.UTF8StringHandle(pchLanguage)) { - return NativeMethods.ISteamGameServerUGC_SetLanguage(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchLanguage2); + return NativeMethods.ISteamUGC_SetLanguage(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchLanguage2); } } public static bool SetAllowCachedResponse(UGCQueryHandle_t handle, uint unMaxAgeSeconds) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetAllowCachedResponse(CSteamGameServerAPIContext.GetSteamUGC(), handle, unMaxAgeSeconds); + return NativeMethods.ISteamUGC_SetAllowCachedResponse(CSteamGameServerAPIContext.GetSteamUGC(), handle, unMaxAgeSeconds); } /// @@ -289,7 +291,7 @@ public static bool SetAllowCachedResponse(UGCQueryHandle_t handle, uint unMaxAge /// public static bool SetAdminQuery(UGCUpdateHandle_t handle, bool bAdminQuery) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetAdminQuery(CSteamGameServerAPIContext.GetSteamUGC(), handle, bAdminQuery); + return NativeMethods.ISteamUGC_SetAdminQuery(CSteamGameServerAPIContext.GetSteamUGC(), handle, bAdminQuery); } /// @@ -298,7 +300,7 @@ public static bool SetAdminQuery(UGCUpdateHandle_t handle, bool bAdminQuery) { public static bool SetCloudFileNameFilter(UGCQueryHandle_t handle, string pMatchCloudFileName) { InteropHelp.TestIfAvailableGameServer(); using (var pMatchCloudFileName2 = new InteropHelp.UTF8StringHandle(pMatchCloudFileName)) { - return NativeMethods.ISteamGameServerUGC_SetCloudFileNameFilter(CSteamGameServerAPIContext.GetSteamUGC(), handle, pMatchCloudFileName2); + return NativeMethods.ISteamUGC_SetCloudFileNameFilter(CSteamGameServerAPIContext.GetSteamUGC(), handle, pMatchCloudFileName2); } } @@ -307,36 +309,36 @@ public static bool SetCloudFileNameFilter(UGCQueryHandle_t handle, string pMatch /// public static bool SetMatchAnyTag(UGCQueryHandle_t handle, bool bMatchAnyTag) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetMatchAnyTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, bMatchAnyTag); + return NativeMethods.ISteamUGC_SetMatchAnyTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, bMatchAnyTag); } public static bool SetSearchText(UGCQueryHandle_t handle, string pSearchText) { InteropHelp.TestIfAvailableGameServer(); using (var pSearchText2 = new InteropHelp.UTF8StringHandle(pSearchText)) { - return NativeMethods.ISteamGameServerUGC_SetSearchText(CSteamGameServerAPIContext.GetSteamUGC(), handle, pSearchText2); + return NativeMethods.ISteamUGC_SetSearchText(CSteamGameServerAPIContext.GetSteamUGC(), handle, pSearchText2); } } public static bool SetRankedByTrendDays(UGCQueryHandle_t handle, uint unDays) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetRankedByTrendDays(CSteamGameServerAPIContext.GetSteamUGC(), handle, unDays); + return NativeMethods.ISteamUGC_SetRankedByTrendDays(CSteamGameServerAPIContext.GetSteamUGC(), handle, unDays); } public static bool SetTimeCreatedDateRange(UGCQueryHandle_t handle, uint rtStart, uint rtEnd) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetTimeCreatedDateRange(CSteamGameServerAPIContext.GetSteamUGC(), handle, rtStart, rtEnd); + return NativeMethods.ISteamUGC_SetTimeCreatedDateRange(CSteamGameServerAPIContext.GetSteamUGC(), handle, rtStart, rtEnd); } public static bool SetTimeUpdatedDateRange(UGCQueryHandle_t handle, uint rtStart, uint rtEnd) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetTimeUpdatedDateRange(CSteamGameServerAPIContext.GetSteamUGC(), handle, rtStart, rtEnd); + return NativeMethods.ISteamUGC_SetTimeUpdatedDateRange(CSteamGameServerAPIContext.GetSteamUGC(), handle, rtStart, rtEnd); } public static bool AddRequiredKeyValueTag(UGCQueryHandle_t handle, string pKey, string pValue) { InteropHelp.TestIfAvailableGameServer(); using (var pKey2 = new InteropHelp.UTF8StringHandle(pKey)) using (var pValue2 = new InteropHelp.UTF8StringHandle(pValue)) { - return NativeMethods.ISteamGameServerUGC_AddRequiredKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pKey2, pValue2); + return NativeMethods.ISteamUGC_AddRequiredKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pKey2, pValue2); } } @@ -345,7 +347,7 @@ public static bool AddRequiredKeyValueTag(UGCQueryHandle_t handle, string pKey, /// public static SteamAPICall_t RequestUGCDetails(PublishedFileId_t nPublishedFileID, uint unMaxAgeSeconds) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_RequestUGCDetails(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, unMaxAgeSeconds); + return (SteamAPICall_t)NativeMethods.ISteamUGC_RequestUGCDetails(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, unMaxAgeSeconds); } /// @@ -354,7 +356,7 @@ public static SteamAPICall_t RequestUGCDetails(PublishedFileId_t nPublishedFileI /// public static SteamAPICall_t CreateItem(AppId_t nConsumerAppId, EWorkshopFileType eFileType) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_CreateItem(CSteamGameServerAPIContext.GetSteamUGC(), nConsumerAppId, eFileType); + return (SteamAPICall_t)NativeMethods.ISteamUGC_CreateItem(CSteamGameServerAPIContext.GetSteamUGC(), nConsumerAppId, eFileType); } /// @@ -362,7 +364,7 @@ public static SteamAPICall_t CreateItem(AppId_t nConsumerAppId, EWorkshopFileTyp /// public static UGCUpdateHandle_t StartItemUpdate(AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (UGCUpdateHandle_t)NativeMethods.ISteamGameServerUGC_StartItemUpdate(CSteamGameServerAPIContext.GetSteamUGC(), nConsumerAppId, nPublishedFileID); + return (UGCUpdateHandle_t)NativeMethods.ISteamUGC_StartItemUpdate(CSteamGameServerAPIContext.GetSteamUGC(), nConsumerAppId, nPublishedFileID); } /// @@ -371,7 +373,7 @@ public static UGCUpdateHandle_t StartItemUpdate(AppId_t nConsumerAppId, Publishe public static bool SetItemTitle(UGCUpdateHandle_t handle, string pchTitle) { InteropHelp.TestIfAvailableGameServer(); using (var pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle)) { - return NativeMethods.ISteamGameServerUGC_SetItemTitle(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchTitle2); + return NativeMethods.ISteamUGC_SetItemTitle(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchTitle2); } } @@ -381,7 +383,7 @@ public static bool SetItemTitle(UGCUpdateHandle_t handle, string pchTitle) { public static bool SetItemDescription(UGCUpdateHandle_t handle, string pchDescription) { InteropHelp.TestIfAvailableGameServer(); using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription)) { - return NativeMethods.ISteamGameServerUGC_SetItemDescription(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchDescription2); + return NativeMethods.ISteamUGC_SetItemDescription(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchDescription2); } } @@ -391,7 +393,7 @@ public static bool SetItemDescription(UGCUpdateHandle_t handle, string pchDescri public static bool SetItemUpdateLanguage(UGCUpdateHandle_t handle, string pchLanguage) { InteropHelp.TestIfAvailableGameServer(); using (var pchLanguage2 = new InteropHelp.UTF8StringHandle(pchLanguage)) { - return NativeMethods.ISteamGameServerUGC_SetItemUpdateLanguage(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchLanguage2); + return NativeMethods.ISteamUGC_SetItemUpdateLanguage(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchLanguage2); } } @@ -401,7 +403,7 @@ public static bool SetItemUpdateLanguage(UGCUpdateHandle_t handle, string pchLan public static bool SetItemMetadata(UGCUpdateHandle_t handle, string pchMetaData) { InteropHelp.TestIfAvailableGameServer(); using (var pchMetaData2 = new InteropHelp.UTF8StringHandle(pchMetaData)) { - return NativeMethods.ISteamGameServerUGC_SetItemMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchMetaData2); + return NativeMethods.ISteamUGC_SetItemMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchMetaData2); } } @@ -410,7 +412,7 @@ public static bool SetItemMetadata(UGCUpdateHandle_t handle, string pchMetaData) /// public static bool SetItemVisibility(UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetItemVisibility(CSteamGameServerAPIContext.GetSteamUGC(), handle, eVisibility); + return NativeMethods.ISteamUGC_SetItemVisibility(CSteamGameServerAPIContext.GetSteamUGC(), handle, eVisibility); } /// @@ -418,7 +420,7 @@ public static bool SetItemVisibility(UGCUpdateHandle_t handle, ERemoteStoragePub /// public static bool SetItemTags(UGCUpdateHandle_t updateHandle, System.Collections.Generic.IList pTags, bool bAllowAdminTags = false) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetItemTags(CSteamGameServerAPIContext.GetSteamUGC(), updateHandle, new InteropHelp.SteamParamStringArray(pTags), bAllowAdminTags); + return NativeMethods.ISteamUGC_SetItemTags(CSteamGameServerAPIContext.GetSteamUGC(), updateHandle, new InteropHelp.SteamParamStringArray(pTags), bAllowAdminTags); } /// @@ -427,7 +429,7 @@ public static bool SetItemTags(UGCUpdateHandle_t updateHandle, System.Collection public static bool SetItemContent(UGCUpdateHandle_t handle, string pszContentFolder) { InteropHelp.TestIfAvailableGameServer(); using (var pszContentFolder2 = new InteropHelp.UTF8StringHandle(pszContentFolder)) { - return NativeMethods.ISteamGameServerUGC_SetItemContent(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszContentFolder2); + return NativeMethods.ISteamUGC_SetItemContent(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszContentFolder2); } } @@ -437,7 +439,7 @@ public static bool SetItemContent(UGCUpdateHandle_t handle, string pszContentFol public static bool SetItemPreview(UGCUpdateHandle_t handle, string pszPreviewFile) { InteropHelp.TestIfAvailableGameServer(); using (var pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile)) { - return NativeMethods.ISteamGameServerUGC_SetItemPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszPreviewFile2); + return NativeMethods.ISteamUGC_SetItemPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszPreviewFile2); } } @@ -446,7 +448,7 @@ public static bool SetItemPreview(UGCUpdateHandle_t handle, string pszPreviewFil /// public static bool SetAllowLegacyUpload(UGCUpdateHandle_t handle, bool bAllowLegacyUpload) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetAllowLegacyUpload(CSteamGameServerAPIContext.GetSteamUGC(), handle, bAllowLegacyUpload); + return NativeMethods.ISteamUGC_SetAllowLegacyUpload(CSteamGameServerAPIContext.GetSteamUGC(), handle, bAllowLegacyUpload); } /// @@ -454,7 +456,7 @@ public static bool SetAllowLegacyUpload(UGCUpdateHandle_t handle, bool bAllowLeg /// public static bool RemoveAllItemKeyValueTags(UGCUpdateHandle_t handle) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_RemoveAllItemKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle); + return NativeMethods.ISteamUGC_RemoveAllItemKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle); } /// @@ -463,7 +465,7 @@ public static bool RemoveAllItemKeyValueTags(UGCUpdateHandle_t handle) { public static bool RemoveItemKeyValueTags(UGCUpdateHandle_t handle, string pchKey) { InteropHelp.TestIfAvailableGameServer(); using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) { - return NativeMethods.ISteamGameServerUGC_RemoveItemKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchKey2); + return NativeMethods.ISteamUGC_RemoveItemKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchKey2); } } @@ -474,7 +476,7 @@ public static bool AddItemKeyValueTag(UGCUpdateHandle_t handle, string pchKey, s InteropHelp.TestIfAvailableGameServer(); using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) using (var pchValue2 = new InteropHelp.UTF8StringHandle(pchValue)) { - return NativeMethods.ISteamGameServerUGC_AddItemKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchKey2, pchValue2); + return NativeMethods.ISteamUGC_AddItemKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchKey2, pchValue2); } } @@ -484,7 +486,7 @@ public static bool AddItemKeyValueTag(UGCUpdateHandle_t handle, string pchKey, s public static bool AddItemPreviewFile(UGCUpdateHandle_t handle, string pszPreviewFile, EItemPreviewType type) { InteropHelp.TestIfAvailableGameServer(); using (var pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile)) { - return NativeMethods.ISteamGameServerUGC_AddItemPreviewFile(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszPreviewFile2, type); + return NativeMethods.ISteamUGC_AddItemPreviewFile(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszPreviewFile2, type); } } @@ -494,7 +496,7 @@ public static bool AddItemPreviewFile(UGCUpdateHandle_t handle, string pszPrevie public static bool AddItemPreviewVideo(UGCUpdateHandle_t handle, string pszVideoID) { InteropHelp.TestIfAvailableGameServer(); using (var pszVideoID2 = new InteropHelp.UTF8StringHandle(pszVideoID)) { - return NativeMethods.ISteamGameServerUGC_AddItemPreviewVideo(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszVideoID2); + return NativeMethods.ISteamUGC_AddItemPreviewVideo(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszVideoID2); } } @@ -504,7 +506,7 @@ public static bool AddItemPreviewVideo(UGCUpdateHandle_t handle, string pszVideo public static bool UpdateItemPreviewFile(UGCUpdateHandle_t handle, uint index, string pszPreviewFile) { InteropHelp.TestIfAvailableGameServer(); using (var pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile)) { - return NativeMethods.ISteamGameServerUGC_UpdateItemPreviewFile(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pszPreviewFile2); + return NativeMethods.ISteamUGC_UpdateItemPreviewFile(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pszPreviewFile2); } } @@ -514,7 +516,7 @@ public static bool UpdateItemPreviewFile(UGCUpdateHandle_t handle, uint index, s public static bool UpdateItemPreviewVideo(UGCUpdateHandle_t handle, uint index, string pszVideoID) { InteropHelp.TestIfAvailableGameServer(); using (var pszVideoID2 = new InteropHelp.UTF8StringHandle(pszVideoID)) { - return NativeMethods.ISteamGameServerUGC_UpdateItemPreviewVideo(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pszVideoID2); + return NativeMethods.ISteamUGC_UpdateItemPreviewVideo(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pszVideoID2); } } @@ -523,17 +525,17 @@ public static bool UpdateItemPreviewVideo(UGCUpdateHandle_t handle, uint index, /// public static bool RemoveItemPreview(UGCUpdateHandle_t handle, uint index) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_RemoveItemPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); + return NativeMethods.ISteamUGC_RemoveItemPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); } public static bool AddContentDescriptor(UGCUpdateHandle_t handle, EUGCContentDescriptorID descid) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_AddContentDescriptor(CSteamGameServerAPIContext.GetSteamUGC(), handle, descid); + return NativeMethods.ISteamUGC_AddContentDescriptor(CSteamGameServerAPIContext.GetSteamUGC(), handle, descid); } public static bool RemoveContentDescriptor(UGCUpdateHandle_t handle, EUGCContentDescriptorID descid) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_RemoveContentDescriptor(CSteamGameServerAPIContext.GetSteamUGC(), handle, descid); + return NativeMethods.ISteamUGC_RemoveContentDescriptor(CSteamGameServerAPIContext.GetSteamUGC(), handle, descid); } /// @@ -543,7 +545,7 @@ public static bool SetRequiredGameVersions(UGCUpdateHandle_t handle, string pszG InteropHelp.TestIfAvailableGameServer(); using (var pszGameBranchMin2 = new InteropHelp.UTF8StringHandle(pszGameBranchMin)) using (var pszGameBranchMax2 = new InteropHelp.UTF8StringHandle(pszGameBranchMax)) { - return NativeMethods.ISteamGameServerUGC_SetRequiredGameVersions(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszGameBranchMin2, pszGameBranchMax2); + return NativeMethods.ISteamUGC_SetRequiredGameVersions(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszGameBranchMin2, pszGameBranchMax2); } } @@ -553,13 +555,13 @@ public static bool SetRequiredGameVersions(UGCUpdateHandle_t handle, string pszG public static SteamAPICall_t SubmitItemUpdate(UGCUpdateHandle_t handle, string pchChangeNote) { InteropHelp.TestIfAvailableGameServer(); using (var pchChangeNote2 = new InteropHelp.UTF8StringHandle(pchChangeNote)) { - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_SubmitItemUpdate(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchChangeNote2); + return (SteamAPICall_t)NativeMethods.ISteamUGC_SubmitItemUpdate(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchChangeNote2); } } public static EItemUpdateStatus GetItemUpdateProgress(UGCUpdateHandle_t handle, out ulong punBytesProcessed, out ulong punBytesTotal) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_GetItemUpdateProgress(CSteamGameServerAPIContext.GetSteamUGC(), handle, out punBytesProcessed, out punBytesTotal); + return NativeMethods.ISteamUGC_GetItemUpdateProgress(CSteamGameServerAPIContext.GetSteamUGC(), handle, out punBytesProcessed, out punBytesTotal); } /// @@ -567,22 +569,22 @@ public static EItemUpdateStatus GetItemUpdateProgress(UGCUpdateHandle_t handle, /// public static SteamAPICall_t SetUserItemVote(PublishedFileId_t nPublishedFileID, bool bVoteUp) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_SetUserItemVote(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, bVoteUp); + return (SteamAPICall_t)NativeMethods.ISteamUGC_SetUserItemVote(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, bVoteUp); } public static SteamAPICall_t GetUserItemVote(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_GetUserItemVote(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamUGC_GetUserItemVote(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } public static SteamAPICall_t AddItemToFavorites(AppId_t nAppId, PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_AddItemToFavorites(CSteamGameServerAPIContext.GetSteamUGC(), nAppId, nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamUGC_AddItemToFavorites(CSteamGameServerAPIContext.GetSteamUGC(), nAppId, nPublishedFileID); } public static SteamAPICall_t RemoveItemFromFavorites(AppId_t nAppId, PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_RemoveItemFromFavorites(CSteamGameServerAPIContext.GetSteamUGC(), nAppId, nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveItemFromFavorites(CSteamGameServerAPIContext.GetSteamUGC(), nAppId, nPublishedFileID); } /// @@ -590,7 +592,7 @@ public static SteamAPICall_t RemoveItemFromFavorites(AppId_t nAppId, PublishedFi /// public static SteamAPICall_t SubscribeItem(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_SubscribeItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamUGC_SubscribeItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } /// @@ -598,7 +600,7 @@ public static SteamAPICall_t SubscribeItem(PublishedFileId_t nPublishedFileID) { /// public static SteamAPICall_t UnsubscribeItem(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_UnsubscribeItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamUGC_UnsubscribeItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } /// @@ -606,7 +608,7 @@ public static SteamAPICall_t UnsubscribeItem(PublishedFileId_t nPublishedFileID) /// public static uint GetNumSubscribedItems(bool bIncludeLocallyDisabled = false) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_GetNumSubscribedItems(CSteamGameServerAPIContext.GetSteamUGC(), bIncludeLocallyDisabled); + return NativeMethods.ISteamUGC_GetNumSubscribedItems(CSteamGameServerAPIContext.GetSteamUGC(), bIncludeLocallyDisabled); } /// @@ -614,7 +616,7 @@ public static uint GetNumSubscribedItems(bool bIncludeLocallyDisabled = false) { /// public static uint GetSubscribedItems(PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries, bool bIncludeLocallyDisabled = false) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_GetSubscribedItems(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, cMaxEntries, bIncludeLocallyDisabled); + return NativeMethods.ISteamUGC_GetSubscribedItems(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, cMaxEntries, bIncludeLocallyDisabled); } /// @@ -622,7 +624,7 @@ public static uint GetSubscribedItems(PublishedFileId_t[] pvecPublishedFileID, u /// public static uint GetItemState(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_GetItemState(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); + return NativeMethods.ISteamUGC_GetItemState(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } /// @@ -632,7 +634,7 @@ public static uint GetItemState(PublishedFileId_t nPublishedFileID) { public static bool GetItemInstallInfo(PublishedFileId_t nPublishedFileID, out ulong punSizeOnDisk, out string pchFolder, uint cchFolderSize, out uint punTimeStamp) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchFolder2 = Marshal.AllocHGlobal((int)cchFolderSize); - bool ret = NativeMethods.ISteamGameServerUGC_GetItemInstallInfo(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, out punSizeOnDisk, pchFolder2, cchFolderSize, out punTimeStamp); + bool ret = NativeMethods.ISteamUGC_GetItemInstallInfo(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, out punSizeOnDisk, pchFolder2, cchFolderSize, out punTimeStamp); pchFolder = ret ? InteropHelp.PtrToStringUTF8(pchFolder2) : null; Marshal.FreeHGlobal(pchFolder2); return ret; @@ -643,7 +645,7 @@ public static bool GetItemInstallInfo(PublishedFileId_t nPublishedFileID, out ul /// public static bool GetItemDownloadInfo(PublishedFileId_t nPublishedFileID, out ulong punBytesDownloaded, out ulong punBytesTotal) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_GetItemDownloadInfo(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, out punBytesDownloaded, out punBytesTotal); + return NativeMethods.ISteamUGC_GetItemDownloadInfo(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, out punBytesDownloaded, out punBytesTotal); } /// @@ -653,7 +655,7 @@ public static bool GetItemDownloadInfo(PublishedFileId_t nPublishedFileID, out u /// public static bool DownloadItem(PublishedFileId_t nPublishedFileID, bool bHighPriority) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_DownloadItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, bHighPriority); + return NativeMethods.ISteamUGC_DownloadItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, bHighPriority); } /// @@ -663,7 +665,7 @@ public static bool DownloadItem(PublishedFileId_t nPublishedFileID, bool bHighPr public static bool BInitWorkshopForGameServer(DepotId_t unWorkshopDepotID, string pszFolder) { InteropHelp.TestIfAvailableGameServer(); using (var pszFolder2 = new InteropHelp.UTF8StringHandle(pszFolder)) { - return NativeMethods.ISteamGameServerUGC_BInitWorkshopForGameServer(CSteamGameServerAPIContext.GetSteamUGC(), unWorkshopDepotID, pszFolder2); + return NativeMethods.ISteamUGC_BInitWorkshopForGameServer(CSteamGameServerAPIContext.GetSteamUGC(), unWorkshopDepotID, pszFolder2); } } @@ -672,7 +674,7 @@ public static bool BInitWorkshopForGameServer(DepotId_t unWorkshopDepotID, strin /// public static void SuspendDownloads(bool bSuspend) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerUGC_SuspendDownloads(CSteamGameServerAPIContext.GetSteamUGC(), bSuspend); + NativeMethods.ISteamUGC_SuspendDownloads(CSteamGameServerAPIContext.GetSteamUGC(), bSuspend); } /// @@ -680,17 +682,17 @@ public static void SuspendDownloads(bool bSuspend) { /// public static SteamAPICall_t StartPlaytimeTracking(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_StartPlaytimeTracking(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); + return (SteamAPICall_t)NativeMethods.ISteamUGC_StartPlaytimeTracking(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); } public static SteamAPICall_t StopPlaytimeTracking(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_StopPlaytimeTracking(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); + return (SteamAPICall_t)NativeMethods.ISteamUGC_StopPlaytimeTracking(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); } public static SteamAPICall_t StopPlaytimeTrackingForAllItems() { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_StopPlaytimeTrackingForAllItems(CSteamGameServerAPIContext.GetSteamUGC()); + return (SteamAPICall_t)NativeMethods.ISteamUGC_StopPlaytimeTrackingForAllItems(CSteamGameServerAPIContext.GetSteamUGC()); } /// @@ -698,12 +700,12 @@ public static SteamAPICall_t StopPlaytimeTrackingForAllItems() { /// public static SteamAPICall_t AddDependency(PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_AddDependency(CSteamGameServerAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamUGC_AddDependency(CSteamGameServerAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID); } public static SteamAPICall_t RemoveDependency(PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_RemoveDependency(CSteamGameServerAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveDependency(CSteamGameServerAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID); } /// @@ -711,12 +713,12 @@ public static SteamAPICall_t RemoveDependency(PublishedFileId_t nParentPublished /// public static SteamAPICall_t AddAppDependency(PublishedFileId_t nPublishedFileID, AppId_t nAppID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_AddAppDependency(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, nAppID); + return (SteamAPICall_t)NativeMethods.ISteamUGC_AddAppDependency(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, nAppID); } public static SteamAPICall_t RemoveAppDependency(PublishedFileId_t nPublishedFileID, AppId_t nAppID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_RemoveAppDependency(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, nAppID); + return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveAppDependency(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, nAppID); } /// @@ -725,7 +727,7 @@ public static SteamAPICall_t RemoveAppDependency(PublishedFileId_t nPublishedFil /// public static SteamAPICall_t GetAppDependencies(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_GetAppDependencies(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamUGC_GetAppDependencies(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } /// @@ -733,7 +735,7 @@ public static SteamAPICall_t GetAppDependencies(PublishedFileId_t nPublishedFile /// public static SteamAPICall_t DeleteItem(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_DeleteItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); + return (SteamAPICall_t)NativeMethods.ISteamUGC_DeleteItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } /// @@ -741,7 +743,7 @@ public static SteamAPICall_t DeleteItem(PublishedFileId_t nPublishedFileID) { /// public static bool ShowWorkshopEULA() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_ShowWorkshopEULA(CSteamGameServerAPIContext.GetSteamUGC()); + return NativeMethods.ISteamUGC_ShowWorkshopEULA(CSteamGameServerAPIContext.GetSteamUGC()); } /// @@ -749,7 +751,7 @@ public static bool ShowWorkshopEULA() { /// public static SteamAPICall_t GetWorkshopEULAStatus() { InteropHelp.TestIfAvailableGameServer(); - return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_GetWorkshopEULAStatus(CSteamGameServerAPIContext.GetSteamUGC()); + return (SteamAPICall_t)NativeMethods.ISteamUGC_GetWorkshopEULAStatus(CSteamGameServerAPIContext.GetSteamUGC()); } /// @@ -757,7 +759,7 @@ public static SteamAPICall_t GetWorkshopEULAStatus() { /// public static uint GetUserContentDescriptorPreferences(EUGCContentDescriptorID[] pvecDescriptors, uint cMaxEntries) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_GetUserContentDescriptorPreferences(CSteamGameServerAPIContext.GetSteamUGC(), pvecDescriptors, cMaxEntries); + return NativeMethods.ISteamUGC_GetUserContentDescriptorPreferences(CSteamGameServerAPIContext.GetSteamUGC(), pvecDescriptors, cMaxEntries); } /// @@ -765,7 +767,7 @@ public static uint GetUserContentDescriptorPreferences(EUGCContentDescriptorID[] /// public static bool SetItemsDisabledLocally(PublishedFileId_t[] pvecPublishedFileIDs, uint unNumPublishedFileIDs, bool bDisabledLocally) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetItemsDisabledLocally(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileIDs, unNumPublishedFileIDs, bDisabledLocally); + return NativeMethods.ISteamUGC_SetItemsDisabledLocally(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileIDs, unNumPublishedFileIDs, bDisabledLocally); } /// @@ -773,7 +775,7 @@ public static bool SetItemsDisabledLocally(PublishedFileId_t[] pvecPublishedFile /// public static bool SetSubscriptionsLoadOrder(PublishedFileId_t[] pvecPublishedFileIDs, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUGC_SetSubscriptionsLoadOrder(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileIDs, unNumPublishedFileIDs); + return NativeMethods.ISteamUGC_SetSubscriptionsLoadOrder(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileIDs, unNumPublishedFileIDs); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverutils.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverutils.cs index 483defa4..378006e2 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverutils.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverutils.cs @@ -21,12 +21,12 @@ public static class SteamGameServerUtils { /// public static uint GetSecondsSinceAppActive() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_GetSecondsSinceAppActive(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_GetSecondsSinceAppActive(CSteamGameServerAPIContext.GetSteamUtils()); } public static uint GetSecondsSinceComputerActive() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_GetSecondsSinceComputerActive(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_GetSecondsSinceComputerActive(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -34,7 +34,7 @@ public static uint GetSecondsSinceComputerActive() { /// public static EUniverse GetConnectedUniverse() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_GetConnectedUniverse(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_GetConnectedUniverse(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -42,7 +42,7 @@ public static EUniverse GetConnectedUniverse() { /// public static uint GetServerRealTime() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_GetServerRealTime(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_GetServerRealTime(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -51,7 +51,7 @@ public static uint GetServerRealTime() { /// public static string GetIPCountry() { InteropHelp.TestIfAvailableGameServer(); - return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamGameServerUtils_GetIPCountry(CSteamGameServerAPIContext.GetSteamUtils())); + return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUtils_GetIPCountry(CSteamGameServerAPIContext.GetSteamUtils())); } /// @@ -59,7 +59,7 @@ public static string GetIPCountry() { /// public static bool GetImageSize(int iImage, out uint pnWidth, out uint pnHeight) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_GetImageSize(CSteamGameServerAPIContext.GetSteamUtils(), iImage, out pnWidth, out pnHeight); + return NativeMethods.ISteamUtils_GetImageSize(CSteamGameServerAPIContext.GetSteamUtils(), iImage, out pnWidth, out pnHeight); } /// @@ -69,7 +69,7 @@ public static bool GetImageSize(int iImage, out uint pnWidth, out uint pnHeight) /// public static bool GetImageRGBA(int iImage, byte[] pubDest, int nDestBufferSize) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_GetImageRGBA(CSteamGameServerAPIContext.GetSteamUtils(), iImage, pubDest, nDestBufferSize); + return NativeMethods.ISteamUtils_GetImageRGBA(CSteamGameServerAPIContext.GetSteamUtils(), iImage, pubDest, nDestBufferSize); } /// @@ -77,7 +77,7 @@ public static bool GetImageRGBA(int iImage, byte[] pubDest, int nDestBufferSize) /// public static byte GetCurrentBatteryPower() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_GetCurrentBatteryPower(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_GetCurrentBatteryPower(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -85,7 +85,7 @@ public static byte GetCurrentBatteryPower() { /// public static AppId_t GetAppID() { InteropHelp.TestIfAvailableGameServer(); - return (AppId_t)NativeMethods.ISteamGameServerUtils_GetAppID(CSteamGameServerAPIContext.GetSteamUtils()); + return (AppId_t)NativeMethods.ISteamUtils_GetAppID(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -94,7 +94,7 @@ public static AppId_t GetAppID() { /// public static void SetOverlayNotificationPosition(ENotificationPosition eNotificationPosition) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerUtils_SetOverlayNotificationPosition(CSteamGameServerAPIContext.GetSteamUtils(), eNotificationPosition); + NativeMethods.ISteamUtils_SetOverlayNotificationPosition(CSteamGameServerAPIContext.GetSteamUtils(), eNotificationPosition); } /// @@ -103,17 +103,17 @@ public static void SetOverlayNotificationPosition(ENotificationPosition eNotific /// public static bool IsAPICallCompleted(SteamAPICall_t hSteamAPICall, out bool pbFailed) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_IsAPICallCompleted(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall, out pbFailed); + return NativeMethods.ISteamUtils_IsAPICallCompleted(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall, out pbFailed); } public static ESteamAPICallFailure GetAPICallFailureReason(SteamAPICall_t hSteamAPICall) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_GetAPICallFailureReason(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall); + return NativeMethods.ISteamUtils_GetAPICallFailureReason(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall); } public static bool GetAPICallResult(SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, out bool pbFailed) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_GetAPICallResult(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall, pCallback, cubCallback, iCallbackExpected, out pbFailed); + return NativeMethods.ISteamUtils_GetAPICallResult(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall, pCallback, cubCallback, iCallbackExpected, out pbFailed); } /// @@ -124,7 +124,7 @@ public static bool GetAPICallResult(SteamAPICall_t hSteamAPICall, IntPtr pCallba /// public static uint GetIPCCallCount() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_GetIPCCallCount(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_GetIPCCallCount(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -135,7 +135,7 @@ public static uint GetIPCCallCount() { /// public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerUtils_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamUtils(), pFunction); + NativeMethods.ISteamUtils_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamUtils(), pFunction); } /// @@ -144,7 +144,7 @@ public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) /// public static bool IsOverlayEnabled() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_IsOverlayEnabled(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_IsOverlayEnabled(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -159,7 +159,7 @@ public static bool IsOverlayEnabled() { /// public static bool BOverlayNeedsPresent() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_BOverlayNeedsPresent(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_BOverlayNeedsPresent(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -175,7 +175,7 @@ public static bool BOverlayNeedsPresent() { public static SteamAPICall_t CheckFileSignature(string szFileName) { InteropHelp.TestIfAvailableGameServer(); using (var szFileName2 = new InteropHelp.UTF8StringHandle(szFileName)) { - return (SteamAPICall_t)NativeMethods.ISteamGameServerUtils_CheckFileSignature(CSteamGameServerAPIContext.GetSteamUtils(), szFileName2); + return (SteamAPICall_t)NativeMethods.ISteamUtils_CheckFileSignature(CSteamGameServerAPIContext.GetSteamUtils(), szFileName2); } } @@ -186,7 +186,7 @@ public static bool ShowGamepadTextInput(EGamepadTextInputMode eInputMode, EGamep InteropHelp.TestIfAvailableGameServer(); using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription)) using (var pchExistingText2 = new InteropHelp.UTF8StringHandle(pchExistingText)) { - return NativeMethods.ISteamGameServerUtils_ShowGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), eInputMode, eLineInputMode, pchDescription2, unCharMax, pchExistingText2); + return NativeMethods.ISteamUtils_ShowGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), eInputMode, eLineInputMode, pchDescription2, unCharMax, pchExistingText2); } } @@ -195,13 +195,13 @@ public static bool ShowGamepadTextInput(EGamepadTextInputMode eInputMode, EGamep /// public static uint GetEnteredGamepadTextLength() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_GetEnteredGamepadTextLength(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_GetEnteredGamepadTextLength(CSteamGameServerAPIContext.GetSteamUtils()); } public static bool GetEnteredGamepadTextInput(out string pchText, uint cchText) { InteropHelp.TestIfAvailableGameServer(); IntPtr pchText2 = Marshal.AllocHGlobal((int)cchText); - bool ret = NativeMethods.ISteamGameServerUtils_GetEnteredGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), pchText2, cchText); + bool ret = NativeMethods.ISteamUtils_GetEnteredGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), pchText2, cchText); pchText = ret ? InteropHelp.PtrToStringUTF8(pchText2) : null; Marshal.FreeHGlobal(pchText2); return ret; @@ -212,7 +212,7 @@ public static bool GetEnteredGamepadTextInput(out string pchText, uint cchText) /// public static string GetSteamUILanguage() { InteropHelp.TestIfAvailableGameServer(); - return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamGameServerUtils_GetSteamUILanguage(CSteamGameServerAPIContext.GetSteamUtils())); + return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUtils_GetSteamUILanguage(CSteamGameServerAPIContext.GetSteamUtils())); } /// @@ -220,7 +220,7 @@ public static string GetSteamUILanguage() { /// public static bool IsSteamRunningInVR() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_IsSteamRunningInVR(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_IsSteamRunningInVR(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -228,7 +228,7 @@ public static bool IsSteamRunningInVR() { /// public static void SetOverlayNotificationInset(int nHorizontalInset, int nVerticalInset) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerUtils_SetOverlayNotificationInset(CSteamGameServerAPIContext.GetSteamUtils(), nHorizontalInset, nVerticalInset); + NativeMethods.ISteamUtils_SetOverlayNotificationInset(CSteamGameServerAPIContext.GetSteamUtils(), nHorizontalInset, nVerticalInset); } /// @@ -238,7 +238,7 @@ public static void SetOverlayNotificationInset(int nHorizontalInset, int nVertic /// public static bool IsSteamInBigPictureMode() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_IsSteamInBigPictureMode(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_IsSteamInBigPictureMode(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -246,7 +246,7 @@ public static bool IsSteamInBigPictureMode() { /// public static void StartVRDashboard() { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerUtils_StartVRDashboard(CSteamGameServerAPIContext.GetSteamUtils()); + NativeMethods.ISteamUtils_StartVRDashboard(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -254,7 +254,7 @@ public static void StartVRDashboard() { /// public static bool IsVRHeadsetStreamingEnabled() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_IsVRHeadsetStreamingEnabled(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_IsVRHeadsetStreamingEnabled(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -266,7 +266,7 @@ public static bool IsVRHeadsetStreamingEnabled() { /// public static void SetVRHeadsetStreamingEnabled(bool bEnabled) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerUtils_SetVRHeadsetStreamingEnabled(CSteamGameServerAPIContext.GetSteamUtils(), bEnabled); + NativeMethods.ISteamUtils_SetVRHeadsetStreamingEnabled(CSteamGameServerAPIContext.GetSteamUtils(), bEnabled); } /// @@ -274,7 +274,7 @@ public static void SetVRHeadsetStreamingEnabled(bool bEnabled) { /// public static bool IsSteamChinaLauncher() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_IsSteamChinaLauncher(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_IsSteamChinaLauncher(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -286,7 +286,7 @@ public static bool IsSteamChinaLauncher() { /// public static bool InitFilterText(uint unFilterOptions = 0) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_InitFilterText(CSteamGameServerAPIContext.GetSteamUtils(), unFilterOptions); + return NativeMethods.ISteamUtils_InitFilterText(CSteamGameServerAPIContext.GetSteamUtils(), unFilterOptions); } /// @@ -302,7 +302,7 @@ public static int FilterText(ETextFilteringContext eContext, CSteamID sourceStea InteropHelp.TestIfAvailableGameServer(); IntPtr pchOutFilteredText2 = Marshal.AllocHGlobal((int)nByteSizeOutFilteredText); using (var pchInputMessage2 = new InteropHelp.UTF8StringHandle(pchInputMessage)) { - int ret = NativeMethods.ISteamGameServerUtils_FilterText(CSteamGameServerAPIContext.GetSteamUtils(), eContext, sourceSteamID, pchInputMessage2, pchOutFilteredText2, nByteSizeOutFilteredText); + int ret = NativeMethods.ISteamUtils_FilterText(CSteamGameServerAPIContext.GetSteamUtils(), eContext, sourceSteamID, pchInputMessage2, pchOutFilteredText2, nByteSizeOutFilteredText); pchOutFilteredText = ret != -1 ? InteropHelp.PtrToStringUTF8(pchOutFilteredText2) : null; Marshal.FreeHGlobal(pchOutFilteredText2); return ret; @@ -315,7 +315,7 @@ public static int FilterText(ETextFilteringContext eContext, CSteamID sourceStea /// public static ESteamIPv6ConnectivityState GetIPv6ConnectivityState(ESteamIPv6ConnectivityProtocol eProtocol) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_GetIPv6ConnectivityState(CSteamGameServerAPIContext.GetSteamUtils(), eProtocol); + return NativeMethods.ISteamUtils_GetIPv6ConnectivityState(CSteamGameServerAPIContext.GetSteamUtils(), eProtocol); } /// @@ -323,7 +323,7 @@ public static ESteamIPv6ConnectivityState GetIPv6ConnectivityState(ESteamIPv6Con /// public static bool IsSteamRunningOnSteamDeck() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_IsSteamRunningOnSteamDeck(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_IsSteamRunningOnSteamDeck(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -332,7 +332,7 @@ public static bool IsSteamRunningOnSteamDeck() { /// public static bool ShowFloatingGamepadTextInput(EFloatingGamepadTextInputMode eKeyboardMode, int nTextFieldXPosition, int nTextFieldYPosition, int nTextFieldWidth, int nTextFieldHeight) { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_ShowFloatingGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), eKeyboardMode, nTextFieldXPosition, nTextFieldYPosition, nTextFieldWidth, nTextFieldHeight); + return NativeMethods.ISteamUtils_ShowFloatingGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), eKeyboardMode, nTextFieldXPosition, nTextFieldYPosition, nTextFieldWidth, nTextFieldHeight); } /// @@ -340,7 +340,7 @@ public static bool ShowFloatingGamepadTextInput(EFloatingGamepadTextInputMode eK /// public static void SetGameLauncherMode(bool bLauncherMode) { InteropHelp.TestIfAvailableGameServer(); - NativeMethods.ISteamGameServerUtils_SetGameLauncherMode(CSteamGameServerAPIContext.GetSteamUtils(), bLauncherMode); + NativeMethods.ISteamUtils_SetGameLauncherMode(CSteamGameServerAPIContext.GetSteamUtils(), bLauncherMode); } /// @@ -348,7 +348,7 @@ public static void SetGameLauncherMode(bool bLauncherMode) { /// public static bool DismissFloatingGamepadTextInput() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_DismissFloatingGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_DismissFloatingGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils()); } /// @@ -356,7 +356,7 @@ public static bool DismissFloatingGamepadTextInput() { /// public static bool DismissGamepadTextInput() { InteropHelp.TestIfAvailableGameServer(); - return NativeMethods.ISteamGameServerUtils_DismissGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils()); + return NativeMethods.ISteamUtils_DismissGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils()); } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs index 7b1cf9b5..fd2c81c8 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs @@ -783,13 +783,14 @@ public static PartyBeaconID_t GetBeaconByIndex(uint unIndex) { public static bool GetBeaconDetails(PartyBeaconID_t ulBeaconID, out CSteamID pSteamIDBeaconOwner, out SteamPartyBeaconLocation_t pLocation, out string pchMetadata, int cchMetadata) { InteropHelp.TestIfAvailableClient(); IntPtr pchMetadata2 = Marshal.AllocHGlobal(cchMetadata); - bool anyCpuResult; + bool ret; if (!Packsize.IsLargePack) { - anyCpuResult = NativeMethods.ISteamParties_GetBeaconDetails(CSteamAPIContext.GetSteamParties(), ulBeaconID, out pSteamIDBeaconOwner, out pLocation, pchMetadata2, cchMetadata); + ret = NativeMethods.ISteamParties_GetBeaconDetails(CSteamAPIContext.GetSteamParties(), ulBeaconID, out pSteamIDBeaconOwner, out pLocation, pchMetadata2, cchMetadata); } else { - anyCpuResult = NativeMethods.ISteamParties_GetBeaconDetails(CSteamAPIContext.GetSteamParties(), ulBeaconID, out pSteamIDBeaconOwner, out pLocation_lp, pchMetadata2, cchMetadata); + SteamPartyBeaconLocation_t pLocation_lp; + ret = NativeMethods.ISteamParties_GetBeaconDetails(CSteamAPIContext.GetSteamParties(), ulBeaconID, out pSteamIDBeaconOwner, out pLocation_lp, pchMetadata2, cchMetadata); + pLocation = pLocation_lp; } - return anyCpuResult; pchMetadata = ret ? InteropHelp.PtrToStringUTF8(pchMetadata2) : null; Marshal.FreeHGlobal(pchMetadata2); return ret; @@ -816,13 +817,15 @@ public static bool GetNumAvailableBeaconLocations(out uint puNumLocations) { public static bool GetAvailableBeaconLocations(SteamPartyBeaconLocation_t[] pLocationList, uint uMaxNumLocations) { InteropHelp.TestIfAvailableClient(); - bool anyCpuResult; + bool ret; if (!Packsize.IsLargePack) { - anyCpuResult = NativeMethods.ISteamParties_GetAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), pLocationList, uMaxNumLocations); + ret = NativeMethods.ISteamParties_GetAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), pLocationList, uMaxNumLocations); } else { - anyCpuResult = NativeMethods.ISteamParties_GetAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), pLocationList_lp, uMaxNumLocations); + SteamPartyBeaconLocation_t[] pLocationList_lp = pLocationList; + ret = NativeMethods.ISteamParties_GetAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), pLocationList_lp, uMaxNumLocations); + pLocationList = pLocationList_lp; } - return anyCpuResult; + return ret; } /// @@ -835,13 +838,15 @@ public static SteamAPICall_t CreateBeacon(uint unOpenSlots, ref SteamPartyBeacon InteropHelp.TestIfAvailableClient(); using (var pchConnectString2 = new InteropHelp.UTF8StringHandle(pchConnectString)) using (var pchMetadata2 = new InteropHelp.UTF8StringHandle(pchMetadata)) { - ulong anyCpuResult; + SteamAPICall_t ret; if (!Packsize.IsLargePack) { - anyCpuResult = (SteamAPICall_t)NativeMethods.ISteamParties_CreateBeacon(CSteamAPIContext.GetSteamParties(), unOpenSlots, ref pBeaconLocation, pchConnectString2, pchMetadata2); + ret = (SteamAPICall_t)NativeMethods.ISteamParties_CreateBeacon(CSteamAPIContext.GetSteamParties(), unOpenSlots, ref pBeaconLocation, pchConnectString2, pchMetadata2); } else { - anyCpuResult = (SteamAPICall_t)NativeMethods.ISteamParties_CreateBeacon(CSteamAPIContext.GetSteamParties(), unOpenSlots, ref pBeaconLocation_lp, pchConnectString2, pchMetadata2); + SteamPartyBeaconLocation_t pBeaconLocation_lp = pBeaconLocation; + ret = (SteamAPICall_t)NativeMethods.ISteamParties_CreateBeacon(CSteamAPIContext.GetSteamParties(), unOpenSlots, ref pBeaconLocation_lp, pchConnectString2, pchMetadata2); + pBeaconLocation = pBeaconLocation_lp; } - return anyCpuResult; + return ret; } } @@ -888,13 +893,14 @@ public static bool DestroyBeacon(PartyBeaconID_t ulBeacon) { public static bool GetBeaconLocationData(SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, out string pchDataStringOut, int cchDataStringOut) { InteropHelp.TestIfAvailableClient(); IntPtr pchDataStringOut2 = Marshal.AllocHGlobal(cchDataStringOut); - bool anyCpuResult; + bool ret; if (!Packsize.IsLargePack) { - anyCpuResult = NativeMethods.ISteamParties_GetBeaconLocationData(CSteamAPIContext.GetSteamParties(), BeaconLocation, eData, pchDataStringOut2, cchDataStringOut); + ret = NativeMethods.ISteamParties_GetBeaconLocationData(CSteamAPIContext.GetSteamParties(), BeaconLocation, eData, pchDataStringOut2, cchDataStringOut); } else { - anyCpuResult = NativeMethods.ISteamParties_GetBeaconLocationData(CSteamAPIContext.GetSteamParties(), BeaconLocation_lp, eData, pchDataStringOut2, cchDataStringOut); + SteamPartyBeaconLocation_t BeaconLocation_lp = BeaconLocation; + ret = NativeMethods.ISteamParties_GetBeaconLocationData(CSteamAPIContext.GetSteamParties(), BeaconLocation_lp, eData, pchDataStringOut2, cchDataStringOut); + BeaconLocation = BeaconLocation_lp; } - return anyCpuResult; pchDataStringOut = ret ? InteropHelp.PtrToStringUTF8(pchDataStringOut2) : null; Marshal.FreeHGlobal(pchDataStringOut2); return ret; diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs index ba3b0206..8e6aec57 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs @@ -134,13 +134,15 @@ public static bool CloseChannelWithUser(ref SteamNetworkingIdentity identityRemo /// public static ESteamNetworkingConnectionState GetSessionConnectionInfo(ref SteamNetworkingIdentity identityRemote, out SteamNetConnectionInfo_t pConnectionInfo, out SteamNetConnectionRealTimeStatus_t pQuickStatus) { InteropHelp.TestIfAvailableClient(); - ESteamNetworkingConnectionState anyCpuResult; + ESteamNetworkingConnectionState ret; if (!Packsize.IsLargePack) { - anyCpuResult = NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo, out pQuickStatus); + ret = NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo, out pQuickStatus); } else { - anyCpuResult = NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo_lp, out pQuickStatus); + SteamNetConnectionInfo_t pConnectionInfo_lp; + ret = NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo_lp, out pQuickStatus); + pConnectionInfo = pConnectionInfo_lp; } - return anyCpuResult; + return ret; } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs index f56bb2f3..cd97da8c 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs @@ -397,13 +397,15 @@ public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, IntPtr[ /// public static bool GetConnectionInfo(HSteamNetConnection hConn, out SteamNetConnectionInfo_t pInfo) { InteropHelp.TestIfAvailableClient(); - bool anyCpuResult; + bool ret; if (!Packsize.IsLargePack) { - anyCpuResult = NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); + ret = NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); } else { - anyCpuResult = NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo_lp); + SteamNetConnectionInfo_t pInfo_lp; + ret = NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo_lp); + pInfo = pInfo_lp; } - return anyCpuResult; + return ret; } /// diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs index b3f5c644..02bd6ce1 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs @@ -63,13 +63,15 @@ public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) { /// public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails) { InteropHelp.TestIfAvailableClient(); - bool anyCpuResult; + bool ret; if (!Packsize.IsLargePack) { - anyCpuResult = NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamAPIContext.GetSteamUGC(), handle, index, out pDetails); + ret = NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamAPIContext.GetSteamUGC(), handle, index, out pDetails); } else { - anyCpuResult = NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamAPIContext.GetSteamUGC(), handle, index, out pDetails_lp); + SteamUGCDetails_t pDetails_lp; + ret = NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamAPIContext.GetSteamUGC(), handle, index, out pDetails_lp); + pDetails = pDetails_lp; } - return anyCpuResult; + return ret; } public static uint GetQueryUGCNumTags(UGCQueryHandle_t handle, uint index) { diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs index 6197cc4c..17604318 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs @@ -317,13 +317,15 @@ public static SteamAPICall_t DownloadLeaderboardEntriesForUsers(SteamLeaderboard /// public static bool GetDownloadedLeaderboardEntry(SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, out LeaderboardEntry_t pLeaderboardEntry, int[] pDetails, int cDetailsMax) { InteropHelp.TestIfAvailableClient(); - bool anyCpuResult; + bool ret; if (!Packsize.IsLargePack) { - anyCpuResult = NativeMethods.ISteamUserStats_GetDownloadedLeaderboardEntry(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboardEntries, index, out pLeaderboardEntry, pDetails, cDetailsMax); + ret = NativeMethods.ISteamUserStats_GetDownloadedLeaderboardEntry(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboardEntries, index, out pLeaderboardEntry, pDetails, cDetailsMax); } else { - anyCpuResult = NativeMethods.ISteamUserStats_GetDownloadedLeaderboardEntry(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboardEntries, index, out pLeaderboardEntry_lp, pDetails, cDetailsMax); + LeaderboardEntry_t pLeaderboardEntry_lp; + ret = NativeMethods.ISteamUserStats_GetDownloadedLeaderboardEntry(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboardEntries, index, out pLeaderboardEntry_lp, pDetails, cDetailsMax); + pLeaderboardEntry = pLeaderboardEntry_lp; } - return anyCpuResult; + return ret; } /// From 205f2ce01aa5f0e575b575f7548df22a91b9fb39 Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Tue, 28 Oct 2025 22:55:26 +0800 Subject: [PATCH 61/82] Fix array parameter usage of packsize aware structs. Regenerated files are also included. --- CodeGen/src/interfaces.py | 27 ++++++++++++++----- .../Runtime/autogen/isteammatchmaking.cs | 7 +++-- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/CodeGen/src/interfaces.py b/CodeGen/src/interfaces.py index f5e4dca3..b7ed8c83 100644 --- a/CodeGen/src/interfaces.py +++ b/CodeGen/src/interfaces.py @@ -769,7 +769,7 @@ def generate_wrapper_function(f, interface, func: Function, args_with_explicit_count = args[5] isPacksizeAware = args[6] largePackNativeArgs: str = args[7] - largePackMarshalInfo: list[(str, str, bool)] = args[8] # (typeName, argName, shouldAssignInput) + largePackByrefArgs: list[(str, str, bool)] = args[8] # (typeName, argName, shouldAssignInput) strCast = "" wrapperreturntype = None @@ -875,14 +875,26 @@ def generate_wrapper_function(f, interface, func: Function, b.append("if (!Packsize.IsLargePack) {") b.append("\t" + prebuiltInvocationExpression) b.append("} else {") + # generate large-pack byref intermediate struct variables - for lpArg in largePackMarshalInfo: - assignByRefManaged = "" if not lpArg[2] else f" = {lpArg[1]}" - b.append(f"\t{lpArg[0]} {lpArg[1]}_lp{assignByRefManaged};") + for lpArg in largePackByrefArgs: + if not lpArg[0].endswith("[]"): + assignByRefManaged = "" if not lpArg[2] else f" = {lpArg[1]}" + b.append(f"\t{lpArg[0]} {lpArg[1]}_lp{assignByRefManaged};") + else: + b.append(f"\t{lpArg[0][:-2]}_LargePack[] {lpArg[1]}_lp = new {lpArg[0][:-2]}_LargePack[{lpArg[1]}.Length];") + b.append(f"\tfor (int i = 0; i < {lpArg[1]}.Length; i++)") + b.append(f"\t\t{lpArg[1]}_lp[i] = {lpArg[1]}[i];") + b.append("\t" + prebuiltInvocationExpressionLargePack) # convert large pack form to managed form - for lpArg in largePackMarshalInfo: - b.append(f"\t{lpArg[1]} = {lpArg[1]}_lp;") + for lpArg in largePackByrefArgs: + if not lpArg[0].endswith('[]'): + b.append(f"\t{lpArg[1]} = {lpArg[1]}_lp;") + else: + b.append(f"\tfor (int i = 0; i < {lpArg[1]}.Length; i++)") + b.append(f"\t\t{lpArg[1]}[i] = {lpArg[1]}_lp[i];") + b.append("}") functionBody.extend(map(lambda l: "\t\t\t" + l, b)) @@ -995,6 +1007,9 @@ def parse_args(strEntryPoint: str, args: list[Arg], _: bool, parser: Parser): else: args_with_explicit_count[arg.name] = argattribute.value + if isParamArray and isThisArgPackAware : + (t, n, byref) = largePackArgMarshalRecord + largePackArgMarshalRecord = (t + "[]", n, byref) if arg.type == "MatchMakingKeyValuePair_t **": # TODO: Fixme - Small Hack... We do this because MatchMakingKeyValuePair's have ARRAY_COUNT() and two **'s, things get broken :( pInvokeArgType = "IntPtr" diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs index fd2c81c8..1a2ca084 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs @@ -821,9 +821,12 @@ public static bool GetAvailableBeaconLocations(SteamPartyBeaconLocation_t[] pLoc if (!Packsize.IsLargePack) { ret = NativeMethods.ISteamParties_GetAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), pLocationList, uMaxNumLocations); } else { - SteamPartyBeaconLocation_t[] pLocationList_lp = pLocationList; + SteamPartyBeaconLocation_t_LargePack[] pLocationList_lp = new SteamPartyBeaconLocation_t_LargePack[pLocationList.Length]; + for (int i = 0; i < pLocationList.Length; i++) + pLocationList_lp[i] = pLocationList[i]; ret = NativeMethods.ISteamParties_GetAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), pLocationList_lp, uMaxNumLocations); - pLocationList = pLocationList_lp; + for (int i = 0; i < pLocationList.Length; i++) + pLocationList[i] = pLocationList_lp[i]; } return ret; } From a69c39cc736f43dc13438bf0603739c37782a4f2 Mon Sep 17 00:00:00 2001 From: RcubDev Date: Sun, 2 Nov 2025 20:47:08 -0700 Subject: [PATCH 62/82] include STEAMWORKS_WIN constant --- Standalone3.0/Steamworks.NET.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Standalone3.0/Steamworks.NET.csproj b/Standalone3.0/Steamworks.NET.csproj index f94989e2..eb03812f 100644 --- a/Standalone3.0/Steamworks.NET.csproj +++ b/Standalone3.0/Steamworks.NET.csproj @@ -4,7 +4,7 @@ net8.0 Steamworks git - STEAMWORKS_LIN_OSX;STEAMWORKS_X64;STEAMWORKS_ANYCPU + STEAMWORKS_WIN;STEAMWORKS_LIN_OSX;STEAMWORKS_X64;STEAMWORKS_ANYCPU From 3f496ea9625a9cbd2f00e18dc2ea5b1261ad4c20 Mon Sep 17 00:00:00 2001 From: RcubDev Date: Sun, 2 Nov 2025 22:49:31 -0700 Subject: [PATCH 63/82] add a fix to dynamically load assembly on windows --- .../Runtime/autogen/NativeMethods.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs index 6f458bf4..806743ae 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs @@ -37,6 +37,36 @@ namespace Steamworks { [System.Security.SuppressUnmanagedCodeSecurity()] internal static class NativeMethods { +#if STEAMWORKS_ANYCPU + static NativeMethods() + { + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, DllImportResolver); + } + + private static IntPtr DllImportResolver(string libraryName, System.Reflection.Assembly assembly, DllImportSearchPath? searchPath) + { + // Only handle steam_api libraries + if (libraryName != "steam_api" && libraryName != "steam_api64" && + libraryName != "sdkencryptedappticket" && libraryName != "sdkencryptedappticket64") + { + return IntPtr.Zero; + } + + // On Windows x64, use steam_api64 + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && System.Environment.Is64BitProcess) + { + string libName = libraryName.Contains("encrypted") ? "sdkencryptedappticket64" : "steam_api64"; + if (NativeLibrary.TryLoad(libName, assembly, searchPath, out IntPtr handle)) + { + return handle; + } + } + + // For all other platforms, let .NET's default RID-based resolution handle it + return IntPtr.Zero; + } +#endif + #if STEAMWORKS_WIN && STEAMWORKS_X64 internal const string NativeLibraryName = "steam_api64"; internal const string NativeLibrary_SDKEncryptedAppTicket = "sdkencryptedappticket64"; From 83b69013ba5f99fe16e34487807faf7ddf3f01cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Mon, 3 Nov 2025 19:34:10 +0800 Subject: [PATCH 64/82] Revert adding of macro `STEAMWORKS_WIN` To avoid breaking internal symbol usages, `STEAMWORKS_WIN` is dropped versus `STEAMWORKS_LIN_OSX`. --- Standalone3.0/Steamworks.NET.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Standalone3.0/Steamworks.NET.csproj b/Standalone3.0/Steamworks.NET.csproj index eb03812f..f94989e2 100644 --- a/Standalone3.0/Steamworks.NET.csproj +++ b/Standalone3.0/Steamworks.NET.csproj @@ -4,7 +4,7 @@ net8.0 Steamworks git - STEAMWORKS_WIN;STEAMWORKS_LIN_OSX;STEAMWORKS_X64;STEAMWORKS_ANYCPU + STEAMWORKS_LIN_OSX;STEAMWORKS_X64;STEAMWORKS_ANYCPU From 9537d42aae9c891c5ce6780a88794f88a7e1f976 Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Mon, 3 Nov 2025 20:33:33 +0800 Subject: [PATCH 65/82] Changed the time to hook dll loading. Now we can do our hook in any AssemblyLoacContext s. DLL loading issues in godot(editor?) caused by multiple A.L.C.s should be fixed. --- .../Runtime/Steam.cs | 68 ------------------- .../Runtime/autogen/NativeMethods.cs | 38 +++++++---- 2 files changed, 24 insertions(+), 82 deletions(-) diff --git a/com.rlabrecque.steamworks.net/Runtime/Steam.cs b/com.rlabrecque.steamworks.net/Runtime/Steam.cs index c5dd2bce..5b2b9a28 100644 --- a/com.rlabrecque.steamworks.net/Runtime/Steam.cs +++ b/com.rlabrecque.steamworks.net/Runtime/Steam.cs @@ -14,59 +14,6 @@ using IntPtr = System.IntPtr; namespace Steamworks { -#if STEAMWORKS_ANYCPU // implies .net 8.0 and STEAMWORKS_X86 - internal static class AnyCPU - { - internal static void BeCompatible() - { - // not checking os or arch etc, this library can act as a placeholder - - if (s_isAnyCPUHookApplied) - return; - - s_isAnyCPUHookApplied = true; - System.Runtime.Loader.AssemblyLoadContext.Default.ResolvingUnmanagedDll += SteamNativeResolveHook; - } - - private static bool s_isAnyCPUHookApplied = false; - - private static nint SteamNativeResolveHook(System.Reflection.Assembly requestAsm, string name) - { - // check is requesting library name matches steam native - // we don't check requester here because we want to ensure we are the first loader of steam native - // otherwise other libraries may have already loaded steam native with wrong architecture - if ((name == NativeMethods.NativeLibraryName || name == NativeMethods.NativeLibrary_SDKEncryptedAppTicket) - // check are we on win64, the special case we are going to handle - && RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && System.Environment.Is64BitProcess) - { - // check who is requesting steam native - if (requestAsm.GetName().Name != "Steamworks.NET") - { - // document of ALC says unmanaged libraries(steam native dll) will be cached(probably by name), - // we warn developers here the steam native will be cached for any later loads, this is a potentional pollution. - System.Diagnostics.Debug.WriteLine( - $"[Warning] Assembly {requestAsm.GetName().Name} is requesting Steam native by it's original name, " + - $"but Steamworks.NET.AnyCPU want to load x64 version of steam library \"{name}\". The loaded Steam native will be cached " + - $"and may potentially break it.\n" + - $"Affected assembly's full name: {requestAsm.FullName}"); - - return 0; - } - - // platform specific suffix is not needed, to reuse default unmanaged dependencies resolve logic - string x64LibName = $"{name}64"; - // we don't care failed load, let next handler manage it - NativeLibrary.TryLoad(x64LibName, requestAsm, null, out nint lib); - return lib; - } - - return 0; - } - } -#endif - - - public static class SteamAPI { //----------------------------------------------------------------------------------------------------------------------------------------------------------// // Steam API setup & shutdown @@ -108,9 +55,6 @@ public static class SteamAPI { // Returns true on success public static ESteamAPIInitResult InitEx(out string OutSteamErrMsg) { -#if STEAMWORKS_ANYCPU - AnyCPU.BeCompatible(); -#endif InteropHelp.TestIfPlatformSupported(); var pszInternalCheckInterfaceVersions = new System.Text.StringBuilder(); @@ -167,9 +111,6 @@ public static ESteamAPIInitResult InitEx(out string OutSteamErrMsg) } public static bool Init() { -#if STEAMWORKS_ANYCPU - AnyCPU.BeCompatible(); -#endif InteropHelp.TestIfPlatformSupported(); string SteamErrorMsg; @@ -195,9 +136,6 @@ public static void Shutdown() { // NOTE: If you use the Steam DRM wrapper on your primary executable file, this check is unnecessary // since the DRM wrapper will ensure that your application was launched properly through Steam. public static bool RestartAppIfNecessary(AppId_t unOwnAppID) { -#if STEAMWORKS_ANYCPU - AnyCPU.BeCompatible(); -#endif InteropHelp.TestIfPlatformSupported(); return NativeMethods.SteamAPI_RestartAppIfNecessary(unOwnAppID); } @@ -289,9 +227,6 @@ public static class GameServer { // - The version string should be in the form x.x.x.x, and is used by the master server to detect when the // server is out of date. (Only servers with the latest version will be listed.) public static ESteamAPIInitResult InitEx(uint unIP, ushort usGamePort, ushort usQueryPort, EServerMode eServerMode, string pchVersionString, out string OutSteamErrMsg) { -#if STEAMWORKS_ANYCPU - AnyCPU.BeCompatible(); -#endif InteropHelp.TestIfPlatformSupported(); var pszInternalCheckInterfaceVersions = new System.Text.StringBuilder(); @@ -335,9 +270,6 @@ public static ESteamAPIInitResult InitEx(uint unIP, ushort usGamePort, ushort us // This function is included for compatibility with older SDK. // You can use it if you don't care about decent error handling public static bool Init(uint unIP, ushort usGamePort, ushort usQueryPort, EServerMode eServerMode, string pchVersionString) { -#if STEAMWORKS_ANYCPU - AnyCPU.BeCompatible(); -#endif InteropHelp.TestIfPlatformSupported(); string SteamErrorMsg; diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs index 806743ae..7d00f2f3 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs @@ -45,25 +45,35 @@ static NativeMethods() private static IntPtr DllImportResolver(string libraryName, System.Reflection.Assembly assembly, DllImportSearchPath? searchPath) { - // Only handle steam_api libraries - if (libraryName != "steam_api" && libraryName != "steam_api64" && - libraryName != "sdkencryptedappticket" && libraryName != "sdkencryptedappticket64") + // check is requesting library name matches steam native + // we don't check requester here because we want to ensure we are the first loader of steam native + // otherwise other libraries may have already loaded steam native with wrong architecture + if ((libraryName == NativeLibraryName || libraryName == NativeLibrary_SDKEncryptedAppTicket) + // check are we on win64, the special case we are going to handle + && RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && System.Environment.Is64BitProcess) { - return IntPtr.Zero; - } - - // On Windows x64, use steam_api64 - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && System.Environment.Is64BitProcess) - { - string libName = libraryName.Contains("encrypted") ? "sdkencryptedappticket64" : "steam_api64"; - if (NativeLibrary.TryLoad(libName, assembly, searchPath, out IntPtr handle)) + // check who is requesting steam native + if (assembly.GetName().Name != "Steamworks.NET") { - return handle; + // Unmanaged libraries(steam native dll) will be cached(probably by name), + // we warn developers here the steam native will be cached for any later loads, this is a potentional pollution. + System.Diagnostics.Debug.WriteLine( + $"[Warning] Assembly {assembly.GetName().Name} is requesting Steam native by it's original name, " + + $"but Steamworks.NET.AnyCPU want to load x64 version of steam library \"{libraryName}\". The loaded Steam native will be cached " + + $"and may potentially break it.\n" + + $"Affected assembly's full name: {assembly.FullName}"); + + return 0; } + + // platform specific suffix is not needed, to reuse default unmanaged dependencies resolve logic + string x64LibName = $"{libraryName}64"; + // we don't care failed load, let next handler manage it + NativeLibrary.TryLoad(x64LibName, assembly, searchPath, out nint lib); + return lib; } - // For all other platforms, let .NET's default RID-based resolution handle it - return IntPtr.Zero; + return 0; } #endif From 041d48de38ccde1e01af8a9316ed2fd61ec681cc Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Tue, 4 Nov 2025 18:53:53 +0800 Subject: [PATCH 66/82] Move loader hook fix to source generator's template. --- CodeGen/templates/nativemethods.txt | 36 +++++++++++++++++++ .../Runtime/autogen/NativeMethods.cs | 14 +++----- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/CodeGen/templates/nativemethods.txt b/CodeGen/templates/nativemethods.txt index 7274efd8..fb3b51ff 100644 --- a/CodeGen/templates/nativemethods.txt +++ b/CodeGen/templates/nativemethods.txt @@ -37,6 +37,42 @@ using IntPtr = System.IntPtr; namespace Steamworks { [System.Security.SuppressUnmanagedCodeSecurity()] internal static class NativeMethods { + #if STEAMWORKS_ANYCPU + static NativeMethods() { + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, DllImportResolver); + } + + private static IntPtr DllImportResolver(string libraryName, System.Reflection.Assembly assembly, DllImportSearchPath? searchPath) { + // check is requesting library name matches steam native + // we don't check requester here because we want to ensure we are the first loader of steam native + // otherwise other libraries may have already loaded steam native with wrong architecture + if ((libraryName == NativeLibraryName || libraryName == NativeLibrary_SDKEncryptedAppTicket) + // check are we on win64, the special case we are going to handle + && RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && System.Environment.Is64BitProcess) { + // check who is requesting steam native + if (assembly.GetName().Name != "Steamworks.NET") { + // Unmanaged libraries(steam native dll) will be cached(probably by name), + // we warn developers here the steam native will be cached for any later loads, this is a potentional pollution. + System.Diagnostics.Debug.WriteLine( + $"[Warning] Assembly {assembly.GetName().Name} is requesting Steam native by it's original name, " + + $"but Steamworks.NET.AnyCPU want to load x64 version of steam library \"{libraryName}\". The loaded Steam native will be cached " + + $"and may potentially break it.\n" + + $"Affected assembly's full name: {assembly.FullName}"); + + return 0; + } + + // platform specific suffix is not needed, to reuse default unmanaged dependencies resolve logic + string x64LibName = $"{libraryName}64"; + // we don't care failed load, let next handler manage it + NativeLibrary.TryLoad(x64LibName, assembly, searchPath, out nint lib); + return lib; + } + + return 0; + } +#endif + #if STEAMWORKS_WIN && STEAMWORKS_X64 internal const string NativeLibraryName = "steam_api64"; internal const string NativeLibrary_SDKEncryptedAppTicket = "sdkencryptedappticket64"; diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs index 7d00f2f3..177c4928 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs @@ -37,24 +37,20 @@ namespace Steamworks { [System.Security.SuppressUnmanagedCodeSecurity()] internal static class NativeMethods { -#if STEAMWORKS_ANYCPU - static NativeMethods() - { + #if STEAMWORKS_ANYCPU + static NativeMethods() { NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, DllImportResolver); } - private static IntPtr DllImportResolver(string libraryName, System.Reflection.Assembly assembly, DllImportSearchPath? searchPath) - { + private static IntPtr DllImportResolver(string libraryName, System.Reflection.Assembly assembly, DllImportSearchPath? searchPath) { // check is requesting library name matches steam native // we don't check requester here because we want to ensure we are the first loader of steam native // otherwise other libraries may have already loaded steam native with wrong architecture if ((libraryName == NativeLibraryName || libraryName == NativeLibrary_SDKEncryptedAppTicket) // check are we on win64, the special case we are going to handle - && RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && System.Environment.Is64BitProcess) - { + && RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && System.Environment.Is64BitProcess) { // check who is requesting steam native - if (assembly.GetName().Name != "Steamworks.NET") - { + if (assembly.GetName().Name != "Steamworks.NET") { // Unmanaged libraries(steam native dll) will be cached(probably by name), // we warn developers here the steam native will be cached for any later loads, this is a potentional pollution. System.Diagnostics.Debug.WriteLine( From 584dfee73dba482e2fd8476ba60837d5e064aa60 Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Tue, 4 Nov 2025 20:50:46 +0800 Subject: [PATCH 67/82] Fix anycpu large pack native function was leak. --- CodeGen/src/interfaces.py | 2 ++ .../Runtime/autogen/NativeMethods.cs | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/CodeGen/src/interfaces.py b/CodeGen/src/interfaces.py index b7ed8c83..827b1c60 100644 --- a/CodeGen/src/interfaces.py +++ b/CodeGen/src/interfaces.py @@ -749,12 +749,14 @@ def parse_func_native(f, interface, func: Function, strEntryPoint: str, args, ge g_NativeMethods.append("") if isPacksizeAware: + g_NativeMethods.append("\t#if STEAMWORKS_ANYCPU") g_NativeMethods.append("\t\t[DllImport(NativeLibraryName, EntryPoint = \"SteamAPI_{0}\", CallingConvention = CallingConvention.Cdecl)]".format(strEntryPoint)) if returntype == "bool": g_NativeMethods.append("\t\t[return: MarshalAs(UnmanagedType.I1)]") g_NativeMethods.append("\t\tpublic static extern {0} {1}({2});".format(returntype, strEntryPoint, largePackPInvokeArgs)) + g_NativeMethods.append("\t#endif") g_NativeMethods.append("") pass diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs index 177c4928..db796c24 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs @@ -1784,9 +1784,11 @@ private static IntPtr DllImportResolver(string libraryName, System.Reflection.As [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetBeaconDetails(IntPtr instancePtr, PartyBeaconID_t ulBeaconID, out CSteamID pSteamIDBeaconOwner, out SteamPartyBeaconLocation_t pLocation, IntPtr pchMetadata, int cchMetadata); + #if STEAMWORKS_ANYCPU [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconDetails", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetBeaconDetails(IntPtr instancePtr, PartyBeaconID_t ulBeaconID, out CSteamID pSteamIDBeaconOwner, out SteamPartyBeaconLocation_t_LargePack pLocation_lp, IntPtr pchMetadata, int cchMetadata); + #endif [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_JoinParty", CallingConvention = CallingConvention.Cdecl)] public static extern ulong ISteamParties_JoinParty(IntPtr instancePtr, PartyBeaconID_t ulBeaconID); @@ -1799,15 +1801,19 @@ private static IntPtr DllImportResolver(string libraryName, System.Reflection.As [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetAvailableBeaconLocations(IntPtr instancePtr, [In, Out] SteamPartyBeaconLocation_t[] pLocationList, uint uMaxNumLocations); + #if STEAMWORKS_ANYCPU [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_GetAvailableBeaconLocations", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetAvailableBeaconLocations(IntPtr instancePtr, [In, Out] SteamPartyBeaconLocation_t_LargePack[] pLocationList_lp, uint uMaxNumLocations); + #endif [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_CreateBeacon", CallingConvention = CallingConvention.Cdecl)] public static extern ulong ISteamParties_CreateBeacon(IntPtr instancePtr, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, InteropHelp.UTF8StringHandle pchConnectString, InteropHelp.UTF8StringHandle pchMetadata); + #if STEAMWORKS_ANYCPU [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_CreateBeacon", CallingConvention = CallingConvention.Cdecl)] public static extern ulong ISteamParties_CreateBeacon(IntPtr instancePtr, uint unOpenSlots, ref SteamPartyBeaconLocation_t_LargePack pBeaconLocation_lp, InteropHelp.UTF8StringHandle pchConnectString, InteropHelp.UTF8StringHandle pchMetadata); + #endif [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_OnReservationCompleted", CallingConvention = CallingConvention.Cdecl)] public static extern void ISteamParties_OnReservationCompleted(IntPtr instancePtr, PartyBeaconID_t ulBeacon, CSteamID steamIDUser); @@ -1826,9 +1832,11 @@ private static IntPtr DllImportResolver(string libraryName, System.Reflection.As [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetBeaconLocationData(IntPtr instancePtr, SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut); + #if STEAMWORKS_ANYCPU [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconLocationData", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetBeaconLocationData(IntPtr instancePtr, SteamPartyBeaconLocation_t_LargePack BeaconLocation_lp, ESteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut); + #endif #endregion #region SteamMusic [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamMusic_BIsEnabled", CallingConvention = CallingConvention.Cdecl)] @@ -2095,8 +2103,10 @@ private static IntPtr DllImportResolver(string libraryName, System.Reflection.As [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingMessages_GetSessionConnectionInfo", CallingConvention = CallingConvention.Cdecl)] public static extern ESteamNetworkingConnectionState ISteamNetworkingMessages_GetSessionConnectionInfo(IntPtr instancePtr, ref SteamNetworkingIdentity identityRemote, out SteamNetConnectionInfo_t pConnectionInfo, out SteamNetConnectionRealTimeStatus_t pQuickStatus); + #if STEAMWORKS_ANYCPU [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingMessages_GetSessionConnectionInfo", CallingConvention = CallingConvention.Cdecl)] public static extern ESteamNetworkingConnectionState ISteamNetworkingMessages_GetSessionConnectionInfo(IntPtr instancePtr, ref SteamNetworkingIdentity identityRemote, out SteamNetConnectionInfo_t_LargePack pConnectionInfo_lp, out SteamNetConnectionRealTimeStatus_t pQuickStatus); + #endif #endregion #region SteamNetworkingSockets [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreateListenSocketIP", CallingConvention = CallingConvention.Cdecl)] @@ -2152,9 +2162,11 @@ private static IntPtr DllImportResolver(string libraryName, System.Reflection.As [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_GetConnectionInfo(IntPtr instancePtr, HSteamNetConnection hConn, out SteamNetConnectionInfo_t pInfo); + #if STEAMWORKS_ANYCPU [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetConnectionInfo", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_GetConnectionInfo(IntPtr instancePtr, HSteamNetConnection hConn, out SteamNetConnectionInfo_t_LargePack pInfo_lp); + #endif [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetConnectionRealTimeStatus", CallingConvention = CallingConvention.Cdecl)] public static extern EResult ISteamNetworkingSockets_GetConnectionRealTimeStatus(IntPtr instancePtr, HSteamNetConnection hConn, ref SteamNetConnectionRealTimeStatus_t pStatus, int nLanes, ref SteamNetConnectionRealTimeLaneStatus_t pLanes); @@ -2731,9 +2743,11 @@ private static IntPtr DllImportResolver(string libraryName, System.Reflection.As [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_GetQueryUGCResult(IntPtr instancePtr, UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails); + #if STEAMWORKS_ANYCPU [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCResult", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_GetQueryUGCResult(IntPtr instancePtr, UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t_LargePack pDetails_lp); + #endif [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCNumTags", CallingConvention = CallingConvention.Cdecl)] public static extern uint ISteamUGC_GetQueryUGCNumTags(IntPtr instancePtr, UGCQueryHandle_t handle, uint index); @@ -3281,9 +3295,11 @@ private static IntPtr DllImportResolver(string libraryName, System.Reflection.As [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetDownloadedLeaderboardEntry(IntPtr instancePtr, SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, out LeaderboardEntry_t pLeaderboardEntry, [In, Out] int[] pDetails, int cDetailsMax); + #if STEAMWORKS_ANYCPU [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetDownloadedLeaderboardEntry(IntPtr instancePtr, SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, out LeaderboardEntry_t_LargePack pLeaderboardEntry_lp, [In, Out] int[] pDetails, int cDetailsMax); + #endif [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamUserStats_UploadLeaderboardScore", CallingConvention = CallingConvention.Cdecl)] public static extern ulong ISteamUserStats_UploadLeaderboardScore(IntPtr instancePtr, SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In, Out] int[] pScoreDetails, int cScoreDetailsCount); From f87d28f84df84c651ea3e9f6592da0f0b35f8aa7 Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Tue, 4 Nov 2025 21:17:39 +0800 Subject: [PATCH 68/82] Fix non-anycpu variant uses anycpu wrapper It will cause complication failure. --- CodeGen/src/interfaces.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/CodeGen/src/interfaces.py b/CodeGen/src/interfaces.py index 827b1c60..d4365962 100644 --- a/CodeGen/src/interfaces.py +++ b/CodeGen/src/interfaces.py @@ -762,7 +762,7 @@ def parse_func_native(f, interface, func: Function, strEntryPoint: str, args, ge def generate_wrapper_function(f, interface, func: Function, args: tuple[str, str, str, list[str], tuple[list[str], list[Arg]], OrderedDict, str, bool, str], - strEntryPoint: str, bGameServerVersion: bool, parser: Parser): + strEntryPoint: str, bGameServerVersion: bool, _): wrapperargs = args[1] argnames = args[2] stringargs = args[3] @@ -860,6 +860,7 @@ def generate_wrapper_function(f, interface, func: Function, else: b:list[str] = [] + b.append("#if STEAMWORKS_ANYCPU") if returntype != "void": b.append(f"{wrapperreturntype} ret;") @@ -896,9 +897,14 @@ def generate_wrapper_function(f, interface, func: Function, else: b.append(f"\tfor (int i = 0; i < {lpArg[1]}.Length; i++)") b.append(f"\t\t{lpArg[1]}[i] = {lpArg[1]}_lp[i];") - b.append("}") + b.append("#else") + b.append("{0}{1}{2}NativeMethods.{3}({4});".format( + "", strReturnable, strCast, + invokingNativeFunctionName, argnames)) + b.append("#endif") + functionBody.extend(map(lambda l: "\t\t\t" + l, b)) if outstringargs: @@ -917,8 +923,17 @@ def generate_wrapper_function(f, interface, func: Function, if strEntryPoint != "ISteamRemoteStorage_GetUGCDetails": functionBody.append(indentlevel + "Marshal.FreeHGlobal(" + argName + "2);") - if (returntype != "void" and isPacksizeAware) or (returntype != "void" and outstringargs): + if (returntype != "void" and (isPacksizeAware)): + if not outstringargs: + functionBody.append(indentlevel + "#if STEAMWORKS_ANYCPU") functionBody.append(indentlevel + "return ret;") + if not outstringargs: + functionBody.append(indentlevel + "#endif") + elif returntype != 'void' and outstringargs: + functionBody.append(indentlevel + "return ret;") + elif returntype != "void" and not isPacksizeAware: + pass + if stringargs: functionBody.append("\t\t\t}") From 4eef45304d1e9a69ed1fdca80885a9a78ea1aa73 Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Tue, 4 Nov 2025 21:18:26 +0800 Subject: [PATCH 69/82] Regenreate to fix AnyCPU wrappers leak. --- .../isteamgameservernetworkingmessages.cs | 6 ++++++ .../isteamgameservernetworkingsockets.cs | 6 ++++++ .../Runtime/autogen/isteamgameserverugc.cs | 6 ++++++ .../Runtime/autogen/isteammatchmaking.cs | 20 +++++++++++++++++++ .../autogen/isteamnetworkingmessages.cs | 6 ++++++ .../autogen/isteamnetworkingsockets.cs | 6 ++++++ .../Runtime/autogen/isteamugc.cs | 6 ++++++ .../Runtime/autogen/isteamuserstats.cs | 6 ++++++ 8 files changed, 62 insertions(+) diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs index 0b5711f3..f010f2d2 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs @@ -134,6 +134,7 @@ public static bool CloseChannelWithUser(ref SteamNetworkingIdentity identityRemo /// public static ESteamNetworkingConnectionState GetSessionConnectionInfo(ref SteamNetworkingIdentity identityRemote, out SteamNetConnectionInfo_t pConnectionInfo, out SteamNetConnectionRealTimeStatus_t pQuickStatus) { InteropHelp.TestIfAvailableGameServer(); + #if STEAMWORKS_ANYCPU ESteamNetworkingConnectionState ret; if (!Packsize.IsLargePack) { ret = NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo, out pQuickStatus); @@ -142,7 +143,12 @@ public static ESteamNetworkingConnectionState GetSessionConnectionInfo(ref Steam ret = NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo_lp, out pQuickStatus); pConnectionInfo = pConnectionInfo_lp; } + #else + return NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo, out pQuickStatus); + #endif + #if STEAMWORKS_ANYCPU return ret; + #endif } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs index 29c1dbee..cff86683 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs @@ -397,6 +397,7 @@ public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, IntPtr[ /// public static bool GetConnectionInfo(HSteamNetConnection hConn, out SteamNetConnectionInfo_t pInfo) { InteropHelp.TestIfAvailableGameServer(); + #if STEAMWORKS_ANYCPU bool ret; if (!Packsize.IsLargePack) { ret = NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); @@ -405,7 +406,12 @@ public static bool GetConnectionInfo(HSteamNetConnection hConn, out SteamNetConn ret = NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo_lp); pInfo = pInfo_lp; } + #else + return NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); + #endif + #if STEAMWORKS_ANYCPU return ret; + #endif } /// diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs index 58d4c3a9..70a6d399 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs @@ -63,6 +63,7 @@ public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) { /// public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails) { InteropHelp.TestIfAvailableGameServer(); + #if STEAMWORKS_ANYCPU bool ret; if (!Packsize.IsLargePack) { ret = NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, out pDetails); @@ -71,7 +72,12 @@ public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out St ret = NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, out pDetails_lp); pDetails = pDetails_lp; } + #else + return NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, out pDetails); + #endif + #if STEAMWORKS_ANYCPU return ret; + #endif } public static uint GetQueryUGCNumTags(UGCQueryHandle_t handle, uint index) { diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs index 1a2ca084..bdc2b262 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs @@ -783,6 +783,7 @@ public static PartyBeaconID_t GetBeaconByIndex(uint unIndex) { public static bool GetBeaconDetails(PartyBeaconID_t ulBeaconID, out CSteamID pSteamIDBeaconOwner, out SteamPartyBeaconLocation_t pLocation, out string pchMetadata, int cchMetadata) { InteropHelp.TestIfAvailableClient(); IntPtr pchMetadata2 = Marshal.AllocHGlobal(cchMetadata); + #if STEAMWORKS_ANYCPU bool ret; if (!Packsize.IsLargePack) { ret = NativeMethods.ISteamParties_GetBeaconDetails(CSteamAPIContext.GetSteamParties(), ulBeaconID, out pSteamIDBeaconOwner, out pLocation, pchMetadata2, cchMetadata); @@ -791,6 +792,9 @@ public static bool GetBeaconDetails(PartyBeaconID_t ulBeaconID, out CSteamID pSt ret = NativeMethods.ISteamParties_GetBeaconDetails(CSteamAPIContext.GetSteamParties(), ulBeaconID, out pSteamIDBeaconOwner, out pLocation_lp, pchMetadata2, cchMetadata); pLocation = pLocation_lp; } + #else + bool ret = NativeMethods.ISteamParties_GetBeaconDetails(CSteamAPIContext.GetSteamParties(), ulBeaconID, out pSteamIDBeaconOwner, out pLocation, pchMetadata2, cchMetadata); + #endif pchMetadata = ret ? InteropHelp.PtrToStringUTF8(pchMetadata2) : null; Marshal.FreeHGlobal(pchMetadata2); return ret; @@ -817,6 +821,7 @@ public static bool GetNumAvailableBeaconLocations(out uint puNumLocations) { public static bool GetAvailableBeaconLocations(SteamPartyBeaconLocation_t[] pLocationList, uint uMaxNumLocations) { InteropHelp.TestIfAvailableClient(); + #if STEAMWORKS_ANYCPU bool ret; if (!Packsize.IsLargePack) { ret = NativeMethods.ISteamParties_GetAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), pLocationList, uMaxNumLocations); @@ -828,7 +833,12 @@ public static bool GetAvailableBeaconLocations(SteamPartyBeaconLocation_t[] pLoc for (int i = 0; i < pLocationList.Length; i++) pLocationList[i] = pLocationList_lp[i]; } + #else + return NativeMethods.ISteamParties_GetAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), pLocationList, uMaxNumLocations); + #endif + #if STEAMWORKS_ANYCPU return ret; + #endif } /// @@ -841,6 +851,7 @@ public static SteamAPICall_t CreateBeacon(uint unOpenSlots, ref SteamPartyBeacon InteropHelp.TestIfAvailableClient(); using (var pchConnectString2 = new InteropHelp.UTF8StringHandle(pchConnectString)) using (var pchMetadata2 = new InteropHelp.UTF8StringHandle(pchMetadata)) { + #if STEAMWORKS_ANYCPU SteamAPICall_t ret; if (!Packsize.IsLargePack) { ret = (SteamAPICall_t)NativeMethods.ISteamParties_CreateBeacon(CSteamAPIContext.GetSteamParties(), unOpenSlots, ref pBeaconLocation, pchConnectString2, pchMetadata2); @@ -849,7 +860,12 @@ public static SteamAPICall_t CreateBeacon(uint unOpenSlots, ref SteamPartyBeacon ret = (SteamAPICall_t)NativeMethods.ISteamParties_CreateBeacon(CSteamAPIContext.GetSteamParties(), unOpenSlots, ref pBeaconLocation_lp, pchConnectString2, pchMetadata2); pBeaconLocation = pBeaconLocation_lp; } + #else + return (SteamAPICall_t)NativeMethods.ISteamParties_CreateBeacon(CSteamAPIContext.GetSteamParties(), unOpenSlots, ref pBeaconLocation, pchConnectString2, pchMetadata2); + #endif + #if STEAMWORKS_ANYCPU return ret; + #endif } } @@ -896,6 +912,7 @@ public static bool DestroyBeacon(PartyBeaconID_t ulBeacon) { public static bool GetBeaconLocationData(SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, out string pchDataStringOut, int cchDataStringOut) { InteropHelp.TestIfAvailableClient(); IntPtr pchDataStringOut2 = Marshal.AllocHGlobal(cchDataStringOut); + #if STEAMWORKS_ANYCPU bool ret; if (!Packsize.IsLargePack) { ret = NativeMethods.ISteamParties_GetBeaconLocationData(CSteamAPIContext.GetSteamParties(), BeaconLocation, eData, pchDataStringOut2, cchDataStringOut); @@ -904,6 +921,9 @@ public static bool GetBeaconLocationData(SteamPartyBeaconLocation_t BeaconLocati ret = NativeMethods.ISteamParties_GetBeaconLocationData(CSteamAPIContext.GetSteamParties(), BeaconLocation_lp, eData, pchDataStringOut2, cchDataStringOut); BeaconLocation = BeaconLocation_lp; } + #else + bool ret = NativeMethods.ISteamParties_GetBeaconLocationData(CSteamAPIContext.GetSteamParties(), BeaconLocation, eData, pchDataStringOut2, cchDataStringOut); + #endif pchDataStringOut = ret ? InteropHelp.PtrToStringUTF8(pchDataStringOut2) : null; Marshal.FreeHGlobal(pchDataStringOut2); return ret; diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs index 8e6aec57..f6f09836 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs @@ -134,6 +134,7 @@ public static bool CloseChannelWithUser(ref SteamNetworkingIdentity identityRemo /// public static ESteamNetworkingConnectionState GetSessionConnectionInfo(ref SteamNetworkingIdentity identityRemote, out SteamNetConnectionInfo_t pConnectionInfo, out SteamNetConnectionRealTimeStatus_t pQuickStatus) { InteropHelp.TestIfAvailableClient(); + #if STEAMWORKS_ANYCPU ESteamNetworkingConnectionState ret; if (!Packsize.IsLargePack) { ret = NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo, out pQuickStatus); @@ -142,7 +143,12 @@ public static ESteamNetworkingConnectionState GetSessionConnectionInfo(ref Steam ret = NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo_lp, out pQuickStatus); pConnectionInfo = pConnectionInfo_lp; } + #else + return NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo, out pQuickStatus); + #endif + #if STEAMWORKS_ANYCPU return ret; + #endif } } } diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs index cd97da8c..e027183d 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs @@ -397,6 +397,7 @@ public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, IntPtr[ /// public static bool GetConnectionInfo(HSteamNetConnection hConn, out SteamNetConnectionInfo_t pInfo) { InteropHelp.TestIfAvailableClient(); + #if STEAMWORKS_ANYCPU bool ret; if (!Packsize.IsLargePack) { ret = NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); @@ -405,7 +406,12 @@ public static bool GetConnectionInfo(HSteamNetConnection hConn, out SteamNetConn ret = NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo_lp); pInfo = pInfo_lp; } + #else + return NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); + #endif + #if STEAMWORKS_ANYCPU return ret; + #endif } /// diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs index 02bd6ce1..528041ed 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs @@ -63,6 +63,7 @@ public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) { /// public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails) { InteropHelp.TestIfAvailableClient(); + #if STEAMWORKS_ANYCPU bool ret; if (!Packsize.IsLargePack) { ret = NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamAPIContext.GetSteamUGC(), handle, index, out pDetails); @@ -71,7 +72,12 @@ public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out St ret = NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamAPIContext.GetSteamUGC(), handle, index, out pDetails_lp); pDetails = pDetails_lp; } + #else + return NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamAPIContext.GetSteamUGC(), handle, index, out pDetails); + #endif + #if STEAMWORKS_ANYCPU return ret; + #endif } public static uint GetQueryUGCNumTags(UGCQueryHandle_t handle, uint index) { diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs index 17604318..ce5b4b31 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs @@ -317,6 +317,7 @@ public static SteamAPICall_t DownloadLeaderboardEntriesForUsers(SteamLeaderboard /// public static bool GetDownloadedLeaderboardEntry(SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, out LeaderboardEntry_t pLeaderboardEntry, int[] pDetails, int cDetailsMax) { InteropHelp.TestIfAvailableClient(); + #if STEAMWORKS_ANYCPU bool ret; if (!Packsize.IsLargePack) { ret = NativeMethods.ISteamUserStats_GetDownloadedLeaderboardEntry(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboardEntries, index, out pLeaderboardEntry, pDetails, cDetailsMax); @@ -325,7 +326,12 @@ public static bool GetDownloadedLeaderboardEntry(SteamLeaderboardEntries_t hStea ret = NativeMethods.ISteamUserStats_GetDownloadedLeaderboardEntry(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboardEntries, index, out pLeaderboardEntry_lp, pDetails, cDetailsMax); pLeaderboardEntry = pLeaderboardEntry_lp; } + #else + return NativeMethods.ISteamUserStats_GetDownloadedLeaderboardEntry(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboardEntries, index, out pLeaderboardEntry, pDetails, cDetailsMax); + #endif + #if STEAMWORKS_ANYCPU return ret; + #endif } /// From 8b2150859651065ec0a69847a7018bc4ba972c87 Mon Sep 17 00:00:00 2001 From: RcubDev Date: Tue, 4 Nov 2025 20:48:29 -0700 Subject: [PATCH 70/82] update sendsignal to be pack aware with manual edits --- .../Runtime/autogen/NativeMethods.cs | 4 ++++ .../Runtime/autogen/SteamStructs.cs | 6 +++++- .../ISteamNetworkingConnectionSignaling.cs | 10 +++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs index 7d00f2f3..8c4c1b0b 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs @@ -343,6 +343,10 @@ private static IntPtr DllImportResolver(string libraryName, System.Reflection.As [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_ISteamNetworkingConnectionSignaling_SendSignal(ref ISteamNetworkingConnectionSignaling self, HSteamNetConnection hConn, ref SteamNetConnectionInfo_t info, IntPtr pMsg, int cbMsg); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingConnectionSignaling_SendSignal", CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool SteamAPI_ISteamNetworkingConnectionSignaling_SendSignal(ref ISteamNetworkingConnectionSignaling self, HSteamNetConnection hConn, ref SteamNetConnectionInfo_t_LargePack info_lp, IntPtr pMsg, int cbMsg); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingConnectionSignaling_Release", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_ISteamNetworkingConnectionSignaling_Release(ref ISteamNetworkingConnectionSignaling self); #endregion diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs index 1e26a01a..6204784a 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs @@ -453,9 +453,13 @@ public struct GameID_t { } /// Describe the state of a connection. + #if STEAMWORKS_ANYCPU + [StructLayout(LayoutKind.Sequential, Pack = 8)] + #else [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + #endif public struct SteamNetConnectionInfo_t { - + /// Who is on the other end? Depending on the connection type and phase of the connection, we might not know public SteamNetworkingIdentity m_identityRemote; diff --git a/com.rlabrecque.steamworks.net/Runtime/types/SteamNetworkingSockets/ISteamNetworkingConnectionSignaling.cs b/com.rlabrecque.steamworks.net/Runtime/types/SteamNetworkingSockets/ISteamNetworkingConnectionSignaling.cs index 4dafa4de..ee672a42 100644 --- a/com.rlabrecque.steamworks.net/Runtime/types/SteamNetworkingSockets/ISteamNetworkingConnectionSignaling.cs +++ b/com.rlabrecque.steamworks.net/Runtime/types/SteamNetworkingSockets/ISteamNetworkingConnectionSignaling.cs @@ -43,7 +43,15 @@ public struct ISteamNetworkingConnectionSignaling /// You can assume that the same value of hConn will be used /// every time. public bool SendSignal(HSteamNetConnection hConn, ref SteamNetConnectionInfo_t info, IntPtr pMsg, int cbMsg) { - return NativeMethods.SteamAPI_ISteamNetworkingConnectionSignaling_SendSignal(ref this, hConn, ref info, pMsg, cbMsg); + bool ret; + if (!Packsize.IsLargePack) { + ret = NativeMethods.SteamAPI_ISteamNetworkingConnectionSignaling_SendSignal(ref this, hConn, ref info, pMsg, cbMsg); + } else { + SteamNetConnectionInfo_t info_lp = info; + ret = NativeMethods.SteamAPI_ISteamNetworkingConnectionSignaling_SendSignal(ref this, hConn, ref info_lp, pMsg, cbMsg); + info = info_lp; + } + return ret; } /// Called when the connection no longer needs to send signals. From 01d6df4d4aa20513c1cf356774cd4d48616ffdd9 Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Tue, 4 Nov 2025 18:53:53 +0800 Subject: [PATCH 71/82] Move loader hook fix to source generator's template. --- CodeGen/templates/nativemethods.txt | 36 +++++++++++++++++++ .../Runtime/autogen/NativeMethods.cs | 14 +++----- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/CodeGen/templates/nativemethods.txt b/CodeGen/templates/nativemethods.txt index 7274efd8..fb3b51ff 100644 --- a/CodeGen/templates/nativemethods.txt +++ b/CodeGen/templates/nativemethods.txt @@ -37,6 +37,42 @@ using IntPtr = System.IntPtr; namespace Steamworks { [System.Security.SuppressUnmanagedCodeSecurity()] internal static class NativeMethods { + #if STEAMWORKS_ANYCPU + static NativeMethods() { + NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, DllImportResolver); + } + + private static IntPtr DllImportResolver(string libraryName, System.Reflection.Assembly assembly, DllImportSearchPath? searchPath) { + // check is requesting library name matches steam native + // we don't check requester here because we want to ensure we are the first loader of steam native + // otherwise other libraries may have already loaded steam native with wrong architecture + if ((libraryName == NativeLibraryName || libraryName == NativeLibrary_SDKEncryptedAppTicket) + // check are we on win64, the special case we are going to handle + && RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && System.Environment.Is64BitProcess) { + // check who is requesting steam native + if (assembly.GetName().Name != "Steamworks.NET") { + // Unmanaged libraries(steam native dll) will be cached(probably by name), + // we warn developers here the steam native will be cached for any later loads, this is a potentional pollution. + System.Diagnostics.Debug.WriteLine( + $"[Warning] Assembly {assembly.GetName().Name} is requesting Steam native by it's original name, " + + $"but Steamworks.NET.AnyCPU want to load x64 version of steam library \"{libraryName}\". The loaded Steam native will be cached " + + $"and may potentially break it.\n" + + $"Affected assembly's full name: {assembly.FullName}"); + + return 0; + } + + // platform specific suffix is not needed, to reuse default unmanaged dependencies resolve logic + string x64LibName = $"{libraryName}64"; + // we don't care failed load, let next handler manage it + NativeLibrary.TryLoad(x64LibName, assembly, searchPath, out nint lib); + return lib; + } + + return 0; + } +#endif + #if STEAMWORKS_WIN && STEAMWORKS_X64 internal const string NativeLibraryName = "steam_api64"; internal const string NativeLibrary_SDKEncryptedAppTicket = "sdkencryptedappticket64"; diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs index 8c4c1b0b..79e09a9b 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs @@ -37,24 +37,20 @@ namespace Steamworks { [System.Security.SuppressUnmanagedCodeSecurity()] internal static class NativeMethods { -#if STEAMWORKS_ANYCPU - static NativeMethods() - { + #if STEAMWORKS_ANYCPU + static NativeMethods() { NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, DllImportResolver); } - private static IntPtr DllImportResolver(string libraryName, System.Reflection.Assembly assembly, DllImportSearchPath? searchPath) - { + private static IntPtr DllImportResolver(string libraryName, System.Reflection.Assembly assembly, DllImportSearchPath? searchPath) { // check is requesting library name matches steam native // we don't check requester here because we want to ensure we are the first loader of steam native // otherwise other libraries may have already loaded steam native with wrong architecture if ((libraryName == NativeLibraryName || libraryName == NativeLibrary_SDKEncryptedAppTicket) // check are we on win64, the special case we are going to handle - && RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && System.Environment.Is64BitProcess) - { + && RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && System.Environment.Is64BitProcess) { // check who is requesting steam native - if (assembly.GetName().Name != "Steamworks.NET") - { + if (assembly.GetName().Name != "Steamworks.NET") { // Unmanaged libraries(steam native dll) will be cached(probably by name), // we warn developers here the steam native will be cached for any later loads, this is a potentional pollution. System.Diagnostics.Debug.WriteLine( From a1520aea416255645213e0b3f8694b3ad43bc9fc Mon Sep 17 00:00:00 2001 From: RcubDev Date: Tue, 4 Nov 2025 20:59:51 -0700 Subject: [PATCH 72/82] update structs.py to include SteamNetConnectionInfo_t as a sequential struct --- CodeGen/src/structs.py | 1 + .../Runtime/autogen/SteamStructs.cs | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CodeGen/src/structs.py b/CodeGen/src/structs.py index 4d0e1ac3..21bc3bac 100644 --- a/CodeGen/src/structs.py +++ b/CodeGen/src/structs.py @@ -71,6 +71,7 @@ g_SequentialStructs = ( "MatchMakingKeyValuePair_t", + "SteamNetConnectionInfo_t" ) g_SpecialFieldTypes = { diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs index 6204784a..88ba50b1 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs @@ -453,11 +453,7 @@ public struct GameID_t { } /// Describe the state of a connection. - #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = 8)] - #else - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - #endif + [StructLayout(LayoutKind.Sequential)] public struct SteamNetConnectionInfo_t { /// Who is on the other end? Depending on the connection type and phase of the connection, we might not know From 0484eda86ede66d3afeb45f51726c72c09560159 Mon Sep 17 00:00:00 2001 From: RcubDev Date: Tue, 4 Nov 2025 21:13:31 -0700 Subject: [PATCH 73/82] update send signal template to be pack size aware --- .../ISteamNetworkingConnectionSignaling.cs | 10 +++++++++- .../Runtime/autogen/SteamStructs.cs | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CodeGen/templates/custom_types/SteamNetworkingSockets/ISteamNetworkingConnectionSignaling.cs b/CodeGen/templates/custom_types/SteamNetworkingSockets/ISteamNetworkingConnectionSignaling.cs index d3419904..84cb3326 100644 --- a/CodeGen/templates/custom_types/SteamNetworkingSockets/ISteamNetworkingConnectionSignaling.cs +++ b/CodeGen/templates/custom_types/SteamNetworkingSockets/ISteamNetworkingConnectionSignaling.cs @@ -27,7 +27,15 @@ public struct ISteamNetworkingConnectionSignaling /// You can assume that the same value of hConn will be used /// every time. public bool SendSignal(HSteamNetConnection hConn, ref SteamNetConnectionInfo_t info, IntPtr pMsg, int cbMsg) { - return NativeMethods.SteamAPI_ISteamNetworkingConnectionSignaling_SendSignal(ref this, hConn, ref info, pMsg, cbMsg); + bool ret; + if (!Packsize.IsLargePack) { + ret = NativeMethods.SteamAPI_ISteamNetworkingConnectionSignaling_SendSignal(ref this, hConn, ref info, pMsg, cbMsg); + } else { + SteamNetConnectionInfo_t info_lp = info; + ret = NativeMethods.SteamAPI_ISteamNetworkingConnectionSignaling_SendSignal(ref this, hConn, ref info_lp, pMsg, cbMsg); + info = info_lp; + } + return ret; } /// Called when the connection no longer needs to send signals. diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs index 88ba50b1..44026b1c 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs @@ -455,7 +455,7 @@ public struct GameID_t { /// Describe the state of a connection. [StructLayout(LayoutKind.Sequential)] public struct SteamNetConnectionInfo_t { - + /// Who is on the other end? Depending on the connection type and phase of the connection, we might not know public SteamNetworkingIdentity m_identityRemote; From 5db56bbf70dd6b5c4e15e730372a351fc3769c68 Mon Sep 17 00:00:00 2001 From: RcubDev Date: Tue, 4 Nov 2025 21:27:04 -0700 Subject: [PATCH 74/82] update nativemethods.txt to have pack aware dll import --- CodeGen/templates/nativemethods.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CodeGen/templates/nativemethods.txt b/CodeGen/templates/nativemethods.txt index fb3b51ff..d20ee5e7 100644 --- a/CodeGen/templates/nativemethods.txt +++ b/CodeGen/templates/nativemethods.txt @@ -339,6 +339,10 @@ namespace Steamworks { [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_ISteamNetworkingConnectionSignaling_SendSignal(ref ISteamNetworkingConnectionSignaling self, HSteamNetConnection hConn, ref SteamNetConnectionInfo_t info, IntPtr pMsg, int cbMsg); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingConnectionSignaling_SendSignal", CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool SteamAPI_ISteamNetworkingConnectionSignaling_SendSignal(ref ISteamNetworkingConnectionSignaling self, HSteamNetConnection hConn, ref SteamNetConnectionInfo_t_LargePack info_lp, IntPtr pMsg, int cbMsg); + [DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingConnectionSignaling_Release", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_ISteamNetworkingConnectionSignaling_Release(ref ISteamNetworkingConnectionSignaling self); #endregion From b93ba43a8c47ff600f16302a747b1f4ec6e803ca Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Wed, 5 Nov 2025 19:26:13 +0800 Subject: [PATCH 75/82] Fix packsize aware struct nested in pack aware struct. But pack aware struct nested in common struct are not in consideration. Write it down here for one day we met some bug related. --- .vscode/launch.json | 9 +++++++++ CodeGen/src/structs.py | 17 +++++++++++------ .../Runtime/autogen/SteamCallbacks.cs | 2 +- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 4d82f020..51a89683 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,6 +12,15 @@ "cwd": "${workspaceFolder}/CodeGen/", "console": "integratedTerminal", "justMyCode": true + }, + { + "name": "Debug parser", + "type": "debugpy", + "request": "launch", + "program": "${workspaceFolder}/CodeGen/SteamworksParser/debug_entrypoint.py", + "console": "integratedTerminal", + "cwd": "${workspaceFolder}/CodeGen/SteamworksParser/", + "justMyCode": true } ] } \ No newline at end of file diff --git a/CodeGen/src/structs.py b/CodeGen/src/structs.py index 4d0e1ac3..f95400a9 100644 --- a/CodeGen/src/structs.py +++ b/CodeGen/src/structs.py @@ -116,9 +116,9 @@ def main(parser: Parser): for f in parser.files: for struct in f.structs: - lines.extend(parse(struct, True, anyCpuConditionalMarshallerLines, packsizeAwareStructNames)) + lines.extend(parse(struct, True, anyCpuConditionalMarshallerLines, packsizeAwareStructNames, parser)) for callback in f.callbacks: - callbacklines.extend(parse(callback, True, anyCpuConditionalMarshallerLines, packsizeAwareStructNames)) + callbacklines.extend(parse(callback, True, anyCpuConditionalMarshallerLines, packsizeAwareStructNames, parser)) with open("../com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs", "wb") as out: with open("templates/header.txt", "r") as f: @@ -153,7 +153,7 @@ def main(parser: Parser): out.write(bytes("#endif // !DISABLESTEAMWORKS\n", "utf-8")) -def parse(struct: Struct, isMainStruct, marshalTableLines: list[str], packsizeAwareStructNames: list[str]) -> list[str]: +def parse(struct: Struct, isMainStruct, marshalTableLines: list[str], packsizeAwareStructNames: list[str], parser: Parser) -> list[str]: # ignore structs that manually defined by us # ignore nested structs, they probably handled by hand # ignore structs which has nested types, they probably interop by hand @@ -221,7 +221,7 @@ def parse(struct: Struct, isMainStruct, marshalTableLines: list[str], packsizeAw if not isMainStruct: fieldHandlingStructName = fieldHandlingStructName[:structname.rindex("_")] - lines.extend(parse_field(field, fieldHandlingStructName)) + lines.extend(parse_field(field, fieldHandlingStructName, isMainStruct, parser)) if fieldHandlingStructName in packsizeAwareStructNames and not isMainStruct: mainStructName = structname[:structname.rindex("_")] @@ -275,7 +275,7 @@ def parse(struct: Struct, isMainStruct, marshalTableLines: list[str], packsizeAw largePackStruct = deepcopy(struct) largePackStruct.name = structname + "_LargePack" largePackStruct.packsize = 8 - lines.extend(parse(largePackStruct, False, marshalTableLines, packsizeAwareStructNames)) + lines.extend(parse(largePackStruct, False, marshalTableLines, packsizeAwareStructNames, parser)) lines.append("\t#endif") @@ -290,7 +290,7 @@ def gen_fieldcopycode(field, structname, marshalTableLines): else: marshalTableLines.append(f"\t\t\tresult.{field.name} = value.{field.name};") -def parse_field(field: StructField, structname): +def parse_field(field: StructField, structname: str, isMainStruct: bool, parser: Parser): lines = [] for comment in field.c.rawprecomments: if type(comment) is BlankLine: @@ -334,6 +334,11 @@ def parse_field(field: StructField, structname): lines.append("\t\t\tset { InteropHelp.StringToByteArrayUTF8(value, " + field.name + "_, " + constantsstr + field.arraysizeStr + "); }") lines.append("\t\t}") else: + if not isMainStruct: + typeInfo = parser.resolveTypeInfo(fieldtype) + if isinstance(typeInfo, Struct) and typeInfo.packsize_aware: + fieldtype = fieldtype + "_LargePack" + lines.append("\t\tpublic " + fieldtype + " " + field.name + ";" + comment) return lines diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs index ee5c576e..a0bf13ec 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs @@ -3446,7 +3446,7 @@ internal struct SteamNetConnectionStatusChangedCallback_t_LargePack { public HSteamNetConnection m_hConn; /// Full connection info - public SteamNetConnectionInfo_t m_info; + public SteamNetConnectionInfo_t_LargePack m_info; /// Previous state. (Current state is in m_info.m_eState) public ESteamNetworkingConnectionState m_eOldState; From ce4f0d1d002c6a2fe26120c9b1e01fd315845a53 Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Wed, 19 Nov 2025 18:16:00 +0800 Subject: [PATCH 76/82] Show pack and size of structs by C++ --- CodeGen/SteamworksParser/debug_entrypoint.py | 24 +++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/CodeGen/SteamworksParser/debug_entrypoint.py b/CodeGen/SteamworksParser/debug_entrypoint.py index 4eb1901a..c8bd2e9d 100644 --- a/CodeGen/SteamworksParser/debug_entrypoint.py +++ b/CodeGen/SteamworksParser/debug_entrypoint.py @@ -4,4 +4,26 @@ # Settings.print_unuseddefines = True # Settings.warn_spacing = True -parse("./steamtest") # put steam headers inside +parser = parse("./steamtest") # put steam headers inside + + + +with open("bin/pack-size-test.cpp", "w", encoding="utf-8") as f: + f.write("#include \n") + f.write("#include \"steam_api.h\"\n") + f.write("#include \"steam_gameserver.h\"\n") + f.write("#include \"isteamgamecoordinator.h\"\n") + + f.write("int main() {\n") + structInspectionTemplate = "std::cout << \"{0}\" << '\t' << sizeof({0}) << '\\t' << alignof({0}) << '\\n';\n" + f.write("std::cout << std::ios::binary;\n") + for interface in parser.files: + for s in interface.callbacks: + f.write(structInspectionTemplate.format(s.name)) + for s in interface.structs: + if not s.should_not_generate(): + f.write(structInspectionTemplate.format(s.name)) + + f.write('}') + + # generated file still need some fix at 25/11/19 \ No newline at end of file From b2f6812777ba73031331ff4251c3d30e19f6022d Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Wed, 19 Nov 2025 18:23:46 +0800 Subject: [PATCH 77/82] Pull from latest contributions --- CodeGen/SteamworksParser/debug_entrypoint.py | 1 + CodeGen/SteamworksParser/steamworksparser.py | 33 ++++++++++++++----- CodeGen/src/structs.py | 10 ++++-- .../Runtime/autogen/SteamStructs.cs | 2 +- 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/CodeGen/SteamworksParser/debug_entrypoint.py b/CodeGen/SteamworksParser/debug_entrypoint.py index 4eb1901a..b26989dc 100644 --- a/CodeGen/SteamworksParser/debug_entrypoint.py +++ b/CodeGen/SteamworksParser/debug_entrypoint.py @@ -3,5 +3,6 @@ # Settings.print_skippedtypedefs = True # Settings.print_unuseddefines = True # Settings.warn_spacing = True +Settings.print_debug = True parse("./steamtest") # put steam headers inside diff --git a/CodeGen/SteamworksParser/steamworksparser.py b/CodeGen/SteamworksParser/steamworksparser.py index c6493a31..063000f1 100644 --- a/CodeGen/SteamworksParser/steamworksparser.py +++ b/CodeGen/SteamworksParser/steamworksparser.py @@ -160,6 +160,7 @@ class Settings: print_unuseddefines = False print_skippedtypedefs = False fake_gameserver_interfaces = False + print_debug = False class BlankLine(object): pass # linenum? @@ -238,7 +239,7 @@ def __init__(self, name, comments): self.pack = 4 class Struct: - def __init__(self, name, packsize: int | None, comments, scopePath): + def __init__(self, name, packsize: int | Literal["PlatformABIDefault"] | None, comments, scopePath): self.name = name # keep it to remain compatibility self.packsize = packsize @@ -253,6 +254,7 @@ def __init__(self, name, packsize: int | None, comments, scopePath): self.size: int | None = None self.packsize_aware = False self.is_skipped: bool = False + self.is_sequential = packsize == "PlatformABIDefault" def calculate_offsets(self, defaultAlign: int): def calcRealSize(sizelike: int | Literal['intptr']) -> int: @@ -428,15 +430,21 @@ def beginEnum(self): def endComplexType(self): self.complexTypeStack.pop() - def getCurrentPack(self) -> int | None: + def getCurrentPack(self) -> int | Literal['PlatformABIDefault'] | None: # pack size is default value # our parser can't evaluate #ifdefs, so in the situlation of # using default pack, the self.packsize will be [4, 8] - if self.packsize != [4, 8]: - return self.packsize[-1] if len(self.packsize) > 0 else None - else: + if self.packsize == [4, 8]: # default pack return None + elif self.packsize == [4]: + # we can't eval #ifdefs, so all push will be recorded without + # checking if it is really sets pack value + # one of [4, 8] is not used by #ifdef, if code pops in this state + # it means platform ABI default pack is restored + return 'PlatformABIDefault' + else: + return self.packsize[-1] if len(self.packsize) > 0 else None def getCurrentComplexType(self) -> Literal['struct', 'union', 'enum'] | None: return self.complexTypeStack[-1] if len(self.complexTypeStack) > 0 else None @@ -470,8 +478,8 @@ def __init__(self, folder): s.lines = infile.readlines() s.lines[0] = s.lines[0][3:] - if Settings.warn_utf8bom: - printWarning("File contains a UTF8 BOM.", s) + if Settings.warn_utf8bom: + printWarning("File contains a UTF8 BOM.", s) self.parse(s) @@ -1408,9 +1416,13 @@ def findout_platform_aware_structs(self): structs.extend(file.structs) for struct in structs: - if struct.packsize: + if type(struct.packsize) == int: continue + if struct.is_sequential: + printDebugPostParse(f"Struct {struct.name} is aligns by platform ABI default, means sequential") + continue + self.populate_struct_field_layout(struct, 8) offsetsLargePack: list[FieldOffset] = struct.calculate_offsets(8) offsetsLargePack.sort(key = lambda item: item.name) @@ -1422,12 +1434,15 @@ def findout_platform_aware_structs(self): sizeSmall = struct.size if offsetsLargePack != offsetsSmallPack or sizeLarge != sizeSmall: - print(f"Found packsize aware struct '{struct.name}'") + printDebugPostParse(f"Found packsize aware struct '{struct.name}'") struct.packsize_aware = True self.packSizeAwareStructs.append(struct.name) pass +def printDebugPostParse(string: str): + if Settings.print_debug: + print(f"[DEBUG][PostParse] {string}") def printWarning(string, s): print("[WARNING] " + string + " - In File: " + s.f.name + " - On Line " + str(s.linenum) + " - " + s.line) diff --git a/CodeGen/src/structs.py b/CodeGen/src/structs.py index f95400a9..d9cec464 100644 --- a/CodeGen/src/structs.py +++ b/CodeGen/src/structs.py @@ -160,6 +160,9 @@ def parse(struct: Struct, isMainStruct, marshalTableLines: list[str], packsizeAw if struct.name in g_SkippedStructs or struct.should_not_generate(): return [] + if struct.is_sequential and not isMainStruct: + return [] + lines = [] for comment in struct.c.rawprecomments: if type(comment) is BlankLine: @@ -175,7 +178,7 @@ def parse(struct: Struct, isMainStruct, marshalTableLines: list[str], packsizeAw if g_ExplicitStructs.get(structname, False): lines.append("\t[StructLayout(LayoutKind.Explicit, Pack = " + packsize + ")]") isExplicitStruct = True - elif isMainStruct: + elif isMainStruct and not struct.is_sequential: if struct.packsize != "Packsize.value" and structname not in g_SequentialStructs: customsize = "" @@ -192,8 +195,9 @@ def parse(struct: Struct, isMainStruct, marshalTableLines: list[str], packsizeAw if struct.callbackid: lines.append("\t[CallbackIdentity(Constants." + struct.callbackid + ")]") - for name in g_SequentialStructs: - if name == structname: + # use pack-size sematic for sequential + for name in g_SequentialStructs or struct.is_sequential: + if name == structname or struct.is_sequential: lines.append("\t[StructLayout(LayoutKind.Sequential)]") break diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs index 1e26a01a..a0d4c814 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs @@ -739,7 +739,7 @@ public struct SteamNetConnectionRealTimeLaneStatus_t { /// send it over the wire, or persist it in a file or database! If you need /// to do that, convert it to a string representation using the methods in /// ISteamNetworkingUtils(). - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential)] public struct SteamNetworkPingLocation_t { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] public byte[] m_data; From b3c8e993c423a4e4c6e63740322b54209c23f54c Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Thu, 20 Nov 2025 21:48:47 +0800 Subject: [PATCH 78/82] Commit parser to be merged to packable branch --- CodeGen/SteamworksParser/steamworksparser.py | 26 ++++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/CodeGen/SteamworksParser/steamworksparser.py b/CodeGen/SteamworksParser/steamworksparser.py index c6493a31..3b9477d2 100644 --- a/CodeGen/SteamworksParser/steamworksparser.py +++ b/CodeGen/SteamworksParser/steamworksparser.py @@ -384,7 +384,7 @@ def __init__(self, file): self.lines = [] self.line: str = "" self.originalline = "" - self.linesplit = [] + self.linesplit: list[str] = [] """ linenum is Zero based """ @@ -411,7 +411,8 @@ def __init__(self, file): self.bInMultilineComment = False self.bInMultilineMacro = False self.bInPrivate = False - self.callbackid = None + self.callbackid: int | None = None + self.isClassLikeStruct: bool | None = None self.functionAttributes: list[FunctionAttribute] = [] # FunctionAttribute self.currentSpecialStruct: PrimitiveType = None @@ -899,6 +900,7 @@ def parse_structs(self, s: ParserState): else: s.f.structs.append(s.struct) + s.isClassLikeStruct = None s.endComplexType() currentStruct: Struct = s.struct @@ -914,13 +916,20 @@ def parse_structs(self, s: ParserState): else: self.parse_struct_fields(s) else: - if s.linesplit[0] != "struct": + if s.linesplit[0] not in ("struct", "class")\ + or (len(s.linesplit) > 2\ + and not s.linesplit[1].startswith("ISteam")): return # Skip Forward Declares if s.linesplit[1].endswith(";"): return + if s.linesplit[0] == "class": + s.isClassLikeStruct = True + else: + s.isClassLikeStruct = False + # special structs typeNameCandidate = s.linesplit[1] if typeNameCandidate in g_SpecialStructs.keys(): @@ -938,10 +947,10 @@ def parse_structs(self, s: ParserState): s.beginStruct() comments = self.consume_comments(s) - oldStruct = s.struct + outerTypeCandidate = s.struct s.struct = Struct(s.linesplit[1].strip(), s.getCurrentPack(),\ comments, s.scopeDepth) - s.struct.outer_type = oldStruct + s.struct.outer_type = outerTypeCandidate if s.linesplit[1].strip() in g_SkippedStructs: s.struct.is_skipped = True @@ -950,6 +959,9 @@ def parse_struct_fields(self, s): if s.line.startswith("enum"): return + + if s.line.startswith('friend '): # in classes + return if s.line == "{": return @@ -1291,7 +1303,7 @@ def parse_interface_functions(self, s): attr.value += token continue - def parse_classes(self, s): + def parse_classes(self, s: ParserState): if s.linesplit[0] != "class": return @@ -1300,8 +1312,6 @@ def parse_classes(self, s): self.consume_comments(s) - #print("Skipped class: " + s.line) - def parse_scope(self, s): if "{" in s.line: s.scopeDepth += 1 From c801a1fd7a7733d0e0dd3f65c3e1a05d707d4398 Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Mon, 24 Nov 2025 21:52:23 +0800 Subject: [PATCH 79/82] Try to analyze structs like CGameID Puropse is to exclude fake top level structs like CGameID::GameID_t. Maybe just add a table is enough? --- CodeGen/SteamworksParser/debug_entrypoint.py | 1 + CodeGen/SteamworksParser/steamworksparser.py | 213 ++++++++++++++++++- 2 files changed, 206 insertions(+), 8 deletions(-) diff --git a/CodeGen/SteamworksParser/debug_entrypoint.py b/CodeGen/SteamworksParser/debug_entrypoint.py index baf52d5a..ba79727f 100644 --- a/CodeGen/SteamworksParser/debug_entrypoint.py +++ b/CodeGen/SteamworksParser/debug_entrypoint.py @@ -14,6 +14,7 @@ f.write("#include \"steam_api.h\"\n") f.write("#include \"steam_gameserver.h\"\n") f.write("#include \"isteamgamecoordinator.h\"\n") + f.write("#include \"steamnetworkingfakeip.h\"\n") f.write("int main() {\n") structInspectionTemplate = "std::cout << \"{0}\" << '\t' << sizeof({0}) << '\\t' << alignof({0}) << '\\n';\n" diff --git a/CodeGen/SteamworksParser/steamworksparser.py b/CodeGen/SteamworksParser/steamworksparser.py index 86771496..23cbbf7c 100644 --- a/CodeGen/SteamworksParser/steamworksparser.py +++ b/CodeGen/SteamworksParser/steamworksparser.py @@ -86,6 +86,15 @@ 'isteamutils.h', ) +class ClassSpecialRBracket: + def __init__(self, lineZB: int, action: Literal['EndStruct'] | Literal['ContniueStruct']): + self.lineZeroBased = lineZB + self.action: Literal['EndStruct'] | Literal['ContniueStruct'] = action + +g_ClassSpecialRBracket = { + "CSteamID" : ClassSpecialRBracket(850, 'ContniueStruct') +} + class PrimitiveType: def __init__(self, name: str, size: int, pack: int): self.name = name @@ -281,6 +290,8 @@ def calcRealSize(sizelike: int | Literal['intptr']) -> int: padding = (effective_field_pack - (current_offset % effective_field_pack)) % effective_field_pack current_offset += padding + if field.size is None: # For classes with typedef inside + return [] effective_struct_pack = max(effective_struct_pack, effective_field_pack) field_total_size = calcRealSize(field.size) * (field.arraysize or 1) @@ -413,6 +424,7 @@ def __init__(self, file): self.bInMultilineComment = False self.bInMultilineMacro = False self.bInPrivate = False + self.isInlineMethodDeclared = False self.callbackid: int | None = None self.isClassLikeStruct: bool | None = None self.functionAttributes: list[FunctionAttribute] = [] # FunctionAttribute @@ -453,6 +465,7 @@ def getCurrentComplexType(self) -> Literal['struct', 'union', 'enum'] | None: class Parser: files = None typedefs = [] + ignoredStructs: list[Struct] = [] def __init__(self, folder): self.files: list[SteamFile] = [SteamFile(f) for f in os.listdir(folder) @@ -899,6 +912,13 @@ def parse_structs(self, s: ParserState): if s.struct and s.linesplit[0] != "struct": if s.line == "};": + if s.struct.name in g_ClassSpecialRBracket: + special = g_ClassSpecialRBracket[s.struct.name] + if special.lineZeroBased == s.line\ + and special.action == 'ContniueStruct': + return + + s.struct.endcomments = self.consume_comments(s) if s.callbackid: @@ -924,22 +944,22 @@ def parse_structs(self, s: ParserState): else: self.parse_struct_fields(s) else: - if s.linesplit[0] not in ("struct", "class")\ - or (len(s.linesplit) > 2\ - and not s.linesplit[1].startswith("ISteam")): + if s.linesplit[0] not in ("struct", "class"): + return + + if len(s.linesplit) > 1 and s.linesplit[1].startswith("ISteam"): return # Skip Forward Declares if s.linesplit[1].endswith(";"): return - - if s.linesplit[0] == "class": - s.isClassLikeStruct = True - else: - s.isClassLikeStruct = False # special structs typeNameCandidate = s.linesplit[1] + if (typeNameCandidate in ("CCallResult", "CCallback", "CCallbackBase", "CCallbackImpl", "CCallbackManual")): + self.ignoredStructs.append(Struct(typeNameCandidate, 8, None, "")) + return + if typeNameCandidate in g_SpecialStructs.keys(): if s.linesplit[0] == 'struct': s.currentSpecialStruct = g_SpecialStructs[typeNameCandidate] @@ -953,6 +973,12 @@ def parse_structs(self, s: ParserState): return s.beginStruct() + + if s.linesplit[0] == "class": + s.isClassLikeStruct = True + else: + s.isClassLikeStruct = False + comments = self.consume_comments(s) outerTypeCandidate = s.struct @@ -962,6 +988,170 @@ def parse_structs(self, s: ParserState): if s.linesplit[1].strip() in g_SkippedStructs: s.struct.is_skipped = True + def visit_inline_method(self, s: ParserState): + if s.struct: + if s.function == None: + s.function = Function() + if len(s.ifstatements) > 1: + s.function.ifstatements = s.ifstatements[-1] + s.function.comments = s.comments + s.function.linecomment = s.linecomment + s.function.private = True + s.function.attributes = s.functionAttributes + s.functionAttributes = [] + self.consume_comments(s) + + linesplit_iter = iter(enumerate(s.linesplit)) + for i, token in linesplit_iter: + if s.funcState == 0: # Return Value + if token == "virtual" or token == "inline": + continue + + if token.startswith("*"): + s.function.returntype += "*" + token = token[1:] + s.funcState = 1 + elif "(" in token: + s.function.returntype = s.function.returntype.strip() + s.funcState = 1 + else: + s.function.returntype += token + " " + continue + + if s.funcState == 1: # Method Name + s.function.name = token.split("(", 1)[0] + + if token[-1] == ")": + s.funcState = 3 + elif token[-1] == ";": + s.funcState = 0 + s.interface.functions.append(s.function) + s.function = None + break + elif token[-1] != "(": # Like f(void arg ) + if Settings.warn_spacing: + printWarning("Function is missing whitespace between the opening parentheses and first arg.", s) + token = token.split("(")[1] + s.funcState = 2 + else: + s.funcState = 2 + continue + + if s.funcState == 2: # Args + # Strip clang attributes + bIsAttrib = False + for a in g_ArgAttribs: + if token.startswith(a): + attr = ArgAttribute() + bIsAttrib = True + break + if bIsAttrib: + openparen_index = token.index("(") + attr.name = token[:openparen_index] + if len(token) > openparen_index+1: + if token.endswith(")"): + attr.value = token[openparen_index+1:-1] + continue + else: + attr.value = token[openparen_index+1:] + s.funcState = 4 + continue + + if token.startswith("**"): + args += token[:2] + token = token[2:] + elif token.startswith("*") or token.startswith("&"): + args += token[0] + token = token[1:] + + if len(token) == 0: + continue + + if token.startswith(")"): # Like f( void arg ")" + if args: + TEST = 1 + TEST2 = 0 # TODO: Cleanup, I don't even know what the fuck is going on here anymore. + if "**" in s.linesplit[i-1]: + TEST -= 2 + TEST2 += 2 + elif "*" in s.linesplit[i-1] or "&" in s.linesplit[i-1]: + TEST -= 1 + TEST2 += 1 + + arg = Arg() + arg.type = args[:-len(s.linesplit[i-1]) - TEST].strip() + arg.name = s.linesplit[i-1][TEST2:] + arg.attribute = attr + s.function.args.append(arg) + args = "" + attr = None + s.funcState = 3 + elif token.endswith(")"): # Like f( void "arg)" + if Settings.warn_spacing: + printWarning("Function is missing whitespace between the closing parentheses and first arg.", s) + + arg = Arg() + arg.type = args.strip() + arg.name = token[:-1] + arg.attribute = attr + s.function.args.append(arg) + args = "" + attr = None + s.funcState = 3 + elif token[-1] == ",": # Like f( void "arg," void arg2 ) + TEST2 = 0 + if "*" in token[:-1] or "&" in token[:-1]: + TEST2 += 1 + + arg = Arg() + arg.type = args.strip() + arg.name = token[:-1][TEST2:] + arg.attribute = attr + s.function.args.append(arg) + args = "" + attr = None + elif token == "=": + # Copied from ")" above + TEST = 1 + TEST2 = 0 # TODO: Cleanup, I don't even know what the fuck is going on here anymore. + if "*" in s.linesplit[i-1] or "&" in s.linesplit[i-1]: + TEST -= 1 + TEST2 += 1 + + arg = Arg() + arg.type = args[:-len(s.linesplit[i-1]) - TEST].strip() + arg.name = s.linesplit[i-1][TEST2:] + arg.default = s.linesplit[i+1].rstrip(",") + arg.attribute = attr + s.function.args.append(arg) + args = "" + attr = None + next(linesplit_iter, None) + else: + args += token + " " + + continue + + if s.funcState == 3: # = 0; or line + if token.endswith(";"): + s.funcState = 0 + s.interface.functions.append(s.function) + s.function = None + break + continue + + if s.funcState == 4: # ATTRIBS + if token.endswith(")"): + attr.value += token[:-1] + s.funcState = 2 + else: + attr.value += token + continue + + s.isInlineMethodDeclared = True + return + + def parse_struct_fields(self, s): comments = self.consume_comments(s) @@ -1398,6 +1588,13 @@ def populate_union_sizes(self, defaultPack = 8): def populate_struct_field_layout(self, struct: Struct, defaultPack = 8): for field in struct.fields: typeinfo = self.resolveTypeInfo(field.type) + + if typeinfo is None: + # this usually means typedef is used inside a class, + # but reminder we treat classes as struct + self.ignoredStructs.append(struct) + return [] + # check if we facing a struct which may not populated yet if isinstance(typeinfo, Struct): struct = typeinfo From 6467bd2b3bfaa463a2fbf563df87f46673cce37e Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Tue, 25 Nov 2025 22:19:21 +0800 Subject: [PATCH 80/82] Add an comparer to official generated data. --- .vscode/launch.json | 10 +++ .../SteamworksParser/compare_with_official.py | 69 +++++++++++++++++++ CodeGen/SteamworksParser/debug_entrypoint.py | 20 ++++-- CodeGen/SteamworksParser/steamworksparser.py | 6 +- 4 files changed, 97 insertions(+), 8 deletions(-) create mode 100644 CodeGen/SteamworksParser/compare_with_official.py diff --git a/.vscode/launch.json b/.vscode/launch.json index 51a89683..fac8a9a3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,7 @@ // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { "name": "Debug generator", "type": "debugpy", @@ -13,6 +14,15 @@ "console": "integratedTerminal", "justMyCode": true }, + { + "name": "Debug comparer", + "type": "debugpy", + "request": "launch", + "program": "${workspaceFolder}/CodeGen/SteamworksParser/compare_with_official.py", + "cwd": "${workspaceFolder}/CodeGen/SteamworksParser/", + "console": "integratedTerminal", + "justMyCode": true + }, { "name": "Debug parser", "type": "debugpy", diff --git a/CodeGen/SteamworksParser/compare_with_official.py b/CodeGen/SteamworksParser/compare_with_official.py new file mode 100644 index 00000000..f0c9dde0 --- /dev/null +++ b/CodeGen/SteamworksParser/compare_with_official.py @@ -0,0 +1,69 @@ +from types import SimpleNamespace +from steamworksparser import Struct, StructField, parse, Settings +import os +import json +import itertools +# Settings.print_skippedtypedefs = True +# Settings.print_unuseddefines = True +# Settings.warn_spacing = True +# Settings.print_debug = True + +parser = parse("./steamtest") # put steam headers inside + +os.makedirs("./bin/compare-official", exist_ok=True) +os.makedirs("./bin/native", exist_ok=True) + +mismatchCallbackDiagnostics:list[tuple[int, str]] = [] +matchCallbackIds: list[int] = [] +redundantCallbackIds: list[int] = [] + +fieldsMatchedStructs: list[Struct] = [] + +with open("./steamtest/steam_api.json") as f: + official = json.load(f, object_hook=lambda d: SimpleNamespace(**d)) + with open("./bin/compare-official/result.txt", "w", encoding="utf-8") as compareF: + flattenedCallbacks = [callback for file in parser.files for callback in file.callbacks] + flattenedStructs = [struct for file in parser.files for struct in file.structs] + + + for cb in flattenedCallbacks: + idParts = cb.callbackid.strip().split(' ') + idConst = parser.resolveConstValue(idParts[0].strip()) + identity = None + if idParts == 3: + identity = int(idConst.value) + int(idParts[2]) + else: + identity = int(idConst.value) + + officialCBs: list = official.callback_structs + officialCB = next((o for o in officialCBs if o.callback_id == identity), None) + diag = None + if officialCB is None: + redundantCallbackIds.append(identity) + continue + if officialCB.struct != cb.name: + diag = (identity, f"E1: Name mismatch, ours is `{cb.name}`, official one is `{officialCB.struct}`") + mismatchCallbackDiagnostics.append(diag) + continue + for i, fld in enumerate(officialCB.fields): + if fld.fieldname != cb.fields[i].name: + diag = (identity, f"E2: field[{i}]'s name mismatch, `{fld.fieldname}` expected, got `{cb.fields[i].name}`") + break + + def our_type_to_official_string(ourFld: StructField): + if ourFld.arraysize: + return f"{ourFld.type} [{ourFld.arraysize}]" + else: + return ourFld.name + + if fld.fieldtype != our_type_to_official_string(cb.fields[i]): + arrayDiag = cb.fields[i].arraysize or "None" + diag = (identity, f"E3: field[{i}]'s type mismatch, `{fld.fieldtype}` expected," + f" got `{cb.fields[i].type}`, array size {arrayDiag}") + break + if diag is not None: + mismatchCallbackDiagnostics.append(diag) + continue + +for diag in mismatchCallbackDiagnostics: + print(f"{diag[1]}.\n\tCallback id {diag[0]}.") diff --git a/CodeGen/SteamworksParser/debug_entrypoint.py b/CodeGen/SteamworksParser/debug_entrypoint.py index ba79727f..b5bbdfb2 100644 --- a/CodeGen/SteamworksParser/debug_entrypoint.py +++ b/CodeGen/SteamworksParser/debug_entrypoint.py @@ -1,5 +1,7 @@ from steamworksparser import parse, Settings - +import os +import json +import itertools # Settings.print_skippedtypedefs = True # Settings.print_unuseddefines = True # Settings.warn_spacing = True @@ -7,18 +9,26 @@ parser = parse("./steamtest") # put steam headers inside +os.makedirs("bin/compare-official") +os.makedirs("bin/native") - -with open("bin/pack-size-test.cpp", "w", encoding="utf-8") as f: +with open("bin/native/pack-size-test.cpp", "w", encoding="utf-8") as f: f.write("#include \n") f.write("#include \"steam_api.h\"\n") f.write("#include \"steam_gameserver.h\"\n") f.write("#include \"isteamgamecoordinator.h\"\n") f.write("#include \"steamnetworkingfakeip.h\"\n") + f.write("#ifdef _MSC_VER\n") + f.write("#include \"fcntl.h\"\n") + f.write("#include \"io.h\"\n") + f.write("#endif\n") f.write("int main() {\n") - structInspectionTemplate = "std::cout << \"{0}\" << '\t' << sizeof({0}) << '\\t' << alignof({0}) << '\\n';\n" - f.write("std::cout << std::ios::binary;\n") + f.write("#ifdef _MSC_VER\n") + f.write("fflush(stdout);\n") + f.write("_setmode(_fileno(stdout), _O_BINARY);\n") + f.write("#endif\n") + structInspectionTemplate = "std::cout << \"{0}\" << '\\t' << sizeof({0}) << '\\t' << alignof({0}) << '\\n';\n" for interface in parser.files: for s in interface.callbacks: f.write(structInspectionTemplate.format(s.name)) diff --git a/CodeGen/SteamworksParser/steamworksparser.py b/CodeGen/SteamworksParser/steamworksparser.py index 23cbbf7c..32f45429 100644 --- a/CodeGen/SteamworksParser/steamworksparser.py +++ b/CodeGen/SteamworksParser/steamworksparser.py @@ -257,7 +257,7 @@ def __init__(self, name, packsize: int | Literal["PlatformABIDefault"] | None, c self.nested_struct: list[Struct] = [] # nested structs self.outer_type: Struct | Union | None = None self.scopeDepth: int = scopePath - self.callbackid = None + self.callbackid: str | None = None self.endcomments = None # Comment self.pack = packsize self.size: int | None = None @@ -352,7 +352,7 @@ def calculate_offsets(self, defaultAlign: int): '''Also used in Union''' class StructField: def __init__(self, name, typee, arraysize: str | None, comments): - self.name = name + self.name: str = name self.type = typee self.arraysizeStr = arraysize self.arraysize: int | None = None @@ -425,7 +425,7 @@ def __init__(self, file): self.bInMultilineMacro = False self.bInPrivate = False self.isInlineMethodDeclared = False - self.callbackid: int | None = None + self.callbackid: str | None = None self.isClassLikeStruct: bool | None = None self.functionAttributes: list[FunctionAttribute] = [] # FunctionAttribute From e3fdc5e655cd62305fd07232bce0147e34d507b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=E9=B8=BD?= <43724908+Akarinnnnn@users.noreply.github.com> Date: Sun, 30 Nov 2025 02:46:13 +0800 Subject: [PATCH 81/82] Revert class parsing and fixed array related field handling --- .../SteamworksParser/compare_with_official.py | 103 +++++++++++------- CodeGen/SteamworksParser/steamworksparser.py | 19 ++-- 2 files changed, 69 insertions(+), 53 deletions(-) diff --git a/CodeGen/SteamworksParser/compare_with_official.py b/CodeGen/SteamworksParser/compare_with_official.py index f0c9dde0..6bd4699d 100644 --- a/CodeGen/SteamworksParser/compare_with_official.py +++ b/CodeGen/SteamworksParser/compare_with_official.py @@ -13,7 +13,8 @@ os.makedirs("./bin/compare-official", exist_ok=True) os.makedirs("./bin/native", exist_ok=True) -mismatchCallbackDiagnostics:list[tuple[int, str]] = [] + +mismatchCallbackDiagnostics:list[tuple[int, str, str]] = [] # (callbackid, message, code) matchCallbackIds: list[int] = [] redundantCallbackIds: list[int] = [] @@ -21,49 +22,67 @@ with open("./steamtest/steam_api.json") as f: official = json.load(f, object_hook=lambda d: SimpleNamespace(**d)) - with open("./bin/compare-official/result.txt", "w", encoding="utf-8") as compareF: - flattenedCallbacks = [callback for file in parser.files for callback in file.callbacks] - flattenedStructs = [struct for file in parser.files for struct in file.structs] - + flattenedCallbacks = [callback for file in parser.files for callback in file.callbacks] + flattenedStructs = [struct for file in parser.files for struct in file.structs] + + + for cb in flattenedCallbacks: + idParts = cb.callbackid.strip().split(' ') + idConst = parser.resolveConstValue(idParts[0].strip()) + identity = None + if len(idParts) == 3: + identity = int(idConst.value) + int(idParts[2]) + else: + identity = int(idConst.value) + + officialCBs: list = official.callback_structs + officialCB = next((o for o in officialCBs if o.callback_id == identity), None) + diag = None + if officialCB is None: + redundantCallbackIds.append(identity) + continue + if officialCB.struct != cb.name and identity != 1108: # 1108 is shared between CL and GS + diag = (identity, f"Name mismatch, ours is `{cb.name}`, official one is `{officialCB.struct}`", 'E1') + mismatchCallbackDiagnostics.append(diag) + continue - for cb in flattenedCallbacks: - idParts = cb.callbackid.strip().split(' ') - idConst = parser.resolveConstValue(idParts[0].strip()) - identity = None - if idParts == 3: - identity = int(idConst.value) + int(idParts[2]) - else: - identity = int(idConst.value) + if len(officialCB.fields) != len(cb.fields): + diag = (identity, f"Callback `{cb.name}`'s field count({len(cb.fields)}) is not execpted({len(officialCB.fields)})", 'E4') + continue - officialCBs: list = official.callback_structs - officialCB = next((o for o in officialCBs if o.callback_id == identity), None) - diag = None - if officialCB is None: - redundantCallbackIds.append(identity) - continue - if officialCB.struct != cb.name: - diag = (identity, f"E1: Name mismatch, ours is `{cb.name}`, official one is `{officialCB.struct}`") - mismatchCallbackDiagnostics.append(diag) - continue - for i, fld in enumerate(officialCB.fields): - if fld.fieldname != cb.fields[i].name: - diag = (identity, f"E2: field[{i}]'s name mismatch, `{fld.fieldname}` expected, got `{cb.fields[i].name}`") - break + for i, fld in enumerate(officialCB.fields): + official_field = officialCB.fields[i] + our_field = cb.fields[i] + + # compare name + if official_field.fieldname != our_field.name: + diag = (identity, f"field[{i}]'s name mismatch, `{official_field.fieldname}` expected, got `{our_field.name}`", 'E2') + break - def our_type_to_official_string(ourFld: StructField): - if ourFld.arraysize: - return f"{ourFld.type} [{ourFld.arraysize}]" - else: - return ourFld.name + def our_type_to_official_format(ourFld: StructField): + if ourFld.arraysize: + return f"{ourFld.type} [{ourFld.arraysize}]" + else: + return ourFld.type + + # compare type + typeGot = our_type_to_official_format(our_field) + if official_field.fieldtype != typeGot: + arrayDiag = our_field.arraysize or "None" + diag = (identity, f"Callback {officialCB.struct} field[{i}] ({official_field.fieldname})'s type mismatch, "\ + f"`{official_field.fieldtype}` excepted, got `{our_field.name}: {typeGot}`", 'E3') + break - if fld.fieldtype != our_type_to_official_string(cb.fields[i]): - arrayDiag = cb.fields[i].arraysize or "None" - diag = (identity, f"E3: field[{i}]'s type mismatch, `{fld.fieldtype}` expected," - f" got `{cb.fields[i].type}`, array size {arrayDiag}") - break - if diag is not None: - mismatchCallbackDiagnostics.append(diag) - continue + if diag is not None: + mismatchCallbackDiagnostics.append(diag) + continue -for diag in mismatchCallbackDiagnostics: - print(f"{diag[1]}.\n\tCallback id {diag[0]}.") +with open("./bin/compare-official/result.txt", "w", encoding="utf-8") as compareF: + diagLines: list[str] = [] + for diag in mismatchCallbackDiagnostics: + diagString = f"{diag[2]}: {diag[1]}.\n\tCallback id {diag[0]}." + diagLines.append(diagString) + print(diagString) + + diagLines = [line + '\n' for line in diagLines] + compareF.writelines(diagLines) diff --git a/CodeGen/SteamworksParser/steamworksparser.py b/CodeGen/SteamworksParser/steamworksparser.py index 32f45429..767b7d2c 100644 --- a/CodeGen/SteamworksParser/steamworksparser.py +++ b/CodeGen/SteamworksParser/steamworksparser.py @@ -944,7 +944,7 @@ def parse_structs(self, s: ParserState): else: self.parse_struct_fields(s) else: - if s.linesplit[0] not in ("struct", "class"): + if s.linesplit[0] != "struct": return if len(s.linesplit) > 1 and s.linesplit[1].startswith("ISteam"): @@ -1538,6 +1538,8 @@ def consume_comments(self, s): s.linecomment = None return c + # I initially choose camel case by my habit, but keep this name here + # for hinting it this is an external available API is also useful def resolveTypeInfo(self, typeName): # search order: primitive, pointer, enum, typedef, struct. no callbacks result = g_PrimitiveTypesLayout.get(typeName) @@ -1597,18 +1599,16 @@ def populate_struct_field_layout(self, struct: Struct, defaultPack = 8): # check if we facing a struct which may not populated yet if isinstance(typeinfo, Struct): - struct = typeinfo - # we assume there will no circular references across structs if not typeinfo.size: self.populate_struct_field_layout(typeinfo, defaultPack) typeinfo.calculate_offsets(defaultPack) field.size = typeinfo.size - field.pack = typeinfo.pack or defaultPack + field.pack = typeinfo.pack or struct.pack or defaultPack if (field.arraysizeStr is not None): arrsize = field.arraysizeStr - field.arraysize = int(arrsize) if arrsize.isdigit() else eval(self.resolveConstValue(arrsize).value) + field.arraysize = int(arrsize) if arrsize.isdigit() else eval(self.resolveConstValue(arrsize).value, {}, ) struct.calculate_offsets(defaultPack) @@ -1623,11 +1623,8 @@ def findout_platform_aware_structs(self): structs.extend(file.structs) for struct in structs: - if type(struct.packsize) == int: - continue - if struct.is_sequential: - printDebugPostParse(f"Struct {struct.name} is aligns by platform ABI default, means sequential") + print_debug(f"Struct {struct.name} is aligns by platform ABI default, means sequential") continue self.populate_struct_field_layout(struct, 8) @@ -1641,13 +1638,13 @@ def findout_platform_aware_structs(self): sizeSmall = struct.size if offsetsLargePack != offsetsSmallPack or sizeLarge != sizeSmall: - printDebugPostParse(f"Found packsize aware struct '{struct.name}'") + print_debug(f"Found packsize aware struct '{struct.name}'") struct.packsize_aware = True self.packSizeAwareStructs.append(struct.name) pass -def printDebugPostParse(string: str): +def print_debug(string: str): if Settings.print_debug: print(f"[DEBUG][PostParse] {string}") From e0a11ea82f294fb9430c0b6cbb547817cc905000 Mon Sep 17 00:00:00 2001 From: Akarinnnnn <43724908+Akarinnnnn@users.noreply.github.com> Date: Sat, 27 Dec 2025 19:13:20 +0800 Subject: [PATCH 82/82] Add a advanced script to test parser's pack-awareness --- .vscode/launch.json | 9 +++ CodeGen/SteamworksParser/debug_entrypoint.py | 4 +- CodeGen/SteamworksParser/steamworksparser.py | 5 +- CodeGen/SteamworksParser/test_pack_size.py | 71 ++++++++++++++++++++ 4 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 CodeGen/SteamworksParser/test_pack_size.py diff --git a/.vscode/launch.json b/.vscode/launch.json index fac8a9a3..030ae9e7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -23,6 +23,15 @@ "console": "integratedTerminal", "justMyCode": true }, + { + "name": "Test pack size", + "type": "debugpy", + "request": "launch", + "program": "${workspaceFolder}/CodeGen/SteamworksParser/test_pack_size.py", + "cwd": "${workspaceFolder}/CodeGen/SteamworksParser/", + "console": "integratedTerminal", + "justMyCode": true + }, { "name": "Debug parser", "type": "debugpy", diff --git a/CodeGen/SteamworksParser/debug_entrypoint.py b/CodeGen/SteamworksParser/debug_entrypoint.py index b5bbdfb2..4011824e 100644 --- a/CodeGen/SteamworksParser/debug_entrypoint.py +++ b/CodeGen/SteamworksParser/debug_entrypoint.py @@ -9,8 +9,8 @@ parser = parse("./steamtest") # put steam headers inside -os.makedirs("bin/compare-official") -os.makedirs("bin/native") +os.makedirs("bin/compare-official", exist_ok=True) +os.makedirs("bin/native", exist_ok=True) with open("bin/native/pack-size-test.cpp", "w", encoding="utf-8") as f: f.write("#include \n") diff --git a/CodeGen/SteamworksParser/steamworksparser.py b/CodeGen/SteamworksParser/steamworksparser.py index 767b7d2c..f42a2b7c 100644 --- a/CodeGen/SteamworksParser/steamworksparser.py +++ b/CodeGen/SteamworksParser/steamworksparser.py @@ -48,7 +48,8 @@ "SteamDatagramRelayAuthTicket", "SteamIDComponent_t" - # sync with g_SpecialStructsLP and g_SpecialStructsSP + # steamclientpublic.h nested struct + "GameID_t" ) g_FuncAttribs = ( @@ -314,7 +315,7 @@ def calcRealSize(sizelike: int | Literal['intptr']) -> int: return result def should_not_generate(self): - return self.is_skipped or (self.outer_type is not None) or len(self.nested_struct) > 0 + return self.name in g_SkippedStructs or self.is_skipped or (self.outer_type is not None) or len(self.nested_struct) > 0 class Union: def __init__(self, name, isUnnamed, pack): diff --git a/CodeGen/SteamworksParser/test_pack_size.py b/CodeGen/SteamworksParser/test_pack_size.py new file mode 100644 index 00000000..4c8955a1 --- /dev/null +++ b/CodeGen/SteamworksParser/test_pack_size.py @@ -0,0 +1,71 @@ +from types import SimpleNamespace +from steamworksparser import Struct, StructField, parse, Settings +import os +import json +import itertools +# Settings.print_skippedtypedefs = True +# Settings.print_unuseddefines = True +# Settings.warn_spacing = True +# Settings.print_debug = True + +filepath1 = "./bin/packsize-aware-list.aggressive.txt" +filepath2 = "./bin/packsize-aware-list.conservative.txt" + +special_structs = [] +special_structs_conservative = [] + +# read size-different based special struct +with open(filepath1, 'r') as f: + special_structs = [line.strip() for line in f if line.strip()] + +# any differences in struct info will be a special struct, which called conservative +with open(filepath2, 'r') as f: + special_structs_conservative = [line.strip() for line in f if line.strip()] + +parser = parse("./steamtest") # put steam headers inside + +mismatchCallbackDiagnostics:list[tuple[int, str, str, str]] = [] # (callbackid, name, message, code) +matchStructs: list[str] = [] +mismatchStructs: list[str] = [] + + +for structName in parser.packSizeAwareStructs: + special = False + specialConservative = False + typeinfo: Struct = parser.resolveTypeInfo(structName) + if structName in special_structs: + special = True + special_structs.remove(structName) + if structName in special_structs_conservative: + specialConservative = True + special_structs_conservative.remove(structName) + + if not special and not specialConservative: + mismatchStructs.append(structName) + diagRecord = (typeinfo.callbackid, structName, f"{structName} is absolutely not a special marshalling struct", "W1") + mismatchCallbackDiagnostics.append(diagRecord) + continue + + if specialConservative and not special: + diagRecord = (typeinfo.callbackid, structName, f"{structName} might be a special marshalling struct by align issues", "W2") + mismatchCallbackDiagnostics.append(diagRecord) + + if special: + matchStructs.append(structName) + +for missingCriticialStruct in special_structs: + typeinfo: Struct = parser.resolveTypeInfo(missingCriticialStruct) + diagRecord = (typeinfo.callbackid, missingCriticialStruct, f"Critical special marshalling struct {missingCriticialStruct} is missing", "E3") + mismatchCallbackDiagnostics.append(diagRecord) + +for missingOptionalStruct in special_structs: + typeinfo: Struct = parser.resolveTypeInfo(missingOptionalStruct) + diagRecord = (typeinfo.callbackid, missingOptionalStruct, f"{structName} might be a special marshalling struct by align issues", "W2") + mismatchCallbackDiagnostics.append(diagRecord) + +with open("./bin/struct_test_result.txt", "w") as f: + for diag in mismatchCallbackDiagnostics: + fallbackStr = "None" + formatted = f"{diag[3]}: {diag[2]}\n\tname: {diag[1]}, cbid(optional): {diag[0] or fallbackStr}\n" + print(formatted) + f.write(formatted)