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/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..030ae9e7 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,45 @@ +{ + // 使用 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 + }, + { + "name": "Debug comparer", + "type": "debugpy", + "request": "launch", + "program": "${workspaceFolder}/CodeGen/SteamworksParser/compare_with_official.py", + "cwd": "${workspaceFolder}/CodeGen/SteamworksParser/", + "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", + "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/SteamworksParser b/CodeGen/SteamworksParser deleted file mode 160000 index 6f70e9cb..00000000 --- a/CodeGen/SteamworksParser +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6f70e9cb638b240f39a77063f6160673014e094b diff --git a/CodeGen/SteamworksParser/.editorconfig b/CodeGen/SteamworksParser/.editorconfig new file mode 100644 index 00000000..b3c5df63 --- /dev/null +++ b/CodeGen/SteamworksParser/.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/CodeGen/SteamworksParser/.gitignore b/CodeGen/SteamworksParser/.gitignore new file mode 100644 index 00000000..74cd7124 --- /dev/null +++ b/CodeGen/SteamworksParser/.gitignore @@ -0,0 +1,4 @@ +*.pyc +__pycache__ +steamtest/ +bin \ No newline at end of file diff --git a/CodeGen/SteamworksParser/.vscode/launch.json b/CodeGen/SteamworksParser/.vscode/launch.json new file mode 100644 index 00000000..80560674 --- /dev/null +++ b/CodeGen/SteamworksParser/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Debug parser", + "type": "debugpy", + "request": "launch", + "program": "${workspaceFolder}/debug_entrypoint.py", + "console": "integratedTerminal", + "cwd": "${workspaceFolder}", + "justMyCode": true + } + ] +} \ No newline at end of file diff --git a/CodeGen/SteamworksParser/LICENSE.txt b/CodeGen/SteamworksParser/LICENSE.txt new file mode 100644 index 00000000..338a2e47 --- /dev/null +++ b/CodeGen/SteamworksParser/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +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 +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. diff --git a/CodeGen/SteamworksParser/README.md b/CodeGen/SteamworksParser/README.md new file mode 100644 index 00000000..563cc5ea --- /dev/null +++ b/CodeGen/SteamworksParser/README.md @@ -0,0 +1,40 @@ +# SteamworksParser + +This is a simple parser for the [Steamworks](https://partner.steamgames.com/) header files. + +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). + +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. + +```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() +``` diff --git a/CodeGen/SteamworksParser/__init__.py b/CodeGen/SteamworksParser/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/CodeGen/SteamworksParser/compare_with_official.py b/CodeGen/SteamworksParser/compare_with_official.py new file mode 100644 index 00000000..6bd4699d --- /dev/null +++ b/CodeGen/SteamworksParser/compare_with_official.py @@ -0,0 +1,88 @@ +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, str]] = [] # (callbackid, message, code) +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)) + 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 + + 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 + + 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_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 diag is not None: + mismatchCallbackDiagnostics.append(diag) + continue + +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/debug_entrypoint.py b/CodeGen/SteamworksParser/debug_entrypoint.py new file mode 100644 index 00000000..f34e2df9 --- /dev/null +++ b/CodeGen/SteamworksParser/debug_entrypoint.py @@ -0,0 +1,49 @@ +from steamworksparser import 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) + +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") + 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)) + 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 + +with open("bin/pack-aware-structs.txt", "wb") as fp: + for structName in parser.packSizeAwareStructs: + fp.write(bytes(structName + "\n", "utf-8")) + +# if you want to generate a detailed diff file, +# you can see parser.resolveTypeInfo() and parser.populate_struct_field_layout() +# latter is used to calculate size by passing different platform default pack size \ No newline at end of file diff --git a/CodeGen/SteamworksParser/steamworksparser.py b/CodeGen/SteamworksParser/steamworksparser.py new file mode 100644 index 00000000..f42a2b7c --- /dev/null +++ b/CodeGen/SteamworksParser/steamworksparser.py @@ -0,0 +1,1662 @@ +import os +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 + + # PS3-only Headers not currently supported + "isteamps3overlayrenderer.h", + "steamps3params.h", + + # Deprecated, moved to isteaminput.h + "isteamcontroller.h", + + # Non-steam code + "isteamdualsense.h", +) + +g_SkippedLines = ( + # steamtypes.h + "STEAM_CLANG_ATTR", + "#define VALVE_BIG_ENDIAN", + + # Multiple + "public:", + "private:", + "protected:", + "_STEAM_CALLBACK_", + "#define STEAM_CALLBACK_BEGIN", + "#define STEAM_CALLBACK_END", + "#define STEAM_CALLBACK_MEMBER", + "STEAM_DEFINE_INTERFACE_ACCESSOR", +) + +g_SkippedStructs = ( + # steamnetworkingtypes.h + "SteamNetworkingIPAddr", + "SteamNetworkingIdentity", + "SteamNetworkingMessage_t", + "SteamNetworkingConfigValue_t", + + # steamdatagram_tickets.h + "SteamDatagramHostedAddress", + "SteamDatagramRelayAuthTicket", + "SteamIDComponent_t" + + # steamclientpublic.h nested struct + "GameID_t" +) + +g_FuncAttribs = ( + "STEAM_METHOD_DESC", + "STEAM_IGNOREATTR", + "STEAM_CALL_RESULT", + "STEAM_CALL_BACK", + "STEAM_FLAT_NAME", +) + +g_ArgAttribs = ( + "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 = ( + 'isteamclient.h', + #'isteamgameserver.h', + #'isteamgameserverstats.h', + 'isteamhttp.h', + 'isteaminventory.h', + 'isteamnetworking.h', + 'isteamnetworkingmessages.h', + 'isteamnetworkingsockets.h', + 'isteamnetworkingutils.h', + 'isteamugc.h', + '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 + 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), + "int8": 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), + + "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), + "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"), + "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 = { + "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 + "SteamIDComponent_t": PrimitiveType("SteamIDComponent_t", 8, 8) +} + + +class Settings: + warn_utf8bom = False + warn_includeguardname = False + warn_spacing = False + print_unuseddefines = False + print_skippedtypedefs = False + fake_gameserver_interfaces = False + print_debug = 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 ArgAttribute: + def __init__(self, name="", value=""): + self.name = name + self.value = value + +class Arg: + 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): + self.name = "" + self.value = "" + +class Function: + def __init__(self): + self.name = "" + self.returntype = "" + self.args: list[Arg] = [] # Arg + self.ifstatements = [] + self.comments = [] + self.linecomment = "" + self.attributes = [] # FunctionAttribute + self.private = False + +class Interface: + def __init__(self): + self.name = "" + self.functions: list[Function] = [] # 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 + # enums' size is always 4(an int) + self.size = 4 + self.pack = 4 + +class Struct: + def __init__(self, name, packsize: int | Literal["PlatformABIDefault"] | None, comments, scopePath): + self.name = name + # keep it to remain compatibility + self.packsize = packsize + self.c = comments # Comment + self.fields: list[StructField] = [] # StructField + self.nested_struct: list[Struct] = [] # nested structs + self.outer_type: Struct | Union | None = None + self.scopeDepth: int = scopePath + self.callbackid: str | None = None + self.endcomments = None # Comment + self.pack = packsize + 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: + 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 + + result = [] + current_offset = 0 + + for field in self.fields: + pack = field.pack or defaultAlign + 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 + + 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) + + # store offset and total size into layout info + result.append(FieldOffset(field.name, current_offset)) + + 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 + + def should_not_generate(self): + 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): + self.name: str = name + self.isUnnamed: bool = isUnnamed + 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_offsets(self, defaultAlign: int): + if not self.fields: + self.size = 1 + 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: + self.size = max_size + (max_pack - remainder) + else: + self.size = max_size + else: + self.size = max_size + + return self.size + +'''Also used in Union''' +class StructField: + def __init__(self, name, typee, arraysize: str | None, comments): + self.name: str = name + self.type = typee + self.arraysizeStr = arraysize + self.arraysize: int | None = None + self.c = comments # Comment + 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): + self.name = name + self.offset = offset + + def __eq__(self, value): + return self.name == value.name and self.offset == value.offset + +class Typedef: + def __init__(self, name, typee, filename, comments, size: int, pack: Optional[int] | None = None): + 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): + self.name = name + self.header = [] + self.includes = [] + 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: + def __init__(self, file): + self.f: SteamFile = file # SteamFile + self.lines = [] + self.line: str = "" + self.originalline = "" + self.linesplit: list[str] = [] + """ + linenum is Zero based + """ + self.linenum = 0 + self.rawcomments = [] + self.comments = [] + self.rawlinecomment = None + self.linecomment = None + self.ifstatements = [] + # packsize stack + self.packsize = [] + self.funcState = 0 + self.scopeDepth = 0 + self.complexTypeStack: list[Literal['union', 'struct', 'enum']] = [] + + 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.callbackmacro = None + + self.bInHeader = True + self.bInMultilineComment = False + self.bInMultilineMacro = False + self.bInPrivate = False + self.isInlineMethodDeclared = False + self.callbackid: str | None = None + self.isClassLikeStruct: bool | None = 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 | 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]: + # 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 + +class Parser: + files = None + typedefs = [] + ignoredStructs: list[Struct] = [] + + 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 + self.files.sort(key=lambda f: f.name) + + self.typedefs:list[Typedef] = [ + ] + + + for f in self.files: + s = ParserState(f) + filepath = os.path.join(folder, f.name) + with open(filepath, 'r', encoding="latin-1") as infile: + 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) + + self.parse(s) + + + self.populate_typedef_layouts() + # 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. + 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) + + self.findout_platform_aware_structs() + + def parse(self, s: ParserState): + 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.visit_union(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) + + 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) + + multipleQuoteblocks = False + if s.line.count("/*") > 1 or s.line.count("*/") > 1: + multipleQuoteblocks = True + + # 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()) + + if multipleQuoteblocks: + self.parse_comments_multiline(s) + + 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 "!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 + + if s.bInMultilineMacro: + s.bInMultilineMacro = False + return True + + for skip in g_SkippedLines: + 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: ParserState): + if not s.line.startswith("#"): + return + + 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 "push" in s.line: + tmpline = s.line[s.line.index(",")+1:-1].strip() + + packsize = None + try: + packsize = int(tmpline) + except ValueError: + pass + + s.packsize.append(packsize) + elif "pop" in s.line: + s.packsize.pop() + 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) + + + def parse_typedefs(self, s: ParserState): + if s.linesplit[0] != "typedef": + return + + comments = 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 + + name = s.linesplit[-1].rstrip(";") + typee = " ".join(s.linesplit[1:-1]) + if name.startswith("*"): + typee += " *" + name = name[1:] + + 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) + + 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"): + return + + if s.scopeDepth > 1: + return + + comments = self.consume_comments(s) + + # 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 + + 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) + + def parse_enums(self, s: ParserState): + 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) + # Don't append unnamed (constant) enums + if s.enum.name is not None: + s.f.enums.append(s.enum) + + s.endComplexType() + 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 + # + # 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 + # Currently only skips one enum in DEFINE_CALLBACK + if s.linesplit[-1] == "\\": + 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) + + 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) + return + + 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 { + k_name1 = value, + k_name2 = value, + };''' + return + + s.beginEnum() + 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 value: + field.prespacing = result.group(2) + field.postspacing = result.group(3) + field.value = value + + field.c = comments + s.enum.fields.append(field) + + def parse_structs(self, s: ParserState): + if s.enum: + return + + 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: + s.struct.callbackid = s.callbackid + s.f.callbacks.append(s.struct) + s.callbackid = None + else: + s.f.structs.append(s.struct) + + s.isClassLikeStruct = None + 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.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) + else: + if s.linesplit[0] != "struct": + return + + if len(s.linesplit) > 1 and s.linesplit[1].startswith("ISteam"): + return + + # Skip Forward Declares + if s.linesplit[1].endswith(";"): + return + + # 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] + + 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() + + if s.linesplit[0] == "class": + s.isClassLikeStruct = True + else: + s.isClassLikeStruct = False + + comments = self.consume_comments(s) + + outerTypeCandidate = s.struct + s.struct = Struct(s.linesplit[1].strip(), s.getCurrentPack(),\ + comments, s.scopeDepth) + s.struct.outer_type = outerTypeCandidate + 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) + + if s.line.startswith("enum"): + return + + if s.line.startswith('friend '): # in classes + return + + if s.line == "{": + 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 + + fieldarraysizeText = None + + result = re.match(r"^([^=.]*\s\**)(\w+);$", line) + if result is 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: + fieldarraysizeText = 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 or '}' in fieldtype\ + or '{' in fieldname or '}' in fieldname: + return + + + 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) + if not result: return + + + mainType = result.group(1).strip() + varNames = result.group(2).split(',') + + for varName in varNames: + try_match(f"{mainType} {varName};", s) + else: + try_match(s.line, s) + + def visit_union(self, s: ParserState): + if s.enum: + return + + 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.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, 1, "")) + + + pass + + def parse_callbackmacros(self, s: ParserState): + if s.callbackmacro: + comments = self.consume_comments(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) + + 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("STEAM_CALLBACK_BEGIN"): + return + + comments = self.consume_comments(s) + + result = re.match("^STEAM_CALLBACK_BEGIN\(\s?(\w+),\s?(.*?)\s*\)", s.line) + + s.callbackmacro = Struct(result.group(1), s.getCurrentPack(), comments, s.scopeDepth) + 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_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("STEAM_PRIVATE_API"): + 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")): + return + + 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 + s.function.private = bInPrivate + 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 + + def parse_classes(self, s: ParserState): + if s.linesplit[0] != "class": + return + + if s.line.startswith("class ISteam"): + return + + self.consume_comments(s) + + 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 + + # 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) + + if not result and '*' in typeName: + return g_PrimitiveTypesLayout["intptr"] + + if not result: + result = g_SpecialStructs.get(typeName) + + if not result: + result = next((typedef for typedef in self.typedefs if typedef.name == typeName), None) + + if not result: + # see enums + 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 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 + + result = next((struct for struct in allstructs 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 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_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): + # 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 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, {}, ) + + struct.calculate_offsets(defaultPack) + + + def findout_platform_aware_structs(self): + self.packSizeAwareStructs: list[str] = [] + self.populate_typedef_layouts() + + for file in self.files: + structs: list[Struct] = [] + structs.extend(file.callbacks) + structs.extend(file.structs) + + for struct in structs: + if struct.is_sequential: + print_debug(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) + sizeLarge = struct.size + + self.populate_struct_field_layout(struct, 4) + offsetsSmallPack: list[FieldOffset] = struct.calculate_offsets(4) + offsetsSmallPack.sort(key = lambda item: item.name) + sizeSmall = struct.size + + if offsetsLargePack != offsetsSmallPack or sizeLarge != sizeSmall: + print_debug(f"Found packsize aware struct '{struct.name}'") + struct.packsize_aware = True + self.packSizeAwareStructs.append(struct.name) + + pass + +def print_debug(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) + + +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) 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) diff --git a/CodeGen/src/interfaces.py b/CodeGen/src/interfaces.py index a007b5d2..d4365962 100644 --- a/CodeGen/src/interfaces.py +++ b/CodeGen/src/interfaces.py @@ -1,7 +1,9 @@ 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 = ( # We don't currently support the following interfaces because they don't provide a factory of their own. @@ -532,38 +534,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 +599,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 +612,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 +627,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 +635,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 +647,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 +688,18 @@ 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, None, parser) + parse_func_native(f, interface, func, strEntryPoint, parsed_args, False, bGameServerVersion, parser) + + generate_wrapper_function(f, interface, func, parsed_args, strEntryPoint, bGameServerVersion, parser) + # Remove last whitespace if not bGameServerVersion: @@ -705,19 +718,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,15 +736,9 @@ 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] - + isPacksizeAware = args[6] + largePackPInvokeArgs = args[9] if not bGameServerVersion: g_NativeMethods.append("\t\t[DllImport(NativeLibraryName, EntryPoint = \"SteamAPI_{0}\", CallingConvention = CallingConvention.Cdecl)]".format(strEntryPoint)) @@ -753,6 +748,48 @@ def parse_func(f, interface, func): g_NativeMethods.append("\t\tpublic static extern {0} {1}({2});".format(returntype, strEntryPoint, pinvokeargs)) 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 + +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, _): + 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] + largePackByrefArgs: list[(str, str, bool)] = args[8] # (typeName, argName, shouldAssignInput) + + strCast = "" + wrapperreturntype = None + 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: @@ -786,36 +823,89 @@ def parse_func(f, interface, func): 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 + + if not isPacksizeAware: + functionBody.append("{0}{1}{2}NativeMethods.{3}({4});".format( + indentlevel, strReturnable, strCast, + invokingNativeFunctionName, argnames)) + else: + b:list[str] = [] + + b.append("#if STEAMWORKS_ANYCPU") + if returntype != "void": + b.append(f"{wrapperreturntype} ret;") + + invocationTemplate = "{0}{1}{2}NativeMethods.{3}({4});" + prebuiltInvocationExpression = invocationTemplate.format( + "", "" if returntype == "void" else "ret = ", strCast, + invokingNativeFunctionName, argnames) + + prebuiltInvocationExpressionLargePack = invocationTemplate.format( + "", "" if returntype == "void" else "ret = ", 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 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 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.append("{0}{1}{2}NativeMethods.{3}({4});".format(indentlevel, strReturnable, strCast, strEntryPoint2, argnames)) + 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: retcmp = "ret != 0" @@ -824,21 +914,31 @@ def parse_func(f, interface, func): 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" 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 returntype != "void": - functionBody.append(indentlevel + "return ret;") if stringargs: functionBody.append("\t\t\t}") + comments = func.comments if func.linecomment: comments.append(func.linecomment) @@ -857,37 +957,65 @@ 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): + # Akarinnnnn: I think we should extract a result class pinvokeargs = "IntPtr instancePtr, " + pinvokeargsLargePack = pinvokeargs wrapperargs = "" - argnames = "" + nativeFunctionArgs = "" + nativeFunctionArgsLargePack = "" stringargs = [] outstringargs = [] outstringsize = [] + isMethodPacksizeAware = False args_with_explicit_count = OrderedDict() + largePackArgMarshalInfo: list[(str, str, bool)] = [] 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 = [] for arg in args: + + #region populate PInvoke params list and wrapper args (both LP and SP) 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) + isThisArgPackAware = potentialtype in parser.packSizeAwareStructs + + isMethodPacksizeAware = True if isThisArgPackAware else isMethodPacksizeAware + + 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: + # add this arg to marshal list + largePackArgMarshalRecord = (potentialtype, arg.name, True) + + + 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) + "[]" + 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 isMethodPacksizeAware: + pInvokeLargePackType = g_TypeDict.get(potentialtype, potentialtype) + "_LargePack[]" if argattribute.name == "STEAM_OUT_ARRAY_COUNT": commaindex = argattribute.value.find(',') @@ -896,22 +1024,37 @@ def parse_args(strEntryPoint, args): 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 :( - 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 + 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 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, " - pinvokeargs += argtype + " " + arg.name + ", " + 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*": @@ -922,28 +1065,45 @@ def parse_args(strEntryPoint, args): 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 " + if isThisArgPackAware: + (t, n, _) = largePackArgMarshalRecord + largePackArgMarshalRecord = (t, n, False) elif wrapperargtype.startswith("ref"): - argnames += "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": - 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) @@ -954,10 +1114,12 @@ def parse_args(strEntryPoint, args): 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) @@ -965,13 +1127,26 @@ def parse_args(strEntryPoint, args): pass else: getNextArgAsStringSize = True + + + + if isThisArgPackAware: + nativeFunctionArgsLargePack += "_lp" + largePackArgMarshalInfo.append(largePackArgMarshalRecord) + + nativeFunctionArgs += ", " + nativeFunctionArgsLargePack += ", " - argnames += ", " pinvokeargs = pinvokeargs.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, + largePackArgMarshalInfo, pinvokeargsLargePack if isMethodPacksizeAware else None) if __name__ == "__main__": diff --git a/CodeGen/src/structs.py b/CodeGen/src/structs.py index 0ab200d0..5653ec72 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 import steamworksparser +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", @@ -65,6 +71,7 @@ g_SequentialStructs = ( "MatchMakingKeyValuePair_t", + "SteamNetConnectionInfo_t" ) g_SpecialFieldTypes = { @@ -95,12 +102,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 +117,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, parser)) for callback in f.callbacks: - callbacklines.extend(parse(callback, True, anyCpuConditionalMarshallerLines)) + 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: @@ -145,105 +154,133 @@ def main(parser): out.write(bytes("#endif // !DISABLESTEAMWORKS\n", "utf-8")) -def parse(struct, isMainStruct, marshalTableLines: list[str]): - if struct.name in g_SkippedStructs: +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 + 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 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 isMainStruct and not struct.is_sequential: + + 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 + ")]") - 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 if isMainStruct: - lines.append("\tpublic struct " + structname + " {") + 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: + 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 + ";") + 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)) + lines.extend(parse_field(field, fieldHandlingStructName, isMainStruct, parser)) + + 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;") + # 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) =>") + 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: + # 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") - 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, parser)) lines.append("\t#endif") @@ -254,14 +291,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): +def parse_field(field: StructField, structname: str, isMainStruct: bool, parser: Parser): 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) @@ -277,30 +314,36 @@ 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: + 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 @@ -321,5 +364,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); + } } } } 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/CodeGen/templates/nativemethods.txt b/CodeGen/templates/nativemethods.txt index 7274efd8..d20ee5e7 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"; @@ -303,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 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..91c08998 100644 --- a/Standalone3.0/ConditionalMarshallerTable.g.cs +++ b/Standalone3.0/ConditionalMarshallerTable.g.cs @@ -30,3695 +30,307 @@ namespace Steamworks { internal static partial class ConditionalMarshallerTable { - static ConditionalMarshallerTable() { - Dictionary> marshallers = new(); + private static partial class Impl { + static Impl() { + - 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); - } - - 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 (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; - } - - return result; - }); - marshallers.Add(typeof(UserStatsUnloaded_t), (unmanaged) => { - UserStatsUnloaded_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(UserAchievementIconFetched_t), (unmanaged) => { - UserAchievementIconFetched_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(GlobalAchievementPercentagesReady_t), (unmanaged) => { - GlobalAchievementPercentagesReady_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(LeaderboardUGCSet_t), (unmanaged) => { - LeaderboardUGCSet_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(GlobalStatsReceived_t), (unmanaged) => { - GlobalStatsReceived_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(IPCountry_t), (unmanaged) => { - IPCountry_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(LowBatteryPower_t), (unmanaged) => { - LowBatteryPower_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(SteamAPICallCompleted_t), (unmanaged) => { - SteamAPICallCompleted_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(SteamShutdown_t), (unmanaged) => { - SteamShutdown_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(CheckFileSignature_t), (unmanaged) => { - CheckFileSignature_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(GamepadTextInputDismissed_t), (unmanaged) => { - GamepadTextInputDismissed_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(AppResumingFromSuspend_t), (unmanaged) => { - AppResumingFromSuspend_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(FloatingGamepadTextInputDismissed_t), (unmanaged) => { - FloatingGamepadTextInputDismissed_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(FilterTextDictionaryChanged_t), (unmanaged) => { - FilterTextDictionaryChanged_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(GetVideoURLResult_t), (unmanaged) => { - GetVideoURLResult_t result = default; - - 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_; - } - - return result; - }); - marshallers.Add(typeof(GetOPFSettingsResult_t), (unmanaged) => { - GetOPFSettingsResult_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(BroadcastUploadStart_t), (unmanaged) => { - BroadcastUploadStart_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(BroadcastUploadStop_t), (unmanaged) => { - BroadcastUploadStop_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(MatchMakingKeyValuePair_t), (unmanaged) => { - MatchMakingKeyValuePair_t result = default; - - 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_; - } - - return result; - }); - marshallers.Add(typeof(CallbackMsg_t), (unmanaged) => { - CallbackMsg_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(SteamNetworkingFakeIPResult_t), (unmanaged) => { - SteamNetworkingFakeIPResult_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(SteamNetConnectionInfo_t), (unmanaged) => { - SteamNetConnectionInfo_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(SteamNetConnectionRealTimeStatus_t), (unmanaged) => { - SteamNetConnectionRealTimeStatus_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(SteamNetConnectionRealTimeLaneStatus_t), (unmanaged) => { - SteamNetConnectionRealTimeLaneStatus_t result = default; - - 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; - } - - return result; - }); - marshallers.Add(typeof(SteamNetworkPingLocation_t), (unmanaged) => { - SteamNetworkPingLocation_t result = default; - - 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; - } - - return result; - }); - s_marshallerLookupTable = FrozenDictionary.ToFrozenDictionary(marshallers); + if (typeof(T) == typeof(FileDetailsResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(FriendsGetFollowerCount_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(FriendsIsFollowing_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(FriendsEnumerateFollowingList_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(EquippedProfileItems_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(GSReputation_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(GSStatsReceived_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(GSStatsStored_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_NeedsPaint_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_StartRequest_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_URLChanged_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_FinishedRequest_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_OpenLinkInNewTab_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_ChangedTitle_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_LinkAtPosition_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_JSAlert_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_JSConfirm_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_FileOpenDialog_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_NewWindow_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_StatusText_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_ShowToolTip_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTML_UpdateToolTip_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTTPRequestCompleted_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTTPRequestHeadersReceived_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(HTTPRequestDataReceived_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(SteamInputConfigurationLoaded_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(SteamInputGamepadSlotChange_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(SteamInventoryEligiblePromoItemDefIDs_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(SteamInventoryStartPurchaseResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(SteamPartyBeaconLocation_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(LobbyCreated_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(SearchForGameProgressCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(SearchForGameResultCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RequestPlayersForGameProgressCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RequestPlayersForGameResultCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RequestPlayersForGameFinalResultCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(SubmitPlayerResultResultCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(EndGameResultCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(JoinPartyCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(CreateBeaconCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(SteamNetConnectionStatusChangedCallback_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageFileShareResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStoragePublishFileResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageDeletePublishedFileResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageEnumerateUserPublishedFilesResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageSubscribePublishedFileResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageUnsubscribePublishedFileResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageUpdatePublishedFileResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageDownloadUGCResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageGetPublishedFileDetailsResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageEnumerateWorkshopFilesResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageGetPublishedItemVoteDetailsResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageUpdateUserPublishedItemVoteResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageUserVoteDetails_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStorageSetUserPublishedFileActionResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoteStoragePublishedFileUpdated_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); + + if (typeof(T) == typeof(CreateItemResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(ItemInstalled_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(DownloadItemResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(AddUGCDependencyResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoveUGCDependencyResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(AddAppDependencyResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(RemoveAppDependencyResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(GetAppDependenciesResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(DeleteItemResult_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(ValidateAuthTicketResponse_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(MicroTxnAuthorizationResponse_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(LeaderboardEntry_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(LeaderboardScoreUploaded_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(LeaderboardUGCSet_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + if (typeof(T) == typeof(SteamNetConnectionInfo_t) && Packsize.IsLargePack) + Impl.Marshaller = (unmanaged) => + System.Runtime.InteropServices.Marshal.PtrToStructure(unmanaged); + + } } } } diff --git a/Standalone3.0/ICallbackIdentity.cs b/Standalone3.0/ICallbackIdentity.cs new file mode 100644 index 00000000..31e520dd --- /dev/null +++ b/Standalone3.0/ICallbackIdentity.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Steamworks +{ + internal interface ICallbackIdentity + { + public static int CallbackIdentity { get; } + } +} diff --git a/com.rlabrecque.steamworks.net/Runtime/CallbackDispatcher.cs b/com.rlabrecque.steamworks.net/Runtime/CallbackDispatcher.cs index ec824ef5..37ae5dda 100644 --- a/com.rlabrecque.steamworks.net/Runtime/CallbackDispatcher.cs +++ b/com.rlabrecque.steamworks.net/Runtime/CallbackDispatcher.cs @@ -323,8 +323,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); } @@ -423,10 +427,10 @@ internal protected override void OnRunCallResult(IntPtr pvParam, bool bFailed, u 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); } 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/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 9f75e84f..abbb66e2 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/NativeMethods.cs @@ -37,6 +37,42 @@ 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"; @@ -303,6 +339,10 @@ internal static class NativeMethods { [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 @@ -1748,6 +1788,12 @@ 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); + #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); @@ -1759,9 +1805,20 @@ internal static class NativeMethods { [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); @@ -1778,6 +1835,12 @@ 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); + + #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)] @@ -2043,6 +2106,11 @@ 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); + + #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)] @@ -2098,6 +2166,12 @@ internal static class NativeMethods { [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); @@ -2673,6 +2747,12 @@ 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); + #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); @@ -3219,6 +3299,12 @@ 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); + #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); diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs index 2dd47fd6..91d998c8 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamCallbacks.cs @@ -21,36 +21,16 @@ 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 { + : 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 } - #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,87 +39,28 @@ 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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamAppsCallbacks + 14; + public static int CallbackIdentity { get; } = Constants.k_iSteamAppsCallbacks + 14; } - #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); } - } - } - + public struct AppProofOfPurchaseKeyResponse_t #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 { + : 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; @@ -152,14 +73,18 @@ 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 struct FileDetailsResult_t + #if STEAMWORKS_ANYCPU + : 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 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] @@ -171,30 +96,32 @@ 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 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(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 +130,13 @@ 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 { + : 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 @@ -242,89 +144,37 @@ 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)] [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 { + : 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 } - #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)] [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 { + : 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 @@ -332,65 +182,19 @@ 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)] [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 { + : ICallbackIdentity + #endif + { 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") @@ -407,60 +211,38 @@ internal struct GameServerChangeRequested_t_SmallPack { } } - #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 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) 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; - } - - - //----------------------------------------------------------------------------- - // 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_SmallPack { - 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; - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: called when an avatar is loaded in from a previous GetLargeFriendAvatar() call - // if the image wasn't already available + // 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)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 34)] - public struct AvatarImageLoaded_t { + 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 @@ -472,47 +254,30 @@ public struct AvatarImageLoaded_t { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [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 { + : 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; } - #endif //----------------------------------------------------------------------------- // Purpose: callback indicating updated data about friends rich presence information //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 36)] - public struct FriendRichPresenceUpdate_t { + 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) } @@ -523,46 +288,13 @@ public struct FriendRichPresenceUpdate_t { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [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 { + : 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) [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchMaxRichPresenceValueLength)] internal byte[] m_rgchConnect_; @@ -573,14 +305,18 @@ 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)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 38)] - public struct GameConnectedClanChatMsg_t { + 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; @@ -591,44 +327,29 @@ public struct GameConnectedClanChatMsg_t { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [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 { + : 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; } - #endif //----------------------------------------------------------------------------- // Purpose: a user has left the chat we're in //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = 1)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 40)] - public struct GameConnectedChatLeave_t { + 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)] @@ -642,44 +363,29 @@ public struct GameConnectedChatLeave_t { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [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 { + : 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; } - #endif //----------------------------------------------------------------------------- // Purpose: a JoinClanChatRoom() call has finished //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 42)] - public struct JoinClanChatRoomCompletionResult_t { + 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; } @@ -689,35 +395,108 @@ public struct JoinClanChatRoomCompletionResult_t { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 43)] - public struct GameConnectedFriendChatMsg_t { + 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 = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 44)] - public struct FriendsGetFollowerCount_t { + 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; } + #if STEAMWORKS_ANYCPU + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 44)] + internal struct FriendsGetFollowerCount_t_LargePack { + public EResult m_eResult; + public CSteamID m_steamID; + public int m_nCount; + + public static implicit operator FriendsGetFollowerCount_t(FriendsGetFollowerCount_t_LargePack value) { + FriendsGetFollowerCount_t result = default; + result.m_eResult = value.m_eResult; + result.m_steamID = value.m_steamID; + result.m_nCount = value.m_nCount; + return result; + } + + public static implicit operator FriendsGetFollowerCount_t_LargePack(FriendsGetFollowerCount_t value) { + FriendsGetFollowerCount_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_steamID = value.m_steamID; + result.m_nCount = value.m_nCount; + return result; + } + } + + #endif [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 45)] - public struct FriendsIsFollowing_t { + 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; + } + + #if STEAMWORKS_ANYCPU + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 45)] + internal struct FriendsIsFollowing_t_LargePack { public EResult m_eResult; public CSteamID m_steamID; [MarshalAs(UnmanagedType.I1)] public bool m_bIsFollowing; + + public static implicit operator FriendsIsFollowing_t(FriendsIsFollowing_t_LargePack value) { + FriendsIsFollowing_t result = default; + result.m_eResult = value.m_eResult; + result.m_steamID = value.m_steamID; + result.m_bIsFollowing = value.m_bIsFollowing; + return result; + } + + public static implicit operator FriendsIsFollowing_t_LargePack(FriendsIsFollowing_t value) { + FriendsIsFollowing_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_steamID = value.m_steamID; + result.m_bIsFollowing = value.m_bIsFollowing; + return result; + } } + #endif [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 46)] - public struct FriendsEnumerateFollowingList_t { + 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; [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cEnumerateFollowersMax)] public CSteamID[] m_rgSteamID; @@ -725,77 +504,62 @@ public struct FriendsEnumerateFollowingList_t { public int m_nTotalResultCount; } - //----------------------------------------------------------------------------- - // Purpose: Invoked when the status of unread messages changes - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 48)] - public struct UnreadChatMessagesChanged_t { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 48; - } - #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; - } + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 46)] + internal struct FriendsEnumerateFollowingList_t_LargePack { + public EResult m_eResult; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cEnumerateFollowersMax)] + public CSteamID[] m_rgSteamID; + public int m_nResultsReturned; + public int m_nTotalResultCount; + + public static implicit operator FriendsEnumerateFollowingList_t(FriendsEnumerateFollowingList_t_LargePack value) { + FriendsEnumerateFollowingList_t result = default; + result.m_eResult = value.m_eResult; + result.m_rgSteamID = value.m_rgSteamID; + result.m_nResultsReturned = value.m_nResultsReturned; + result.m_nTotalResultCount = value.m_nTotalResultCount; + return result; + } + public static implicit operator FriendsEnumerateFollowingList_t_LargePack(FriendsEnumerateFollowingList_t value) { + FriendsEnumerateFollowingList_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_rgSteamID = value.m_rgSteamID; + result.m_nResultsReturned = value.m_nResultsReturned; + result.m_nTotalResultCount = value.m_nTotalResultCount; + return result; + } + } + #endif //----------------------------------------------------------------------------- // 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 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; } - #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); } - } - } - + public struct OverlayBrowserProtocolNavigation_t #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)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 49)] - internal struct OverlayBrowserProtocolNavigation_t_SmallPack { + : ICallbackIdentity + #endif + { 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 @@ -805,47 +569,33 @@ public string rgchURI } } - #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 EquippedProfileItemsChanged_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; - } - - - //----------------------------------------------------------------------------- - // Purpose: A user's equipped profile items have changed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 50)] - internal struct EquippedProfileItemsChanged_t_SmallPack { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 50; + public static int CallbackIdentity { get; } = 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 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)] @@ -866,10 +616,9 @@ public struct EquippedProfileItems_t { //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 51)] internal struct EquippedProfileItems_t_LargePack { - public const int k_iCallback = Constants.k_iSteamFriendsCallbacks + 51; public EResult m_eResult; public CSteamID m_steamID; [MarshalAs(UnmanagedType.I1)] @@ -884,30 +633,32 @@ internal struct EquippedProfileItems_t_LargePack { public bool m_bHasMiniProfileBackground; [MarshalAs(UnmanagedType.I1)] public bool m_bFromCache; - } + public static implicit operator EquippedProfileItems_t(EquippedProfileItems_t_LargePack value) { + EquippedProfileItems_t result = default; + 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; + } - //----------------------------------------------------------------------------- - // Purpose: - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamFriendsCallbacks + 51)] - internal struct EquippedProfileItems_t_SmallPack { - 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 static implicit operator EquippedProfileItems_t_LargePack(EquippedProfileItems_t value) { + EquippedProfileItems_t_LargePack result = default; + 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; + } } #endif @@ -915,94 +666,53 @@ internal struct EquippedProfileItems_t_SmallPack { // 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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamGameCoordinatorCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameCoordinatorCallbacks + 1; 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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamGameCoordinatorCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameCoordinatorCallbacks + 2; } - #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 - } - + public struct GSClientApprove_t #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 { + : 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 } - #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 struct GSClientDeny_t + #if STEAMWORKS_ANYCPU + : 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; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] @@ -1017,8 +727,13 @@ 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 struct GSClientKick_t + #if STEAMWORKS_ANYCPU + : 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; } @@ -1028,48 +743,13 @@ 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 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; - } - + public struct GSClientAchievementStatus_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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 6; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameServerCallbacks + 6; public ulong m_SteamID; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] internal byte[] m_pchAchievement_; @@ -1082,78 +762,46 @@ public string m_pchAchievement public bool m_bUnlocked; } - #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; - } - + public struct GSPolicyResponse_t #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamUserCallbacks + 15; + public static int CallbackIdentity { get; } = 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 { + : 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 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 struct GSClientGroupStatus_t + #if STEAMWORKS_ANYCPU + : 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)] @@ -1165,8 +813,13 @@ 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 struct GSReputation_t + #if STEAMWORKS_ANYCPU + : 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)] @@ -1186,10 +839,9 @@ 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 EResult m_eResult; // Result of the call; public uint m_unReputationScore; // The reputation score for the game server [MarshalAs(UnmanagedType.I1)] @@ -1205,90 +857,56 @@ 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 { + : 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; } - #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; - } - + public struct ComputeNewPlayerCompatibilityResult_t #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 EResult m_eResult; // Result of the call; - public int m_cPlayersThatDontLikeCandidate; - public int m_cPlayersThatCandidateDoesntLike; - public int m_cClanPlayersThatDontLikeCandidate; - 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 { + : 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; @@ -1296,7 +914,6 @@ internal struct ComputeNewPlayerCompatibilityResult_t_SmallPack { public CSteamID m_SteamIDCandidate; } - #endif // callbacks //----------------------------------------------------------------------------- // Purpose: called when the latests stats and achievements have been received @@ -1304,102 +921,131 @@ internal struct ComputeNewPlayerCompatibilityResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamGameServerStatsCallbacks)] - public struct GSStatsReceived_t { + public struct GSStatsReceived_t + #if STEAMWORKS_ANYCPU + : 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 + } + + #if STEAMWORKS_ANYCPU + // callbacks + //----------------------------------------------------------------------------- + // Purpose: called when the latests stats and achievements have been received + // from the server + //----------------------------------------------------------------------------- + [StructLayout(LayoutKind.Sequential, Pack = 8)] + [CallbackIdentity(Constants.k_iSteamGameServerStatsCallbacks)] + internal struct GSStatsReceived_t_LargePack { 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 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 } - //----------------------------------------------------------------------------- - // 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 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 struct GSStatsUnloaded_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 } - #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 { + : 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 } - #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 struct HTML_NeedsPaint_t + #if STEAMWORKS_ANYCPU + : 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 @@ -1418,10 +1064,9 @@ 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 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 +1079,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 +1122,13 @@ internal struct HTML_NeedsPaint_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 3)] - public struct HTML_StartRequest_t { + public struct HTML_StartRequest_t + #if STEAMWORKS_ANYCPU + : 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 ) @@ -1480,33 +1142,35 @@ 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 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 +1179,28 @@ 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; - 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 { + : 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 } - #endif //----------------------------------------------------------------------------- // 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 struct HTML_URLChanged_t + #if STEAMWORKS_ANYCPU + : 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 @@ -1564,10 +1215,9 @@ 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 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 +1226,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 +1256,13 @@ internal struct HTML_URLChanged_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 6)] - public struct HTML_FinishedRequest_t { + public struct HTML_FinishedRequest_t + #if STEAMWORKS_ANYCPU + : 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; // @@ -1613,26 +1272,28 @@ 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 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 +1302,13 @@ internal struct HTML_FinishedRequest_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 7)] - public struct HTML_OpenLinkInNewTab_t { + public struct HTML_OpenLinkInNewTab_t + #if STEAMWORKS_ANYCPU + : 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; // } @@ -1651,24 +1317,25 @@ 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 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 +1344,13 @@ internal struct HTML_OpenLinkInNewTab_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 8)] - public struct HTML_ChangedTitle_t { + public struct HTML_ChangedTitle_t + #if STEAMWORKS_ANYCPU + : 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; // } @@ -1687,24 +1359,25 @@ 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 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 +1386,30 @@ 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 { + : 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; // } - #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 { + : 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; // @@ -1791,14 +1417,18 @@ 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 struct HTML_HorizontalScroll_t + #if STEAMWORKS_ANYCPU + : 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; // @@ -1808,14 +1438,18 @@ public struct HTML_HorizontalScroll_t { public uint unPageSize; // } - #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- - // Purpose: details on the visibility and size of the horizontal scrollbar + // Purpose: details on the visibility and size of the vertical 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; + [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 12)] + public struct HTML_VerticalScroll_t + #if STEAMWORKS_ANYCPU + : 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; // @@ -1825,82 +1459,18 @@ internal struct HTML_HorizontalScroll_t_LargePack { public uint unPageSize; // } - //----------------------------------------------------------------------------- - // Purpose: details on the visibility and size of the horizontal scrollbar + // Purpose: response to GetLinkAtPosition call //----------------------------------------------------------------------------- [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; // - } - - #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; // - } - + [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 13)] + public struct HTML_LinkAtPosition_t #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; // - public float flPageScale; // - [MarshalAs(UnmanagedType.I1)] - public bool bVisible; // - 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 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: 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 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 @@ -1915,10 +1485,9 @@ 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 HHTMLBrowser unBrowserHandle; // the handle of the surface public uint x; // NOTE - Not currently set public uint y; // NOTE - Not currently set @@ -1927,24 +1496,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 +1527,13 @@ internal struct HTML_LinkAtPosition_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 14)] - public struct HTML_JSAlert_t { + public struct HTML_JSAlert_t + #if STEAMWORKS_ANYCPU + : 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; // } @@ -1965,25 +1543,25 @@ 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 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 +1571,13 @@ internal struct HTML_JSAlert_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 15)] - public struct HTML_JSConfirm_t { + public struct HTML_JSConfirm_t + #if STEAMWORKS_ANYCPU + : 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; // } @@ -2004,25 +1587,25 @@ 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 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 +1615,13 @@ internal struct HTML_JSConfirm_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 16)] - public struct HTML_FileOpenDialog_t { + public struct HTML_FileOpenDialog_t + #if STEAMWORKS_ANYCPU + : 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; // @@ -2044,27 +1632,28 @@ 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 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; // + 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 @@ -2079,8 +1668,13 @@ internal struct HTML_FileOpenDialog_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 21)] - public struct HTML_NewWindow_t { + public struct HTML_NewWindow_t + #if STEAMWORKS_ANYCPU + : 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 @@ -2100,10 +1694,9 @@ 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 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 +1704,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 +1736,29 @@ 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 { + : 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 } - #endif //----------------------------------------------------------------------------- // Purpose: informational message from the browser //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 23)] - public struct HTML_StatusText_t { + public struct HTML_StatusText_t + #if STEAMWORKS_ANYCPU + : 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 } @@ -2188,24 +1767,25 @@ 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 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 +1794,13 @@ internal struct HTML_StatusText_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 24)] - public struct HTML_ShowToolTip_t { + public struct HTML_ShowToolTip_t + #if STEAMWORKS_ANYCPU + : 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 } @@ -2224,24 +1809,25 @@ 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 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 +1836,13 @@ internal struct HTML_ShowToolTip_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTMLSurfaceCallbacks + 25)] - public struct HTML_UpdateToolTip_t { + public struct HTML_UpdateToolTip_t + #if STEAMWORKS_ANYCPU + : 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 } @@ -2260,24 +1851,25 @@ 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 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 +1878,42 @@ 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 { + : 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 } - #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 struct HTML_BrowserRestarted_t + #if STEAMWORKS_ANYCPU + : 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 } - #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; - 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 + // callbacks [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamHTTPCallbacks + 1)] - public struct HTTPRequestCompleted_t { + public struct HTTPRequestCompleted_t + #if STEAMWORKS_ANYCPU + : 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; @@ -2377,10 +1936,9 @@ 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; // Handle value for the request that has completed. public HTTPRequestHandle m_hRequest; @@ -2399,39 +1957,38 @@ 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 struct HTTPRequestHeadersReceived_t + #if STEAMWORKS_ANYCPU + : 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; @@ -2442,10 +1999,9 @@ 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; // Handle value for the request that has received headers. public HTTPRequestHandle m_hRequest; @@ -2453,27 +2009,32 @@ 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 struct HTTPRequestDataReceived_t + #if STEAMWORKS_ANYCPU + : 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; @@ -2491,10 +2052,9 @@ 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; // Handle value for the request that has received data. public HTTPRequestHandle m_hRequest; @@ -2509,27 +2069,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 +2096,45 @@ 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 { + : 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 } - #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 { + : 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 } - #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 struct SteamInputConfigurationLoaded_t + #if STEAMWORKS_ANYCPU + : 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 @@ -2631,10 +2153,9 @@ 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 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 +2167,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 +2200,13 @@ internal struct SteamInputConfigurationLoaded_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamControllerCallbacks + 4)] - public struct SteamInputGamepadSlotChange_t { + public struct SteamInputGamepadSlotChange_t + #if STEAMWORKS_ANYCPU + : 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 @@ -2691,31 +2219,34 @@ 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 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 +2255,17 @@ 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 { + : 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; } - #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 +2275,41 @@ 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 { + : 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; } - #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamInventoryCallbacks + 2; } - #endif // Returned [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamInventoryCallbacks + 3)] - public struct SteamInventoryEligiblePromoItemDefIDs_t { + public struct SteamInventoryEligiblePromoItemDefIDs_t + #if STEAMWORKS_ANYCPU + : 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; @@ -2847,36 +2319,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 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 struct SteamInventoryStartPurchaseResult_t + #if STEAMWORKS_ANYCPU + : 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; @@ -2884,64 +2365,41 @@ 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 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 struct SteamInventoryRequestPricesResult_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamInventoryCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamInventoryCallbacks + 5; public EResult m_result; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] internal byte[] m_rgchCurrency_; @@ -2952,7 +2410,6 @@ public string m_rgchCurrency } } - #endif //----------------------------------------------------------------------------- // Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system) //----------------------------------------------------------------------------- @@ -2960,48 +2417,13 @@ 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 { + : 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; @@ -3012,7 +2434,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 +2444,19 @@ 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 { + : 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 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,44 +2464,13 @@ 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 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 struct LobbyEnter_t #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) - //----------------------------------------------------------------------------- - [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; - - 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 - } - - - //----------------------------------------------------------------------------- - // 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 { + : 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 @@ -3123,7 +2479,6 @@ internal struct LobbyEnter_t_SmallPack { 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 @@ -3131,42 +2486,13 @@ internal struct LobbyEnter_t_SmallPack { //----------------------------------------------------------------------------- [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 - } - + public struct LobbyDataUpdate_t #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 { + : 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 @@ -3174,49 +2500,19 @@ internal struct LobbyDataUpdate_t_SmallPack { // 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 //----------------------------------------------------------------------------- [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 { + : 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 @@ -3225,15 +2521,19 @@ 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 struct LobbyChatMsg_t + #if STEAMWORKS_ANYCPU + : 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 @@ -3241,171 +2541,62 @@ public struct LobbyChatMsg_t { public uint m_iChatID; // index of the chat entry to lookup } - #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- - // Purpose: A chat message for this lobby has been sent - // use GetLobbyChatEntry( m_iChatID ) to retrieve the contents of this message + // 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 + 7)] - internal struct LobbyChatMsg_t_LargePack { - public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 7; + [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 9)] + public struct LobbyGameCreated_t + #if STEAMWORKS_ANYCPU + : 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 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 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 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; - - 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 - } - - #endif - //----------------------------------------------------------------------------- - // 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)] - 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; - } - - #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; - - 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; - } - - #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 { + : 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 } - #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 { + : 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) } - #endif //----------------------------------------------------------------------------- // Purpose: Result of our request to create a Lobby // m_eResult == k_EResultOK on success @@ -3414,8 +2605,13 @@ internal struct LobbyKicked_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 13)] - public struct LobbyCreated_t { + public struct LobbyCreated_t + #if STEAMWORKS_ANYCPU + : 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 @@ -3434,10 +2630,9 @@ 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 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 +2642,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,57 +2671,28 @@ 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 EResult m_eResult; - } - + public struct FavoritesListAccountsUpdated_t #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) - //----------------------------------------------------------------------------- - [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; - - public EResult m_eResult; - } - - - // 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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 16; + public static int CallbackIdentity { get; } = 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 struct SearchForGameProgressCallback_t + #if STEAMWORKS_ANYCPU + : 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 @@ -3549,10 +2707,9 @@ public struct SearchForGameProgressCallback_t { #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 ulong m_ullSearchID; // all future callbacks referencing this search will include this Search ID @@ -3562,32 +2719,41 @@ 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 struct SearchForGameResultCallback_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamGameSearchCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamGameSearchCallbacks + 2; public ulong m_ullSearchID; @@ -3604,10 +2770,9 @@ 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 ulong m_ullSearchID; @@ -3620,26 +2785,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 +2816,13 @@ 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 struct RequestPlayersForGameProgressCallback_t + #if STEAMWORKS_ANYCPU + : 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 @@ -3661,27 +2833,26 @@ 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 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 +2861,65 @@ 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 struct RequestPlayersForGameResultCallback_t + #if STEAMWORKS_ANYCPU + : 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; 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 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; + } + + 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; + } + } - // 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; - } - - #endif + #endif + // expect this many callbacks at minimum [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamGameSearchCallbacks + 13)] - public struct RequestPlayersForGameFinalResultCallback_t { + public struct RequestPlayersForGameFinalResultCallback_t + #if STEAMWORKS_ANYCPU + : 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; @@ -3762,33 +2927,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 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 struct SubmitPlayerResultResultCallback_t + #if STEAMWORKS_ANYCPU + : 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; @@ -3797,26 +2972,29 @@ 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 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 +3002,13 @@ 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 struct EndGameResultCallback_t + #if STEAMWORKS_ANYCPU + : 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; @@ -3834,25 +3017,26 @@ 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 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,8 +3045,13 @@ 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 struct JoinPartyCallback_t + #if STEAMWORKS_ANYCPU + : 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; @@ -3880,10 +3069,9 @@ public string m_rgchConnectString // 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 EResult m_eResult; public PartyBeaconID_t m_ulBeaconID; @@ -3895,26 +3083,23 @@ 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_; + 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 +3107,13 @@ 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 struct CreateBeaconCallback_t + #if STEAMWORKS_ANYCPU + : 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; @@ -3931,24 +3121,26 @@ 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 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,529 +3150,270 @@ 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 { + : 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; } - #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamPartiesCallbacks + 4; 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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamPartiesCallbacks + 5; } - #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; - } - + public struct ActiveBeaconsUpdated_t #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamPartiesCallbacks + 6; + public static int CallbackIdentity { get; } = Constants.k_iSteamPartiesCallbacks + 6; } - #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 - // 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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicCallbacks + 1; } - #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; - } - + public struct VolumeHasChanged_t #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 2; + public static int CallbackIdentity { get; } = 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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 1; } - #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; - } - + public struct MusicPlayerRemoteWillDeactivate_t #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 2; + public static int CallbackIdentity { get; } = 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 MusicPlayerRemoteToFront_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; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 3)] - internal struct MusicPlayerRemoteToFront_t_SmallPack { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 3; + public static int CallbackIdentity { get; } = 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 MusicPlayerWillQuit_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; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 4)] - internal struct MusicPlayerWillQuit_t_SmallPack { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 4; } - #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 5)] - public struct MusicPlayerWantsPlay_t { + public struct MusicPlayerWantsPlay_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 5; } - #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; - } - - - [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 MusicPlayerWantsPause_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; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 6)] - internal struct MusicPlayerWantsPause_t_SmallPack { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 6; + public static int CallbackIdentity { get; } = 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 MusicPlayerWantsPlayPrevious_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; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 7)] - internal struct MusicPlayerWantsPlayPrevious_t_SmallPack { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 7; + public static int CallbackIdentity { get; } = 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 MusicPlayerWantsPlayNext_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; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 8)] - internal struct MusicPlayerWantsPlayNext_t_SmallPack { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 8; + public static int CallbackIdentity { get; } = 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 MusicPlayerWantsShuffled_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; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamMusicRemoteCallbacks + 9)] - internal struct MusicPlayerWantsShuffled_t_SmallPack { + : 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; } - #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 { + : 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; } - #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 11; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicCallbacks + 11; 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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 12; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicCallbacks + 12; public int nID; } - #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; - } - + public struct MusicPlayerSelectsPlaylistEntry_t #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicCallbacks + 13; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicCallbacks + 13; 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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamMusicRemoteCallbacks + 14; + public static int CallbackIdentity { get; } = Constants.k_iSteamMusicRemoteCallbacks + 14; 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)] [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 { + : 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 } - #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)] [CallbackIdentity(Constants.k_iSteamNetworkingCallbacks + 3)] - public struct P2PSessionConnectFail_t { + 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 } @@ -4489,8 +3422,13 @@ public struct P2PSessionConnectFail_t { // used as part of the CreateListenSocket() / CreateP2PConnectionSocket() [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(Constants.k_iSteamNetworkingCallbacks + 1)] - public struct SocketStatusCallback_t { + 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 @@ -4503,36 +3441,16 @@ public struct SocketStatusCallback_t { /// 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)] - 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 { + : 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 } - #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 @@ -4546,54 +3464,13 @@ internal struct SteamNetworkingMessagesSessionRequest_t_SmallPack { /// none, connecting, and findingroute again. [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamNetworkingMessagesCallbacks + 2)] - public struct SteamNetworkingMessagesSessionFailed_t { - 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; - } - + public struct SteamNetworkingMessagesSessionFailed_t #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 { + : 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 @@ -4601,7 +3478,6 @@ internal struct SteamNetworkingMessagesSessionFailed_t_SmallPack { 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 +3516,13 @@ 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 struct SteamNetConnectionStatusChangedCallback_t + #if STEAMWORKS_ANYCPU + : 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; @@ -4690,76 +3571,39 @@ 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; /// Connection handle 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; - } + 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; + } - /// 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: + 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: /// /// - The list of trusted CA certificates that might be relevant for this /// app. @@ -4768,64 +3612,13 @@ internal struct SteamNetConnectionStatusChangedCallback_t_SmallPack { /// 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 struct SteamNetAuthenticationStatus_t #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); } - } - } - - - /// 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_SmallPack { + : 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; @@ -4841,99 +3634,18 @@ public string m_debugMsg } } - #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); } - } - } - - #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; - - /// 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); } - } - } - - /// 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 struct SteamRelayNetworkStatus_t + #if STEAMWORKS_ANYCPU + : 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 @@ -4969,105 +3681,54 @@ public string m_debugMsg } } - #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; - } - - //----------------------------------------------------------------------------- // Purpose: Callback for querying UGC //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] [CallbackIdentity(Constants.k_ISteamParentalSettingsCallbacks + 1)] - internal struct SteamParentalSettingsChanged_t_SmallPack { + public struct SteamParentalSettingsChanged_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_ISteamParentalSettingsCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_ISteamParentalSettingsCallbacks + 1; } - #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; - } - + public struct SteamRemotePlaySessionConnected_t #if STEAMWORKS_ANYCPU - // callbacks - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 1)] - internal struct SteamRemotePlaySessionConnected_t_LargePack { - public const int k_iCallback = Constants.k_iSteamRemotePlayCallbacks + 1; - public RemotePlaySessionID_t m_unSessionID; - } - - - // callbacks - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 1)] - internal struct SteamRemotePlaySessionConnected_t_SmallPack { + : 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; } - #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 struct SteamRemotePlaySessionDisconnected_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; - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 2)] - internal struct SteamRemotePlaySessionDisconnected_t_SmallPack { + : 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; } - #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); } - } - } - + public struct SteamRemotePlayTogetherGuestInvite_t #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemotePlayCallbacks + 3)] - internal struct SteamRemotePlayTogetherGuestInvite_t_LargePack { + : ICallbackIdentity + #endif + { 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 @@ -5077,29 +3738,19 @@ public string m_szConnectURL } } - - [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 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 [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchFilenameMax)] @@ -5116,10 +3767,9 @@ public string m_rgchFilename // The name of the file that was shared //----------------------------------------------------------------------------- // Purpose: The result of a call to FileShare() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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)] @@ -5129,25 +3779,21 @@ 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); } } - } + public static implicit operator RemoteStorageFileShareResult_t(RemoteStorageFileShareResult_t_LargePack value) { + RemoteStorageFileShareResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_hFile = value.m_hFile; + result.m_rgchFilename_ = value.m_rgchFilename_; + return result; + } - // 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); } + public static implicit operator RemoteStorageFileShareResult_t_LargePack(RemoteStorageFileShareResult_t value) { + RemoteStorageFileShareResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_hFile = value.m_hFile; + result.m_rgchFilename_ = value.m_rgchFilename_; + return result; } } @@ -5158,8 +3804,13 @@ public string m_rgchFilename // The name of the file that was shared //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 9)] - public struct RemoteStoragePublishFileResult_t { + 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)] @@ -5171,29 +3822,29 @@ public struct RemoteStoragePublishFileResult_t { //----------------------------------------------------------------------------- // Purpose: The result of a call to PublishFile() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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; - } + public static implicit operator RemoteStoragePublishFileResult_t(RemoteStoragePublishFileResult_t_LargePack value) { + RemoteStoragePublishFileResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_bUserNeedsToAcceptWorkshopLegalAgreement = value.m_bUserNeedsToAcceptWorkshopLegalAgreement; + return result; + } - // 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; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; - [MarshalAs(UnmanagedType.I1)] - public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; + public static implicit operator RemoteStoragePublishFileResult_t_LargePack(RemoteStoragePublishFileResult_t value) { + RemoteStoragePublishFileResult_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 @@ -5203,8 +3854,13 @@ internal struct RemoteStoragePublishFileResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 11)] - public struct RemoteStorageDeletePublishedFileResult_t { + 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; } @@ -5214,25 +3870,25 @@ public struct RemoteStorageDeletePublishedFileResult_t { //----------------------------------------------------------------------------- // Purpose: The result of a call to DeletePublishedFile() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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; - } + public static implicit operator RemoteStorageDeletePublishedFileResult_t(RemoteStorageDeletePublishedFileResult_t_LargePack value) { + RemoteStorageDeletePublishedFileResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + return result; + } - // 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; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; + public static implicit operator RemoteStorageDeletePublishedFileResult_t_LargePack(RemoteStorageDeletePublishedFileResult_t value) { + RemoteStorageDeletePublishedFileResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + return result; + } } #endif @@ -5241,8 +3897,13 @@ internal struct RemoteStorageDeletePublishedFileResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 12)] - public struct RemoteStorageEnumerateUserPublishedFilesResult_t { + 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; @@ -5254,30 +3915,32 @@ public struct RemoteStorageEnumerateUserPublishedFilesResult_t { //----------------------------------------------------------------------------- // Purpose: The result of a call to EnumerateUserPublishedFiles() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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; - } + public static implicit operator RemoteStorageEnumerateUserPublishedFilesResult_t(RemoteStorageEnumerateUserPublishedFilesResult_t_LargePack value) { + RemoteStorageEnumerateUserPublishedFilesResult_t result = default; + 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; + } - //----------------------------------------------------------------------------- - // 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; - 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 static implicit operator RemoteStorageEnumerateUserPublishedFilesResult_t_LargePack(RemoteStorageEnumerateUserPublishedFilesResult_t value) { + RemoteStorageEnumerateUserPublishedFilesResult_t_LargePack result = default; + 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; + } } #endif @@ -5286,8 +3949,13 @@ internal struct RemoteStorageEnumerateUserPublishedFilesResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 13)] - public struct RemoteStorageSubscribePublishedFileResult_t { + 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; } @@ -5296,24 +3964,25 @@ public struct RemoteStorageSubscribePublishedFileResult_t { //----------------------------------------------------------------------------- // Purpose: The result of a call to SubscribePublishedFile() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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; - } + public static implicit operator RemoteStorageSubscribePublishedFileResult_t(RemoteStorageSubscribePublishedFileResult_t_LargePack value) { + RemoteStorageSubscribePublishedFileResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + return result; + } - //----------------------------------------------------------------------------- - // 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; - public EResult m_eResult; // The result of the operation. - public PublishedFileId_t m_nPublishedFileId; + public static implicit operator RemoteStorageSubscribePublishedFileResult_t_LargePack(RemoteStorageSubscribePublishedFileResult_t value) { + RemoteStorageSubscribePublishedFileResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + return result; + } } #endif @@ -5322,8 +3991,13 @@ internal struct RemoteStorageSubscribePublishedFileResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 14)] - public struct RemoteStorageEnumerateUserSubscribedFilesResult_t { + 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; @@ -5337,10 +4011,9 @@ public struct RemoteStorageEnumerateUserSubscribedFilesResult_t { //----------------------------------------------------------------------------- // Purpose: The result of a call to EnumerateSubscribePublishedFiles() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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; @@ -5348,23 +4021,26 @@ internal struct RemoteStorageEnumerateUserSubscribedFilesResult_t_LargePack { public PublishedFileId_t[] m_rgPublishedFileId; [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_unEnumeratePublishedFilesMaxResults)] public uint[] m_rgRTimeSubscribed; - } + public static implicit operator RemoteStorageEnumerateUserSubscribedFilesResult_t(RemoteStorageEnumerateUserSubscribedFilesResult_t_LargePack value) { + RemoteStorageEnumerateUserSubscribedFilesResult_t result = default; + 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; + } - //----------------------------------------------------------------------------- - // 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; - 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 static implicit operator RemoteStorageEnumerateUserSubscribedFilesResult_t_LargePack(RemoteStorageEnumerateUserSubscribedFilesResult_t value) { + RemoteStorageEnumerateUserSubscribedFilesResult_t_LargePack result = default; + 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; + } } #endif @@ -5373,8 +4049,13 @@ internal struct RemoteStorageEnumerateUserSubscribedFilesResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 15)] - public struct RemoteStorageUnsubscribePublishedFileResult_t { + 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; } @@ -5383,24 +4064,25 @@ public struct RemoteStorageUnsubscribePublishedFileResult_t { //----------------------------------------------------------------------------- // Purpose: The result of a call to UnsubscribePublishedFile() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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; - } + public static implicit operator RemoteStorageUnsubscribePublishedFileResult_t(RemoteStorageUnsubscribePublishedFileResult_t_LargePack value) { + RemoteStorageUnsubscribePublishedFileResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + return result; + } - //----------------------------------------------------------------------------- - // 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; + public static implicit operator RemoteStorageUnsubscribePublishedFileResult_t_LargePack(RemoteStorageUnsubscribePublishedFileResult_t value) { + RemoteStorageUnsubscribePublishedFileResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + return result; + } } #endif @@ -5409,8 +4091,13 @@ internal struct RemoteStorageUnsubscribePublishedFileResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 16)] - public struct RemoteStorageUpdatePublishedFileResult_t { + 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)] @@ -5421,28 +4108,29 @@ public struct RemoteStorageUpdatePublishedFileResult_t { //----------------------------------------------------------------------------- // 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_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; - } + public static implicit operator RemoteStorageUpdatePublishedFileResult_t(RemoteStorageUpdatePublishedFileResult_t_LargePack value) { + RemoteStorageUpdatePublishedFileResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_bUserNeedsToAcceptWorkshopLegalAgreement = value.m_bUserNeedsToAcceptWorkshopLegalAgreement; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: The result of a call to CommitPublishedFileUpdate() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 16)] - internal struct RemoteStorageUpdatePublishedFileResult_t_SmallPack { - 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; + public static implicit operator RemoteStorageUpdatePublishedFileResult_t_LargePack(RemoteStorageUpdatePublishedFileResult_t value) { + RemoteStorageUpdatePublishedFileResult_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 @@ -5451,8 +4139,13 @@ internal struct RemoteStorageUpdatePublishedFileResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 17)] - public struct RemoteStorageDownloadUGCResult_t { + 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. @@ -5471,10 +4164,9 @@ public string m_pchFileName // The name of the file that was downloaded. //----------------------------------------------------------------------------- // Purpose: The result of a call to UGCDownload() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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. @@ -5487,28 +4179,28 @@ public string m_pchFileName // The name of the file that was downloaded. set { InteropHelp.StringToByteArrayUTF8(value, m_pchFileName_, Constants.k_cchFilenameMax); } } public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. - } + public static implicit operator RemoteStorageDownloadUGCResult_t(RemoteStorageDownloadUGCResult_t_LargePack value) { + RemoteStorageDownloadUGCResult_t result = default; + 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; + } - //----------------------------------------------------------------------------- - // 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; - 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 static implicit operator RemoteStorageDownloadUGCResult_t_LargePack(RemoteStorageDownloadUGCResult_t value) { + RemoteStorageDownloadUGCResult_t_LargePack result = default; + 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; } - public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content. } #endif @@ -5517,8 +4209,13 @@ public string m_pchFileName // The name of the file that was downloaded. //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 18)] - public struct RemoteStorageGetPublishedFileDetailsResult_t { + 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. @@ -5579,10 +4276,9 @@ public string m_pchFileName // The name of the primary file //----------------------------------------------------------------------------- // Purpose: The result of a call to GetPublishedFileDetails() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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. @@ -5637,77 +4333,70 @@ public string m_pchFileName // The name of the primary file 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; - 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 static implicit operator RemoteStorageGetPublishedFileDetailsResult_t(RemoteStorageGetPublishedFileDetailsResult_t_LargePack value) { + RemoteStorageGetPublishedFileDetailsResult_t result = default; + 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; } - 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 static implicit operator RemoteStorageGetPublishedFileDetailsResult_t_LargePack(RemoteStorageGetPublishedFileDetailsResult_t value) { + RemoteStorageGetPublishedFileDetailsResult_t_LargePack result = default; + 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; } - 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)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 19)] - public struct RemoteStorageEnumerateWorkshopFilesResult_t { + 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; @@ -5720,10 +4409,9 @@ public struct RemoteStorageEnumerateWorkshopFilesResult_t { } #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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; @@ -5733,32 +4421,45 @@ internal struct RemoteStorageEnumerateWorkshopFilesResult_t_LargePack { public float[] m_rgScore; public AppId_t m_nAppId; public uint m_unStartIndex; - } + public static implicit operator RemoteStorageEnumerateWorkshopFilesResult_t(RemoteStorageEnumerateWorkshopFilesResult_t_LargePack value) { + RemoteStorageEnumerateWorkshopFilesResult_t result = default; + 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; + } + + public static implicit operator RemoteStorageEnumerateWorkshopFilesResult_t_LargePack(RemoteStorageEnumerateWorkshopFilesResult_t value) { + RemoteStorageEnumerateWorkshopFilesResult_t_LargePack result = default; + 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; + } + } - [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; - 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; - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: The result of GetPublishedItemVoteDetails - //----------------------------------------------------------------------------- + #endif + //----------------------------------------------------------------------------- + // Purpose: The result of GetPublishedItemVoteDetails + //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 20)] - public struct RemoteStorageGetPublishedItemVoteDetailsResult_t { + 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; @@ -5771,32 +4472,37 @@ public struct RemoteStorageGetPublishedItemVoteDetailsResult_t { //----------------------------------------------------------------------------- // Purpose: The result of GetPublishedItemVoteDetails //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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; - } + public static implicit operator RemoteStorageGetPublishedItemVoteDetailsResult_t(RemoteStorageGetPublishedItemVoteDetailsResult_t_LargePack value) { + RemoteStorageGetPublishedItemVoteDetailsResult_t result = default; + 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; + } - //----------------------------------------------------------------------------- - // 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; - 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 static implicit operator RemoteStorageGetPublishedItemVoteDetailsResult_t_LargePack(RemoteStorageGetPublishedItemVoteDetailsResult_t value) { + RemoteStorageGetPublishedItemVoteDetailsResult_t_LargePack result = default; + 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; + } } #endif @@ -5805,116 +4511,61 @@ internal struct RemoteStorageGetPublishedItemVoteDetailsResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [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 { + : 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. } - #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. - } - + public struct RemoteStoragePublishedFileUnsubscribed_t #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 { + : 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. } - #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. - } - + public struct RemoteStoragePublishedFileDeleted_t #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 { + : 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. } - #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 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 } @@ -5923,24 +4574,25 @@ public struct RemoteStorageUpdateUserPublishedItemVoteResult_t { //----------------------------------------------------------------------------- // Purpose: The result of a call to UpdateUserPublishedItemVote() //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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. public PublishedFileId_t m_nPublishedFileId; // The published file id - } + public static implicit operator RemoteStorageUpdateUserPublishedItemVoteResult_t(RemoteStorageUpdateUserPublishedItemVoteResult_t_LargePack value) { + RemoteStorageUpdateUserPublishedItemVoteResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: The result of a call to UpdateUserPublishedItemVote() - //----------------------------------------------------------------------------- - [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. - public PublishedFileId_t m_nPublishedFileId; // The published file id + public static implicit operator RemoteStorageUpdateUserPublishedItemVoteResult_t_LargePack(RemoteStorageUpdateUserPublishedItemVoteResult_t value) { + RemoteStorageUpdateUserPublishedItemVoteResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + return result; + } } #endif @@ -5949,8 +4601,13 @@ internal struct RemoteStorageUpdateUserPublishedItemVoteResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 25)] - public struct RemoteStorageUserVoteDetails_t { + 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 @@ -5960,33 +4617,40 @@ public struct RemoteStorageUserVoteDetails_t { //----------------------------------------------------------------------------- // 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_LargePack { - public const int k_iCallback = 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 - } + public static implicit operator RemoteStorageUserVoteDetails_t(RemoteStorageUserVoteDetails_t_LargePack value) { + RemoteStorageUserVoteDetails_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_eVote = value.m_eVote; + return result; + } - //----------------------------------------------------------------------------- - // Purpose: The result of a call to GetUserPublishedItemVoteDetails() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 25)] - internal struct RemoteStorageUserVoteDetails_t_SmallPack { - public const int k_iCallback = 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 + public static implicit operator RemoteStorageUserVoteDetails_t_LargePack(RemoteStorageUserVoteDetails_t value) { + RemoteStorageUserVoteDetails_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_eVote = value.m_eVote; + return result; + } } #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 26)] - public struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t { + 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; @@ -5995,94 +4659,84 @@ public struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t { } #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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; - } + public static implicit operator RemoteStorageEnumerateUserSharedWorkshopFilesResult_t(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t_LargePack value) { + RemoteStorageEnumerateUserSharedWorkshopFilesResult_t result = default; + 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; + } - [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; - 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 static implicit operator RemoteStorageEnumerateUserSharedWorkshopFilesResult_t_LargePack(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t value) { + RemoteStorageEnumerateUserSharedWorkshopFilesResult_t_LargePack result = default; + 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; + } } #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 27)] - public struct RemoteStorageSetUserPublishedFileActionResult_t { + 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 } #if STEAMWORKS_ANYCPU - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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 - } + public static implicit operator RemoteStorageSetUserPublishedFileActionResult_t(RemoteStorageSetUserPublishedFileActionResult_t_LargePack value) { + RemoteStorageSetUserPublishedFileActionResult_t result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_eAction = value.m_eAction; + return result; + } - [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; - 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 static implicit operator RemoteStorageSetUserPublishedFileActionResult_t_LargePack(RemoteStorageSetUserPublishedFileActionResult_t value) { + RemoteStorageSetUserPublishedFileActionResult_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_eAction = value.m_eAction; + return result; + } } #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [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 { + : 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; @@ -6093,53 +4747,35 @@ internal struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t_SmallPa public uint[] m_rgRTimeUpdated; } - #endif //----------------------------------------------------------------------------- // Purpose: Called periodically while a PublishWorkshopFile is in progress //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [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 { + : 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; } - #endif //----------------------------------------------------------------------------- // Purpose: Called when the content for a published file is updated //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 30)] - public struct RemoteStoragePublishedFileUpdated_t { + 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 @@ -6149,26 +4785,28 @@ public struct RemoteStoragePublishedFileUpdated_t { //----------------------------------------------------------------------------- // 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)] 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 - } + public static implicit operator RemoteStoragePublishedFileUpdated_t(RemoteStoragePublishedFileUpdated_t_LargePack value) { + RemoteStoragePublishedFileUpdated_t result = default; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_nAppID = value.m_nAppID; + result.m_ulUnused = value.m_ulUnused; + return result; + } - //----------------------------------------------------------------------------- - // 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; - 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 static implicit operator RemoteStoragePublishedFileUpdated_t_LargePack(RemoteStoragePublishedFileUpdated_t value) { + RemoteStoragePublishedFileUpdated_t_LargePack result = default; + result.m_nPublishedFileId = value.m_nPublishedFileId; + result.m_nAppID = value.m_nAppID; + result.m_ulUnused = value.m_ulUnused; + return result; + } } #endif @@ -6177,76 +4815,34 @@ internal struct RemoteStoragePublishedFileUpdated_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [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 { + : 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 } - #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 - } - + public struct RemoteStorageFileReadAsyncComplete_t #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)] - [CallbackIdentity(Constants.k_iSteamRemoteStorageCallbacks + 32)] - internal struct RemoteStorageFileReadAsyncComplete_t_SmallPack { + : 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 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 @@ -6254,35 +4850,15 @@ internal struct RemoteStorageFileReadAsyncComplete_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, 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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamRemoteStorageCallbacks + 33; + public static int CallbackIdentity { get; } = Constants.k_iSteamRemoteStorageCallbacks + 33; } - #endif // callbacks //----------------------------------------------------------------------------- // Purpose: Screenshot successfully written or otherwise added to the library @@ -6290,41 +4866,17 @@ internal struct RemoteStorageLocalFileChange_t_SmallPack { //----------------------------------------------------------------------------- [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; - } - + public struct ScreenshotReady_t #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 { + : 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; } - - // 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 @@ -6332,84 +4884,27 @@ internal struct ScreenshotReady_t_SmallPack { //----------------------------------------------------------------------------- [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; - } - + public struct ScreenshotRequested_t #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; - } - - - //----------------------------------------------------------------------------- - // 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_SmallPack { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamScreenshotsCallbacks + 2; + public static int CallbackIdentity { get; } = Constants.k_iSteamScreenshotsCallbacks + 2; } - #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 ulong m_ulRecordingMS; - public ulong m_ulLongestClipMS; - public uint m_unClipCount; - public uint m_unScreenshotCount; - } - + public struct SteamTimelineGamePhaseRecordingExists_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: Callback for querying UGC - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [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 ulong m_ulRecordingMS; - public ulong m_ulLongestClipMS; - public uint m_unClipCount; - public uint m_unScreenshotCount; - } - - - //----------------------------------------------------------------------------- - // Purpose: Callback for querying UGC - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamTimelineCallbacks + 1)] - internal struct SteamTimelineGamePhaseRecordingExists_t_SmallPack { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamTimelineCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamTimelineCallbacks + 1; [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchMaxPhaseIDLength)] internal byte[] m_rgchPhaseID_; public string m_rgchPhaseID @@ -6423,161 +4918,79 @@ public string m_rgchPhaseID public uint m_unScreenshotCount; } - #endif //----------------------------------------------------------------------------- // Purpose: Callback for querying UGC //----------------------------------------------------------------------------- [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 { + : 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; } - #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); } - } - } - - #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; - 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); } - } - } - - #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 - } - - #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; + public struct SteamUGCQueryCompleted_t + #if STEAMWORKS_ANYCPU + : 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 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 requesting details on one piece of UGC //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 2)] - internal struct SteamUGCRequestUGCDetailsResult_t_SmallPack { + public struct SteamUGCRequestUGCDetailsResult_t + #if STEAMWORKS_ANYCPU + : 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 } - #endif //----------------------------------------------------------------------------- // Purpose: result for ISteamUGC::CreateItem() //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 3)] - public struct CreateItemResult_t { + public struct CreateItemResult_t + #if STEAMWORKS_ANYCPU + : 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)] @@ -6588,28 +5001,29 @@ 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 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 +5032,31 @@ 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 { + : 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; 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 struct ItemInstalled_t + #if STEAMWORKS_ANYCPU + : 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; @@ -6672,28 +5067,31 @@ 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 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,8 +5100,13 @@ internal struct ItemInstalled_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 6)] - public struct DownloadItemResult_t { + public struct DownloadItemResult_t + #if STEAMWORKS_ANYCPU + : 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; @@ -6713,26 +5116,28 @@ public struct DownloadItemResult_t { //----------------------------------------------------------------------------- // Purpose: result of DownloadItem(), existing item files can be accessed again //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [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 AppId_t m_unAppID; public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; - } + 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; + } - //----------------------------------------------------------------------------- - // 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; + 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 @@ -6741,128 +5146,49 @@ internal struct DownloadItemResult_t_SmallPack { //----------------------------------------------------------------------------- [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 UserFavoriteItemsListChanged_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 { + : 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)] public bool m_bWasAddRequest; } - #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 PublishedFileId_t m_nPublishedFileId; - public EResult m_eResult; - [MarshalAs(UnmanagedType.I1)] - public bool m_bVoteUp; - } - + public struct SetUserItemVoteResult_t #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() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 8)] - internal struct SetUserItemVoteResult_t_SmallPack { + : 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)] public bool m_bVoteUp; } - #endif //----------------------------------------------------------------------------- // Purpose: The result of a call to GetUserItemVote() //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 9)] - public struct GetUserItemVoteResult_t { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 9; - 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 struct GetUserItemVoteResult_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The result of a call to GetUserItemVote() - //----------------------------------------------------------------------------- - [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; - 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; - } - - - //----------------------------------------------------------------------------- - // Purpose: The result of a call to GetUserItemVote() - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 9)] - internal struct GetUserItemVoteResult_t_SmallPack { + : 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)] @@ -6873,80 +5199,48 @@ 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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 10; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 10; public EResult m_eResult; } - #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; - } - + public struct StopPlaytimeTrackingResult_t #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 11; + public static int CallbackIdentity { get; } = Constants.k_iSteamUGCCallbacks + 11; 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 struct AddUGCDependencyResult_t + #if STEAMWORKS_ANYCPU + : 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; @@ -6956,26 +5250,28 @@ 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 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,37 +5280,44 @@ 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 EResult m_eResult; - public PublishedFileId_t m_nPublishedFileId; - public PublishedFileId_t m_nChildPublishedFileId; - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: The result of a call to RemoveDependency - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 13)] - internal struct RemoveUGCDependencyResult_t_LargePack { + public struct RemoveUGCDependencyResult_t + #if STEAMWORKS_ANYCPU + : 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; } - + #if STEAMWORKS_ANYCPU //----------------------------------------------------------------------------- // 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_SmallPack { - public const int k_iCallback = Constants.k_iSteamUGCCallbacks + 13; + internal struct RemoveUGCDependencyResult_t_LargePack { 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; + } + + 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 +5326,13 @@ internal struct RemoveUGCDependencyResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 14)] - public struct AddAppDependencyResult_t { + public struct AddAppDependencyResult_t + #if STEAMWORKS_ANYCPU + : 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; @@ -7034,26 +5342,28 @@ 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 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 +5372,13 @@ internal struct AddAppDependencyResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 15)] - public struct RemoveAppDependencyResult_t { + public struct RemoveAppDependencyResult_t + #if STEAMWORKS_ANYCPU + : 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; @@ -7073,26 +5388,28 @@ 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 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,8 +5419,13 @@ internal struct RemoveAppDependencyResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 16)] - public struct GetAppDependenciesResult_t { + public struct GetAppDependenciesResult_t + #if STEAMWORKS_ANYCPU + : 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; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] @@ -7117,33 +5439,35 @@ 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 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(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 +5476,13 @@ internal struct GetAppDependenciesResult_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUGCCallbacks + 17)] - public struct DeleteItemResult_t { + public struct DeleteItemResult_t + #if STEAMWORKS_ANYCPU + : 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; } @@ -7162,24 +5491,25 @@ 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 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,77 +5518,28 @@ 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 { + : 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; } - #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; - } - + public struct WorkshopEULAStatus_t #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 { + : 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; @@ -7269,37 +5550,6 @@ internal struct WorkshopEULAStatus_t_SmallPack { 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; - } - - // callbacks //----------------------------------------------------------------------------- // Purpose: Called when an authenticated connection to the Steam back-end has been established. @@ -7310,129 +5560,49 @@ 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; - } - - #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; - } - - - //----------------------------------------------------------------------------- - // 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_SmallPack { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 2; - 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 SteamServersConnected_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; - public EResult m_eResult; - } - + : ICallbackIdentity #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. - // 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)] - 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 const int k_iCallback = Constants.k_iSteamUserCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 1; } - #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. + // 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 + 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; + [CallbackIdentity(Constants.k_iSteamUserCallbacks + 2)] + public struct SteamServerConnectFailure_t + #if STEAMWORKS_ANYCPU + : 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; } + //----------------------------------------------------------------------------- + // 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 + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + public const int k_iCallback = Constants.k_iSteamUserCallbacks + 3; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 3; + public EResult m_eResult; + } //----------------------------------------------------------------------------- // Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server, @@ -7442,8 +5612,13 @@ internal struct ClientGameServerDeny_t_LargePack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 13)] - internal struct ClientGameServerDeny_t_SmallPack { + public struct ClientGameServerDeny_t + #if STEAMWORKS_ANYCPU + : 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; @@ -7452,95 +5627,94 @@ 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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamUserCallbacks + 17; - public byte m_eFailureType; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 17; } - #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; - } - + public struct LicensesUpdated_t #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamUserCallbacks + 25; + public static int CallbackIdentity { get; } = Constants.k_iSteamUserCallbacks + 25; } - //----------------------------------------------------------------------------- - // 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 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 } - #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 { - public const int k_iCallback = Constants.k_iSteamUserCallbacks + 43; + internal struct ValidateAuthTicketResponse_t_LargePack { public CSteamID m_SteamID; public EAuthSessionResponse m_eAuthSessionResponse; public CSteamID m_OwnerSteamID; // different from m_SteamID if borrowed + + 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; + } + + 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)] - public struct MicroTxnAuthorizationResponse_t { + public struct MicroTxnAuthorizationResponse_t + #if STEAMWORKS_ANYCPU + : 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 @@ -7551,28 +5725,29 @@ public struct MicroTxnAuthorizationResponse_t { //----------------------------------------------------------------------------- // Purpose: called when a user has responded to a microtransaction authorization request //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [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 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; + } - //----------------------------------------------------------------------------- - // 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 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_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; + } } #endif @@ -7581,114 +5756,45 @@ internal struct MicroTxnAuthorizationResponse_t_SmallPack { //----------------------------------------------------------------------------- [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; - } - + public struct EncryptedAppTicketResponse_t #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamUserCallbacks + 54; + public static int CallbackIdentity { get; } = 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; - } - + public struct GetAuthSessionTicketResponse_t #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 { + : 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; } - #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); } - } - } - + public struct GameWebCallback_t #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 { + : ICallbackIdentity + #endif + { 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 @@ -7698,99 +5804,39 @@ public string m_szURL } } - #endif //----------------------------------------------------------------------------- // Purpose: sent to your game in response to ISteamUser::RequestStoreAuthURL //----------------------------------------------------------------------------- [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); } - } - } - + public struct StoreAuthURLResponse_t #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: sent to your game in response to ISteamUser::RequestStoreAuthURL - //----------------------------------------------------------------------------- - [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); } - } - } - - - //----------------------------------------------------------------------------- - // Purpose: sent to your game in response to ISteamUser::RequestStoreAuthURL - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUserCallbacks + 65)] - internal struct StoreAuthURLResponse_t_SmallPack { + : ICallbackIdentity + #endif + { 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); } - } - } - - #endif - //----------------------------------------------------------------------------- - // Purpose: sent in response to ISteamUser::GetMarketEligibility - //----------------------------------------------------------------------------- - [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 - } - - #if STEAMWORKS_ANYCPU - //----------------------------------------------------------------------------- - // Purpose: sent in response to ISteamUser::GetMarketEligibility - //----------------------------------------------------------------------------- - [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 + set { InteropHelp.StringToByteArrayUTF8(value, m_szURL_, 512); } + } } - //----------------------------------------------------------------------------- // Purpose: sent in response to ISteamUser::GetMarketEligibility //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserCallbacks + 66)] - internal struct MarketEligibilityResponse_t_SmallPack { + public struct MarketEligibilityResponse_t + #if STEAMWORKS_ANYCPU + : 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; @@ -7800,7 +5846,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 +5856,13 @@ 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 { + : 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 @@ -7884,44 +5878,18 @@ 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 { + : 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; @@ -7929,7 +5897,6 @@ internal struct GetTicketForWebApiResponse_t_SmallPack { public byte[] m_rgubTicket; } - #endif // callbacks //----------------------------------------------------------------------------- // Purpose: called when the latests stats and achievements have been received @@ -7937,8 +5904,13 @@ internal struct GetTicketForWebApiResponse_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Explicit, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 1)] - public struct UserStatsReceived_t { + public struct UserStatsReceived_t + #if STEAMWORKS_ANYCPU + : 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)] @@ -7952,37 +5924,17 @@ public struct UserStatsReceived_t { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [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 { + : 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 } - #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 @@ -7990,58 +5942,13 @@ internal struct UserStatsStored_t_SmallPack { //----------------------------------------------------------------------------- [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 - } - + public struct UserAchievementStored_t #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)] - [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 3)] - internal struct UserAchievementStored_t_SmallPack { + : 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)] @@ -8057,96 +5964,54 @@ public string m_rgchAchievementName // name of 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 - } - + public struct LeaderboardFindResult_t #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 { + : 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 } - #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 LeaderboardScoresDownloaded_t #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() - // 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 - } - - - //----------------------------------------------------------------------------- - // 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)] - internal struct LeaderboardScoresDownloaded_t_SmallPack { + : 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 } - #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)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 6)] - public struct LeaderboardScoreUploaded_t { + 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 @@ -8160,150 +6025,81 @@ public struct LeaderboardScoreUploaded_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 = Packsize.value)] + [StructLayout(LayoutKind.Sequential, Pack = 8)] [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; - 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 - } - - #endif - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [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 - } - - #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 - } + 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 static implicit operator LeaderboardScoreUploaded_t(LeaderboardScoreUploaded_t_LargePack value) { + LeaderboardScoreUploaded_t result = default; + 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; + } + public static implicit operator LeaderboardScoreUploaded_t_LargePack(LeaderboardScoreUploaded_t value) { + LeaderboardScoreUploaded_t_LargePack result = default; + 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; + } + } + #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 7)] - internal struct NumberOfCurrentPlayers_t_SmallPack { + 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 } - #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)] - 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 { + : 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 } - #endif //----------------------------------------------------------------------------- // Purpose: Callback indicating that an achievement icon has been fetched //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [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 { + : 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 [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchStatNameMax)] @@ -8318,53 +6114,35 @@ public string m_rgchAchievementName // name of the achievement 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)] [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 { + : 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 } - #endif //----------------------------------------------------------------------------- // 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)] - public struct LeaderboardUGCSet_t { + 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 } @@ -8373,24 +6151,25 @@ public struct LeaderboardUGCSet_t { //----------------------------------------------------------------------------- // 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)] 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 - } + public static implicit operator LeaderboardUGCSet_t(LeaderboardUGCSet_t_LargePack value) { + LeaderboardUGCSet_t result = default; + result.m_eResult = value.m_eResult; + result.m_hSteamLeaderboard = value.m_hSteamLeaderboard; + return result; + } - //----------------------------------------------------------------------------- - // 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; - public EResult m_eResult; // The result of the operation - public SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was + public static implicit operator LeaderboardUGCSet_t_LargePack(LeaderboardUGCSet_t value) { + LeaderboardUGCSet_t_LargePack result = default; + result.m_eResult = value.m_eResult; + result.m_hSteamLeaderboard = value.m_hSteamLeaderboard; + return result; + } } #endif @@ -8400,378 +6179,163 @@ internal struct LeaderboardUGCSet_t_SmallPack { //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [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 { + : 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 } - #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 1; + public static int CallbackIdentity { get; } = Constants.k_iSteamUtilsCallbacks + 1; } - #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; - } - + public struct LowBatteryPower_t #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 2; + public static int CallbackIdentity { get; } = 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; - } - + public struct SteamAPICallCompleted_t #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; - } - - - //----------------------------------------------------------------------------- - // 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 { + : 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; } - #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; - } - - #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; - } - - #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; + // called when Steam wants to shutdown + //----------------------------------------------------------------------------- + [StructLayout(LayoutKind.Sequential, Pack = Packsize.value, Size = 1)] + [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 4)] + public struct SteamShutdown_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { + public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 4; + public static int CallbackIdentity { get; } = Constants.k_iSteamUtilsCallbacks + 4; } - //----------------------------------------------------------------------------- // callback for CheckFileSignature //----------------------------------------------------------------------------- [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 5)] - internal struct CheckFileSignature_t_SmallPack { + public struct CheckFileSignature_t + #if STEAMWORKS_ANYCPU + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamUtilsCallbacks + 5; 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 { + : 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; 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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 36; + public static int CallbackIdentity { get; } = Constants.k_iSteamUtilsCallbacks + 36; } - #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; - } - + public struct FloatingGamepadTextInputDismissed_t #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 38; + public static int CallbackIdentity { get; } = 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 FilterTextDictionaryChanged_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 - } - - - //----------------------------------------------------------------------------- - // The text filtering dictionary has changed - //----------------------------------------------------------------------------- - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - [CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 39)] - internal struct FilterTextDictionaryChanged_t_SmallPack { + : 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 } - #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 { + : 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; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] @@ -8783,85 +6347,44 @@ public string m_rgchURL } } - #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 struct GetOPFSettingsResult_t #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 { + : 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; } - #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 { + : 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; } - #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 { + : ICallbackIdentity + #endif + { public const int k_iCallback = Constants.k_iSteamVideoCallbacks + 5; + public static int CallbackIdentity { get; } = Constants.k_iSteamVideoCallbacks + 5; 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 +6392,13 @@ 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 { + : 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. @@ -8981,7 +6429,6 @@ internal struct SteamNetworkingFakeIPResult_t_SmallPack { 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..3fa3ef82 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamConstants.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamConstants.cs @@ -181,6 +181,11 @@ public static class Constants { public const int k_nMaxReturnPorts = 8; /// Max length of diagnostic error message public const int k_cchMaxSteamNetworkingErrMsg = 1024; + // 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..e469bed3 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/SteamStructs.cs @@ -25,36 +25,16 @@ public struct FriendGameInfo_t { public CSteamID m_steamIDLobby; } - #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 { - public CGameID m_gameID; - public uint m_unGameIP; - public ushort m_usGamePort; - public ushort m_usQueryPort; - public CSteamID m_steamIDLobby; - } - - #endif [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct InputAnalogActionData_t { // 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; @@ -105,81 +85,6 @@ public struct InputMotionData_t { public float rotVelZ; // Local Yaw } - #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 { - // 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 - } - - #endif [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] public struct SteamItemDetails_t { public SteamItemInstanceID_t m_itemId; @@ -188,25 +93,6 @@ public struct SteamItemDetails_t { public ushort m_unFlags; // see ESteamItemFlags } - #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 - } - - - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamItemDetails_t_SmallPack { - 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 ESteamPartyBeaconLocationType m_eType; @@ -214,17 +100,24 @@ public struct SteamPartyBeaconLocation_t { } #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 @@ -242,37 +135,6 @@ public struct P2PSessionState_t { public ushort m_nRemotePort; // Only exists for compatibility with older authentication api's } - #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 { - 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 - } - - #endif // Mouse motion event data, valid when m_eType is k_ERemotePlayInputMouseMotion [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] public struct RemotePlayInputMouseMotion_t { @@ -284,31 +146,6 @@ public struct RemotePlayInputMouseMotion_t { public int m_nDeltaY; // Relative mouse motion in the Y direction } - #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 { - [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 - } - - #endif // Mouse wheel event data, valid when m_eType is k_ERemotePlayInputMouseWheel [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] public struct RemotePlayInputMouseWheel_t { @@ -316,23 +153,6 @@ public struct RemotePlayInputMouseWheel_t { public float m_flAmount; // 1.0f is a single click of the wheel, 120 units on Windows } - #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 { - 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 { @@ -341,25 +161,6 @@ public struct RemotePlayInputKey_t { 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 } - #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 { - 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 //----------------------------------------------------------------------------- @@ -369,27 +170,6 @@ public struct SteamParamStringArray_t { public int m_nNumStrings; } - #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; - public int m_nNumStrings; - } - - #endif // Details for a single published file/UGC [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] public struct SteamUGCDetails_t { @@ -460,7 +240,7 @@ 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. @@ -525,75 +305,70 @@ 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); } + 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; } - [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_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; } - 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); } - } - // 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 @@ -609,24 +384,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 @@ -648,35 +432,6 @@ public struct MatchMakingKeyValuePair_t { 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 @@ -688,33 +443,17 @@ public struct CallbackMsg_t { public int m_cubParam; // Size of the data pointed to by m_pubParam } - #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 - } - - - // 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 + // 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 = Packsize.value, Size = 1)] + public struct GameID_t { } - #endif /// Describe the state of a connection. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [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 @@ -782,7 +521,7 @@ public string m_szConnectionDescription #if STEAMWORKS_ANYCPU /// Describe the state of a connection. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] + [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 @@ -846,74 +585,42 @@ public string m_szConnectionDescription /// Internal stuff, room to change API easily [MarshalAs(UnmanagedType.ByValArray, SizeConst = 63)] public uint[] reserved; - } - - /// Describe the state of a connection. - [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] - internal struct SteamNetConnectionInfo_t_SmallPack { - - /// 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); } + 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; } - - /// 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); } + + 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; } - - /// 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; } #endif @@ -996,167 +703,6 @@ public struct SteamNetConnectionRealTimeStatus_t { public uint[] reserved; } - #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 { - - /// 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; - } - - #endif /// Quick status of a particular lane [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] public struct SteamNetConnectionRealTimeLaneStatus_t { @@ -1177,49 +723,6 @@ public struct SteamNetConnectionRealTimeLaneStatus_t { public uint[] reserved; } - #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 - - /// 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; - - // 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 - - /// 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; - - // Internal stuff, room to change API easily - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] - public uint[] reserved; - } - - #endif // // Ping location / measurement // @@ -1236,59 +739,12 @@ 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)] + [StructLayout(LayoutKind.Sequential)] public struct SteamNetworkPingLocation_t { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] public byte[] m_data; } - #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; - } - - - // - // 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_SmallPack { - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] - public byte[] m_data; - } - - #endif } #endif // !DISABLESTEAMWORKS diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs index 589d4996..f010f2d2 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingmessages.cs @@ -134,7 +134,21 @@ 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); + } else { + SteamNetConnectionInfo_t pConnectionInfo_lp; + 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 c51b9f88..cff86683 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameservernetworkingsockets.cs @@ -397,7 +397,21 @@ 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); + } else { + SteamNetConnectionInfo_t pInfo_lp; + 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 e9638e55..70a6d399 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamgameserverugc.cs @@ -63,7 +63,21 @@ 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); + } else { + SteamUGCDetails_t pDetails_lp; + 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 bbd2186c..bdc2b262 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteammatchmaking.cs @@ -783,7 +783,18 @@ 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); + } else { + SteamPartyBeaconLocation_t pLocation_lp; + 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; @@ -810,7 +821,24 @@ 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); + } else { + 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); + 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 } /// @@ -823,7 +851,21 @@ 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); + #if STEAMWORKS_ANYCPU + SteamAPICall_t ret; + if (!Packsize.IsLargePack) { + ret = (SteamAPICall_t)NativeMethods.ISteamParties_CreateBeacon(CSteamAPIContext.GetSteamParties(), unOpenSlots, ref pBeaconLocation, pchConnectString2, pchMetadata2); + } else { + SteamPartyBeaconLocation_t pBeaconLocation_lp = pBeaconLocation; + 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 } } @@ -870,7 +912,18 @@ 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); + } else { + SteamPartyBeaconLocation_t BeaconLocation_lp = BeaconLocation; + 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 5125d493..f6f09836 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingmessages.cs @@ -134,7 +134,21 @@ 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); + } else { + SteamNetConnectionInfo_t pConnectionInfo_lp; + 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 a94dd7a4..e027183d 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamnetworkingsockets.cs @@ -397,7 +397,21 @@ 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); + } else { + SteamNetConnectionInfo_t pInfo_lp; + 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 a555e91a..528041ed 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamugc.cs @@ -63,7 +63,21 @@ 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); + } else { + SteamUGCDetails_t pDetails_lp; + 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 2a8811e6..ce5b4b31 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamuserstats.cs @@ -317,7 +317,21 @@ 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); + } else { + LeaderboardEntry_t pLeaderboardEntry_lp; + 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 } /// 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 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.