From cc76f7cc3fd69a3fcfd62e36d5c8ece548b3ae4e Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Fri, 22 Dec 2023 05:55:17 +0100 Subject: [PATCH 01/36] Initial work on relative mouse position capturing and relevant features: - Tidied up function hooks prototype a bit - Implemented some code in the CLI app to compute the mouse position relative to an object - Fixed bug in D3DMeshFileObject - Added new MemArrayList to wrap TList<> objects - Added WriteMemory method which takes a StrPtrType - Implemented OmsiAnimSubMesh and OmsiAnimSubMeshInst - Bugfixes to OmsiComplObj and OmsiComplObjInst - OmsiObject now has an IsNull property to quickly check if an OmsiObject points to null (ideally shouldn't be possible) - Fixed a bug in the OmsiRemoteMethods reader task - Added some utility methods to Vector/Matrix/etc structs --- OmsiExtensionsCLI/Program.cs | 70 +++++++++++- OmsiHook/D3DMeshFileObject.cs | 4 +- OmsiHook/MemArray.cs | 118 +++++++++++++++++++++ OmsiHook/Memory.cs | 13 +++ OmsiHook/OmsiAnimSubMesh.cs | 96 +++++++++++++++++ OmsiHook/OmsiAnimSubMeshInst.cs | 73 +++++++++++++ OmsiHook/OmsiComplObj.cs | 20 ++-- OmsiHook/OmsiComplObjInst.cs | 9 +- OmsiHook/OmsiObject.cs | 2 + OmsiHook/OmsiRemoteMethods.cs | 4 +- OmsiHook/OmsiStructs.cs | 64 +++++++++++ OmsiHookInvoker/FunctionHooks.cpp | 22 ++-- OmsiHookInvoker/FunctionHooks.h | 6 +- OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj | 2 +- 14 files changed, 469 insertions(+), 34 deletions(-) create mode 100644 OmsiHook/OmsiAnimSubMesh.cs create mode 100644 OmsiHook/OmsiAnimSubMeshInst.cs diff --git a/OmsiExtensionsCLI/Program.cs b/OmsiExtensionsCLI/Program.cs index 8655891..fffdcd5 100644 --- a/OmsiExtensionsCLI/Program.cs +++ b/OmsiExtensionsCLI/Program.cs @@ -1,4 +1,6 @@ using System; +using System.Linq; +using System.Numerics; using System.Threading; using OmsiHook; @@ -17,6 +19,9 @@ static void Main(string[] args) dXTests.Init(omsi); bool toggle = false; var playerVehicle = omsi.Globals.PlayerVehicle; + var progMan = omsi.Globals.ProgamManager; + var meshes = playerVehicle?.ComplObjInst?.ComplObj?.Meshes; + var meshInsts = playerVehicle?.ComplObjInst?.AnimSubMeshInsts; while (true) { playerVehicle ??= omsi.Globals.PlayerVehicle; @@ -41,10 +46,71 @@ static void Main(string[] args) Console.WriteLine($"Camera data: x:{camPos.x:F3} y:{camPos.y:F3} z:{camPos.z:F3} ".PadRight(Console.WindowWidth - 1)); Console.WriteLine($"{omsi.Globals.Drivers}".PadRight(Console.WindowWidth - 1)); - if(!dXTests.IsReady) + /*if(!dXTests.IsReady) dXTests.CreateTexture(); if(dXTests.IsReady) - dXTests.UpdateTexture(); + dXTests.UpdateTexture();*/ + + progMan ??= omsi.Globals.ProgamManager; + meshes ??= playerVehicle?.ComplObjInst?.ComplObj?.Meshes; + meshInsts ??= playerVehicle?.ComplObjInst?.AnimSubMeshInsts; + + Console.WriteLine($"[MOUSE] pos: {progMan.MausPos} ray_pos: {progMan.MausLine3DPos} ray_dir: {progMan.MausLine3DDir}".PadRight(Console.WindowWidth - 1)); + Console.WriteLine($"[MOUSE] {progMan.MausCrossObjFlat} {progMan.MausCrossObjFlat_ObjHeight} {progMan.Maus_MeshEvent}".PadRight(Console.WindowWidth - 1)); + if (meshes != null) + { + int i = 0; + foreach (var mesh in meshes) + { + if(mesh.MausEvent != null) + { + Console.WriteLine($" Mesh '{mesh.Filename_Int}' has event: {mesh.MausEvent}"); + i++; + } + if(i > 20) + { + Console.WriteLine(" ..."); + break; + } + } + } + OmsiAnimSubMesh clickMesh = null; + OmsiAnimSubMeshInst clickMeshInst = null; + string mouseEventName = "door0"; + if(meshes != null) + clickMesh = meshes.FirstOrDefault(mesh => mesh.MausEvent == mouseEventName); + if (clickMesh != null) + clickMeshInst = meshInsts[meshes.IndexOf(clickMesh)]; + if (clickMesh != null && progMan.Maus_MeshEvent == mouseEventName && (progMan.Maus_Clicked || true)) + { + // Work out object space coords of the mouse click + // Note that (if wrapped) we could use D3DXIntersect to find the UV coords given the submesh's d3d mesh + + // Transform the mouse ray from world space to object space + Matrix4x4 invMat; + //if (clickMesh.UseCharMatrix) + // invMat = clickMesh.CharMatrixInv; + //else + Matrix4x4.Invert((Matrix4x4)clickMeshInst.Matrix, out invMat); + + var rayStart = Vector3.Transform(progMan.MausLine3DPos, invMat); + var rayDir = Vector3.Transform(progMan.MausLine3DDir, invMat); + // Now trace the ray, in our simplification we assume the surface of the mesh we want to hit is coplanar to the xz plane + // Taken from: https://stackoverflow.com/a/18543221 + Vector3 planeNrm = new(1, 0, 0); + float planeD = 0; + float dot = Vector3.Dot(planeNrm, rayDir); + var intersect = new Vector3(); + if(dot > 1e-9) + { + var w = rayStart - planeNrm * planeD; + var fac = -Vector3.Dot(planeNrm, w) / dot; + var u = rayDir * fac; + intersect = rayStart + u; + } + + Console.WriteLine($" Clicked on {clickMesh.Filename_Int} at local coords: {(D3DVector)intersect}"); + } /*Console.WriteLine("".PadRight(Console.WindowWidth-1)); try diff --git a/OmsiHook/D3DMeshFileObject.cs b/OmsiHook/D3DMeshFileObject.cs index d0e46a4..9a61d53 100644 --- a/OmsiHook/D3DMeshFileObject.cs +++ b/OmsiHook/D3DMeshFileObject.cs @@ -15,8 +15,8 @@ public bool Loaded_MeshFileObject } public string Filename { - get => Memory.ReadMemoryString(Address + 0x178); - set => Memory.WriteMemory(Address + 0x178, value); + get => Memory.ReadMemoryString(Address + 0x17c, StrPtrType.DelphiAnsiString); + set => Memory.WriteMemory(Address + 0x17c, value); } public OmsiWeightData[] WeightData { diff --git a/OmsiHook/MemArray.cs b/OmsiHook/MemArray.cs index ff0a1eb..6c68ccc 100644 --- a/OmsiHook/MemArray.cs +++ b/OmsiHook/MemArray.cs @@ -503,4 +503,122 @@ public override bool Remove(string item) return true; } } + + /// + /// Wrapper for Lists in OMSI's Memory. + /// + /// + /// This is a heavyweight wrapper for native arrays that provides methods for reading and writing to arrays as well as + /// helping with memory management. For fast, low-level access, use the methods in the class. + /// For better performance in c# the contents of the wrapped array can be copied to managed memory when constructed + /// or whenever is called. + /// Cached arrays are generally faster when accessed or searched frequently by C#, but they are slower to update and + /// the user is responsible for ensuring that they are synchronised with the native array it wraps. + /// + /// The type of object to wrap. + public class MemArrayList : MemArrayBase where T : OmsiObject, new() + { + private T[] ReadList() + { + uint arr = Memory.ReadMemory(Address); + if (arr == 0) + return Array.Empty(); + uint len = Memory.ReadMemory(arr + 8); + uint arrayData = Memory.ReadMemory(arr + 4); + T[] ret = new T[len]; + for (uint i = 0; i < len; i++) + { + var objAddr = Memory.ReadMemory(arrayData + i * 4); + if (objAddr == 0) + { + ret[i] = null; + continue; + } + + var n = new T(); + n.InitObject(Memory, (int)objAddr); + ret[i] = n; + } + + return ret; + } + + private T ReadListItem(int index) + { + int arr = Memory.ReadMemory(Address); + if (arr == 0) + return null; + + int len = Memory.ReadMemory(arr + 8); + int arrayData = Memory.ReadMemory(arr + 4); + + if(index >= len || index < 0) + throw new ArgumentOutOfRangeException(nameof(index)); + + var objAddr = Memory.ReadMemory(arrayData + index * 4); + if (objAddr == 0) + return null; + + var n = new T(); + n.InitObject(Memory, objAddr); + + return n; + } + + /// + /// Gets the current contents of the wrapped array. On non-cached arrays this is slow. + /// + public override T[] WrappedArray => cached ? arrayCache : ReadList(); + + public MemArrayList() : base() { } + + internal MemArrayList(Memory memory, int address, bool cached = true) : base(memory, address, cached) { } + + public override void UpdateFromHook(int index = -1) + { + if (cached) + { + if (index < 0) + arrayCache = ReadList(); + else + arrayCache[index] = ReadListItem(index); + } + } + + public override T this[int index] + { + get => cached ? arrayCache[index] : ReadListItem(index); + set => throw new NotSupportedException(); + } + + /// + /// TODO: Implement efficient enumerator for non-cached arrays. + /// + /// + public override IEnumerator GetEnumerator() => ((IEnumerable)WrappedArray).GetEnumerator(); + + public override void Add(T item) + { + throw new NotSupportedException(); + } + + public override void Clear() + { + base.Clear(); + if (cached) + arrayCache = Array.Empty(); + } + + public override bool Remove(T item) => throw new NotImplementedException(); + + public override void Insert(int index, T item) => throw new NotImplementedException(); + + public override void RemoveAt(int index) => throw new NotImplementedException(); + + public override int IndexOf(T item) => Array.IndexOf(WrappedArray, item); + + public override bool Contains(T item) => WrappedArray.Contains(item); + + public override void CopyTo(T[] array, int arrayIndex) => WrappedArray.CopyTo(array, arrayIndex); + } } diff --git a/OmsiHook/Memory.cs b/OmsiHook/Memory.cs index 805dd19..9dcf187 100644 --- a/OmsiHook/Memory.cs +++ b/OmsiHook/Memory.cs @@ -407,6 +407,19 @@ public void WriteMemory(int address, string value, bool wide = false, bool copyR //Imports.WriteProcessMemory((int)omsiProcessHandle, address, buffer, buffer.Length, out _); } + /// + /// Sets the value of a string at a given address. + /// + /// The address of the data to set + /// The new value of the string to set; this must be of the + /// correct encoding to avoid memory corruption + /// The type of string to copy to + public void WriteMemory(int address, string value, StrPtrType strType) + { + WriteMemory(address, value, + (strType & StrPtrType.Wide) != 0); + } + /// public async Task WriteMemoryAsync(int address, string value, bool wide = false, bool copyReferences = true) { diff --git a/OmsiHook/OmsiAnimSubMesh.cs b/OmsiHook/OmsiAnimSubMesh.cs new file mode 100644 index 0000000..2651f8b --- /dev/null +++ b/OmsiHook/OmsiAnimSubMesh.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OmsiHook +{ + /// + /// A mesh within a complex mmap object. This represents a single [mesh] tag in a cfg file. + /// + public class OmsiAnimSubMesh : D3DMeshFileObject + { + internal OmsiAnimSubMesh(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } + public OmsiAnimSubMesh() : base() { } + + public string Filename_Int + { + get => Memory.ReadMemoryString(Address + 0x18c, StrPtrType.DelphiAnsiString); + set => Memory.WriteMemory(Address + 0x18c, value, StrPtrType.DelphiAnsiString); + } + public string ident + { + get => Memory.ReadMemoryString(Address + 0x190, StrPtrType.DelphiAnsiString); + set => Memory.WriteMemory(Address + 0x190, value, StrPtrType.DelphiAnsiString); + } + public int AnimParent + { + get => Memory.ReadMemory(Address + 0x194); + set => Memory.WriteMemory(Address + 0x194, value); + } + //public MemArrayList origin + //public MemArrayList originI + //public MemArrayList anim + public int Visible + { + get => Memory.ReadMemory(Address + 0x1a4); + set => Memory.WriteMemory(Address + 0x1a4, value); + } + public int VisibleValue + { + get => Memory.ReadMemory(Address + 0x1a8); + set => Memory.WriteMemory(Address + 0x1a8, value); + } + //public MemArrayList Rauchs + //public MemArrayList LampenSettings + //public MemArrayList InteriorLights + //public MemArrayList BoneProps + public bool SmoothSkin + { + get => Memory.ReadMemory(Address + 0x1bc); + set => Memory.WriteMemory(Address + 0x1bc, value); + } + public float Skin_MaxRelDist + { + get => Memory.ReadMemory(Address + 0x1c0); + set => Memory.WriteMemory(Address + 0x1c0, value); + } + public string MausEvent + { + get => Memory.ReadMemoryString(Address + 0x1c4, StrPtrType.DelphiAnsiString); + set => Memory.WriteMemory(Address + 0x1c4, value, StrPtrType.DelphiAnsiString); + } + public int MyLOD + { + get => Memory.ReadMemory(Address + 0x1c8); + set => Memory.WriteMemory(Address + 0x1c8, value); + } + public byte Flag_GetLights + { + get => Memory.ReadMemory(Address + 0x1cc); + set => Memory.WriteMemory(Address + 0x1cc, value); + } + /* TODO: + public int GetInteriorLights + { + get => Memory.ReadMemory(Address + 0x1cd); + set => Memory.WriteMemory(Address + 0x1cd, value); + }*/ + public byte Flag_ViewPoint + { + get => Memory.ReadMemory(Address + 0x1d1); + set => Memory.WriteMemory(Address + 0x1d1, value); + } + public bool HasShadow + { + get => Memory.ReadMemory(Address + 0x1d2); + set => Memory.WriteMemory(Address + 0x1d2, value); + } + public bool Shadow + { + get => Memory.ReadMemory(Address + 0x1d2); + set => Memory.WriteMemory(Address + 0x1d2, value); + } + } +} diff --git a/OmsiHook/OmsiAnimSubMeshInst.cs b/OmsiHook/OmsiAnimSubMeshInst.cs new file mode 100644 index 0000000..fb0ac4e --- /dev/null +++ b/OmsiHook/OmsiAnimSubMeshInst.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OmsiHook +{ + /// + /// A mesh within a complex mmap object. This represents a single [mesh] tag in a cfg file. + /// + public class OmsiAnimSubMeshInst : OmsiObject + { + internal OmsiAnimSubMeshInst(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } + public OmsiAnimSubMeshInst() : base() { } + + public D3DTransformObject ShadowObject // TODO: Should be a D3DShadowObject + { + get => new(Memory, Address + 0x4); + } + public D3DMatrix Matrix + { + get => Memory.ReadMemory(Address + 0x8); + set => Memory.WriteMemory(Address + 0x8, value); + } + /// + /// Normalized matrix + /// + public D3DMatrix EntzerrteMatrix + { + get => Memory.ReadMemory(Address + 0x48); + set => Memory.WriteMemory(Address + 0x48, value); + } + public D3DMatrix LocalMatrix + { + get => Memory.ReadMemory(Address + 0x88); + set => Memory.WriteMemory(Address + 0x88, value); + } + /* TODO: + public MemArrayList Matl + { + get => new(Memory, Address + 0xc8); + }*/ + public int Tex + { + get => Memory.ReadMemory(Address + 0xcc); + set => Memory.WriteMemory(Address + 0xcc, value); + } + public bool Visible + { + get => Memory.ReadMemory(Address + 0xd0); + set => Memory.WriteMemory(Address + 0xd0, value); + } + // TODO: MemArrayList Lampen @ 0xd4 + // TODO: MemArrayList InteriorLights @ 0xd8 + // TODO: MemArrayList Anim_LastValue @ 0xdc + public IntPtr SkinMesh // ID3DXMesh + { + get => Memory.ReadMemory(Address + 0xe0); + set => Memory.WriteMemory(Address + 0xe0, value); + } + public bool SkinMesh_Use + { + get => Memory.ReadMemory(Address + 0xe4); + set => Memory.WriteMemory(Address + 0xe4, value); + } + public bool RefreshSkinMesh_Render + { + get => Memory.ReadMemory(Address + 0xe5); + set => Memory.WriteMemory(Address + 0xe5, value); + } + } +} diff --git a/OmsiHook/OmsiComplObj.cs b/OmsiHook/OmsiComplObj.cs index f1fe62b..c500a20 100644 --- a/OmsiHook/OmsiComplObj.cs +++ b/OmsiHook/OmsiComplObj.cs @@ -20,14 +20,14 @@ public bool Lighting_Human set => Memory.WriteMemory(Address + 0x4, value); } // TODO: Check this data type, should be a TStringList - public string[] FileText + /*public string[] FileText { get => Memory.ReadMemoryStringArray(Address + 0x8); //set => Memory.WriteMemory(Address + 0x4, value); - } + }*/ public string Code { - get => Memory.ReadMemoryString(Address + 0xc); + get => Memory.ReadMemoryString(Address + 0xc, StrPtrType.DelphiAnsiString); set => Memory.WriteMemory(Address + 0xc, value); } public D3DVector VFDMax @@ -42,12 +42,12 @@ public D3DVector VFDMin } public string FileName { - get => Memory.ReadMemoryString(Address + 0x28); + get => Memory.ReadMemoryString(Address + 0x28, StrPtrType.DelphiAnsiString); set => Memory.WriteMemory(Address + 0x28, value); } public string MyPath { - get => Memory.ReadMemoryString(Address + 0x2c); + get => Memory.ReadMemoryString(Address + 0x2c, StrPtrType.DelphiAnsiString); set => Memory.WriteMemory(Address + 0x2c, value); } public int FileVersion @@ -60,12 +60,10 @@ public int FileVersion_Hole get => Memory.ReadMemory(Address + 0x34); set => Memory.WriteMemory(Address + 0x34, value); } - /* TODO: - public OmsiAnimSubMesh[] Meshs + public MemArrayList Meshes { - get => Memory.ReadMemoryObjArray(Address + 0x38); - //set => Memory.WriteMemory(Address + 0x34, value); - }*/ + get => new(Memory, Address + 0x38); + } /* TODO: public OmsiTexChangeMaster[] TexChangeMasters { @@ -149,7 +147,7 @@ public bool Inc_SkinMesh } public string TerrainHole_FileName { - get => Memory.ReadMemoryString(Address + 0xb0); + get => Memory.ReadMemoryString(Address + 0xb0, StrPtrType.DelphiAnsiString); set => Memory.WriteMemory(Address + 0xb0, value); } public bool GotAllTerrainHoles diff --git a/OmsiHook/OmsiComplObjInst.cs b/OmsiHook/OmsiComplObjInst.cs index 5305d9f..ca2b9ee 100644 --- a/OmsiHook/OmsiComplObjInst.cs +++ b/OmsiHook/OmsiComplObjInst.cs @@ -61,7 +61,7 @@ public float Refresh_OFT } public OmsiComplObj ComplObj { - get => new(Memory, Address + 0x20); + get => new(Memory, Memory.ReadMemory(Address + 0x20)); } public byte ViewPoint_Opt { @@ -151,11 +151,10 @@ public D3DMatrix Shadow_Matrix get => Memory.ReadMemory(Address + 0x9d); set => Memory.WriteMemory(Address + 0x9d, value); } - /* TODO: - public OmsiAnimSubMeshInst[] AnimSubMeshInsts + public MemArrayList AnimSubMeshInsts { - get => Memory.ReadMemoryObjArray(Address + 0xe0); - }*/ + get => new(Memory, Address + 0xe0); + } /* TODO: public OmsiInteriorLightInst[] AnimSubMeshInsts { diff --git a/OmsiHook/OmsiObject.cs b/OmsiHook/OmsiObject.cs index 1e473e3..aa16368 100644 --- a/OmsiHook/OmsiObject.cs +++ b/OmsiHook/OmsiObject.cs @@ -14,6 +14,8 @@ public class OmsiObject internal Memory Memory { get; private set; } internal int Address { get; set; } + public bool IsNull => Address == 0; + public OmsiObject() { } internal OmsiObject(Memory memory, int address) { diff --git a/OmsiHook/OmsiRemoteMethods.cs b/OmsiHook/OmsiRemoteMethods.cs index e943fc6..4678e1f 100644 --- a/OmsiHook/OmsiRemoteMethods.cs +++ b/OmsiHook/OmsiRemoteMethods.cs @@ -83,8 +83,8 @@ private static void ResultReaderTask() int promiseHash = reader.ReadInt32(); int value = reader.ReadInt32(); - resultPromises.TryRemove(promiseHash, out var promise); - promise.SetResult(value); + if(resultPromises.TryRemove(promiseHash, out var promise)) + promise.SetResult(value); } } diff --git a/OmsiHook/OmsiStructs.cs b/OmsiHook/OmsiStructs.cs index b04ee06..6b99a1c 100644 --- a/OmsiHook/OmsiStructs.cs +++ b/OmsiHook/OmsiStructs.cs @@ -1,4 +1,5 @@ using System; +using System.Numerics; using System.Runtime.InteropServices; #pragma warning disable CS0649 @@ -11,10 +12,17 @@ namespace OmsiHook public struct D3DVector { public float x, y, z; + + public override readonly string ToString() => $"[{x:F3}, {y:F3}, {z:F3}]"; + + public static implicit operator Vector3(D3DVector v) => new(v.x, v.y, v.z); + public static implicit operator D3DVector(Vector3 v) => new() { x=v.X, y=v.Y, z=v.Z }; } public struct D3DXVector2 { public float x, y; + + public override readonly string ToString() => $"[{x:F3}, {y:F3}]"; } /// @@ -26,6 +34,56 @@ public struct D3DMatrix _10, _11, _12, _13, _20, _21, _22, _23, _30, _31, _32, _33; + public override readonly string ToString() => $"[ [{_00:F3}, {_01:F3}, {_02:F3}, {_03:F3}],\n" + + $"[{_10:F3}, {_11:F3}, {_12:F3}, {_13:F3}],\n" + + $"[{_20:F3}, {_21:F3}, {_22:F3}, {_23:F3}],\n" + + $"[{_30:F3}, {_31:F3}, {_32:F3}, {_33:F3}] ]"; + + public static implicit operator Matrix4x4(D3DMatrix m) + { + return new Matrix4x4() + { + M11 = m._00, + M12 = m._01, + M13 = m._02, + M14 = m._03, + M21 = m._10, + M22 = m._11, + M23 = m._12, + M24 = m._13, + M31 = m._20, + M32 = m._21, + M33 = m._22, + M34 = m._23, + M41 = m._30, + M42 = m._31, + M43 = m._32, + M44 = m._33 + }; + } + + public static implicit operator D3DMatrix(Matrix4x4 m) + { + return new() + { + _00 = m.M11, + _01 = m.M12, + _02 = m.M13, + _03 = m.M14, + _10 = m.M21, + _11 = m.M22, + _12 = m.M23, + _13 = m.M24, + _20 = m.M31, + _21 = m.M32, + _22 = m.M33, + _23 = m.M34, + _30 = m.M41, + _31 = m.M42, + _32 = m.M43, + _33 = m.M44 + }; + } } /// @@ -34,6 +92,8 @@ public struct D3DMatrix public struct D3DXQuaternion { public float x, y, z, w; + + public override readonly string ToString() => $"[{x:F3}, {y:F3}, {z:F3}, {w:F3}]"; } /// @@ -42,6 +102,8 @@ public struct D3DXQuaternion public struct D3DXPlane { public float a, b, c, d; + + public override readonly string ToString() => $"[{a:F3}, {b:F3}, {c:F3}, {d:F3}]"; } /// @@ -50,6 +112,8 @@ public struct D3DXPlane public struct D3DColorValue { public float r, g, b, a; + + public override readonly string ToString() => $"[{r:F3}, {g:F3}, {b:F3}, {a:F3}]"; } /// diff --git a/OmsiHookInvoker/FunctionHooks.cpp b/OmsiHookInvoker/FunctionHooks.cpp index 88b6545..25ca8a3 100644 --- a/OmsiHookInvoker/FunctionHooks.cpp +++ b/OmsiHookInvoker/FunctionHooks.cpp @@ -3,9 +3,7 @@ FunctionHooks::FunctionHooks() { - DWORD oldProtect; - VirtualProtect(hookTrampolineFunc, sizeof(hookTrampolineFunc), PAGE_EXECUTE_READWRITE, &oldProtect); - ZeroMemory(hookTrampolineFunc, sizeof(hookTrampolineFunc)); + } FunctionHooks::~FunctionHooks() @@ -13,7 +11,7 @@ FunctionHooks::~FunctionHooks() } -void FunctionHooks::InstallHook(UINT32 funcToHook) +void FunctionHooks::InstallHook(UINT32 funcToHook, BYTE* hookTrampolineFunc) { DWORD oldProtect; VirtualProtect((LPVOID)funcToHook, 256, PAGE_EXECUTE_READWRITE, &oldProtect); @@ -28,11 +26,21 @@ void FunctionHooks::InstallHook(UINT32 funcToHook) #define AsLEBytes(addr) ((addr>>3)&0xff), ((addr>>2)&0xff), ((addr>>1)&0xff), ((addr>>0)&0xff) -void FunctionHooks::OnTrigger(void(*callback)(LPCSTR trigger, int value)) +void FunctionHooks::OnTrigger(void(*callback)(int complMapObjInst, LPCSTR trigger, int value)) { + // TComplMapObjInst.TriggerXML(TComplMapObjInst *this,PascalString255 *trigger,int value) + UINT32 funcAddr = 0x007bae90; + UINT32 retAddr = 0x007bae96; + + DWORD oldProtect; + byte* hookTrampolineFunc = (byte*)malloc(256); + if (hookTrampolineFunc == 0) + return; + VirtualProtect(hookTrampolineFunc, sizeof(hookTrampolineFunc), PAGE_EXECUTE_READWRITE, &oldProtect); + ZeroMemory(hookTrampolineFunc, sizeof(hookTrampolineFunc)); // Bouncy bounce UINT32 callbackRelAddr = (UINT32)callback - ((UINT32)hookTrampolineFunc + 11); - UINT32 returnRelAddr = (UINT32)0x007bae96 - ((UINT32)hookTrampolineFunc + 25); + UINT32 returnRelAddr = (UINT32)retAddr - ((UINT32)hookTrampolineFunc + 25); // Setup the hook handler so that it calls the callback and then jumps back to the original function byte hookTrampolineTemp[] = { // Save the register args for later @@ -59,5 +67,5 @@ void FunctionHooks::OnTrigger(void(*callback)(LPCSTR trigger, int value)) }; memcpy(hookTrampolineFunc, hookTrampolineTemp, sizeof(hookTrampolineTemp)); - InstallHook(0x007bae90); + InstallHook(funcAddr, hookTrampolineFunc); } diff --git a/OmsiHookInvoker/FunctionHooks.h b/OmsiHookInvoker/FunctionHooks.h index ce4c485..2197388 100644 --- a/OmsiHookInvoker/FunctionHooks.h +++ b/OmsiHookInvoker/FunctionHooks.h @@ -4,11 +4,9 @@ class FunctionHooks public: FunctionHooks(); ~FunctionHooks(); - void OnTrigger(void (*callback) (LPCSTR trigger, int value)); + void OnTrigger(void(*callback)(int complMapObjInst, LPCSTR trigger, int value)); private: - void InstallHook(UINT32 funcToHook); - - byte hookTrampolineFunc[256]; + void InstallHook(UINT32 funcToHook, BYTE* hookTrampolineFunc); }; diff --git a/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj b/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj index 5b031d8..ab16efc 100644 --- a/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj +++ b/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj @@ -109,6 +109,6 @@ True - + \ No newline at end of file From eb357e76d4ddab98405bbf145405c0f3dcc40d16 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Fri, 22 Dec 2023 23:15:37 +0100 Subject: [PATCH 02/36] + Make work better --- .gitignore | 1 + OmsiExtensionsCLI/Program.cs | 11 ++++++----- OmsiHook/OmsiHook.csproj | 2 +- OmsiHook/log.txt | 0 4 files changed, 8 insertions(+), 6 deletions(-) delete mode 100644 OmsiHook/log.txt diff --git a/.gitignore b/.gitignore index dfcfd56..3457c6c 100644 --- a/.gitignore +++ b/.gitignore @@ -348,3 +348,4 @@ MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ +/OmsiHook/log.txt diff --git a/OmsiExtensionsCLI/Program.cs b/OmsiExtensionsCLI/Program.cs index fffdcd5..3c3421c 100644 --- a/OmsiExtensionsCLI/Program.cs +++ b/OmsiExtensionsCLI/Program.cs @@ -33,7 +33,6 @@ static void Main(string[] args) var camPos = cam?.Pos ?? default; var weather = omsi.Globals.Weather; var tickets = omsi.Globals.TicketPack; - var humans = omsi.Globals.Humans; Console.SetCursorPosition(0, 0); Console.WriteLine(($"Read data: x:{pos.x:F3} y:{pos.y:F3} z:{pos.z:F3} " + @@ -76,12 +75,12 @@ static void Main(string[] args) } OmsiAnimSubMesh clickMesh = null; OmsiAnimSubMeshInst clickMeshInst = null; - string mouseEventName = "door0"; + string mouseEventName = "INEO_Click"; if(meshes != null) clickMesh = meshes.FirstOrDefault(mesh => mesh.MausEvent == mouseEventName); if (clickMesh != null) clickMeshInst = meshInsts[meshes.IndexOf(clickMesh)]; - if (clickMesh != null && progMan.Maus_MeshEvent == mouseEventName && (progMan.Maus_Clicked || true)) + if (clickMesh != null && progMan.Maus_MeshEvent == mouseEventName && (progMan.Maus_Clicked)) { // Work out object space coords of the mouse click // Note that (if wrapped) we could use D3DXIntersect to find the UV coords given the submesh's d3d mesh @@ -92,16 +91,18 @@ static void Main(string[] args) // invMat = clickMesh.CharMatrixInv; //else Matrix4x4.Invert((Matrix4x4)clickMeshInst.Matrix, out invMat); + Matrix4x4.Invert(clickMesh.OriginMatrix, out Matrix4x4 invOriginMat); + invMat = Matrix4x4.Multiply(invMat, invOriginMat); var rayStart = Vector3.Transform(progMan.MausLine3DPos, invMat); var rayDir = Vector3.Transform(progMan.MausLine3DDir, invMat); // Now trace the ray, in our simplification we assume the surface of the mesh we want to hit is coplanar to the xz plane // Taken from: https://stackoverflow.com/a/18543221 - Vector3 planeNrm = new(1, 0, 0); + Vector3 planeNrm = new(0, 1, 0); float planeD = 0; float dot = Vector3.Dot(planeNrm, rayDir); var intersect = new Vector3(); - if(dot > 1e-9) + if(Math.Abs(dot) > 1e-9) { var w = rayStart - planeNrm * planeD; var fac = -Vector3.Dot(planeNrm, w) / dot; diff --git a/OmsiHook/OmsiHook.csproj b/OmsiHook/OmsiHook.csproj index 1450bda..dfcc000 100644 --- a/OmsiHook/OmsiHook.csproj +++ b/OmsiHook/OmsiHook.csproj @@ -12,7 +12,7 @@ true 2.3.2.1 2.3.2.1 - 2.3.2 + 2.3.3 LGPL-3.0-only False README.md diff --git a/OmsiHook/log.txt b/OmsiHook/log.txt deleted file mode 100644 index e69de29..0000000 From 72d094ff1808e1bd962002735d814f3b32117d5b Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Fri, 29 Dec 2023 06:26:54 +0100 Subject: [PATCH 03/36] Restructured the project + new features and fixes: - Updated docfx (although it might be a bit broken still...) - Updated CLI example program - Moved docs into it's own folder - Split MemArray classes into their own files - Implemented MemArrayList for strings and structs - Implemented OmsiMovingMapObjInst - Added OmsiSetTrigger and OmsiTriggerSound remote methods - Added OnActiveVehicleChanged event - Other small changes --- .github/workflows/docs.yml | 4 +- OmsiExtensions.sln | 1 + OmsiExtensionsCLI/Program.cs | 125 ++-- OmsiHook/CustomAttributes.cs | 2 +- OmsiHook/MemArray.cs | 624 ------------------ OmsiHook/{ => MemArray}/MemArrayBase.cs | 17 +- OmsiHook/MemArray/MemArrayObjList.cs | 121 ++++ OmsiHook/MemArray/MemArraySimpleStruct.cs | 103 +++ OmsiHook/MemArray/MemArraySimpleStructPtr.cs | 89 +++ OmsiHook/MemArray/MemArrayString.cs | 132 ++++ OmsiHook/MemArray/MemArrayStringDict.cs | 68 ++ OmsiHook/MemArray/MemArrayStringList.cs | 123 ++++ OmsiHook/MemArray/MemArrayStruct.cs | 123 ++++ OmsiHook/MemArray/MemArrayStructList.cs | 122 ++++ OmsiHook/OmsiHook.cs | 14 + OmsiHook/OmsiHook.csproj | 150 +++-- OmsiHook/OmsiHookRPCMethods.cs | 6 +- OmsiHook/OmsiMovingMapObjInst.cs | 12 - OmsiHook/OmsiRemoteMethods.cs | 100 +++ OmsiHook/OmsiStructs.cs | 135 ++-- .../D3DMeshFileObject.cs | 0 .../{ => WrappedOmsiClasses}/D3DMeshObject.cs | 0 .../{ => WrappedOmsiClasses}/D3DObject.cs | 0 .../D3DTransformObject.cs | 0 .../OmsiActuWeather.cs | 0 .../OmsiAnimSubMesh.cs | 0 .../OmsiAnimSubMeshInst.cs | 0 .../{ => WrappedOmsiClasses}/OmsiBoolClass.cs | 0 .../{ => WrappedOmsiClasses}/OmsiCamera.cs | 0 .../{ => WrappedOmsiClasses}/OmsiChrono.cs | 0 .../OmsiChronoChange.cs | 0 .../OmsiChronoChangeDel.cs | 0 .../OmsiChronoChangeLabels.cs | 0 .../OmsiChronoChangeTyp.cs | 0 .../OmsiComplMapObj.cs | 0 .../OmsiComplMapObjInst.cs | 6 + .../OmsiComplMapSceneObjInst.cs | 0 .../{ => WrappedOmsiClasses}/OmsiComplObj.cs | 0 .../OmsiComplObjInst.cs | 0 .../OmsiCoordSystem.cs | 0 .../OmsiDynHelperMan.cs | 0 .../OmsiFileObject.cs | 0 .../OmsiFileSpline.cs | 0 .../OmsiFileTerrain.cs | 0 .../{ => WrappedOmsiClasses}/OmsiFileWater.cs | 0 .../OmsiFreeTexInst.cs | 0 .../{ => WrappedOmsiClasses}/OmsiFuncClass.cs | 0 OmsiHook/{ => WrappedOmsiClasses}/OmsiHOF.cs | 0 .../OmsiHumanBeing.cs | 0 .../OmsiHumanBeingInst.cs | 0 .../OmsiKachelForest.cs | 0 OmsiHook/{ => WrappedOmsiClasses}/OmsiMap.cs | 0 .../{ => WrappedOmsiClasses}/OmsiMapKachel.cs | 0 .../OmsiMapObjInst.cs | 0 .../OmsiMovingMapObjInst.cs | 241 +++++++ .../OmsiObjBlackRect.cs | 0 .../OmsiObjChronoVars.cs | 0 .../{ => WrappedOmsiClasses}/OmsiPartikel.cs | 0 .../OmsiPartikelemitter.cs | 0 .../OmsiPassengerCabin.cs | 0 .../{ => WrappedOmsiClasses}/OmsiPathGroup.cs | 0 .../OmsiPathManager.cs | 0 .../OmsiPathPointBasic.cs | 0 .../OmsiPathSegment.cs | 0 .../{ => WrappedOmsiClasses}/OmsiPhysObj.cs | 0 .../OmsiPhysObjInst.cs | 0 .../{ => WrappedOmsiClasses}/OmsiProgMan.cs | 0 .../OmsiRoadVehicle.cs | 0 .../OmsiRoadVehicleInst.cs | 10 + .../{ => WrappedOmsiClasses}/OmsiSound.cs | 0 .../{ => WrappedOmsiClasses}/OmsiSoundPack.cs | 0 .../OmsiSplineSegment.cs | 0 .../OmsiStringList.cs | 0 OmsiHook/{ => WrappedOmsiClasses}/OmsiTime.cs | 0 .../OmsiTimeTableMan.cs | 0 .../{ => WrappedOmsiClasses}/OmsiVehicle.cs | 0 .../OmsiVehicleInst.cs | 0 .../{ => WrappedOmsiClasses}/OmsiVisu_OBB.cs | 0 .../{ => WrappedOmsiClasses}/OmsiWeather.cs | 0 OmsiHook/{ => docs}/api/.gitignore | 0 OmsiHook/{ => docs}/api/index.md | 0 .../articles/building-native-plugins.md | 0 OmsiHook/{ => docs}/articles/intro.md | 0 .../{ => docs}/articles/performance-tips.md | 0 OmsiHook/{ => docs}/articles/toc.yml | 0 OmsiHook/{ => docs}/docfx.json | 4 +- OmsiHook/docs/docfx_log.txt | 167 +++++ OmsiHook/{ => docs}/images/favicon.ico | Bin OmsiHook/{ => docs}/images/logo.svg | 0 OmsiHook/{ => docs}/index.md | 0 .../plugins/memberpage.2.59.2/.signature.p7s | Bin .../content/ManagedReference.extension.js | 0 .../content/ManagedReference.overwrite.js | 0 .../content/partials/class.tmpl.partial | 0 .../content/partials/collection.tmpl.partial | 0 .../partials/customMREFContent.tmpl.partial | 0 .../content/partials/item.tmpl.partial | 0 .../content/plugins/HtmlAgilityPack.dll | Bin .../Microsoft.DocAsCode.Build.Common.dll | Bin ...Code.Build.MemberLevelManagedReference.dll | Bin .../plugins/Microsoft.DocAsCode.Common.dll | Bin ...crosoft.DocAsCode.DataContracts.Common.dll | Bin ...cAsCode.DataContracts.ManagedReference.dll | Bin .../Microsoft.DocAsCode.MarkdownLite.dll | Bin .../plugins/Microsoft.DocAsCode.Plugins.dll | Bin .../Microsoft.DocAsCode.YamlSerialization.dll | Bin .../content/plugins/Newtonsoft.Json.dll | Bin .../content/plugins/System.Buffers.dll | Bin .../plugins/System.Collections.Immutable.dll | Bin .../System.Composition.AttributedModel.dll | Bin .../plugins/System.Composition.Convention.dll | Bin .../plugins/System.Composition.Hosting.dll | Bin .../plugins/System.Composition.Runtime.dll | Bin .../plugins/System.Composition.TypedParts.dll | Bin .../content/plugins/System.Memory.dll | Bin .../plugins/System.Numerics.Vectors.dll | Bin ...System.Runtime.CompilerServices.Unsafe.dll | Bin .../content/plugins/YamlDotNet.dll | Bin .../content/plugins/docfx.plugins.config | 0 .../memberpage.2.59.2/content/toc.html.js | 0 .../templates/singulinkfx/layout/_master.tmpl | 0 .../singulinkfx/partials/footer.tmpl.partial | 0 .../singulinkfx/partials/head.tmpl.partial | 0 .../singulinkfx/partials/li.tmpl.partial | 0 .../singulinkfx/partials/logo.tmpl.partial | 0 .../partials/namespace.tmpl.partial | 0 .../singulinkfx/partials/navbar.tmpl.partial | 0 .../singulinkfx/partials/scripts.tmpl.partial | 0 .../partials/searchResults.tmpl.partial | 0 .../singulinkfx/partials/toc.tmpl.partial | 0 .../templates/singulinkfx/styles/config.css | 0 .../templates/singulinkfx/styles/discord.css | 0 .../singulinkfx/styles/down-arrow.svg | 0 .../styles/jquery.twbsPagination.js | 0 .../templates/singulinkfx/styles/main.css | 0 .../templates/singulinkfx/styles/main.js | 0 .../singulinkfx/styles/singulink.css | 0 .../templates/singulinkfx/styles/singulink.js | 0 .../templates/singulinkfx/styles/url.min.js | 0 .../templates/singulinkfx/toc.html.tmpl | 0 OmsiHook/{ => docs}/toc.yml | 0 OmsiHookInvoker/dllmain.cpp | 12 + OmsiHookRPCPlugin/NativeImports.cs | 4 + OmsiHookRPCPlugin/OmsiHookRPCPlugin.cs | 21 + OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj | 2 +- 145 files changed, 1713 insertions(+), 825 deletions(-) delete mode 100644 OmsiHook/MemArray.cs rename OmsiHook/{ => MemArray}/MemArrayBase.cs (78%) create mode 100644 OmsiHook/MemArray/MemArrayObjList.cs create mode 100644 OmsiHook/MemArray/MemArraySimpleStruct.cs create mode 100644 OmsiHook/MemArray/MemArraySimpleStructPtr.cs create mode 100644 OmsiHook/MemArray/MemArrayString.cs create mode 100644 OmsiHook/MemArray/MemArrayStringDict.cs create mode 100644 OmsiHook/MemArray/MemArrayStringList.cs create mode 100644 OmsiHook/MemArray/MemArrayStruct.cs create mode 100644 OmsiHook/MemArray/MemArrayStructList.cs delete mode 100644 OmsiHook/OmsiMovingMapObjInst.cs rename OmsiHook/{ => WrappedOmsiClasses}/D3DMeshFileObject.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/D3DMeshObject.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/D3DObject.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/D3DTransformObject.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiActuWeather.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiAnimSubMesh.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiAnimSubMeshInst.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiBoolClass.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiCamera.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiChrono.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiChronoChange.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiChronoChangeDel.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiChronoChangeLabels.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiChronoChangeTyp.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiComplMapObj.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiComplMapObjInst.cs (96%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiComplMapSceneObjInst.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiComplObj.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiComplObjInst.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiCoordSystem.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiDynHelperMan.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiFileObject.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiFileSpline.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiFileTerrain.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiFileWater.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiFreeTexInst.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiFuncClass.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiHOF.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiHumanBeing.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiHumanBeingInst.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiKachelForest.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiMap.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiMapKachel.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiMapObjInst.cs (100%) create mode 100644 OmsiHook/WrappedOmsiClasses/OmsiMovingMapObjInst.cs rename OmsiHook/{ => WrappedOmsiClasses}/OmsiObjBlackRect.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiObjChronoVars.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiPartikel.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiPartikelemitter.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiPassengerCabin.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiPathGroup.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiPathManager.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiPathPointBasic.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiPathSegment.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiPhysObj.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiPhysObjInst.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiProgMan.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiRoadVehicle.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiRoadVehicleInst.cs (97%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiSound.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiSoundPack.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiSplineSegment.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiStringList.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiTime.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiTimeTableMan.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiVehicle.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiVehicleInst.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiVisu_OBB.cs (100%) rename OmsiHook/{ => WrappedOmsiClasses}/OmsiWeather.cs (100%) rename OmsiHook/{ => docs}/api/.gitignore (100%) rename OmsiHook/{ => docs}/api/index.md (100%) rename OmsiHook/{ => docs}/articles/building-native-plugins.md (100%) rename OmsiHook/{ => docs}/articles/intro.md (100%) rename OmsiHook/{ => docs}/articles/performance-tips.md (100%) rename OmsiHook/{ => docs}/articles/toc.yml (100%) rename OmsiHook/{ => docs}/docfx.json (96%) create mode 100644 OmsiHook/docs/docfx_log.txt rename OmsiHook/{ => docs}/images/favicon.ico (100%) rename OmsiHook/{ => docs}/images/logo.svg (100%) rename OmsiHook/{ => docs}/index.md (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/.signature.p7s (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/ManagedReference.extension.js (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/ManagedReference.overwrite.js (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/partials/class.tmpl.partial (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/partials/collection.tmpl.partial (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/partials/customMREFContent.tmpl.partial (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/partials/item.tmpl.partial (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/HtmlAgilityPack.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Build.Common.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Build.MemberLevelManagedReference.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Common.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.DataContracts.Common.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.DataContracts.ManagedReference.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.MarkdownLite.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Plugins.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.YamlSerialization.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/Newtonsoft.Json.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/System.Buffers.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/System.Collections.Immutable.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/System.Composition.AttributedModel.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/System.Composition.Convention.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/System.Composition.Hosting.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/System.Composition.Runtime.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/System.Composition.TypedParts.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/System.Memory.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/System.Numerics.Vectors.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/System.Runtime.CompilerServices.Unsafe.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/YamlDotNet.dll (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/plugins/docfx.plugins.config (100%) rename OmsiHook/{ => docs}/plugins/memberpage.2.59.2/content/toc.html.js (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/layout/_master.tmpl (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/partials/footer.tmpl.partial (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/partials/head.tmpl.partial (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/partials/li.tmpl.partial (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/partials/logo.tmpl.partial (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/partials/namespace.tmpl.partial (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/partials/navbar.tmpl.partial (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/partials/scripts.tmpl.partial (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/partials/searchResults.tmpl.partial (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/partials/toc.tmpl.partial (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/styles/config.css (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/styles/discord.css (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/styles/down-arrow.svg (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/styles/jquery.twbsPagination.js (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/styles/main.css (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/styles/main.js (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/styles/singulink.css (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/styles/singulink.js (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/styles/url.min.js (100%) rename OmsiHook/{ => docs}/templates/singulinkfx/toc.html.tmpl (100%) rename OmsiHook/{ => docs}/toc.yml (100%) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 395369e..5843dad 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,9 +16,9 @@ jobs: steps: - uses: actions/checkout@v3 - name: Generate docs - uses: nikeee/docfx-action@v1.0.0 + uses: nunit/docfx-action@v2.4.0 with: - args: OmsiHook/docfx.json + args: OmsiHook/docs/docfx.json # Archive the generated site as an artifact - name: Archive artifact diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index c6129e3..84f3749 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -35,6 +35,7 @@ Global {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|Any CPU.Build.0 = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x64.ActiveCfg = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.ActiveCfg = Release|x86 + {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.Build.0 = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|Any CPU.Build.0 = Debug|Any CPU {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x64.ActiveCfg = Debug|Any CPU diff --git a/OmsiExtensionsCLI/Program.cs b/OmsiExtensionsCLI/Program.cs index 3c3421c..d354179 100644 --- a/OmsiExtensionsCLI/Program.cs +++ b/OmsiExtensionsCLI/Program.cs @@ -36,11 +36,11 @@ static void Main(string[] args) Console.SetCursorPosition(0, 0); Console.WriteLine(($"Read data: x:{pos.x:F3} y:{pos.y:F3} z:{pos.z:F3} " + - $"tile:{playerVehicle?.Kachel??0}").PadRight(Console.WindowWidth - 1)); - Console.WriteLine($"Read data: vx:{vel.x:F3} vy:{vel.y:F3} vz:{vel.z:F3}".PadRight(Console.WindowWidth-1)); - Console.WriteLine($"Read data: ax:{posa._30:F3} ay:{posa._31:F3} az:{posa._32:F3}".PadRight(Console.WindowWidth-1)); + $"tile:{playerVehicle?.Kachel ?? 0}").PadRight(Console.WindowWidth - 1)); + Console.WriteLine($"Read data: vx:{vel.x:F3} vy:{vel.y:F3} vz:{vel.z:F3}".PadRight(Console.WindowWidth - 1)); + Console.WriteLine($"Read data: ax:{posa._30:F3} ay:{posa._31:F3} az:{posa._32:F3}".PadRight(Console.WindowWidth - 1)); - Console.WriteLine($"Read data: map:{map?.Name} path:{map?.Filename} friendly:{map?.FriendlyName}".PadRight(Console.WindowWidth-1)); + Console.WriteLine($"Read data: map:{map?.Name} path:{map?.Filename} friendly:{map?.FriendlyName}".PadRight(Console.WindowWidth - 1)); Console.WriteLine($"{omsi.Globals.Time.Day}/{omsi.Globals.Time.Month}/{omsi.Globals.Time.Year} - {omsi.Globals.Time.Hour}:{omsi.Globals.Time.Minute}:{omsi.Globals.Time.Second:F2}"); Console.WriteLine($"Camera data: x:{camPos.x:F3} y:{camPos.y:F3} z:{camPos.z:F3} ".PadRight(Console.WindowWidth - 1)); Console.WriteLine($"{omsi.Globals.Drivers}".PadRight(Console.WindowWidth - 1)); @@ -56,62 +56,7 @@ static void Main(string[] args) Console.WriteLine($"[MOUSE] pos: {progMan.MausPos} ray_pos: {progMan.MausLine3DPos} ray_dir: {progMan.MausLine3DDir}".PadRight(Console.WindowWidth - 1)); Console.WriteLine($"[MOUSE] {progMan.MausCrossObjFlat} {progMan.MausCrossObjFlat_ObjHeight} {progMan.Maus_MeshEvent}".PadRight(Console.WindowWidth - 1)); - if (meshes != null) - { - int i = 0; - foreach (var mesh in meshes) - { - if(mesh.MausEvent != null) - { - Console.WriteLine($" Mesh '{mesh.Filename_Int}' has event: {mesh.MausEvent}"); - i++; - } - if(i > 20) - { - Console.WriteLine(" ..."); - break; - } - } - } - OmsiAnimSubMesh clickMesh = null; - OmsiAnimSubMeshInst clickMeshInst = null; - string mouseEventName = "INEO_Click"; - if(meshes != null) - clickMesh = meshes.FirstOrDefault(mesh => mesh.MausEvent == mouseEventName); - if (clickMesh != null) - clickMeshInst = meshInsts[meshes.IndexOf(clickMesh)]; - if (clickMesh != null && progMan.Maus_MeshEvent == mouseEventName && (progMan.Maus_Clicked)) - { - // Work out object space coords of the mouse click - // Note that (if wrapped) we could use D3DXIntersect to find the UV coords given the submesh's d3d mesh - - // Transform the mouse ray from world space to object space - Matrix4x4 invMat; - //if (clickMesh.UseCharMatrix) - // invMat = clickMesh.CharMatrixInv; - //else - Matrix4x4.Invert((Matrix4x4)clickMeshInst.Matrix, out invMat); - Matrix4x4.Invert(clickMesh.OriginMatrix, out Matrix4x4 invOriginMat); - invMat = Matrix4x4.Multiply(invMat, invOriginMat); - - var rayStart = Vector3.Transform(progMan.MausLine3DPos, invMat); - var rayDir = Vector3.Transform(progMan.MausLine3DDir, invMat); - // Now trace the ray, in our simplification we assume the surface of the mesh we want to hit is coplanar to the xz plane - // Taken from: https://stackoverflow.com/a/18543221 - Vector3 planeNrm = new(0, 1, 0); - float planeD = 0; - float dot = Vector3.Dot(planeNrm, rayDir); - var intersect = new Vector3(); - if(Math.Abs(dot) > 1e-9) - { - var w = rayStart - planeNrm * planeD; - var fac = -Vector3.Dot(planeNrm, w) / dot; - var u = rayDir * fac; - intersect = rayStart + u; - } - - Console.WriteLine($" Clicked on {clickMesh.Filename_Int} at local coords: {(D3DVector)intersect}"); - } + CheckClickPos(progMan, meshes, meshInsts); /*Console.WriteLine("".PadRight(Console.WindowWidth-1)); try @@ -130,6 +75,63 @@ static void Main(string[] args) Thread.Sleep(20); } } + + private static void CheckClickPos(OmsiProgMan progMan, MemArrayList meshes, MemArrayList meshInsts) + { + // A small experiment, with the aim of being able to determine where the user clicks on an object in local space. + if (meshes != null) + { + int i = 0; + foreach (var mesh in meshes) + { + if (mesh.MausEvent != null) + { + Console.WriteLine($" Mesh '{mesh.Filename_Int}' has event: {mesh.MausEvent}"); + i++; + } + if (i > 20) + { + Console.WriteLine(" ..."); + break; + } + } + } + OmsiAnimSubMesh clickMesh = null; + OmsiAnimSubMeshInst clickMeshInst = null; + string mouseEventName = "INEO_Click"; + if (meshes != null) + clickMesh = meshes.FirstOrDefault(mesh => mesh.MausEvent == mouseEventName); + if (clickMesh != null) + clickMeshInst = meshInsts[meshes.IndexOf(clickMesh)]; + if (clickMesh != null && progMan.Maus_MeshEvent == mouseEventName && (progMan.Maus_Clicked)) + { + // Work out object space coords of the mouse click + // Note that (if wrapped) we could use D3DXIntersect to find the UV coords given the submesh's d3d mesh + + // Transform the mouse ray from world space to object space + Matrix4x4.Invert((Matrix4x4)clickMeshInst.Matrix, out Matrix4x4 invMat); + Matrix4x4.Invert(clickMesh.OriginMatrix, out Matrix4x4 invOriginMat); + invMat = Matrix4x4.Multiply(invMat, invOriginMat); + + var rayStart = Vector3.Transform(progMan.MausLine3DPos, invMat); + var rayDir = Vector3.Transform(progMan.MausLine3DDir, invMat); + // Now trace the ray, in our simplification we assume the surface of the mesh we want to hit is coplanar to the xz plane + // Taken from: https://stackoverflow.com/a/18543221 + Vector3 planeNrm = new(0, 1, 0); + float planeD = 0; + float dot = Vector3.Dot(planeNrm, rayDir); + var intersect = new Vector3(); + if (Math.Abs(dot) > 1e-9) + { + var w = rayStart - planeNrm * planeD; + var fac = -Vector3.Dot(planeNrm, w) / dot; + var u = rayDir * fac; + intersect = rayStart + u; + } + + Console.WriteLine($" Clicked on {clickMesh.Filename_Int} at local coords: {(D3DVector)intersect}"); + } + } } public class DXTests @@ -182,6 +184,9 @@ public void CreateTexture() public void UpdateTexture() { + // Note that writing texture data like this is very slow, if possible, try to use SIMD accelerated + // operations (such as those in System.Numerics) or if you need to copy data into a texture buffer + // System.Buffer.BlockCopy() is extremely fast. for (int y = 0; y < texHeight; y++) for(int x = 0; x < texWidth; x++) { diff --git a/OmsiHook/CustomAttributes.cs b/OmsiHook/CustomAttributes.cs index 7febc9a..a026f7d 100644 --- a/OmsiHook/CustomAttributes.cs +++ b/OmsiHook/CustomAttributes.cs @@ -160,7 +160,7 @@ public OmsiObjPtrAttribute(Type objType) } /// - /// Marks a field to be converted from an int to an . + /// Marks a field to be converted from an int to an OmsiObject[]. /// Used by /// [System.AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)] diff --git a/OmsiHook/MemArray.cs b/OmsiHook/MemArray.cs deleted file mode 100644 index 6c68ccc..0000000 --- a/OmsiHook/MemArray.cs +++ /dev/null @@ -1,624 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace OmsiHook -{ - /// - /// Wrapper for Arrays / Lists in OMSI's Memory. - /// - /// - /// This is a heavyweight wrapper for native arrays that provides methods for reading and writing to arrays as well as - /// helping with memory management. For fast, low-level access, use the methods in the class. - /// For better performance in c# the contents of the wrapped array can be copied to managed memory when constructed - /// or whenever is called. - /// Cached arrays are generally faster when accessed or searched frequently by C#, but they are slower to update and - /// the user is responsible for ensuring that they are synchronised with the native array it wraps. - /// - /// The type of struct to wrap - /// Internal struct type to marshal Struct from - public class MemArray : MemArrayBase - where InternalStruct : unmanaged - where Struct : struct - { - - /// - /// Gets the current contents of the wrapped array. On non-cached arrays this is slow. - /// - public override Struct[] WrappedArray => cached ? arrayCache - : Memory.MarshalStructs(Memory.ReadMemoryStructArray(Address)); - - public MemArray() : base() { } - - internal MemArray(Memory memory, int address, bool cached = true) : base(memory, address, cached) { } - - public override void UpdateFromHook(int index = -1) - { - if (cached) - { - if (index < 0) - arrayCache = Memory.MarshalStructs(Memory.ReadMemoryStructArray(Address)); - else - arrayCache[index] = Memory.MarshalStruct(Memory.ReadMemoryArrayItem(Address, index)); - } - } - - public override Struct this[int index] - { - get => cached ? arrayCache[index] - : Memory.MarshalStruct( - Memory.ReadMemoryArrayItemSafe(Address, index)); - set - { - if (cached) - arrayCache[index] = value; - Memory.WriteMemoryArrayItemSafe(Address, Memory.UnMarshalStruct(value), index); - } - } - - /// - /// TODO: Implement efficient enumerator for non-cached arrays. - /// - /// - public override IEnumerator GetEnumerator() => ((IEnumerable)WrappedArray).GetEnumerator(); - - /// - /// Adds an item to the native array. This is slow and might cause memory leaks because it reallocates the whole array. - /// - /// - /// Since this method doesn't call , if the native array is out of sync - /// with the cached array, then data may be lost when adding new items. - /// In the following case though, it should usually be safe (as long as the native array isn't updated by Omsi while this runs): - /// - /// memArray.UpdateFromHook(); - /// foreach(int item in localObjects) - /// memArray.Add(item); - /// - /// - /// The item to add to the native array. - public override void Add(Struct item) - { - int arr = Memory.ReadMemory(Address); - int len = Memory.ReadMemory(arr - 4); - int narr = Memory.AllocateStructArray(++len).Result; - Memory.WriteMemory(Address, narr); - if (cached) - { - // Copy native array from cache - for (int i = 0; i < Math.Min(len, arrayCache.Length); i++) - Memory.WriteMemoryArrayItem(narr, Memory.UnMarshalStruct(arrayCache[i]), i); - - // Update cached array - Array.Resize(ref arrayCache, len); - arrayCache[len - 1] = item; - } - else - { - // Copy native array - Memory.CopyMemory(arr, narr, (len-1) * Marshal.SizeOf()); - } - - // Add the new item to the native array - Memory.WriteMemoryArrayItem(Address, Memory.UnMarshalStruct(item), len - 1); - } - - public override void Clear() - { - base.Clear(); - if(cached) - arrayCache = Array.Empty(); - } - - public override bool Remove(Struct item) => throw new NotImplementedException(); - - public override void Insert(int index, Struct item) => throw new NotImplementedException(); - - public override void RemoveAt(int index) => throw new NotImplementedException(); - - public override int IndexOf(Struct item) => Array.IndexOf(WrappedArray, item); - - public override bool Contains(Struct item) => WrappedArray.Contains(item); - - public override void CopyTo(Struct[] array, int arrayIndex) => WrappedArray.CopyTo(array, arrayIndex); - } - - /// - /// Wrapper for Arrays / Lists in OMSI's Memory. - /// - /// - /// This is a heavyweight wrapper for native arrays that provides methods for reading and writing to arrays as well as - /// helping with memory management. For fast, low-level access, use the methods in the class. - /// For better performance in c# the contents of the wrapped array can be copied to managed memory when constructed - /// or whenever is called. - /// Cached arrays are generally faster when accessed or searched frequently by C#, but they are slower to update and - /// the user is responsible for ensuring that they are synchronised with the native array it wraps. - /// - /// The type of struct to wrap. - public class MemArray : MemArray where T : unmanaged - { - public override T[] WrappedArray => cached ? arrayCache : Memory.ReadMemoryStructArray(Address); - - public MemArray() : base() { } - internal MemArray(Memory memory, int address, bool cached = true) : base(memory, address, cached) { } - - public override void UpdateFromHook(int index = -1) - { - if (cached) - { - if(index >= 0) - arrayCache[index] = Memory.ReadMemoryArrayItem(Address, index); - else - arrayCache = Memory.ReadMemoryStructArray(Address); - } - } - - public override T this[int index] - { - get => cached ? arrayCache [index] : Memory.ReadMemoryArrayItemSafe(Address, index); - set - { - if (cached) - arrayCache[index] = value; - Memory.WriteMemoryArrayItemSafe(Address, value, index); - } - } - - /// - /// Adds an item to the native array. This is slow and might cause memory leaks because it reallocates the whole array. - /// - /// - /// Since this method doesn't call , if the native array is out of sync - /// with the cached array, then data may be lost when adding new items. - /// In the following case though, it should usually be safe (as long as the native array isn't updated by Omsi while this runs): - /// - /// memArray.UpdateFromHook(); - /// foreach(int item in localObjects) - /// memArray.Add(item); - /// - /// - /// The item to add to the native array. - public override void Add(T item) - { - int arr = Memory.ReadMemory(Address); - int len = Memory.ReadMemory(arr - 4); - int narr = Memory.AllocateStructArray(++len).Result; - Memory.WriteMemory(Address, narr); - if(cached) - { - // Copy native array from cache - for(int i = 0; i < Math.Min(len, arrayCache.Length); i++) - Memory.WriteMemoryArrayItem(narr, arrayCache[i], i); - - // Update cached array - Array.Resize(ref arrayCache, len); - arrayCache[len - 1] = item; - } - else - { - // Copy native array - Memory.CopyMemory(arr, narr, (len - 1) * Marshal.SizeOf()); - } - - // Add the new item to the native array - Memory.WriteMemoryArrayItem(Address, item, len-1); - } - - /// - /// Clears the native array but maintains the reference to prevent the GC from destroying it. - /// - public override void Clear() - { - base.Clear(); - if (cached) - arrayCache = Array.Empty(); - } - - public override bool Remove(T item) => throw new NotImplementedException(); - - public override void Insert(int index, T item) => throw new NotImplementedException(); - - public override void RemoveAt(int index) => throw new NotImplementedException(); - } - - /// - /// Wrapper for Arrays / Lists in OMSI's Memory. - /// - /// - /// This is a heavyweight wrapper for native arrays that provides methods for reading and writing to arrays as well as - /// helping with memory management. For fast, low-level access, use the methods in the class. - /// For better performance in c# the contents of the wrapped array can be copied to managed memory when constructed - /// or whenever is called. - /// Cached arrays are generally faster when accessed or searched frequently by C#, but they are slower to update and - /// the user is responsible for ensuring that they are synchronised with the native array it wraps. - /// - /// The type of struct to wrap. - public class MemArrayPtr : MemArray where T : unmanaged - { - public override T[] WrappedArray => cached ? arrayCache : Memory.ReadMemoryStructPtrArray(Address); - - public MemArrayPtr() : base() { } - internal MemArrayPtr(Memory memory, int address, bool cached = true) : base(memory, address, cached) { } - - public override void UpdateFromHook(int index = -1) - { - if (cached) - { - if(index >= 0) - arrayCache[index] = Memory.ReadMemoryArrayItem(Address, index, true); - else - arrayCache = Memory.ReadMemoryStructPtrArray(Address); - } - } - - public override T this[int index] - { - get => cached ? arrayCache[index] : Memory.ReadMemoryArrayItemSafe(Address, index, true); - set - { - if (cached) - arrayCache[index] = value; - Memory.WriteMemoryArrayItemSafe(Address, value, index, true); - } - } - - public override void Add(T item) - { - int arr = Memory.ReadMemory(Address); - int len = Memory.ReadMemory(arr - 4); - var allocTask = Task.WhenAll(Memory.AllocateStructArray(++len), Memory.AllocateStruct(item)); - int narr = allocTask.Result[0]; - int ndata = allocTask.Result[1]; - Memory.WriteMemory(Address, narr); - if (cached) - { - // Copy native array - Memory.CopyMemory(arr, narr, (len - 1) * 4); - - // Update cached array - Array.Resize(ref arrayCache, len); - arrayCache[len - 1] = item; - } - else - { - // Copy native array - Memory.CopyMemory(arr, narr, (len - 1) * 4); - } - - // Add the new item to the native array - Memory.WriteMemoryArrayItem(Address, ndata, len - 1, false); - } - - /// - /// Clears the native array but maintains the reference to prevent the GC from destroying it. - /// Note that this does not free or dereference the items pointed to by the array elements. - /// - public override void Clear() - { - base.Clear(); - if (cached) - arrayCache = Array.Empty(); - } - - public override bool Remove(T item) => throw new NotImplementedException(); - - public override void Insert(int index, T item) => throw new NotImplementedException(); - - public override void RemoveAt(int index) => throw new NotImplementedException(); - } - - /// - /// Wrapper for Arrays / Lists in OMSI's Memory. - /// - /// - /// This is a heavyweight wrapper for native arrays that provides methods for reading and writing to arrays as well as - /// helping with memory management. For fast, low-level access, use the methods in the class. - /// For better performance in c# the contents of the wrapped array can be copied to managed memory when constructed - /// or whenever is called. - /// Cached arrays are generally faster when accessed or searched frequently by C#, but they are slower to update and - /// the user is responsible for ensuring that they are synchronised with the native array it wraps. - /// - public class MemArrayString : MemArrayBase - { - internal readonly bool wide; - - public override string this[int index] - { - get => cached ? arrayCache[index] : Memory.ReadMemoryArrayItemStringSafe(Address, index, wide); - set - { - if (cached) - arrayCache[index] = value; - Memory.WriteMemoryArrayItemSafe(Address, Memory.AllocateString(value).Result, index); - } - } - - public override string[] WrappedArray => cached ? arrayCache - : Memory.ReadMemoryStringArray(Address, wide); - - /// - /// Whether or not the string is in UTF-16. - /// - public bool Wide => wide; - - public MemArrayString() : base() { } - /// - /// Constructs a new MemArray to wrap a native array at a given address. - /// - /// Instance of the memory manager - /// Address of the native array to wrap - /// Whether or not the string is in UTF-16 - /// Whether or not to copy the contents of the array to a local cache - internal MemArrayString(Memory memory, int address, bool wide = false, bool cached = true) : base(memory, address, cached) - { - this.wide = wide; - } - - public override void UpdateFromHook(int index = -1) - { - if (cached) - { - if(index >= 0) - arrayCache[index] = Memory.ReadMemoryArrayItemString(Address, index, wide); - else - arrayCache = Memory.ReadMemoryStringArray(Address, wide); - } - } - - /// - /// Adds an item to the native array. This is slow and might cause memory leaks because it reallocates the whole array. - /// - /// - /// This method is probably slower (and much more memory intensive) on cached arrays. - /// Since this method doesn't call , if the native array is out of sync - /// with the cached array, then data may be lost when adding new items. - /// In the following case though, it should usually be safe (as long as the native array isn't updated by Omsi while this runs): - /// - /// memArray.UpdateFromHook(); - /// foreach(int item in localObjects) - /// memArray.Add(item); - /// - /// - /// The item to add to the native array. - public override void Add(string item) - { - int arr = Memory.ReadMemory(Address); - int len = Memory.ReadMemory(arr - 4); - int narr = Memory.AllocateStructArray(++len).Result; - Memory.WriteMemory(Address, narr); - if (cached) - { - // Copy native array from cache, this will never be faster... - /*Span allocatedStrings = stackalloc int[Math.Min(len, arrayCache.Length)]; - Task.WhenAll(); - for (int i = 0; i < allocatedStrings.Length; i++) - allocatedStrings[i] = Memory.AllocateString(arrayCache[i]); - for (int i = 0; i < Math.Min(len, arrayCache.Length); i++) - Memory.WriteMemoryArrayItem(narr, allocatedStrings[i], i);*/ - // Copy native array - Memory.CopyMemory(arr, narr, (len - 1) * Marshal.SizeOf()); - - // Update cached array - Array.Resize(ref arrayCache, len); - arrayCache[len - 1] = item; - } - else - { - // Copy native array - Memory.CopyMemory(arr, narr, (len - 1) * Marshal.SizeOf()); - } - - // Add the new item to the native array - Memory.WriteMemoryArrayItem(Address, Memory.AllocateString(item).Result, len - 1); - } - - public override void Clear() - { - base.Clear(); - if (cached) - arrayCache = Array.Empty(); - } - - public override bool Contains(string item) => WrappedArray.Contains(item); - - public override void CopyTo(string[] array, int arrayIndex) => WrappedArray.CopyTo(array, arrayIndex); - - //TODO: Implement efficient enumerator for non-cached arrays. - public override IEnumerator GetEnumerator() => (IEnumerator)WrappedArray.GetEnumerator(); - - public override int IndexOf(string item) => Array.IndexOf(WrappedArray, item); - - public override void Insert(int index, string item) => throw new NotImplementedException(); - - public override bool Remove(string item) => throw new NotImplementedException(); - - public override void RemoveAt(int index) => throw new NotImplementedException(); - } - - /// - /// Wrapper for Arrays / Lists in OMSI's Memory with automatic index caching. - /// - /// - /// This type of MemArray relies on it being cached and as such no option exists to use it uncached. - /// This is a heavyweight wrapper for native arrays that provides methods for reading and writing to arrays as well as - /// helping with memory management. For fast, low-level access, use the methods in the class. - /// For better performance in c# the contents of the wrapped array can be copied to managed memory when constructed - /// or whenever is called. - /// Cached arrays are generally faster when accessed or searched frequently by C#, but they are slower to update and - /// the user is responsible for ensuring that they are synchronised with the native array it wraps. - /// - public class MemArrayStringDict : MemArrayString - { - private Dictionary indexDictionary = new(); - - public Dictionary IndexDictionary => indexDictionary; - - internal MemArrayStringDict(Memory memory, int address, bool wide = false) : base(memory, address, wide, true) { } - public MemArrayStringDict() : base() { } - - /// - /// Gets the index of the string in the native array from it's value. - /// - /// - /// - public int this[string item] => indexDictionary[item]; - - public override bool Cached { get => cached; } - - public override void UpdateFromHook(int index = -1) - { - if (index >= 0) - { - string prevValue = arrayCache[index]; - base.UpdateFromHook(index); - if (prevValue != arrayCache[index]) - { - indexDictionary.Remove(prevValue); - indexDictionary.Add(arrayCache[index], index); - } - } - else - { - base.UpdateFromHook(index); - indexDictionary.Clear(); - for (int i = 0; i < Count; i++) - { - if (arrayCache[i] != null) - indexDictionary.TryAdd(arrayCache[i], i); - } - } - } - - public override bool Contains(string item) => indexDictionary.ContainsKey(item); - public override int IndexOf(string item) => indexDictionary[item]; - public override bool Remove(string item) - { - if (indexDictionary.ContainsKey(item)) - base.RemoveAt(indexDictionary[item]); - else - return false; - return true; - } - } - - /// - /// Wrapper for Lists in OMSI's Memory. - /// - /// - /// This is a heavyweight wrapper for native arrays that provides methods for reading and writing to arrays as well as - /// helping with memory management. For fast, low-level access, use the methods in the class. - /// For better performance in c# the contents of the wrapped array can be copied to managed memory when constructed - /// or whenever is called. - /// Cached arrays are generally faster when accessed or searched frequently by C#, but they are slower to update and - /// the user is responsible for ensuring that they are synchronised with the native array it wraps. - /// - /// The type of object to wrap. - public class MemArrayList : MemArrayBase where T : OmsiObject, new() - { - private T[] ReadList() - { - uint arr = Memory.ReadMemory(Address); - if (arr == 0) - return Array.Empty(); - uint len = Memory.ReadMemory(arr + 8); - uint arrayData = Memory.ReadMemory(arr + 4); - T[] ret = new T[len]; - for (uint i = 0; i < len; i++) - { - var objAddr = Memory.ReadMemory(arrayData + i * 4); - if (objAddr == 0) - { - ret[i] = null; - continue; - } - - var n = new T(); - n.InitObject(Memory, (int)objAddr); - ret[i] = n; - } - - return ret; - } - - private T ReadListItem(int index) - { - int arr = Memory.ReadMemory(Address); - if (arr == 0) - return null; - - int len = Memory.ReadMemory(arr + 8); - int arrayData = Memory.ReadMemory(arr + 4); - - if(index >= len || index < 0) - throw new ArgumentOutOfRangeException(nameof(index)); - - var objAddr = Memory.ReadMemory(arrayData + index * 4); - if (objAddr == 0) - return null; - - var n = new T(); - n.InitObject(Memory, objAddr); - - return n; - } - - /// - /// Gets the current contents of the wrapped array. On non-cached arrays this is slow. - /// - public override T[] WrappedArray => cached ? arrayCache : ReadList(); - - public MemArrayList() : base() { } - - internal MemArrayList(Memory memory, int address, bool cached = true) : base(memory, address, cached) { } - - public override void UpdateFromHook(int index = -1) - { - if (cached) - { - if (index < 0) - arrayCache = ReadList(); - else - arrayCache[index] = ReadListItem(index); - } - } - - public override T this[int index] - { - get => cached ? arrayCache[index] : ReadListItem(index); - set => throw new NotSupportedException(); - } - - /// - /// TODO: Implement efficient enumerator for non-cached arrays. - /// - /// - public override IEnumerator GetEnumerator() => ((IEnumerable)WrappedArray).GetEnumerator(); - - public override void Add(T item) - { - throw new NotSupportedException(); - } - - public override void Clear() - { - base.Clear(); - if (cached) - arrayCache = Array.Empty(); - } - - public override bool Remove(T item) => throw new NotImplementedException(); - - public override void Insert(int index, T item) => throw new NotImplementedException(); - - public override void RemoveAt(int index) => throw new NotImplementedException(); - - public override int IndexOf(T item) => Array.IndexOf(WrappedArray, item); - - public override bool Contains(T item) => WrappedArray.Contains(item); - - public override void CopyTo(T[] array, int arrayIndex) => WrappedArray.CopyTo(array, arrayIndex); - } -} diff --git a/OmsiHook/MemArrayBase.cs b/OmsiHook/MemArray/MemArrayBase.cs similarity index 78% rename from OmsiHook/MemArrayBase.cs rename to OmsiHook/MemArray/MemArrayBase.cs index 5ab5284..748dea5 100644 --- a/OmsiHook/MemArrayBase.cs +++ b/OmsiHook/MemArray/MemArrayBase.cs @@ -4,6 +4,18 @@ namespace OmsiHook { + /// + /// Base class for wrappers for Arrays / Lists in OMSI's Memory. + /// + /// + /// This is a heavyweight wrapper for native arrays that provides methods for reading and writing to arrays as well as + /// helping with memory management. For fast, low-level access, use the methods in the class. + /// For better performance in c# the contents of the wrapped array can be copied to managed memory when constructed + /// or whenever is called. + /// Cached arrays are generally faster when accessed or searched frequently by C#, but they are slower to update and + /// the user is responsible for ensuring that they are synchronised with the native array it wraps. + /// + /// The type of struct to wrap public abstract class MemArrayBase : OmsiObject, IDisposable, IEnumerable, ICollection, IList { internal bool cached; @@ -23,12 +35,13 @@ public int Count get { if (cached) - return arrayCache.Length; + return arrayCache?.Length ?? 0; else { int start = Memory.ReadMemory(Address); if (start == 0) - throw new NullReferenceException(); + return 0; + //throw new NullReferenceException(); return Memory.ReadMemory(start - 4); } } diff --git a/OmsiHook/MemArray/MemArrayObjList.cs b/OmsiHook/MemArray/MemArrayObjList.cs new file mode 100644 index 0000000..e974cc8 --- /dev/null +++ b/OmsiHook/MemArray/MemArrayObjList.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OmsiHook +{ + /// + /// Wrapper for Lists in OMSI's Memory. + /// + /// + /// + /// + /// + public class MemArrayList : MemArrayBase where T : OmsiObject, new() + { + private T[] ReadList() + { + uint arr = Memory.ReadMemory(Address); + if (arr == 0) + return Array.Empty(); + uint len = Memory.ReadMemory(arr + 8); + uint arrayData = Memory.ReadMemory(arr + 4); + T[] ret = new T[len]; + for (uint i = 0; i < len; i++) + { + var objAddr = Memory.ReadMemory(arrayData + i * 4); + if (objAddr == 0) + { + ret[i] = null; + continue; + } + + var n = new T(); + n.InitObject(Memory, (int)objAddr); + ret[i] = n; + } + + return ret; + } + + private T ReadListItem(int index) + { + int arr = Memory.ReadMemory(Address); + if (arr == 0) + return null; + + int len = Memory.ReadMemory(arr + 8); + int arrayData = Memory.ReadMemory(arr + 4); + + if (index >= len || index < 0) + throw new ArgumentOutOfRangeException(nameof(index)); + + var objAddr = Memory.ReadMemory(arrayData + index * 4); + if (objAddr == 0) + return null; + + var n = new T(); + n.InitObject(Memory, objAddr); + + return n; + } + + /// + /// Gets the current contents of the wrapped array. On non-cached arrays this is slow. + /// + public override T[] WrappedArray => cached ? arrayCache : ReadList(); + + public MemArrayList() : base() { } + + internal MemArrayList(Memory memory, int address, bool cached = true) : base(memory, address, cached) { } + + public override void UpdateFromHook(int index = -1) + { + if (cached) + { + if (index < 0) + arrayCache = ReadList(); + else + arrayCache[index] = ReadListItem(index); + } + } + + public override T this[int index] + { + get => cached ? arrayCache[index] : ReadListItem(index); + set => throw new NotSupportedException(); + } + + /// + /// TODO: Implement efficient enumerator for non-cached arrays. + /// + /// + public override IEnumerator GetEnumerator() => ((IEnumerable)WrappedArray).GetEnumerator(); + + public override void Add(T item) + { + throw new NotSupportedException(); + } + + public override void Clear() + { + base.Clear(); + if (cached) + arrayCache = Array.Empty(); + } + + public override bool Remove(T item) => throw new NotImplementedException(); + + public override void Insert(int index, T item) => throw new NotImplementedException(); + + public override void RemoveAt(int index) => throw new NotImplementedException(); + + public override int IndexOf(T item) => Array.IndexOf(WrappedArray, item); + + public override bool Contains(T item) => WrappedArray.Contains(item); + + public override void CopyTo(T[] array, int arrayIndex) => WrappedArray.CopyTo(array, arrayIndex); + } +} diff --git a/OmsiHook/MemArray/MemArraySimpleStruct.cs b/OmsiHook/MemArray/MemArraySimpleStruct.cs new file mode 100644 index 0000000..44ba5cb --- /dev/null +++ b/OmsiHook/MemArray/MemArraySimpleStruct.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace OmsiHook +{ + /// + /// Wrapper for dynamic arrays in OMSI's Memory. + /// + /// + /// + /// + /// + public class MemArray : MemArray where T : unmanaged + { + public override T[] WrappedArray => cached ? arrayCache : Memory.ReadMemoryStructArray(Address); + + public MemArray() : base() { } + internal MemArray(Memory memory, int address, bool cached = true) : base(memory, address, cached) { } + + public override void UpdateFromHook(int index = -1) + { + if (cached) + { + if (index >= 0) + arrayCache[index] = Memory.ReadMemoryArrayItem(Address, index); + else + arrayCache = Memory.ReadMemoryStructArray(Address); + } + } + + public override T this[int index] + { + get => cached ? arrayCache[index] : Memory.ReadMemoryArrayItemSafe(Address, index); + set + { + if (cached) + arrayCache[index] = value; + Memory.WriteMemoryArrayItemSafe(Address, value, index); + } + } + + /// + /// Adds an item to the native array. This is slow and might cause memory leaks because it reallocates the whole array. + /// + /// + /// Since this method doesn't call , if the native array is out of sync + /// with the cached array, then data may be lost when adding new items. + /// In the following case though, it should usually be safe (as long as the native array isn't updated by Omsi while this runs): + /// + /// memArray.UpdateFromHook(); + /// foreach(int item in localObjects) + /// memArray.Add(item); + /// + /// + /// The item to add to the native array. + public override void Add(T item) + { + int arr = Memory.ReadMemory(Address); + int len = Memory.ReadMemory(arr - 4); + int narr = Memory.AllocateStructArray(++len).Result; + Memory.WriteMemory(Address, narr); + if (cached) + { + // Copy native array from cache + for (int i = 0; i < Math.Min(len, arrayCache.Length); i++) + Memory.WriteMemoryArrayItem(narr, arrayCache[i], i); + + // Update cached array + Array.Resize(ref arrayCache, len); + arrayCache[len - 1] = item; + } + else + { + // Copy native array + Memory.CopyMemory(arr, narr, (len - 1) * Marshal.SizeOf()); + } + + // Add the new item to the native array + Memory.WriteMemoryArrayItem(Address, item, len - 1); + } + + /// + /// Clears the native array but maintains the reference to prevent the GC from destroying it. + /// + public override void Clear() + { + base.Clear(); + if (cached) + arrayCache = Array.Empty(); + } + + public override bool Remove(T item) => throw new NotImplementedException(); + + public override void Insert(int index, T item) => throw new NotImplementedException(); + + public override void RemoveAt(int index) => throw new NotImplementedException(); + } +} diff --git a/OmsiHook/MemArray/MemArraySimpleStructPtr.cs b/OmsiHook/MemArray/MemArraySimpleStructPtr.cs new file mode 100644 index 0000000..bff9308 --- /dev/null +++ b/OmsiHook/MemArray/MemArraySimpleStructPtr.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OmsiHook +{ + /// + /// Wrapper for dynamic arrays of pointers in OMSI's Memory. + /// + /// + /// + /// + /// + public class MemArrayPtr : MemArray where T : unmanaged + { + public override T[] WrappedArray => cached ? arrayCache : Memory.ReadMemoryStructPtrArray(Address); + + public MemArrayPtr() : base() { } + internal MemArrayPtr(Memory memory, int address, bool cached = true) : base(memory, address, cached) { } + + public override void UpdateFromHook(int index = -1) + { + if (cached) + { + if (index >= 0) + arrayCache[index] = Memory.ReadMemoryArrayItem(Address, index, true); + else + arrayCache = Memory.ReadMemoryStructPtrArray(Address); + } + } + + public override T this[int index] + { + get => cached ? arrayCache[index] : Memory.ReadMemoryArrayItemSafe(Address, index, true); + set + { + if (cached) + arrayCache[index] = value; + Memory.WriteMemoryArrayItemSafe(Address, value, index, true); + } + } + + public override void Add(T item) + { + int arr = Memory.ReadMemory(Address); + int len = Memory.ReadMemory(arr - 4); + var allocTask = Task.WhenAll(Memory.AllocateStructArray(++len), Memory.AllocateStruct(item)); + int narr = allocTask.Result[0]; + int ndata = allocTask.Result[1]; + Memory.WriteMemory(Address, narr); + if (cached) + { + // Copy native array + Memory.CopyMemory(arr, narr, (len - 1) * 4); + + // Update cached array + Array.Resize(ref arrayCache, len); + arrayCache[len - 1] = item; + } + else + { + // Copy native array + Memory.CopyMemory(arr, narr, (len - 1) * 4); + } + + // Add the new item to the native array + Memory.WriteMemoryArrayItem(Address, ndata, len - 1, false); + } + + /// + /// Clears the native array but maintains the reference to prevent the GC from destroying it. + /// Note that this does not free or dereference the items pointed to by the array elements. + /// + public override void Clear() + { + base.Clear(); + if (cached) + arrayCache = Array.Empty(); + } + + public override bool Remove(T item) => throw new NotImplementedException(); + + public override void Insert(int index, T item) => throw new NotImplementedException(); + + public override void RemoveAt(int index) => throw new NotImplementedException(); + } +} diff --git a/OmsiHook/MemArray/MemArrayString.cs b/OmsiHook/MemArray/MemArrayString.cs new file mode 100644 index 0000000..7ed5ae4 --- /dev/null +++ b/OmsiHook/MemArray/MemArrayString.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace OmsiHook +{ + /// + /// Wrapper for arrays of strings in OMSI's memmory. + /// + /// + /// + /// + public class MemArrayString : MemArrayBase + { + internal readonly bool wide; + + public override string this[int index] + { + get => cached ? arrayCache[index] : Memory.ReadMemoryArrayItemStringSafe(Address, index, wide); + set + { + if (cached) + arrayCache[index] = value; + Memory.WriteMemoryArrayItemSafe(Address, Memory.AllocateString(value).Result, index); + } + } + + public override string[] WrappedArray => cached ? arrayCache + : Memory.ReadMemoryStringArray(Address, wide); + + /// + /// Whether or not the string is in UTF-16. + /// + public bool Wide => wide; + + public MemArrayString() : base() { } + /// + /// Constructs a new MemArray to wrap a native array at a given address. + /// + /// Instance of the memory manager + /// Address of the native array to wrap + /// Whether or not the string is in UTF-16 + /// Whether or not to copy the contents of the array to a local cache + internal MemArrayString(Memory memory, int address, bool wide = false, bool cached = true) : base(memory, address, cached) + { + this.wide = wide; + } + + public override void UpdateFromHook(int index = -1) + { + if (cached) + { + if (index >= 0) + arrayCache[index] = Memory.ReadMemoryArrayItemString(Address, index, wide); + else + arrayCache = Memory.ReadMemoryStringArray(Address, wide); + } + } + + /// + /// Adds an item to the native array. This is slow and might cause memory leaks because it reallocates the whole array. + /// + /// + /// This method is probably slower (and much more memory intensive) on cached arrays. + /// Since this method doesn't call , if the native array is out of sync + /// with the cached array, then data may be lost when adding new items. + /// In the following case though, it should usually be safe (as long as the native array isn't updated by Omsi while this runs): + /// + /// memArray.UpdateFromHook(); + /// foreach(int item in localObjects) + /// memArray.Add(item); + /// + /// + /// The item to add to the native array. + public override void Add(string item) + { + int arr = Memory.ReadMemory(Address); + int len = Memory.ReadMemory(arr - 4); + int narr = Memory.AllocateStructArray(++len).Result; + Memory.WriteMemory(Address, narr); + if (cached) + { + // Copy native array from cache, this will never be faster... + /*Span allocatedStrings = stackalloc int[Math.Min(len, arrayCache.Length)]; + Task.WhenAll(); + for (int i = 0; i < allocatedStrings.Length; i++) + allocatedStrings[i] = Memory.AllocateString(arrayCache[i]); + for (int i = 0; i < Math.Min(len, arrayCache.Length); i++) + Memory.WriteMemoryArrayItem(narr, allocatedStrings[i], i);*/ + // Copy native array + Memory.CopyMemory(arr, narr, (len - 1) * Marshal.SizeOf()); + + // Update cached array + Array.Resize(ref arrayCache, len); + arrayCache[len - 1] = item; + } + else + { + // Copy native array + Memory.CopyMemory(arr, narr, (len - 1) * Marshal.SizeOf()); + } + + // Add the new item to the native array + Memory.WriteMemoryArrayItem(Address, Memory.AllocateString(item).Result, len - 1); + } + + public override void Clear() + { + base.Clear(); + if (cached) + arrayCache = Array.Empty(); + } + + public override bool Contains(string item) => WrappedArray.Contains(item); + + public override void CopyTo(string[] array, int arrayIndex) => WrappedArray.CopyTo(array, arrayIndex); + + //TODO: Implement efficient enumerator for non-cached arrays. + public override IEnumerator GetEnumerator() => (IEnumerator)WrappedArray.GetEnumerator(); + + public override int IndexOf(string item) => Array.IndexOf(WrappedArray, item); + + public override void Insert(int index, string item) => throw new NotImplementedException(); + + public override bool Remove(string item) => throw new NotImplementedException(); + + public override void RemoveAt(int index) => throw new NotImplementedException(); + } +} diff --git a/OmsiHook/MemArray/MemArrayStringDict.cs b/OmsiHook/MemArray/MemArrayStringDict.cs new file mode 100644 index 0000000..93de102 --- /dev/null +++ b/OmsiHook/MemArray/MemArrayStringDict.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OmsiHook +{ + /// + /// Wrapper for arrays of strings in OMSI's Memory with automatic index caching. + /// + /// + /// + /// + public class MemArrayStringDict : MemArrayString + { + private Dictionary indexDictionary = new(); + + public Dictionary IndexDictionary => indexDictionary; + + internal MemArrayStringDict(Memory memory, int address, bool wide = false) : base(memory, address, wide, true) { } + public MemArrayStringDict() : base() { } + + /// + /// Gets the index of the string in the native array from it's value. + /// + /// + /// + public int this[string item] => indexDictionary[item]; + + public override bool Cached { get => cached; } + + public override void UpdateFromHook(int index = -1) + { + if (index >= 0) + { + string prevValue = arrayCache[index]; + base.UpdateFromHook(index); + if (prevValue != arrayCache[index]) + { + indexDictionary.Remove(prevValue); + indexDictionary.Add(arrayCache[index], index); + } + } + else + { + base.UpdateFromHook(index); + indexDictionary.Clear(); + for (int i = 0; i < Count; i++) + { + if (arrayCache[i] != null) + indexDictionary.TryAdd(arrayCache[i], i); + } + } + } + + public override bool Contains(string item) => indexDictionary.ContainsKey(item); + public override int IndexOf(string item) => indexDictionary[item]; + public override bool Remove(string item) + { + if (indexDictionary.ContainsKey(item)) + base.RemoveAt(indexDictionary[item]); + else + return false; + return true; + } + } +} diff --git a/OmsiHook/MemArray/MemArrayStringList.cs b/OmsiHook/MemArray/MemArrayStringList.cs new file mode 100644 index 0000000..8498c93 --- /dev/null +++ b/OmsiHook/MemArray/MemArrayStringList.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OmsiHook +{ + /// + /// Wrapper for String Lists in OMSI's Memory. + /// + /// + /// + /// + public class MemArrayStringList : MemArrayBase + { + private StrPtrType stringType = StrPtrType.RawDelphiAnsiString; + + private string[] ReadList() + { + uint arr = Memory.ReadMemory(Address); + if (arr == 0) + return Array.Empty(); + uint len = Memory.ReadMemory(arr + 8); + uint arrayData = Memory.ReadMemory(arr + 4); + string[] ret = new string[len]; + for (uint i = 0; i < len; i++) + { + var objAddr = Memory.ReadMemory(arrayData + i * 4); + if (objAddr == 0) + { + ret[i] = null; + continue; + } + + var n = Memory.ReadMemoryString(objAddr, stringType); + ret[i] = n; + } + + return ret; + } + + private string ReadListItem(int index) + { + int arr = Memory.ReadMemory(Address); + if (arr == 0) + return null; + + int len = Memory.ReadMemory(arr + 8); + int arrayData = Memory.ReadMemory(arr + 4); + + if (index >= len || index < 0) + throw new ArgumentOutOfRangeException(nameof(index)); + + var objAddr = Memory.ReadMemory(arrayData + index * 4); + if (objAddr == 0) + return null; + + var n = Memory.ReadMemoryString(objAddr, stringType); + + return n; + } + + /// + /// Gets the current contents of the wrapped array. On non-cached arrays this is slow. + /// + public override string[] WrappedArray => cached ? arrayCache : ReadList(); + + public MemArrayStringList() : base() { } + + internal MemArrayStringList(Memory memory, int address, bool cached = true, StrPtrType stringType = StrPtrType.RawDelphiAnsiString) : base(memory, address, cached) + { + this.stringType = stringType; + } + + public override void UpdateFromHook(int index = -1) + { + if (cached) + { + if (index < 0) + arrayCache = ReadList(); + else + arrayCache[index] = ReadListItem(index); + } + } + + public override string this[int index] + { + get => cached ? arrayCache[index] : ReadListItem(index); + set => throw new NotSupportedException(); + } + + /// + /// TODO: Implement efficient enumerator for non-cached arrays. + /// + /// + public override IEnumerator GetEnumerator() => ((IEnumerable)WrappedArray).GetEnumerator(); + + public override void Add(string item) + { + throw new NotSupportedException(); + } + + public override void Clear() + { + base.Clear(); + if (cached) + arrayCache = Array.Empty(); + } + + public override bool Remove(string item) => throw new NotImplementedException(); + + public override void Insert(int index, string item) => throw new NotImplementedException(); + + public override void RemoveAt(int index) => throw new NotImplementedException(); + + public override int IndexOf(string item) => Array.IndexOf(WrappedArray, item); + + public override bool Contains(string item) => WrappedArray.Contains(item); + + public override void CopyTo(string[] array, int arrayIndex) => WrappedArray.CopyTo(array, arrayIndex); + } +} diff --git a/OmsiHook/MemArray/MemArrayStruct.cs b/OmsiHook/MemArray/MemArrayStruct.cs new file mode 100644 index 0000000..f0ca7a9 --- /dev/null +++ b/OmsiHook/MemArray/MemArrayStruct.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace OmsiHook +{ + /// + /// Wrapper for Arrays / Lists in OMSI's Memory. + /// + /// + /// + /// + /// + /// Internal struct type to marshal Struct from + public class MemArray : MemArrayBase + where InternalStruct : unmanaged + where Struct : struct + { + + /// + /// Gets the current contents of the wrapped array. On non-cached arrays this is slow. + /// + public override Struct[] WrappedArray => cached ? arrayCache + : Memory.MarshalStructs(Memory.ReadMemoryStructArray(Address)); + + public MemArray() : base() { } + + internal MemArray(Memory memory, int address, bool cached = true) : base(memory, address, cached) { } + + public override void UpdateFromHook(int index = -1) + { + if (cached) + { + if (index < 0) + arrayCache = Memory.MarshalStructs(Memory.ReadMemoryStructArray(Address)); + else + arrayCache[index] = Memory.MarshalStruct(Memory.ReadMemoryArrayItem(Address, index)); + } + } + + public override Struct this[int index] + { + get => cached ? arrayCache[index] + : Memory.MarshalStruct( + Memory.ReadMemoryArrayItemSafe(Address, index)); + set + { + if (cached) + arrayCache[index] = value; + Memory.WriteMemoryArrayItemSafe(Address, Memory.UnMarshalStruct(value), index); + } + } + + /// + /// TODO: Implement efficient enumerator for non-cached arrays. + /// + /// + public override IEnumerator GetEnumerator() => ((IEnumerable)WrappedArray).GetEnumerator(); + + /// + /// Adds an item to the native array. This is slow and might cause memory leaks because it reallocates the whole array. + /// + /// + /// Since this method doesn't call , if the native array is out of sync + /// with the cached array, then data may be lost when adding new items. + /// In the following case though, it should usually be safe (as long as the native array isn't updated by Omsi while this runs): + /// + /// memArray.UpdateFromHook(); + /// foreach(int item in localObjects) + /// memArray.Add(item); + /// + /// + /// The item to add to the native array. + public override void Add(Struct item) + { + int arr = Memory.ReadMemory(Address); + int len = Memory.ReadMemory(arr - 4); + int narr = Memory.AllocateStructArray(++len).Result; + Memory.WriteMemory(Address, narr); + if (cached) + { + // Copy native array from cache + for (int i = 0; i < Math.Min(len, arrayCache.Length); i++) + Memory.WriteMemoryArrayItem(narr, Memory.UnMarshalStruct(arrayCache[i]), i); + + // Update cached array + Array.Resize(ref arrayCache, len); + arrayCache[len - 1] = item; + } + else + { + // Copy native array + Memory.CopyMemory(arr, narr, (len-1) * Marshal.SizeOf()); + } + + // Add the new item to the native array + Memory.WriteMemoryArrayItem(Address, Memory.UnMarshalStruct(item), len - 1); + } + + public override void Clear() + { + base.Clear(); + if(cached) + arrayCache = Array.Empty(); + } + + public override bool Remove(Struct item) => throw new NotImplementedException(); + + public override void Insert(int index, Struct item) => throw new NotImplementedException(); + + public override void RemoveAt(int index) => throw new NotImplementedException(); + + public override int IndexOf(Struct item) => Array.IndexOf(WrappedArray, item); + + public override bool Contains(Struct item) => WrappedArray.Contains(item); + + public override void CopyTo(Struct[] array, int arrayIndex) => WrappedArray.CopyTo(array, arrayIndex); + } +} diff --git a/OmsiHook/MemArray/MemArrayStructList.cs b/OmsiHook/MemArray/MemArrayStructList.cs new file mode 100644 index 0000000..bbd0068 --- /dev/null +++ b/OmsiHook/MemArray/MemArrayStructList.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OmsiHook +{ + /// + /// Wrapper for Lists in OMSI's Memory. + /// + /// + /// + /// + /// + /// Internal struct type to marshal Struct from + public class MemArrayList : MemArrayBase + where InternalStruct : unmanaged + where Struct : struct + { + private Struct[] ReadList() + { + uint arr = Memory.ReadMemory(Address); + if (arr == 0) + return Array.Empty(); + uint len = Memory.ReadMemory(arr + 8); + uint arrayData = Memory.ReadMemory(arr + 4); + Struct[] ret = new Struct[len]; + for (uint i = 0; i < len; i++) + { + var objAddr = Memory.ReadMemory(arrayData + i * 4); + if (objAddr == 0) + { + ret[i] = default; + continue; + } + + var n = Memory.MarshalStruct(Memory.ReadMemory(objAddr)); + ret[i] = n; + } + + return ret; + } + + private Struct ReadListItem(int index) + { + int arr = Memory.ReadMemory(Address); + if (arr == 0) + return default; + + int len = Memory.ReadMemory(arr + 8); + int arrayData = Memory.ReadMemory(arr + 4); + + if (index >= len || index < 0) + throw new ArgumentOutOfRangeException(nameof(index)); + + var objAddr = Memory.ReadMemory(arrayData + index * 4); + if (objAddr == 0) + return default; + + var n = Memory.MarshalStruct(Memory.ReadMemory(objAddr)); + + return n; + } + + /// + /// Gets the current contents of the wrapped array. On non-cached arrays this is slow. + /// + public override Struct[] WrappedArray => cached ? arrayCache : ReadList(); + + public MemArrayList() : base() { } + + internal MemArrayList(Memory memory, int address, bool cached = true) : base(memory, address, cached) { } + + public override void UpdateFromHook(int index = -1) + { + if (cached) + { + if (index < 0) + arrayCache = ReadList(); + else + arrayCache[index] = ReadListItem(index); + } + } + + public override Struct this[int index] + { + get => cached ? arrayCache[index] : ReadListItem(index); + set => throw new NotSupportedException(); + } + + /// + /// TODO: Implement efficient enumerator for non-cached arrays. + /// + /// + public override IEnumerator GetEnumerator() => ((IEnumerable)WrappedArray).GetEnumerator(); + + public override void Add(Struct item) + { + throw new NotSupportedException(); + } + + public override void Clear() + { + base.Clear(); + if (cached) + arrayCache = Array.Empty(); + } + + public override bool Remove(Struct item) => throw new NotImplementedException(); + + public override void Insert(int index, Struct item) => throw new NotImplementedException(); + + public override void RemoveAt(int index) => throw new NotImplementedException(); + + public override int IndexOf(Struct item) => Array.IndexOf(WrappedArray, item); + + public override bool Contains(Struct item) => WrappedArray.Contains(item); + + public override void CopyTo(Struct[] array, int arrayIndex) => WrappedArray.CopyTo(array, arrayIndex); + } +} diff --git a/OmsiHook/OmsiHook.cs b/OmsiHook/OmsiHook.cs index cb243d3..be8ff12 100644 --- a/OmsiHook/OmsiHook.cs +++ b/OmsiHook/OmsiHook.cs @@ -82,10 +82,18 @@ public class OmsiHook /// /// public event EventHandler OnMapLoaded; + /// + /// An event raised when the active vehicle is changed. The EventArgs is a OmsiRoadVehicleInst of the new bus. + /// + /// + /// + /// + public event EventHandler OnActiveVehicleChanged; private int lastD3DState = 0; private int lastMapState = 0; private bool lastMapLoaded = false; + private int lastVehiclePtr = 0; #endregion /// @@ -223,6 +231,12 @@ private void MonitorStateTask() lastMapLoaded = currentMapLoaded; } } + var vehPtr = GetListItem(0x00861508, omsiMemory.ReadMemory(0x00861740)); + if (vehPtr != lastVehiclePtr) + { + lastVehiclePtr = vehPtr; + OnActiveVehicleChanged?.Invoke(this, Globals.PlayerVehicle); + } Thread.Sleep(20); } diff --git a/OmsiHook/OmsiHook.csproj b/OmsiHook/OmsiHook.csproj index dfcc000..c79e638 100644 --- a/OmsiHook/OmsiHook.csproj +++ b/OmsiHook/OmsiHook.csproj @@ -1,83 +1,89 @@  - - net6.0-windows - Thomas Mathieson et al - Copyright Thomas Mathieson 2023 all rights reserved - https://github.com/space928/Omsi-Extensions - https://github.com/space928/Omsi-Extensions - - OmsiHook is a simple library for hooking into Omsi's memory for modding. - true - true - 2.3.2.1 - 2.3.2.1 - 2.3.3 - LGPL-3.0-only - False - README.md - Logo.png - true - snupkg - disable - x86 - + + net6.0-windows + Thomas Mathieson et al + Copyright Thomas Mathieson 2023 all rights reserved + https://github.com/space928/Omsi-Extensions + https://github.com/space928/Omsi-Extensions + + OmsiHook is a simple library for hooking into Omsi's memory for modding. + true + true + 2.4.1.1 + 2.4.1.1 + 2.4.1 + LGPL-3.0-only + False + README.md + Logo.png + true + snupkg + disable + x86 + False + - + - - - - True - \ - - - True - \ - - - PreserveNewest - True - \lib\net6.0 - - - PreserveNewest - True - \lib\net6.0 - - - PreserveNewest - True - \lib\net6.0 - - - PreserveNewest - True - \lib\net6.0 - - + + true + $(MSBuildProjectDirectory)/docs/docfx.json + $(MSBuildProjectDirectory)/docs/_site + $(MSBuildProjectDirectory)/docs + $(MSBuildProjectDirectory)/docs/docfx_log.txt + Info + - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - false - - - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + - - - + + + false + + + diff --git a/OmsiHook/OmsiHookRPCMethods.cs b/OmsiHook/OmsiHookRPCMethods.cs index ccdaaa3..b345f7f 100644 --- a/OmsiHook/OmsiHookRPCMethods.cs +++ b/OmsiHook/OmsiHookRPCMethods.cs @@ -23,7 +23,9 @@ internal enum RemoteMethod : int UpdateSubresource, ReleaseTexture, GetTextureDesc, - IsTexture + IsTexture, + RVTriggerXML, + SoundTrigger } internal static readonly ReadOnlyDictionary RemoteMethodsArgsSizes = new(new Dictionary() @@ -40,6 +42,8 @@ internal enum RemoteMethod : int { RemoteMethod.ReleaseTexture, 4 }, { RemoteMethod.GetTextureDesc, 32 }, { RemoteMethod.IsTexture, 4 }, + { RemoteMethod.RVTriggerXML, 12 }, + { RemoteMethod.SoundTrigger, 12 }, }); } } diff --git a/OmsiHook/OmsiMovingMapObjInst.cs b/OmsiHook/OmsiMovingMapObjInst.cs deleted file mode 100644 index b72b8dd..0000000 --- a/OmsiHook/OmsiMovingMapObjInst.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace OmsiHook -{ - /// - /// Base Class for all instances of moving map objects - vehicles / humans - /// - public class OmsiMovingMapObjInst : OmsiComplMapObjInst - { - internal OmsiMovingMapObjInst(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } - public OmsiMovingMapObjInst() : base() { } - // TODO: this one - } -} \ No newline at end of file diff --git a/OmsiHook/OmsiRemoteMethods.cs b/OmsiHook/OmsiRemoteMethods.cs index 4678e1f..2ee83c8 100644 --- a/OmsiHook/OmsiRemoteMethods.cs +++ b/OmsiHook/OmsiRemoteMethods.cs @@ -454,6 +454,102 @@ public static async Task OmsiIsTextureAsync(uint texturePtr) } } + /// + /// Sets a trigger on a given road vehicle. + /// + /// The OmsiRoadVehicleInst to set the trigger on + /// The name of the trigger to set + /// Whether to enable or disable the trigger + public static async Task OmsiSetTrigger(OmsiRoadVehicleInst roadVehicle, string trigger, bool enabled) + { + var triggerPtr = await memory.AllocateString(trigger); + await OmsiSetTrigger(roadVehicle, triggerPtr, enabled); + } + + /// + /// Sets a trigger on a given road vehicle. + /// + /// The OmsiRoadVehicleInst to set the trigger on + /// A pointer to an Omsi string containing the name of the trigger to set + /// Whether to enable or disable the trigger + public static async Task OmsiSetTrigger(OmsiRoadVehicleInst roadVehicle, int triggerPtr, bool enabled) + { + if (localPlugin) + { + RVTriggerXML(roadVehicle.Address, triggerPtr, enabled?1:0); + return; + } + else + { + if (!IsInitialised) + throw new NotInitialisedException("OmsiHook RPC plugin is not connected! Did you make sure to call OmsiRemoteMethods.InitRemoteMethods() before this call?"); + + int argPos = 0; + var method = OmsiHookRPCMethods.RemoteMethod.RVTriggerXML; + int writeBufferSize = OmsiHookRPCMethods.RemoteMethodsArgsSizes[method] + 8; + // This should be thread safe as the asyncWriteBuff is thread local + byte[] writeBuffer = asyncWriteBuff.Value; + (int resultPromise, TaskCompletionSource promise) = CreateResultPromise(); + BitConverter.TryWriteBytes(writeBuffer.AsSpan()[(argPos)..], (int)method); + BitConverter.TryWriteBytes(writeBuffer.AsSpan()[(argPos += 4)..], resultPromise); + BitConverter.TryWriteBytes(writeBuffer.AsSpan()[(argPos += 4)..], roadVehicle.Address); + BitConverter.TryWriteBytes(writeBuffer.AsSpan()[(argPos += 4)..], triggerPtr); + BitConverter.TryWriteBytes(writeBuffer.AsSpan()[(argPos += 4)..], enabled ? 1 : 0); + lock (pipeTX) + pipeTX.Write(writeBuffer.AsSpan()[..writeBufferSize]); + await promise.Task; + } + } + + /// + /// Triggers a sound for a given OmsiComplMapObjInst + /// + /// The OmsiComplMapObjInst to trigger the sound from + /// The name of the sound pack + /// The filename of the sound to play + public static async Task OmsiSoundTrigger(OmsiComplMapObjInst mapObj, string trigger, string filename) + { + var triggerPtr = memory.AllocateString(trigger); + var filenamePtr = memory.AllocateString(filename); + Task.WaitAll(triggerPtr, filenamePtr); + await OmsiSoundTrigger(mapObj, triggerPtr.Result, filenamePtr.Result); + } + + /// + /// Triggers a sound for a given OmsiComplMapObjInst + /// + /// The OmsiComplMapObjInst to trigger the sound from + /// A pointer to an Omsi string containing the name of the sound pack + /// A pointer to an Omsi string containing the filename of the sound to play + public static async Task OmsiSoundTrigger(OmsiComplMapObjInst mapObj, int triggerPtr, int filenamePtr) + { + if (localPlugin) + { + SoundTrigger(mapObj.Address, triggerPtr, filenamePtr); + return; + } + else + { + if (!IsInitialised) + throw new NotInitialisedException("OmsiHook RPC plugin is not connected! Did you make sure to call OmsiRemoteMethods.InitRemoteMethods() before this call?"); + + int argPos = 0; + var method = OmsiHookRPCMethods.RemoteMethod.SoundTrigger; + int writeBufferSize = OmsiHookRPCMethods.RemoteMethodsArgsSizes[method] + 8; + // This should be thread safe as the asyncWriteBuff is thread local + byte[] writeBuffer = asyncWriteBuff.Value; + (int resultPromise, TaskCompletionSource promise) = CreateResultPromise(); + BitConverter.TryWriteBytes(writeBuffer.AsSpan()[(argPos)..], (int)method); + BitConverter.TryWriteBytes(writeBuffer.AsSpan()[(argPos += 4)..], resultPromise); + BitConverter.TryWriteBytes(writeBuffer.AsSpan()[(argPos += 4)..], mapObj.Address); + BitConverter.TryWriteBytes(writeBuffer.AsSpan()[(argPos += 4)..], triggerPtr); + BitConverter.TryWriteBytes(writeBuffer.AsSpan()[(argPos += 4)..], filenamePtr); + lock (pipeTX) + pipeTX.Write(writeBuffer.AsSpan()[..writeBufferSize]); + await promise.Task; + } + } + [DllImport("OmsiHookInvoker.dll")] private static extern int TProgManMakeVehicle(int progMan, int vehList, int _RoadVehicleTypes, bool onlyvehlist, bool CS, float TTtime, bool situationload, bool dialog, bool setdriver, bool thread, @@ -482,6 +578,10 @@ private static extern int TProgManPlaceRandomBus(int progMan, int aityp, private static extern int GetTextureDesc(uint Texture, uint pWidth, uint pHeight, uint pFormat); [DllImport("OmsiHookInvoker.dll")] private static extern int IsTexture(uint Texture); + [DllImport("OmsiHookInvoker.dll")] + private static extern void RVTriggerXML(int roadVehicle, int trigger, int value); + [DllImport("OmsiHookInvoker.dll")] + internal static extern void SoundTrigger(int complMapObj, int trigger, int filename); public enum D3DFORMAT : uint { diff --git a/OmsiHook/OmsiStructs.cs b/OmsiHook/OmsiStructs.cs index 6b99a1c..2efbd77 100644 --- a/OmsiHook/OmsiStructs.cs +++ b/OmsiHook/OmsiStructs.cs @@ -701,57 +701,66 @@ public struct OmsiPathBelegung } //TODO: Bug when dereferencing this + [StructLayout(LayoutKind.Explicit, Size = 0x110)] internal struct OmsiPathInfoInternal { - public byte veh_type; - public byte uvg; - public bool railroad; - public bool freeOrLarge; - public D3DVector pathPos; - public OmsiPathID path; - public int subPath; - public bool reverse; - public float hdg; - [OmsiStructPtr(typeof(uint))] public int idCode; - [OmsiObjPtr(typeof(OmsiObject))] public int vehicle; - public float veloc; - public float x_L, x_R, z_B, z_F; - public float radius; - public float drehpunkt; - [OmsiStructPtr(typeof(D3DMatrix))] public int absPosition; - public byte waitMode; - public int reserveGroup; - public byte blinker; - public byte einOrdnen;//TODO: Check data type - public bool prevVisible_logical; + [FieldOffset(0x0)] public byte veh_type; + [FieldOffset(0x1)] public byte uvg; + [FieldOffset(0x2)] public bool railroad; + [FieldOffset(0x3)] public bool freeOrLarge; + [FieldOffset(0x4)] public D3DVector pathPos; + [FieldOffset(0x10)] public OmsiPathID path; + [FieldOffset(0x18)] public int subPath; + [FieldOffset(0x1c)] public bool reverse; + [FieldOffset(0x20)] public float hdg; + [FieldOffset(0x24)] [OmsiStructPtr(typeof(uint))] public int idCode; + [FieldOffset(0x28)] [OmsiObjPtr(typeof(OmsiObject))] public int vehicle; + [FieldOffset(0x2c)] public float veloc; + [FieldOffset(0x30)] public float x_L; + [FieldOffset(0x34)] public float x_R; + [FieldOffset(0x38)] public float z_B; + [FieldOffset(0x3c)] public float z_F; + [FieldOffset(0x40)] public float radius; + [FieldOffset(0x44)] public float drehpunkt; + [FieldOffset(0x48)] [OmsiStructPtr(typeof(D3DMatrix))] public int absPosition; + [FieldOffset(0x4c)] public byte waitMode; + [FieldOffset(0x50)] public int reserveGroup; + [FieldOffset(0x54)] public byte blinker; + [FieldOffset(0x55)] public byte einOrdnen;//TODO: Check data type + [FieldOffset(0x56)] public bool prevVisible_logical; //TODO: Determine actual type - public int nextPath_a, nextPath_b, nextPath_c, nextPath_d, nextPath_e; - public OmsiNextPathSegment nextPathSeg; - public OmsiNextPathID nextPathID; - [OmsiStructArrayPtr(typeof(OmsiPathID))] - public int reservePaths; - public int spurwechsel; //TODO: Check data type - public uint spurwechselTime; - public bool spurwechselAuto; - public bool noScheduledSpurwechsel; - public bool on_crossing; - public float leftFree, rightFree; - public byte relPosError; //TODO: Check data type - public bool setPosOnNearTile; - public float rowdy_factor; - public bool eilig; - public bool einSatzFahrzeug; - public float martinshorn; - public float getrieben_von_einSatz; - public uint getrieben_von_einSatz_time; - public byte setSoll; - public int track; - public int trackEntry; - public int stnLink; - public int next_stnLink; - public bool zwangsEinsetzen; - public bool allowHupen; - [OmsiStrPtr] public int debug_aiData_limit; + [FieldOffset(0x58)] public int nextPath_a; + [FieldOffset(0x5c)] public int nextPath_b; + [FieldOffset(0x60)] public int nextPath_c; + [FieldOffset(0x64)] public int nextPath_d; + [FieldOffset(0x68)] public int nextPath_e; + [FieldOffset(0x6c)] public OmsiNextPathSegment nextPathSeg; + [FieldOffset(0x94)] public OmsiNextPathID nextPathID; + [FieldOffset(0xbc)] [OmsiStructArrayPtr(typeof(OmsiPathID))] public int reservePaths; + [FieldOffset(0xc0)] public int spurwechsel; //TODO: Check data type + [FieldOffset(0xc4)] public uint spurwechselTime; + [FieldOffset(0xc8)] public bool spurwechselAuto; + [FieldOffset(0xc9)] public bool noScheduledSpurwechsel; + [FieldOffset(0xca)] public bool on_crossing; + [FieldOffset(0xcc)] public float leftFree; + [FieldOffset(0xd0)] public float rightFree; + [FieldOffset(0xd4)] public byte relPosError; //TODO: Check data type + [FieldOffset(0xd5)] public bool setPosOnNearTile; + [FieldOffset(0xd8)] public float rowdy_factor; + [FieldOffset(0xdc)] public bool eilig; + [FieldOffset(0xdd)] public bool einSatzFahrzeug; + [FieldOffset(0xe0)] public float martinshorn; + [FieldOffset(0xe4)] public float getrieben_von_einSatz; + [FieldOffset(0xe8)] public uint getrieben_von_einSatz_time; + [FieldOffset(0xec)] public byte setSoll; + [FieldOffset(0xf0)] public int track; + [FieldOffset(0xf4)] public int trackEntry; + [FieldOffset(0xf8)] public int stnLink; + [FieldOffset(0xfc)] public int next_stnLink; + [FieldOffset(0x100)] public bool zwangsEinsetzen; + [FieldOffset(0x104)] public float normBrakedDist; + [FieldOffset(0x108)] public bool allowHupen; + [FieldOffset(0x10c)] [OmsiStrPtr] public int debug_aiData_limit; } public struct OmsiPathInfo @@ -844,6 +853,7 @@ public struct OmsiPathInfo /// Forced insertion? /// public bool zwangsEinsetzen; + public float normBrakedDist; /// /// Allow horns /// @@ -2005,5 +2015,34 @@ public struct OmsiFileSplinePathInfoInternal [OmsiStructArrayPtr(typeof(OmsiPathRule), typeof(OmsiPathRuleInternal))] public int Rules; } + [StructLayout(LayoutKind.Explicit)] + public struct OmsiBoogieInternal + { + [OmsiStruct(typeof(OmsiPathInfo), typeof(OmsiPathInfoInternal))] + [FieldOffset(0x0)]internal OmsiPathInfoInternal pathInfo; + [FieldOffset(0x110)]internal D3DVector pos; + [FieldOffset(0x11c)]internal D3DXVector2 y_soll; + [FieldOffset(0x124)]internal D3DXVector2 y_harmon; + [FieldOffset(0x12c)]internal float y_gleisfehler; + [FieldOffset(0x130)]internal float z_gleisfehler; + } + + public struct OmsiBoogie + { + public OmsiPathInfo pathInfo; + public D3DVector pos; + public D3DXVector2 y_soll; + public D3DXVector2 y_harmon; + public float y_gleisfehler; + public float z_gleisfehler; + } + + /// + /// Omsi Path Setpoints + /// + public struct OmsiPathSollwerte + { + public float v, x, curve_x_offset, ai_stdbrems; + } } diff --git a/OmsiHook/D3DMeshFileObject.cs b/OmsiHook/WrappedOmsiClasses/D3DMeshFileObject.cs similarity index 100% rename from OmsiHook/D3DMeshFileObject.cs rename to OmsiHook/WrappedOmsiClasses/D3DMeshFileObject.cs diff --git a/OmsiHook/D3DMeshObject.cs b/OmsiHook/WrappedOmsiClasses/D3DMeshObject.cs similarity index 100% rename from OmsiHook/D3DMeshObject.cs rename to OmsiHook/WrappedOmsiClasses/D3DMeshObject.cs diff --git a/OmsiHook/D3DObject.cs b/OmsiHook/WrappedOmsiClasses/D3DObject.cs similarity index 100% rename from OmsiHook/D3DObject.cs rename to OmsiHook/WrappedOmsiClasses/D3DObject.cs diff --git a/OmsiHook/D3DTransformObject.cs b/OmsiHook/WrappedOmsiClasses/D3DTransformObject.cs similarity index 100% rename from OmsiHook/D3DTransformObject.cs rename to OmsiHook/WrappedOmsiClasses/D3DTransformObject.cs diff --git a/OmsiHook/OmsiActuWeather.cs b/OmsiHook/WrappedOmsiClasses/OmsiActuWeather.cs similarity index 100% rename from OmsiHook/OmsiActuWeather.cs rename to OmsiHook/WrappedOmsiClasses/OmsiActuWeather.cs diff --git a/OmsiHook/OmsiAnimSubMesh.cs b/OmsiHook/WrappedOmsiClasses/OmsiAnimSubMesh.cs similarity index 100% rename from OmsiHook/OmsiAnimSubMesh.cs rename to OmsiHook/WrappedOmsiClasses/OmsiAnimSubMesh.cs diff --git a/OmsiHook/OmsiAnimSubMeshInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiAnimSubMeshInst.cs similarity index 100% rename from OmsiHook/OmsiAnimSubMeshInst.cs rename to OmsiHook/WrappedOmsiClasses/OmsiAnimSubMeshInst.cs diff --git a/OmsiHook/OmsiBoolClass.cs b/OmsiHook/WrappedOmsiClasses/OmsiBoolClass.cs similarity index 100% rename from OmsiHook/OmsiBoolClass.cs rename to OmsiHook/WrappedOmsiClasses/OmsiBoolClass.cs diff --git a/OmsiHook/OmsiCamera.cs b/OmsiHook/WrappedOmsiClasses/OmsiCamera.cs similarity index 100% rename from OmsiHook/OmsiCamera.cs rename to OmsiHook/WrappedOmsiClasses/OmsiCamera.cs diff --git a/OmsiHook/OmsiChrono.cs b/OmsiHook/WrappedOmsiClasses/OmsiChrono.cs similarity index 100% rename from OmsiHook/OmsiChrono.cs rename to OmsiHook/WrappedOmsiClasses/OmsiChrono.cs diff --git a/OmsiHook/OmsiChronoChange.cs b/OmsiHook/WrappedOmsiClasses/OmsiChronoChange.cs similarity index 100% rename from OmsiHook/OmsiChronoChange.cs rename to OmsiHook/WrappedOmsiClasses/OmsiChronoChange.cs diff --git a/OmsiHook/OmsiChronoChangeDel.cs b/OmsiHook/WrappedOmsiClasses/OmsiChronoChangeDel.cs similarity index 100% rename from OmsiHook/OmsiChronoChangeDel.cs rename to OmsiHook/WrappedOmsiClasses/OmsiChronoChangeDel.cs diff --git a/OmsiHook/OmsiChronoChangeLabels.cs b/OmsiHook/WrappedOmsiClasses/OmsiChronoChangeLabels.cs similarity index 100% rename from OmsiHook/OmsiChronoChangeLabels.cs rename to OmsiHook/WrappedOmsiClasses/OmsiChronoChangeLabels.cs diff --git a/OmsiHook/OmsiChronoChangeTyp.cs b/OmsiHook/WrappedOmsiClasses/OmsiChronoChangeTyp.cs similarity index 100% rename from OmsiHook/OmsiChronoChangeTyp.cs rename to OmsiHook/WrappedOmsiClasses/OmsiChronoChangeTyp.cs diff --git a/OmsiHook/OmsiComplMapObj.cs b/OmsiHook/WrappedOmsiClasses/OmsiComplMapObj.cs similarity index 100% rename from OmsiHook/OmsiComplMapObj.cs rename to OmsiHook/WrappedOmsiClasses/OmsiComplMapObj.cs diff --git a/OmsiHook/OmsiComplMapObjInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiComplMapObjInst.cs similarity index 96% rename from OmsiHook/OmsiComplMapObjInst.cs rename to OmsiHook/WrappedOmsiClasses/OmsiComplMapObjInst.cs index c3fee26..f521a05 100644 --- a/OmsiHook/OmsiComplMapObjInst.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiComplMapObjInst.cs @@ -204,5 +204,11 @@ public void SetStringVariable(string varName, string value) throw new KeyNotFoundException($"String Variable '{varName}' not found in object. - Index Out Of Bounds"); stringVars[index] = new(value); } + + /// + public async void SoundTrigger(string trigger, string filename) + { + await OmsiRemoteMethods.OmsiSoundTrigger(this, trigger, filename); + } } } \ No newline at end of file diff --git a/OmsiHook/OmsiComplMapSceneObjInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiComplMapSceneObjInst.cs similarity index 100% rename from OmsiHook/OmsiComplMapSceneObjInst.cs rename to OmsiHook/WrappedOmsiClasses/OmsiComplMapSceneObjInst.cs diff --git a/OmsiHook/OmsiComplObj.cs b/OmsiHook/WrappedOmsiClasses/OmsiComplObj.cs similarity index 100% rename from OmsiHook/OmsiComplObj.cs rename to OmsiHook/WrappedOmsiClasses/OmsiComplObj.cs diff --git a/OmsiHook/OmsiComplObjInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiComplObjInst.cs similarity index 100% rename from OmsiHook/OmsiComplObjInst.cs rename to OmsiHook/WrappedOmsiClasses/OmsiComplObjInst.cs diff --git a/OmsiHook/OmsiCoordSystem.cs b/OmsiHook/WrappedOmsiClasses/OmsiCoordSystem.cs similarity index 100% rename from OmsiHook/OmsiCoordSystem.cs rename to OmsiHook/WrappedOmsiClasses/OmsiCoordSystem.cs diff --git a/OmsiHook/OmsiDynHelperMan.cs b/OmsiHook/WrappedOmsiClasses/OmsiDynHelperMan.cs similarity index 100% rename from OmsiHook/OmsiDynHelperMan.cs rename to OmsiHook/WrappedOmsiClasses/OmsiDynHelperMan.cs diff --git a/OmsiHook/OmsiFileObject.cs b/OmsiHook/WrappedOmsiClasses/OmsiFileObject.cs similarity index 100% rename from OmsiHook/OmsiFileObject.cs rename to OmsiHook/WrappedOmsiClasses/OmsiFileObject.cs diff --git a/OmsiHook/OmsiFileSpline.cs b/OmsiHook/WrappedOmsiClasses/OmsiFileSpline.cs similarity index 100% rename from OmsiHook/OmsiFileSpline.cs rename to OmsiHook/WrappedOmsiClasses/OmsiFileSpline.cs diff --git a/OmsiHook/OmsiFileTerrain.cs b/OmsiHook/WrappedOmsiClasses/OmsiFileTerrain.cs similarity index 100% rename from OmsiHook/OmsiFileTerrain.cs rename to OmsiHook/WrappedOmsiClasses/OmsiFileTerrain.cs diff --git a/OmsiHook/OmsiFileWater.cs b/OmsiHook/WrappedOmsiClasses/OmsiFileWater.cs similarity index 100% rename from OmsiHook/OmsiFileWater.cs rename to OmsiHook/WrappedOmsiClasses/OmsiFileWater.cs diff --git a/OmsiHook/OmsiFreeTexInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiFreeTexInst.cs similarity index 100% rename from OmsiHook/OmsiFreeTexInst.cs rename to OmsiHook/WrappedOmsiClasses/OmsiFreeTexInst.cs diff --git a/OmsiHook/OmsiFuncClass.cs b/OmsiHook/WrappedOmsiClasses/OmsiFuncClass.cs similarity index 100% rename from OmsiHook/OmsiFuncClass.cs rename to OmsiHook/WrappedOmsiClasses/OmsiFuncClass.cs diff --git a/OmsiHook/OmsiHOF.cs b/OmsiHook/WrappedOmsiClasses/OmsiHOF.cs similarity index 100% rename from OmsiHook/OmsiHOF.cs rename to OmsiHook/WrappedOmsiClasses/OmsiHOF.cs diff --git a/OmsiHook/OmsiHumanBeing.cs b/OmsiHook/WrappedOmsiClasses/OmsiHumanBeing.cs similarity index 100% rename from OmsiHook/OmsiHumanBeing.cs rename to OmsiHook/WrappedOmsiClasses/OmsiHumanBeing.cs diff --git a/OmsiHook/OmsiHumanBeingInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiHumanBeingInst.cs similarity index 100% rename from OmsiHook/OmsiHumanBeingInst.cs rename to OmsiHook/WrappedOmsiClasses/OmsiHumanBeingInst.cs diff --git a/OmsiHook/OmsiKachelForest.cs b/OmsiHook/WrappedOmsiClasses/OmsiKachelForest.cs similarity index 100% rename from OmsiHook/OmsiKachelForest.cs rename to OmsiHook/WrappedOmsiClasses/OmsiKachelForest.cs diff --git a/OmsiHook/OmsiMap.cs b/OmsiHook/WrappedOmsiClasses/OmsiMap.cs similarity index 100% rename from OmsiHook/OmsiMap.cs rename to OmsiHook/WrappedOmsiClasses/OmsiMap.cs diff --git a/OmsiHook/OmsiMapKachel.cs b/OmsiHook/WrappedOmsiClasses/OmsiMapKachel.cs similarity index 100% rename from OmsiHook/OmsiMapKachel.cs rename to OmsiHook/WrappedOmsiClasses/OmsiMapKachel.cs diff --git a/OmsiHook/OmsiMapObjInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiMapObjInst.cs similarity index 100% rename from OmsiHook/OmsiMapObjInst.cs rename to OmsiHook/WrappedOmsiClasses/OmsiMapObjInst.cs diff --git a/OmsiHook/WrappedOmsiClasses/OmsiMovingMapObjInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiMovingMapObjInst.cs new file mode 100644 index 0000000..2dd8055 --- /dev/null +++ b/OmsiHook/WrappedOmsiClasses/OmsiMovingMapObjInst.cs @@ -0,0 +1,241 @@ +namespace OmsiHook +{ + /// + /// Base Class for all instances of moving map objects - vehicles / humans + /// + public class OmsiMovingMapObjInst : OmsiComplMapObjInst + { + internal OmsiMovingMapObjInst(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } + public OmsiMovingMapObjInst() : base() { } + + public int Index + { + get => Memory.ReadMemory(Address + 0x258); + set => Memory.WriteMemory(Address + 0x258, value); + } + public bool MarkedForKilling + { + get => Memory.ReadMemory(Address + 0x25c); + set => Memory.WriteMemory(Address + 0x25c, value); + } + public MemArray Boogies + { + get => new(Memory, Address + 0x260); + } + /// + /// Boogies Init Virbrations + /// + public bool Boogies_InitSchwingungen + { + get => Memory.ReadMemory(Address + 0x264); + set => Memory.WriteMemory(Address + 0x264, value); + } + /// + /// Steering arm + /// + public float Lenkhebel + { + get => Memory.ReadMemory(Address + 0x268); + set => Memory.WriteMemory(Address + 0x268, value); + } + public bool UserTrain + { + get => Memory.ReadMemory(Address + 0x26c); + set => Memory.WriteMemory(Address + 0x26c, value); + } + public bool UserTrain_Render + { + get => Memory.ReadMemory(Address + 0x26c); + set => Memory.WriteMemory(Address + 0x26c, value); + } + public D3DVector Last_Position + { + get => Memory.ReadMemory(Address + 0x26e); + set => Memory.WriteMemory(Address + 0x26e, value); + } + public D3DXQuaternion Last_Rotation + { + get => Memory.ReadMemory(Address + 0x27a); + set => Memory.WriteMemory(Address + 0x27a, value); + } + public D3DMatrix RelMatrixVar + { + get => Memory.ReadMemory(Address + 0x28a); + set => Memory.WriteMemory(Address + 0x28a, value); + } + public OmsiPoint MyKachelPnt + { + get => Memory.ReadMemory(Address + 0x2cc); + set => Memory.WriteMemory(Address + 0x2cc, value); + } + public OmsiPoint CenterKachel + { + get => Memory.ReadMemory(Memory.ReadMemory(Address + 0x2d44)); + } + public uint CalcTimer + { + get => Memory.ReadMemory(Address + 0x2d8); + set => Memory.WriteMemory(Address + 0x2d8, value); + } + public bool Visible_Logical + { + get => Memory.ReadMemory(Address + 0x2dc); + set => Memory.WriteMemory(Address + 0x2dc, value); + } + public bool Visible_Logical_RenderThread + { + get => Memory.ReadMemory(Address + 0x2dd); + set => Memory.WriteMemory(Address + 0x2dd, value); + } + public bool PathFixed + { + get => Memory.ReadMemory(Address + 0x2de); + set => Memory.WriteMemory(Address + 0x2de, value); + } + public OmsiPathInfo PathInfo + { + get => Memory.MarshalStruct(Memory.ReadMemory(Address + 0x2e0)); + set => Memory.WriteMemory(Address + 0x2e0, Memory.UnMarshalStruct(value)); + } + public float PathVOffset + { + get => Memory.ReadMemory(Address + 0x3f0); + set => Memory.WriteMemory(Address + 0x3f0, value); + } + public byte TrafficType + { + get => Memory.ReadMemory(Address + 0x3f4); + set => Memory.WriteMemory(Address + 0x3f4, value); + } + public float PAI_Hdg_Soll + { + get => Memory.ReadMemory(Address + 0x3f8); + set => Memory.WriteMemory(Address + 0x3f8, value); + } + public float PAI_Hdg_Ist + { + get => Memory.ReadMemory(Address + 0x3fc); + set => Memory.WriteMemory(Address + 0x3fc, value); + } + public float PAI_Wagenwinkel + { + get => Memory.ReadMemory(Address + 0x400); + set => Memory.WriteMemory(Address + 0x400, value); + } + public float PAI_DeltaBeta + { + get => Memory.ReadMemory(Address + 0x404); + set => Memory.WriteMemory(Address + 0x404, value); + } + public float PAI_DeltaAlpha + { + get => Memory.ReadMemory(Address + 0x408); + set => Memory.WriteMemory(Address + 0x408, value); + } + public float PAI_InvLenk_Ist + { + get => Memory.ReadMemory(Address + 0x40c); + set => Memory.WriteMemory(Address + 0x40c, value); + } + public float PAI_MovingDistance + { + get => Memory.ReadMemory(Address + 0x410); + set => Memory.WriteMemory(Address + 0x410, value); + } + public OmsiPathSollwerte PAI_Soll + { + get => Memory.ReadMemory(Address + 0x414); + set => Memory.WriteMemory(Address + 0x414, value); + } + public float Tacho + { + get => Memory.ReadMemory(Address + 0x424); + set => Memory.WriteMemory(Address + 0x424, value); + } + public float Groundspeed + { + get => Memory.ReadMemory(Address + 0x428); + set => Memory.WriteMemory(Address + 0x428, value); + } + public double KMCounter + { + get => Memory.ReadMemory (Address + 0x430); + set => Memory.WriteMemory(Address + 0x430, value); + } + public double KMCounter_Init + { + get => Memory.ReadMemory(Address + 0x438); + set => Memory.WriteMemory(Address + 0x438, value); + } + public float KMCounter_KM + { + get => Memory.ReadMemory(Address + 0x440); + set => Memory.WriteMemory(Address + 0x440, value); + } + public float KMCounter_M + { + get => Memory.ReadMemory(Address + 0x444); + set => Memory.WriteMemory(Address + 0x444, value); + } + public float RelRange + { + get => Memory.ReadMemory(Address + 0x448); + set => Memory.WriteMemory(Address + 0x448, value); + } + public D3DMatrix OutsideMatrix + { + get => Memory.ReadMemory(Address + 0x44c); + set => Memory.WriteMemory(Address + 0x44c, value); + } + public D3DMatrix OutsideMatrix_ThreadFree + { + get => Memory.ReadMemory(Address + 0x48c); + set => Memory.WriteMemory(Address + 0x48c, value); + } + public float Sound_Reverb_Dist + { + get => Memory.ReadMemory(Address + 0x4cc); + set => Memory.WriteMemory(Address + 0x4cc, value); + } + public OmsiMovingMapObjInst VB_First + { + get => new (Memory, Memory.ReadMemory(Address + 0x4d0)); + } + public OmsiMovingMapObjInst VB_Last + { + get => new(Memory, Memory.ReadMemory(Address + 0x4d4)); + } + public OmsiMovingMapObjInst VB_Next + { + get => new(Memory, Memory.ReadMemory(Address + 0x4d8)); + } + public OmsiMovingMapObjInst VB_Prev + { + get => new(Memory, Memory.ReadMemory(Address + 0x4dc)); + } + public bool VB_Me_Reverse + { + get => Memory.ReadMemory(Address + 0x4e0); + set => Memory.WriteMemory(Address + 0x4e0, value); + } + public bool VB_SchedUnit_Reverse + { + get => Memory.ReadMemory(Address + 0x4e1); + set => Memory.WriteMemory(Address + 0x4e1, value); + } + public bool VB_Leading + { + get => Memory.ReadMemory(Address + 0x4e2); + set => Memory.WriteMemory(Address + 0x4e2, value); + } + public OmsiMovingMapObjInst VB_SoundRef + { + get => new(Memory, Memory.ReadMemory(Address + 0x4e4)); + } + public bool RL_ExitReq + { + get => Memory.ReadMemory(Address + 0x4e8); + set => Memory.WriteMemory(Address + 0x4e8, value); + } + } +} \ No newline at end of file diff --git a/OmsiHook/OmsiObjBlackRect.cs b/OmsiHook/WrappedOmsiClasses/OmsiObjBlackRect.cs similarity index 100% rename from OmsiHook/OmsiObjBlackRect.cs rename to OmsiHook/WrappedOmsiClasses/OmsiObjBlackRect.cs diff --git a/OmsiHook/OmsiObjChronoVars.cs b/OmsiHook/WrappedOmsiClasses/OmsiObjChronoVars.cs similarity index 100% rename from OmsiHook/OmsiObjChronoVars.cs rename to OmsiHook/WrappedOmsiClasses/OmsiObjChronoVars.cs diff --git a/OmsiHook/OmsiPartikel.cs b/OmsiHook/WrappedOmsiClasses/OmsiPartikel.cs similarity index 100% rename from OmsiHook/OmsiPartikel.cs rename to OmsiHook/WrappedOmsiClasses/OmsiPartikel.cs diff --git a/OmsiHook/OmsiPartikelemitter.cs b/OmsiHook/WrappedOmsiClasses/OmsiPartikelemitter.cs similarity index 100% rename from OmsiHook/OmsiPartikelemitter.cs rename to OmsiHook/WrappedOmsiClasses/OmsiPartikelemitter.cs diff --git a/OmsiHook/OmsiPassengerCabin.cs b/OmsiHook/WrappedOmsiClasses/OmsiPassengerCabin.cs similarity index 100% rename from OmsiHook/OmsiPassengerCabin.cs rename to OmsiHook/WrappedOmsiClasses/OmsiPassengerCabin.cs diff --git a/OmsiHook/OmsiPathGroup.cs b/OmsiHook/WrappedOmsiClasses/OmsiPathGroup.cs similarity index 100% rename from OmsiHook/OmsiPathGroup.cs rename to OmsiHook/WrappedOmsiClasses/OmsiPathGroup.cs diff --git a/OmsiHook/OmsiPathManager.cs b/OmsiHook/WrappedOmsiClasses/OmsiPathManager.cs similarity index 100% rename from OmsiHook/OmsiPathManager.cs rename to OmsiHook/WrappedOmsiClasses/OmsiPathManager.cs diff --git a/OmsiHook/OmsiPathPointBasic.cs b/OmsiHook/WrappedOmsiClasses/OmsiPathPointBasic.cs similarity index 100% rename from OmsiHook/OmsiPathPointBasic.cs rename to OmsiHook/WrappedOmsiClasses/OmsiPathPointBasic.cs diff --git a/OmsiHook/OmsiPathSegment.cs b/OmsiHook/WrappedOmsiClasses/OmsiPathSegment.cs similarity index 100% rename from OmsiHook/OmsiPathSegment.cs rename to OmsiHook/WrappedOmsiClasses/OmsiPathSegment.cs diff --git a/OmsiHook/OmsiPhysObj.cs b/OmsiHook/WrappedOmsiClasses/OmsiPhysObj.cs similarity index 100% rename from OmsiHook/OmsiPhysObj.cs rename to OmsiHook/WrappedOmsiClasses/OmsiPhysObj.cs diff --git a/OmsiHook/OmsiPhysObjInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiPhysObjInst.cs similarity index 100% rename from OmsiHook/OmsiPhysObjInst.cs rename to OmsiHook/WrappedOmsiClasses/OmsiPhysObjInst.cs diff --git a/OmsiHook/OmsiProgMan.cs b/OmsiHook/WrappedOmsiClasses/OmsiProgMan.cs similarity index 100% rename from OmsiHook/OmsiProgMan.cs rename to OmsiHook/WrappedOmsiClasses/OmsiProgMan.cs diff --git a/OmsiHook/OmsiRoadVehicle.cs b/OmsiHook/WrappedOmsiClasses/OmsiRoadVehicle.cs similarity index 100% rename from OmsiHook/OmsiRoadVehicle.cs rename to OmsiHook/WrappedOmsiClasses/OmsiRoadVehicle.cs diff --git a/OmsiHook/OmsiRoadVehicleInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiRoadVehicleInst.cs similarity index 97% rename from OmsiHook/OmsiRoadVehicleInst.cs rename to OmsiHook/WrappedOmsiClasses/OmsiRoadVehicleInst.cs index 82230c6..33497f9 100644 --- a/OmsiHook/OmsiRoadVehicleInst.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiRoadVehicleInst.cs @@ -424,5 +424,15 @@ public bool Debug_B get => Memory.ReadMemory(Address + 0x8ec); set => Memory.WriteMemory(Address + 0x8ec, value); } + + /// + /// + /// + /// The name of the trigger to set + /// Whether to enable or disable the trigger + public async void SetTrigger(string trigger, bool enabled) + { + await OmsiRemoteMethods.OmsiSetTrigger(this, trigger, enabled); + } } } \ No newline at end of file diff --git a/OmsiHook/OmsiSound.cs b/OmsiHook/WrappedOmsiClasses/OmsiSound.cs similarity index 100% rename from OmsiHook/OmsiSound.cs rename to OmsiHook/WrappedOmsiClasses/OmsiSound.cs diff --git a/OmsiHook/OmsiSoundPack.cs b/OmsiHook/WrappedOmsiClasses/OmsiSoundPack.cs similarity index 100% rename from OmsiHook/OmsiSoundPack.cs rename to OmsiHook/WrappedOmsiClasses/OmsiSoundPack.cs diff --git a/OmsiHook/OmsiSplineSegment.cs b/OmsiHook/WrappedOmsiClasses/OmsiSplineSegment.cs similarity index 100% rename from OmsiHook/OmsiSplineSegment.cs rename to OmsiHook/WrappedOmsiClasses/OmsiSplineSegment.cs diff --git a/OmsiHook/OmsiStringList.cs b/OmsiHook/WrappedOmsiClasses/OmsiStringList.cs similarity index 100% rename from OmsiHook/OmsiStringList.cs rename to OmsiHook/WrappedOmsiClasses/OmsiStringList.cs diff --git a/OmsiHook/OmsiTime.cs b/OmsiHook/WrappedOmsiClasses/OmsiTime.cs similarity index 100% rename from OmsiHook/OmsiTime.cs rename to OmsiHook/WrappedOmsiClasses/OmsiTime.cs diff --git a/OmsiHook/OmsiTimeTableMan.cs b/OmsiHook/WrappedOmsiClasses/OmsiTimeTableMan.cs similarity index 100% rename from OmsiHook/OmsiTimeTableMan.cs rename to OmsiHook/WrappedOmsiClasses/OmsiTimeTableMan.cs diff --git a/OmsiHook/OmsiVehicle.cs b/OmsiHook/WrappedOmsiClasses/OmsiVehicle.cs similarity index 100% rename from OmsiHook/OmsiVehicle.cs rename to OmsiHook/WrappedOmsiClasses/OmsiVehicle.cs diff --git a/OmsiHook/OmsiVehicleInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiVehicleInst.cs similarity index 100% rename from OmsiHook/OmsiVehicleInst.cs rename to OmsiHook/WrappedOmsiClasses/OmsiVehicleInst.cs diff --git a/OmsiHook/OmsiVisu_OBB.cs b/OmsiHook/WrappedOmsiClasses/OmsiVisu_OBB.cs similarity index 100% rename from OmsiHook/OmsiVisu_OBB.cs rename to OmsiHook/WrappedOmsiClasses/OmsiVisu_OBB.cs diff --git a/OmsiHook/OmsiWeather.cs b/OmsiHook/WrappedOmsiClasses/OmsiWeather.cs similarity index 100% rename from OmsiHook/OmsiWeather.cs rename to OmsiHook/WrappedOmsiClasses/OmsiWeather.cs diff --git a/OmsiHook/api/.gitignore b/OmsiHook/docs/api/.gitignore similarity index 100% rename from OmsiHook/api/.gitignore rename to OmsiHook/docs/api/.gitignore diff --git a/OmsiHook/api/index.md b/OmsiHook/docs/api/index.md similarity index 100% rename from OmsiHook/api/index.md rename to OmsiHook/docs/api/index.md diff --git a/OmsiHook/articles/building-native-plugins.md b/OmsiHook/docs/articles/building-native-plugins.md similarity index 100% rename from OmsiHook/articles/building-native-plugins.md rename to OmsiHook/docs/articles/building-native-plugins.md diff --git a/OmsiHook/articles/intro.md b/OmsiHook/docs/articles/intro.md similarity index 100% rename from OmsiHook/articles/intro.md rename to OmsiHook/docs/articles/intro.md diff --git a/OmsiHook/articles/performance-tips.md b/OmsiHook/docs/articles/performance-tips.md similarity index 100% rename from OmsiHook/articles/performance-tips.md rename to OmsiHook/docs/articles/performance-tips.md diff --git a/OmsiHook/articles/toc.yml b/OmsiHook/docs/articles/toc.yml similarity index 100% rename from OmsiHook/articles/toc.yml rename to OmsiHook/docs/articles/toc.yml diff --git a/OmsiHook/docfx.json b/OmsiHook/docs/docfx.json similarity index 96% rename from OmsiHook/docfx.json rename to OmsiHook/docs/docfx.json index dbe8736..9b17209 100644 --- a/OmsiHook/docfx.json +++ b/OmsiHook/docs/docfx.json @@ -6,7 +6,7 @@ "files": [ "**.csproj" ], - "src": "" + "src": "../" } ], "dest": "api", @@ -29,7 +29,7 @@ "_enableNewTab": true, "_disableContribution": true, "_disableBreadcrumb": false, - "_DocumentationVersion": "2.3.1" + "_DocumentationVersion": "2.4.1" }, "content": [ { diff --git a/OmsiHook/docs/docfx_log.txt b/OmsiHook/docs/docfx_log.txt new file mode 100644 index 0000000..39bf1a6 --- /dev/null +++ b/OmsiHook/docs/docfx_log.txt @@ -0,0 +1,167 @@ +{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T03:57:15.3209935Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.1.1"} +{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T03:57:15.8974533Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.1.2"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' with message: Method not found: 'System.ReadOnlySpan`1 Microsoft.IO.Path.GetFileName(System.ReadOnlySpan`1)'.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T03:57:20.1576112Z","message_severity":"warning","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.1.5"} +{"message":"Project 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' does not contain any documents.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T03:57:21.9498446Z","message_severity":"warning","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.1.8"} +{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T03:57:22.0206788Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.1.9"} +{"message":"No metadata is generated for OmsiHook.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T03:57:34.2744443Z","message_severity":"warning","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.1.13"} +{"message":"Completed Scope:MetadataCommand in 19008.5051 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T03:57:34.2784348Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.2"} +{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_lpnt5z4o.rrx\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_lpnt5z4o.rrx\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T03:57:37.0040601Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.2.2"} +{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_lpnt5z4o.rrx\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T03:57:38.3450637Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.215.1"} +{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T03:57:38.8576627Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.216"} +{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T03:57:38.8646434Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.223"} +{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T03:57:39.2466233Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.224"} +{"message":"Markdown engine is markdig","date_time":"2023-12-29T03:57:39.2725546Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.226"} +{"message":"Cannot load build info: 'build.info' not found under 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\\obj\\.cache\\build'","date_time":"2023-12-29T03:57:39.451077Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.229"} +{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T03:57:39.5208901Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.1"} +{"message":"Building 195 file(s) in ManagedReferenceDocumentProcessor(BuildManagedReferenceDocument=>ValidateManagedReferenceDocumentMetadata=>SplitClassPageToMemberLevel=>ApplyOverwriteDocumentForMref=>FillReferenceInformation)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ManagedReferenceDocumentProcessor","date_time":"2023-12-29T03:57:51.8142477Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.33.8.1"} +{"message":"Building 2 file(s) in ResourceDocumentProcessor(ValidateResourceMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ResourceDocumentProcessor","date_time":"2023-12-29T03:57:51.8182365Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.33.9.1"} +{"message":"Building 3 file(s) in TocDocumentProcessor(BuildTocDocument)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor","date_time":"2023-12-29T03:57:51.8192346Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.33.10.1"} +{"message":"Building 5 file(s) in ConceptualDocumentProcessor(BuildConceptualDocument=>CountWord=>ValidateConceptualDocumentMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ConceptualDocumentProcessor","date_time":"2023-12-29T03:57:51.8192346Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.33.11.1"} +{"message":"0 external references found in 1 xref maps.","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.UpdateContext","date_time":"2023-12-29T03:59:07.4622494Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.34.13.1"} +{"message":"Applying templates to 2137 model(s)...","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","date_time":"2023-12-29T03:59:10.0224247Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.34.18.1"} +{"message":"XRef map exported.","source":"BuildCore.Build Document","date_time":"2023-12-29T03:59:50.8388963Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.36"} +{"message":"Extracting index data from 2132 html files","source":"Postprocess.HandlePostProcessorsWithIncremental.HandlePostProcessors.Processing ExtractSearchIndex","date_time":"2023-12-29T04:03:06.3976295Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.268.1.3.2.1"} +{"message":"Manifest file saved to manifest.json.","source":"Postprocess","date_time":"2023-12-29T04:06:18.4571706Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.268.4"} +{"message":"Completed building documents in 519900.7932 milliseconds.","date_time":"2023-12-29T04:06:18.7663361Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.269"} +{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_lpnt5z4o.rrx\"","source":"BuildCommand","date_time":"2023-12-29T04:06:18.7743154Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.2.3"} +{"message":"Completed Scope:BuildCommand in 524504.8694 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T04:06:18.7832917Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.2.5"} +{"message":"Completed in 543519.3372 milliseconds","date_time":"2023-12-29T04:06:18.7832917Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.3"} +{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:24:25.7279481Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.1.1"} +{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:24:26.1343963Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.1.2"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' with message: Method not found: 'System.ReadOnlySpan`1 Microsoft.IO.Path.GetFileName(System.ReadOnlySpan`1)'.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T04:24:28.4241796Z","message_severity":"warning","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.1.5"} +{"message":"Project 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' does not contain any documents.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:24:29.007166Z","message_severity":"warning","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.1.8"} +{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:24:29.0301048Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.1.9"} +{"message":"No metadata is generated for OmsiHook.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:24:29.58464Z","message_severity":"warning","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.1.13"} +{"message":"Completed Scope:MetadataCommand in 3922.8275 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T04:24:29.5866357Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.2"} +{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_dnuis0t4.yem\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_dnuis0t4.yem\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T04:24:30.1046401Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.2.2"} +{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_dnuis0t4.yem\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T04:24:30.7135581Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.215.1"} +{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T04:24:31.0664413Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.216"} +{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T04:24:31.0714282Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.223"} +{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T04:24:31.44686Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.224"} +{"message":"Markdown engine is markdig","date_time":"2023-12-29T04:24:31.4715421Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.226"} +{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T04:24:33.1342816Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.1"} +{"message":"Building 5 file(s) in ConceptualDocumentProcessor(BuildConceptualDocument=>CountWord=>ValidateConceptualDocumentMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ConceptualDocumentProcessor","date_time":"2023-12-29T04:24:38.8537347Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.33.8.1"} +{"message":"Building 194 file(s) in ManagedReferenceDocumentProcessor(BuildManagedReferenceDocument=>ValidateManagedReferenceDocumentMetadata=>SplitClassPageToMemberLevel=>ApplyOverwriteDocumentForMref=>FillReferenceInformation)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ManagedReferenceDocumentProcessor","date_time":"2023-12-29T04:24:38.8547329Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.33.9.1"} +{"message":"Building 3 file(s) in TocDocumentProcessor(BuildTocDocument)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor","date_time":"2023-12-29T04:24:38.8547329Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.33.10.1"} +{"message":"Building 2 file(s) in ResourceDocumentProcessor(ValidateResourceMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ResourceDocumentProcessor","date_time":"2023-12-29T04:24:38.8961292Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.33.11.1"} +{"message":"0 external references found in 1 xref maps.","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.UpdateContext","date_time":"2023-12-29T04:25:11.2851448Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.34.13.1"} +{"message":"Applying templates to 2135 model(s)...","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","date_time":"2023-12-29T04:25:14.0152956Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.34.18.1"} +{"message":"Error transforming model generated from \"api/OmsiHook.yml\" using \"ManagedReference.html.primary.js\". To get the detailed raw model, please run docfx with debug mode --debug. Error running Transform function inside template preprocessor: type is undefined ","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","file":"api/OmsiHook.yml","date_time":"2023-12-29T04:25:33.9117684Z","message_severity":"error","code":"ApplyTemplatePreprocessorError","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.34.18.1697"} +{"message":"Completed building documents in 68483.6267 milliseconds.","date_time":"2023-12-29T04:25:39.5564609Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.267"} +{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_dnuis0t4.yem\"","source":"BuildCommand","date_time":"2023-12-29T04:25:39.6054527Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.2.3"} +{"message":"Completed Scope:BuildCommand in 70067.6237 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T04:25:39.6544165Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.2.4"} +{"message":"Completed in 73997.2055 milliseconds","date_time":"2023-12-29T04:25:39.6544165Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.3"} +{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:28:09.1293656Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.1.1"} +{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:28:09.4615248Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.1.2"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' with message: Method not found: 'System.ReadOnlySpan`1 Microsoft.IO.Path.GetFileName(System.ReadOnlySpan`1)'.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T04:28:11.7565696Z","message_severity":"warning","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.1.5"} +{"message":"Project 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' does not contain any documents.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:28:12.3367196Z","message_severity":"warning","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.1.8"} +{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:28:12.362651Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.1.9"} +{"message":"No metadata is generated for OmsiHook.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:28:12.8154999Z","message_severity":"warning","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.1.13"} +{"message":"Completed Scope:MetadataCommand in 3736.7786 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T04:28:12.8174961Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.2"} +{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_iaepe2fv.15b\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_iaepe2fv.15b\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T04:28:12.8783325Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.2.2"} +{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_iaepe2fv.15b\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T04:28:13.3290135Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.215.1"} +{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T04:28:13.6753591Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.216"} +{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T04:28:13.6833366Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.223"} +{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T04:28:14.0756317Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.224"} +{"message":"Markdown engine is markdig","date_time":"2023-12-29T04:28:14.1119867Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.226"} +{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T04:28:14.8317387Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.1"} +{"message":"Building 5 file(s) in ConceptualDocumentProcessor(BuildConceptualDocument=>CountWord=>ValidateConceptualDocumentMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ConceptualDocumentProcessor","date_time":"2023-12-29T04:28:18.2531981Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.33.8.1"} +{"message":"Building 2 file(s) in ResourceDocumentProcessor(ValidateResourceMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ResourceDocumentProcessor","date_time":"2023-12-29T04:28:18.2541956Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.33.9.1"} +{"message":"Building 3 file(s) in TocDocumentProcessor(BuildTocDocument)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor","date_time":"2023-12-29T04:28:18.2551933Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.33.10.1"} +{"message":"Building 194 file(s) in ManagedReferenceDocumentProcessor(BuildManagedReferenceDocument=>ValidateManagedReferenceDocumentMetadata=>SplitClassPageToMemberLevel=>ApplyOverwriteDocumentForMref=>FillReferenceInformation)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ManagedReferenceDocumentProcessor","date_time":"2023-12-29T04:28:18.2551933Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.33.11.1"} +{"message":"0 external references found in 1 xref maps.","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.UpdateContext","date_time":"2023-12-29T04:28:43.5359793Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.34.13.1"} +{"message":"Applying templates to 2135 model(s)...","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","date_time":"2023-12-29T04:28:46.6147195Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.34.18.1"} +{"message":"Error transforming model generated from \"api/OmsiHook.yml\" using \"ManagedReference.html.primary.js\". To get the detailed raw model, please run docfx with debug mode --debug. Error running Transform function inside template preprocessor: type is undefined ","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","file":"api/OmsiHook.yml","date_time":"2023-12-29T04:29:12.8059023Z","message_severity":"error","code":"ApplyTemplatePreprocessorError","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.34.18.2187"} +{"message":"Completed building documents in 60206.3874 milliseconds.","date_time":"2023-12-29T04:29:13.8897021Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.267"} +{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_iaepe2fv.15b\"","source":"BuildCommand","date_time":"2023-12-29T04:29:13.934708Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.2.3"} +{"message":"Completed Scope:BuildCommand in 61120.5417 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T04:29:13.9376994Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.2.4"} +{"message":"Completed in 64863.9961 milliseconds","date_time":"2023-12-29T04:29:13.9386974Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.3"} +{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:36:18.5174384Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.1.1"} +{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:36:18.8695193Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.1.2"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' with message: Method not found: 'System.ReadOnlySpan`1 Microsoft.IO.Path.GetFileName(System.ReadOnlySpan`1)'.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T04:36:21.3468096Z","message_severity":"warning","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.1.5"} +{"message":"Project 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' does not contain any documents.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:36:21.9217804Z","message_severity":"warning","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.1.8"} +{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:36:21.9407302Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.1.9"} +{"message":"No metadata is generated for OmsiHook.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:36:22.3701249Z","message_severity":"warning","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.1.13"} +{"message":"Completed Scope:MetadataCommand in 3897.5363 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T04:36:22.3721208Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.2"} +{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_n1od150q.w0j\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_n1od150q.w0j\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T04:36:22.4449253Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.2.2"} +{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_n1od150q.w0j\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T04:36:22.8747969Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.215.1"} +{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T04:36:23.2662855Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.216"} +{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T04:36:23.2732665Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.223"} +{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T04:36:23.7495274Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.224"} +{"message":"Markdown engine is markdig","date_time":"2023-12-29T04:36:23.7844357Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.226"} +{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T04:36:24.5240836Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.1"} +{"message":"Building 5 file(s) in ConceptualDocumentProcessor(BuildConceptualDocument=>CountWord=>ValidateConceptualDocumentMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ConceptualDocumentProcessor","date_time":"2023-12-29T04:36:28.1046742Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.33.8.1"} +{"message":"Building 194 file(s) in ManagedReferenceDocumentProcessor(BuildManagedReferenceDocument=>ValidateManagedReferenceDocumentMetadata=>SplitClassPageToMemberLevel=>ApplyOverwriteDocumentForMref=>FillReferenceInformation)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ManagedReferenceDocumentProcessor","date_time":"2023-12-29T04:36:28.1046742Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.33.9.1"} +{"message":"Building 3 file(s) in TocDocumentProcessor(BuildTocDocument)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor","date_time":"2023-12-29T04:36:28.1066693Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.33.10.1"} +{"message":"Building 2 file(s) in ResourceDocumentProcessor(ValidateResourceMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ResourceDocumentProcessor","date_time":"2023-12-29T04:36:28.1420821Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.33.11.1"} +{"message":"0 external references found in 1 xref maps.","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.UpdateContext","date_time":"2023-12-29T04:36:58.8103469Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.34.13.1"} +{"message":"Applying templates to 2135 model(s)...","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","date_time":"2023-12-29T04:37:01.8754515Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.34.18.1"} +{"message":"Error transforming model generated from \"api/OmsiHook.yml\" using \"ManagedReference.html.primary.js\". To get the detailed raw model, please run docfx with debug mode --debug. Error running Transform function inside template preprocessor: type is undefined ","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","file":"api/OmsiHook.yml","date_time":"2023-12-29T04:37:16.7711967Z","message_severity":"error","code":"ApplyTemplatePreprocessorError","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.34.18.793"} +{"message":"Completed building documents in 68414.5093 milliseconds.","date_time":"2023-12-29T04:37:31.6883566Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.267"} +{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_n1od150q.w0j\"","source":"BuildCommand","date_time":"2023-12-29T04:37:31.7392206Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.2.3"} +{"message":"Completed Scope:BuildCommand in 69413.0149 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T04:37:31.7850981Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.2.4"} +{"message":"Completed in 73314.7086 milliseconds","date_time":"2023-12-29T04:37:31.7850981Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.3"} +{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:02:49.4374203Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.1.1"} +{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:02:49.9203605Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.1.2"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' with message: Method not found: 'System.ReadOnlySpan`1 Microsoft.IO.Path.GetFileName(System.ReadOnlySpan`1)'.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T05:02:52.5408121Z","message_severity":"warning","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.1.5"} +{"message":"Project 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' does not contain any documents.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:02:53.1394715Z","message_severity":"warning","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.1.8"} +{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:02:53.1923229Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.1.9"} +{"message":"No metadata is generated for OmsiHook.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:02:53.7529433Z","message_severity":"warning","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.1.13"} +{"message":"Completed Scope:MetadataCommand in 4366.2148 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T05:02:53.7539409Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.2"} +{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_zdlaufy3.ubn\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_zdlaufy3.ubn\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T05:02:54.1670783Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.2.2"} +{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_zdlaufy3.ubn\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T05:02:54.9756197Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.215.1"} +{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T05:02:55.3727164Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.216"} +{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T05:02:55.3826899Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.223"} +{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T05:02:55.8408702Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.224"} +{"message":"Markdown engine is markdig","date_time":"2023-12-29T05:02:55.8747798Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.226"} +{"message":"Cannot load build info: 'build.info' not found under 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\\obj\\.cache\\build'","date_time":"2023-12-29T05:02:56.1208292Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.229"} +{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T05:02:56.1776779Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.1"} +{"message":"Building 5 file(s) in ConceptualDocumentProcessor(BuildConceptualDocument=>CountWord=>ValidateConceptualDocumentMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ConceptualDocumentProcessor","date_time":"2023-12-29T05:02:57.2154931Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.33.7.1"} +{"message":"Building 2 file(s) in ResourceDocumentProcessor(ValidateResourceMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ResourceDocumentProcessor","date_time":"2023-12-29T05:02:57.2154931Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.33.9.1"} +{"message":"Building 2 file(s) in TocDocumentProcessor(BuildTocDocument)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor","date_time":"2023-12-29T05:02:57.2154931Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.33.8.1"} +{"message":"Unable to find either toc.yml or toc.md inside api/. Make sure the file is included in config file docfx.json!","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor.Prebuild.BuildTocDocument","file":"toc.yml","date_time":"2023-12-29T05:02:57.2394292Z","message_severity":"warning","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.33.8.3.2.1"} +{"message":"Applying templates to 9 model(s)...","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","date_time":"2023-12-29T05:02:58.3279572Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.34.16.1"} +{"message":"XRef map exported.","source":"BuildCore.Build Document","date_time":"2023-12-29T05:02:58.6083935Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.36"} +{"message":"Extracting index data from 5 html files","source":"Postprocess.HandlePostProcessorsWithIncremental.HandlePostProcessors.Processing ExtractSearchIndex","date_time":"2023-12-29T05:02:58.7093118Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.268.1.3.2.1"} +{"message":"Manifest file saved to manifest.json.","source":"Postprocess","date_time":"2023-12-29T05:02:58.8075275Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.268.4"} +{"message":"Completed building documents in 3496.8746 milliseconds.","date_time":"2023-12-29T05:02:58.8798455Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.269"} +{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_zdlaufy3.ubn\"","source":"BuildCommand","date_time":"2023-12-29T05:02:58.8888222Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.2.3"} +{"message":"Completed Scope:BuildCommand in 5140.7362 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T05:02:58.8948063Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.2.5"} +{"message":"Completed in 9510.4268 milliseconds","date_time":"2023-12-29T05:02:58.8948063Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.3"} +{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:07:31.0182535Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.1.1"} +{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:07:33.5169205Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.1.2"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: c1: (0, 0): Cannot open source file: 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c': No such file or directory","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T05:07:49.3572923Z","message_severity":"warning","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.1.5"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: C:\\Users\\Thoma\\.nuget\\packages\\dnne\\1.0.30\\build\\DNNE.targets: (150, 5): The command \"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\bin\\Hostx64\\x86\\cl.exe\" /O2 /LD /TC /MT /GS /Zi /D DNNE_ASSEMBLY_NAME=OmsiHookRPCPlugin /D DNNE_COMPILE_AS_SOURCE /I \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\include\" /I \"C:\\Users\\Thoma\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\" /I \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\7.0.5\\runtimes\\win-x86\\native\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\shared\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\um\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\ucrt\" \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c\" \"C:\\Users\\Thoma\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\\platform.c\" /link /DLL /LTCG /LIBPATH:\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\lib\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\um\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\ucrt\\x86\" \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\7.0.5\\runtimes\\win-x86\\native\\libnethost.lib\" Advapi32.lib /IGNORE:4099 /IMPLIB:\"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.lib\" /OUT:\"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.dll\" \" exited with code 2.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T05:07:49.3582898Z","message_severity":"warning","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.1.6"} +{"message":"Cache for D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj in D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\obj\\xdoc\\cache\\final\\587067676 is corrupted, rebuild...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:07:50.0355742Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.1.9"} +{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:07:50.0355742Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.1.10"} +{"message":"Completed Scope:MetadataCommand in 48889.9882 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T05:08:19.3309115Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.2"} +{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_z5fpqjn5.was\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_z5fpqjn5.was\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T05:08:19.3837698Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.2.2"} +{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_z5fpqjn5.was\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T05:08:20.4053382Z","message_severity":"info","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.215.1"} +{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T05:08:21.4161791Z","message_severity":"info","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.216"} +{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T05:08:21.4221629Z","message_severity":"info","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.223"} +{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T05:08:21.7902104Z","message_severity":"info","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.224"} +{"message":"Markdown engine is markdig","date_time":"2023-12-29T05:08:21.8191028Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.226"} +{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T05:08:22.6569651Z","message_severity":"info","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.266.1.1"} +{"message":"Completed building documents in 1884.1256 milliseconds.","date_time":"2023-12-29T05:08:23.3072678Z","message_severity":"info","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.267"} +{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_z5fpqjn5.was\"","source":"BuildCommand","date_time":"2023-12-29T05:08:23.3581318Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.2.3"} +{"message":"Completed Scope:BuildCommand in 4034.7653 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T05:08:23.3661102Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.2.4"} +{"message":"System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nFile name: 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\r\n at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)\r\n at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()\r\n at System.Reflection.RuntimeMethodInfo.GetParameters()\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.GetCallbackMethodsForType(Type type, List`1& onSerializing, List`1& onSerialized, List`1& onDeserializing, List`1& onDeserialized, List`1& onError)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveCallbackMethods(JsonContract contract, Type t)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type objectType)\r\n at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.ComputeConfigHash(DocumentBuildParameters parameter, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.Create(DocumentBuildParameters parameters, BuildInfo cb, BuildInfo lb, String intermediateFolder, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Prepare(DocumentBuildParameters parameters, DocumentBuildContext context, TemplateProcessor templateProcessor, String markdownServiceContextHash, IHostServiceCreator& hostServiceCreator, PhaseProcessor& phaseProcessor)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.BuildCore(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Build(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.BuildCore(DocumentBuildParameters parameter, IMarkdownServiceProvider markdownServiceProvider, BuildInfo currentBuildInfo, BuildInfo lastBuildInfo)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.Build(IList`1 parameters, String outputDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument(BuildJsonConfig config, TemplateManager templateManager, String baseDirectory, String outputDirectory, String pluginDirectory, String templateDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument()\r\n\r\nWRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].\r\n","date_time":"2023-12-29T05:08:23.3671078Z","message_severity":"error","code":"FatalError","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.3"} +{"message":"Completed in 52929.2734 milliseconds","date_time":"2023-12-29T05:08:23.3671078Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.4"} +{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:09:27.1614424Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.1.1.1"} +{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:09:27.467623Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.1.1.2"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: c1: (0, 0): Cannot open source file: 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c': No such file or directory","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T05:09:32.7556986Z","message_severity":"warning","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.1.1.5"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: C:\\Users\\Thoma\\.nuget\\packages\\dnne\\1.0.30\\build\\DNNE.targets: (150, 5): The command \"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\bin\\Hostx64\\x86\\cl.exe\" /O2 /LD /TC /MT /GS /Zi /D DNNE_ASSEMBLY_NAME=OmsiHookRPCPlugin /D DNNE_COMPILE_AS_SOURCE /I \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\include\" /I \"C:\\Users\\Thoma\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\" /I \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\7.0.5\\runtimes\\win-x86\\native\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\shared\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\um\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\ucrt\" \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c\" \"C:\\Users\\Thoma\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\\platform.c\" /link /DLL /LTCG /LIBPATH:\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\lib\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\um\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\ucrt\\x86\" \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\7.0.5\\runtimes\\win-x86\\native\\libnethost.lib\" Advapi32.lib /IGNORE:4099 /IMPLIB:\"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.lib\" /OUT:\"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.dll\" \" exited with code 2.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T05:09:32.7566964Z","message_severity":"warning","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.1.1.6"} +{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:09:33.3829129Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.1.1.9"} +{"message":"Completed Scope:MetadataCommand in 21799.2343 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T05:09:48.9202811Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.1.2"} +{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_pynjgtyr.eaz\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_pynjgtyr.eaz\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T05:09:48.980122Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.2.2"} +{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_pynjgtyr.eaz\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T05:09:49.5596134Z","message_severity":"info","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.215.1"} +{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T05:09:49.9949609Z","message_severity":"info","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.216"} +{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T05:09:49.9999463Z","message_severity":"info","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.223"} +{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T05:09:50.455242Z","message_severity":"info","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.224"} +{"message":"Markdown engine is markdig","date_time":"2023-12-29T05:09:50.4891514Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.226"} +{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T05:09:50.9479249Z","message_severity":"info","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.266.1.1"} +{"message":"Completed building documents in 1348.2741 milliseconds.","date_time":"2023-12-29T05:09:51.3483625Z","message_severity":"info","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.267"} +{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_pynjgtyr.eaz\"","source":"BuildCommand","date_time":"2023-12-29T05:09:51.39025Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.2.3"} +{"message":"Completed Scope:BuildCommand in 2476.8351 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T05:09:51.3972323Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.2.4"} +{"message":"System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nFile name: 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\r\n at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)\r\n at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()\r\n at System.Reflection.RuntimeMethodInfo.GetParameters()\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.GetCallbackMethodsForType(Type type, List`1& onSerializing, List`1& onSerialized, List`1& onDeserializing, List`1& onDeserialized, List`1& onError)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveCallbackMethods(JsonContract contract, Type t)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type objectType)\r\n at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.ComputeConfigHash(DocumentBuildParameters parameter, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.Create(DocumentBuildParameters parameters, BuildInfo cb, BuildInfo lb, String intermediateFolder, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Prepare(DocumentBuildParameters parameters, DocumentBuildContext context, TemplateProcessor templateProcessor, String markdownServiceContextHash, IHostServiceCreator& hostServiceCreator, PhaseProcessor& phaseProcessor)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.BuildCore(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Build(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.BuildCore(DocumentBuildParameters parameter, IMarkdownServiceProvider markdownServiceProvider, BuildInfo currentBuildInfo, BuildInfo lastBuildInfo)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.Build(IList`1 parameters, String outputDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument(BuildJsonConfig config, TemplateManager templateManager, String baseDirectory, String outputDirectory, String pluginDirectory, String templateDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument()\r\n\r\nWRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].\r\n","date_time":"2023-12-29T05:09:51.3972323Z","message_severity":"error","code":"FatalError","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.3"} +{"message":"Completed in 24280.1555 milliseconds","date_time":"2023-12-29T05:09:51.3972323Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.4"} diff --git a/OmsiHook/images/favicon.ico b/OmsiHook/docs/images/favicon.ico similarity index 100% rename from OmsiHook/images/favicon.ico rename to OmsiHook/docs/images/favicon.ico diff --git a/OmsiHook/images/logo.svg b/OmsiHook/docs/images/logo.svg similarity index 100% rename from OmsiHook/images/logo.svg rename to OmsiHook/docs/images/logo.svg diff --git a/OmsiHook/index.md b/OmsiHook/docs/index.md similarity index 100% rename from OmsiHook/index.md rename to OmsiHook/docs/index.md diff --git a/OmsiHook/plugins/memberpage.2.59.2/.signature.p7s b/OmsiHook/docs/plugins/memberpage.2.59.2/.signature.p7s similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/.signature.p7s rename to OmsiHook/docs/plugins/memberpage.2.59.2/.signature.p7s diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/ManagedReference.extension.js b/OmsiHook/docs/plugins/memberpage.2.59.2/content/ManagedReference.extension.js similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/ManagedReference.extension.js rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/ManagedReference.extension.js diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/ManagedReference.overwrite.js b/OmsiHook/docs/plugins/memberpage.2.59.2/content/ManagedReference.overwrite.js similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/ManagedReference.overwrite.js rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/ManagedReference.overwrite.js diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/partials/class.tmpl.partial b/OmsiHook/docs/plugins/memberpage.2.59.2/content/partials/class.tmpl.partial similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/partials/class.tmpl.partial rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/partials/class.tmpl.partial diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/partials/collection.tmpl.partial b/OmsiHook/docs/plugins/memberpage.2.59.2/content/partials/collection.tmpl.partial similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/partials/collection.tmpl.partial rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/partials/collection.tmpl.partial diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/partials/customMREFContent.tmpl.partial b/OmsiHook/docs/plugins/memberpage.2.59.2/content/partials/customMREFContent.tmpl.partial similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/partials/customMREFContent.tmpl.partial rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/partials/customMREFContent.tmpl.partial diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/partials/item.tmpl.partial b/OmsiHook/docs/plugins/memberpage.2.59.2/content/partials/item.tmpl.partial similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/partials/item.tmpl.partial rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/partials/item.tmpl.partial diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/HtmlAgilityPack.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/HtmlAgilityPack.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/HtmlAgilityPack.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/HtmlAgilityPack.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Build.Common.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Build.Common.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Build.Common.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Build.Common.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Build.MemberLevelManagedReference.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Build.MemberLevelManagedReference.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Build.MemberLevelManagedReference.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Build.MemberLevelManagedReference.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Common.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Common.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Common.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Common.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.DataContracts.Common.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.DataContracts.Common.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.DataContracts.Common.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.DataContracts.Common.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.DataContracts.ManagedReference.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.DataContracts.ManagedReference.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.DataContracts.ManagedReference.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.DataContracts.ManagedReference.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.MarkdownLite.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.MarkdownLite.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.MarkdownLite.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.MarkdownLite.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Plugins.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Plugins.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Plugins.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.Plugins.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.YamlSerialization.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.YamlSerialization.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.YamlSerialization.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Microsoft.DocAsCode.YamlSerialization.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/Newtonsoft.Json.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Newtonsoft.Json.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/Newtonsoft.Json.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/Newtonsoft.Json.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Buffers.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Buffers.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Buffers.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Buffers.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Collections.Immutable.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Collections.Immutable.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Collections.Immutable.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Collections.Immutable.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Composition.AttributedModel.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Composition.AttributedModel.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Composition.AttributedModel.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Composition.AttributedModel.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Composition.Convention.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Composition.Convention.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Composition.Convention.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Composition.Convention.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Composition.Hosting.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Composition.Hosting.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Composition.Hosting.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Composition.Hosting.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Composition.Runtime.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Composition.Runtime.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Composition.Runtime.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Composition.Runtime.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Composition.TypedParts.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Composition.TypedParts.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Composition.TypedParts.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Composition.TypedParts.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Memory.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Memory.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Memory.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Memory.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Numerics.Vectors.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Numerics.Vectors.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Numerics.Vectors.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Numerics.Vectors.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Runtime.CompilerServices.Unsafe.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Runtime.CompilerServices.Unsafe.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/System.Runtime.CompilerServices.Unsafe.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/System.Runtime.CompilerServices.Unsafe.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/YamlDotNet.dll b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/YamlDotNet.dll similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/YamlDotNet.dll rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/YamlDotNet.dll diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/plugins/docfx.plugins.config b/OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/docfx.plugins.config similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/plugins/docfx.plugins.config rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/plugins/docfx.plugins.config diff --git a/OmsiHook/plugins/memberpage.2.59.2/content/toc.html.js b/OmsiHook/docs/plugins/memberpage.2.59.2/content/toc.html.js similarity index 100% rename from OmsiHook/plugins/memberpage.2.59.2/content/toc.html.js rename to OmsiHook/docs/plugins/memberpage.2.59.2/content/toc.html.js diff --git a/OmsiHook/templates/singulinkfx/layout/_master.tmpl b/OmsiHook/docs/templates/singulinkfx/layout/_master.tmpl similarity index 100% rename from OmsiHook/templates/singulinkfx/layout/_master.tmpl rename to OmsiHook/docs/templates/singulinkfx/layout/_master.tmpl diff --git a/OmsiHook/templates/singulinkfx/partials/footer.tmpl.partial b/OmsiHook/docs/templates/singulinkfx/partials/footer.tmpl.partial similarity index 100% rename from OmsiHook/templates/singulinkfx/partials/footer.tmpl.partial rename to OmsiHook/docs/templates/singulinkfx/partials/footer.tmpl.partial diff --git a/OmsiHook/templates/singulinkfx/partials/head.tmpl.partial b/OmsiHook/docs/templates/singulinkfx/partials/head.tmpl.partial similarity index 100% rename from OmsiHook/templates/singulinkfx/partials/head.tmpl.partial rename to OmsiHook/docs/templates/singulinkfx/partials/head.tmpl.partial diff --git a/OmsiHook/templates/singulinkfx/partials/li.tmpl.partial b/OmsiHook/docs/templates/singulinkfx/partials/li.tmpl.partial similarity index 100% rename from OmsiHook/templates/singulinkfx/partials/li.tmpl.partial rename to OmsiHook/docs/templates/singulinkfx/partials/li.tmpl.partial diff --git a/OmsiHook/templates/singulinkfx/partials/logo.tmpl.partial b/OmsiHook/docs/templates/singulinkfx/partials/logo.tmpl.partial similarity index 100% rename from OmsiHook/templates/singulinkfx/partials/logo.tmpl.partial rename to OmsiHook/docs/templates/singulinkfx/partials/logo.tmpl.partial diff --git a/OmsiHook/templates/singulinkfx/partials/namespace.tmpl.partial b/OmsiHook/docs/templates/singulinkfx/partials/namespace.tmpl.partial similarity index 100% rename from OmsiHook/templates/singulinkfx/partials/namespace.tmpl.partial rename to OmsiHook/docs/templates/singulinkfx/partials/namespace.tmpl.partial diff --git a/OmsiHook/templates/singulinkfx/partials/navbar.tmpl.partial b/OmsiHook/docs/templates/singulinkfx/partials/navbar.tmpl.partial similarity index 100% rename from OmsiHook/templates/singulinkfx/partials/navbar.tmpl.partial rename to OmsiHook/docs/templates/singulinkfx/partials/navbar.tmpl.partial diff --git a/OmsiHook/templates/singulinkfx/partials/scripts.tmpl.partial b/OmsiHook/docs/templates/singulinkfx/partials/scripts.tmpl.partial similarity index 100% rename from OmsiHook/templates/singulinkfx/partials/scripts.tmpl.partial rename to OmsiHook/docs/templates/singulinkfx/partials/scripts.tmpl.partial diff --git a/OmsiHook/templates/singulinkfx/partials/searchResults.tmpl.partial b/OmsiHook/docs/templates/singulinkfx/partials/searchResults.tmpl.partial similarity index 100% rename from OmsiHook/templates/singulinkfx/partials/searchResults.tmpl.partial rename to OmsiHook/docs/templates/singulinkfx/partials/searchResults.tmpl.partial diff --git a/OmsiHook/templates/singulinkfx/partials/toc.tmpl.partial b/OmsiHook/docs/templates/singulinkfx/partials/toc.tmpl.partial similarity index 100% rename from OmsiHook/templates/singulinkfx/partials/toc.tmpl.partial rename to OmsiHook/docs/templates/singulinkfx/partials/toc.tmpl.partial diff --git a/OmsiHook/templates/singulinkfx/styles/config.css b/OmsiHook/docs/templates/singulinkfx/styles/config.css similarity index 100% rename from OmsiHook/templates/singulinkfx/styles/config.css rename to OmsiHook/docs/templates/singulinkfx/styles/config.css diff --git a/OmsiHook/templates/singulinkfx/styles/discord.css b/OmsiHook/docs/templates/singulinkfx/styles/discord.css similarity index 100% rename from OmsiHook/templates/singulinkfx/styles/discord.css rename to OmsiHook/docs/templates/singulinkfx/styles/discord.css diff --git a/OmsiHook/templates/singulinkfx/styles/down-arrow.svg b/OmsiHook/docs/templates/singulinkfx/styles/down-arrow.svg similarity index 100% rename from OmsiHook/templates/singulinkfx/styles/down-arrow.svg rename to OmsiHook/docs/templates/singulinkfx/styles/down-arrow.svg diff --git a/OmsiHook/templates/singulinkfx/styles/jquery.twbsPagination.js b/OmsiHook/docs/templates/singulinkfx/styles/jquery.twbsPagination.js similarity index 100% rename from OmsiHook/templates/singulinkfx/styles/jquery.twbsPagination.js rename to OmsiHook/docs/templates/singulinkfx/styles/jquery.twbsPagination.js diff --git a/OmsiHook/templates/singulinkfx/styles/main.css b/OmsiHook/docs/templates/singulinkfx/styles/main.css similarity index 100% rename from OmsiHook/templates/singulinkfx/styles/main.css rename to OmsiHook/docs/templates/singulinkfx/styles/main.css diff --git a/OmsiHook/templates/singulinkfx/styles/main.js b/OmsiHook/docs/templates/singulinkfx/styles/main.js similarity index 100% rename from OmsiHook/templates/singulinkfx/styles/main.js rename to OmsiHook/docs/templates/singulinkfx/styles/main.js diff --git a/OmsiHook/templates/singulinkfx/styles/singulink.css b/OmsiHook/docs/templates/singulinkfx/styles/singulink.css similarity index 100% rename from OmsiHook/templates/singulinkfx/styles/singulink.css rename to OmsiHook/docs/templates/singulinkfx/styles/singulink.css diff --git a/OmsiHook/templates/singulinkfx/styles/singulink.js b/OmsiHook/docs/templates/singulinkfx/styles/singulink.js similarity index 100% rename from OmsiHook/templates/singulinkfx/styles/singulink.js rename to OmsiHook/docs/templates/singulinkfx/styles/singulink.js diff --git a/OmsiHook/templates/singulinkfx/styles/url.min.js b/OmsiHook/docs/templates/singulinkfx/styles/url.min.js similarity index 100% rename from OmsiHook/templates/singulinkfx/styles/url.min.js rename to OmsiHook/docs/templates/singulinkfx/styles/url.min.js diff --git a/OmsiHook/templates/singulinkfx/toc.html.tmpl b/OmsiHook/docs/templates/singulinkfx/toc.html.tmpl similarity index 100% rename from OmsiHook/templates/singulinkfx/toc.html.tmpl rename to OmsiHook/docs/templates/singulinkfx/toc.html.tmpl diff --git a/OmsiHook/toc.yml b/OmsiHook/docs/toc.yml similarity index 100% rename from OmsiHook/toc.yml rename to OmsiHook/docs/toc.yml diff --git a/OmsiHookInvoker/dllmain.cpp b/OmsiHookInvoker/dllmain.cpp index e88dcb5..2fceef7 100644 --- a/OmsiHookInvoker/dllmain.cpp +++ b/OmsiHookInvoker/dllmain.cpp @@ -175,6 +175,18 @@ extern "C" __declspec(dllexport) int FreeMem(int addr) addr); } +extern "C" __declspec(dllexport) void RVTriggerXML(int roadVehicle, int trigger, int value) +{ + BorlandFastCall(0x007e9338, 3, 3, + roadVehicle, trigger, value); +} + +extern "C" __declspec(dllexport) void SoundTrigger(int complMapObj, int trigger, int filename) +{ + BorlandFastCall(0x007bb1a8, 3, 3, + complMapObj, trigger, filename); +} + extern "C" __declspec(dllexport) BOOL HookD3D() { if (!m_dxHook) diff --git a/OmsiHookRPCPlugin/NativeImports.cs b/OmsiHookRPCPlugin/NativeImports.cs index b5b560e..d0875c2 100644 --- a/OmsiHookRPCPlugin/NativeImports.cs +++ b/OmsiHookRPCPlugin/NativeImports.cs @@ -32,5 +32,9 @@ internal static extern int TProgManPlaceRandomBus(int progMan, int aityp, internal static extern int GetTextureDesc(uint Texture, uint pWidth, uint pHeight, uint pFormat); [DllImport("OmsiHookInvoker.dll")] internal static extern int IsTexture(uint Texture); + [DllImport("OmsiHookInvoker.dll")] + internal static extern void RVTriggerXML(int roadVehicle, int trigger, int value); + [DllImport("OmsiHookInvoker.dll")] + internal static extern void SoundTrigger(int complMapObj, int trigger, int filename); } } diff --git a/OmsiHookRPCPlugin/OmsiHookRPCPlugin.cs b/OmsiHookRPCPlugin/OmsiHookRPCPlugin.cs index 245b396..cb6c104 100644 --- a/OmsiHookRPCPlugin/OmsiHookRPCPlugin.cs +++ b/OmsiHookRPCPlugin/OmsiHookRPCPlugin.cs @@ -83,6 +83,11 @@ public static void PluginStart(IntPtr aOwner) } catch { } Log("############## Omsi Hook RPC Plugin ##############"); Log($" version: {Assembly.GetExecutingAssembly().GetName().Version}"); + Log($" copyright Thomas Mathieson 2023"); + Log($"~ Omsi Hook RPC plugin is a simple plugin allowing OMSI mods which use the OmsiHook SDK ~"); + Log($"~ to interact with OMSI from an external process. The source code is available at: ~"); + Log($"~ https://github.com/space928/Omsi-Extensions ~"); + Log($""); Log($@"Starting RPC server on named pipe: \\.\pipe\{PIPE_NAME_RX} and \\.\pipe\{PIPE_NAME_TX} with {MAX_CLIENTS} threads..."); argumentArrayPool = ArrayPool.Create(256,8); @@ -320,6 +325,22 @@ private static void ProcessCall(MethodData methodData) BitConverter.ToUInt32(methodData.args, argInd) ); break; + case RemoteMethod.RVTriggerXML: + ret = 0; + NativeImports.RVTriggerXML( + BitConverter.ToInt32(methodData.args, argInd), + BitConverter.ToInt32(methodData.args, argInd += 4), + BitConverter.ToInt32(methodData.args, argInd += 4) + ); + break; + case RemoteMethod.SoundTrigger: + ret = 0; + NativeImports.SoundTrigger( + BitConverter.ToInt32(methodData.args, argInd), + BitConverter.ToInt32(methodData.args, argInd += 4), + BitConverter.ToInt32(methodData.args, argInd += 4) + ); + break; default: Log($"Unknown message type: {methodData.method} encountered!"); break; diff --git a/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj b/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj index ab16efc..30059cc 100644 --- a/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj +++ b/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj @@ -5,7 +5,7 @@ Thomas Mathieson - 1.3.3 + 1.3.4 Thomas Mathieson From f7518daaa5efaa4b3b563582524e14862c143b74 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Fri, 29 Dec 2023 20:42:05 +0100 Subject: [PATCH 04/36] + Basic CLI Example Code --- OmsiExtensions.sln | 14 ++++++ _OmsiHookExamples/Basic_CLI/Basic_CLI.csproj | 16 +++++++ _OmsiHookExamples/Basic_CLI/Program.cs | 47 ++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 _OmsiHookExamples/Basic_CLI/Basic_CLI.csproj create mode 100644 _OmsiHookExamples/Basic_CLI/Program.cs diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index 84f3749..221cf64 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -15,6 +15,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OmsiHookInvoker", "OmsiHook EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OmsiHookRPCPlugin", "OmsiHookRPCPlugin\OmsiHookRPCPlugin.csproj", "{CDB17143-5653-48BE-AAC8-8419D5B4FD2C}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OHExamples - Basic_CLI", "_OmsiHookExamples\Basic_CLI\Basic_CLI.csproj", "{BA833C68-E8BD-4C86-9555-85542DF02015}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -93,6 +95,18 @@ Global {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x64.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.Build.0 = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.ActiveCfg = Debug|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.Build.0 = Debug|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.ActiveCfg = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.Build.0 = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.Build.0 = Release|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.ActiveCfg = Release|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.Build.0 = Release|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/_OmsiHookExamples/Basic_CLI/Basic_CLI.csproj b/_OmsiHookExamples/Basic_CLI/Basic_CLI.csproj new file mode 100644 index 0000000..33fd140 --- /dev/null +++ b/_OmsiHookExamples/Basic_CLI/Basic_CLI.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0-windows10.0.22621.0 + disable + enable + x86 + Basic_CLI.Program + + + + + + + diff --git a/_OmsiHookExamples/Basic_CLI/Program.cs b/_OmsiHookExamples/Basic_CLI/Program.cs new file mode 100644 index 0000000..de1797c --- /dev/null +++ b/_OmsiHookExamples/Basic_CLI/Program.cs @@ -0,0 +1,47 @@ +using System; +using System.Threading; +using OmsiHook; + +namespace Basic_CLI +{ + // Most Basic example of reading various values exposed by OMSIHook + class Program + { + static void Main(string[] args) + { + Console.WriteLine("#=#=#=#=#=# OMSIHook Basic CLI Sample #=#=#=#=#=#"); + + OmsiHook.OmsiHook omsi = new(); + omsi.AttachToOMSI().Wait(); + var playerVehicle = omsi.Globals.PlayerVehicle; + var time = omsi.Globals.Time; + Console.OutputEncoding = System.Text.Encoding.UTF8; + while (true) + { + playerVehicle ??= omsi.Globals.PlayerVehicle; + var pos = playerVehicle?.Position ?? default; + var rot = playerVehicle?.Rotation ?? default; + var map = omsi.Globals.Map; + var weather = omsi.Globals.Weather; + + Console.SetCursorPosition(0, 1); + Console.WriteLine($"Map: {map?.FriendlyName}".PadRight(Console.WindowWidth - 17) + $"Date: {time.Day:00}/{time.Month:00}/{time.Year:0000}"); + Console.WriteLine($"Weather: {weatherEmoji(weather)}".PadRight(Console.WindowWidth - 15) + $"Time: {time.Hour:00}:{time.Minute:00}:{time.Second:00}"); + Console.WriteLine($"Bus: {playerVehicle?.RoadVehicle?.FileName}".PadRight(Console.WindowWidth - 1)); + Console.WriteLine(($"Position: {pos.x:F2},{pos.y:F2},{pos.z:F2}".PadRight(Console.WindowWidth - 8) + + $"Tile: {playerVehicle?.Kachel ?? 0}")); + Console.WriteLine(($"Rotation: {rot.w:F2},{rot.x:F2},{rot.y:F2},{rot.z:F2}".PadRight(Console.WindowWidth - 1))); + + Thread.Sleep(20); + } + } + static string weatherEmoji(OmsiWeather weather) + { + if (weather?.ActWeather.fogDensity < 900) + return "🌫️"; + if (weather?.ActWeather.percipitation > 0) + return "🌧️"; + return "☀️"; + } + } +} From f3431e27fc3b9f86ce20f1245cf5657e329bb2ed Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Fri, 29 Dec 2023 21:58:37 +0100 Subject: [PATCH 05/36] + Basic CLI Documentation --- OmsiExtensions.sln | 11 +- OmsiHook/docs/articles/examples/Basic_CLI.md | 28 +++++ OmsiHook/docs/articles/toc.yml | 6 +- OmsiHook/docs/docfx_log.txt | 117 +++++++++++++++++++ _OmsiHookExamples/Basic_CLI/Program.cs | 4 +- 5 files changed, 159 insertions(+), 7 deletions(-) create mode 100644 OmsiHook/docs/articles/examples/Basic_CLI.md diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index 221cf64..b488af9 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -14,8 +14,14 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OmsiHookInvoker", "OmsiHookInvoker\OmsiHookInvoker.vcxproj", "{CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OmsiHookRPCPlugin", "OmsiHookRPCPlugin\OmsiHookRPCPlugin.csproj", "{CDB17143-5653-48BE-AAC8-8419D5B4FD2C}" + ProjectSection(ProjectDependencies) = postProject + {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B} = {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B} + EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OHExamples - Basic_CLI", "_OmsiHookExamples\Basic_CLI\Basic_CLI.csproj", "{BA833C68-E8BD-4C86-9555-85542DF02015}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basic_CLI", "_OmsiHookExamples\Basic_CLI\Basic_CLI.csproj", "{BA833C68-E8BD-4C86-9555-85542DF02015}" + ProjectSection(ProjectDependencies) = postProject + {2E750CBE-F868-4AB7-96C2-27560F53E06B} = {2E750CBE-F868-4AB7-96C2-27560F53E06B} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -49,7 +55,6 @@ Global {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x64.ActiveCfg = Release|Any CPU {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x64.Build.0 = Release|Any CPU {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.ActiveCfg = Release|Any CPU - {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.Build.0 = Release|Any CPU {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.Build.0 = Debug|Any CPU {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -61,7 +66,6 @@ Global {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x64.ActiveCfg = Release|Any CPU {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x64.Build.0 = Release|Any CPU {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.ActiveCfg = Release|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.Build.0 = Release|Any CPU {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|Any CPU.ActiveCfg = Debug|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|Any CPU.Build.0 = Debug|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x64.ActiveCfg = Debug|x86 @@ -106,7 +110,6 @@ Global {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.ActiveCfg = Release|Any CPU {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.Build.0 = Release|Any CPU {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/OmsiHook/docs/articles/examples/Basic_CLI.md b/OmsiHook/docs/articles/examples/Basic_CLI.md new file mode 100644 index 0000000..e62f9a1 --- /dev/null +++ b/OmsiHook/docs/articles/examples/Basic_CLI.md @@ -0,0 +1,28 @@ +# Basic CLI Example + +This article provides a basic understanding to a basic C# .NET example leveraging the OMSIHook library. The example focuses on retrieving crucial information about the map, weather, date, and the current vehicle. + +_This article is in direct relation to the Sample Project available [here](https://github.com/space928/Omsi-Extensions/tree/main/_OmsiHookExamples/Basic_CLI)._ + +## Initialization + +Initialize an instance of the `OmsiHook` class and establish a connection to the OMSI game: + +```cs +OmsiHook.OmsiHook omsi = new(); +omsi.AttachToOMSI().Wait(); +``` + +## Caching of Globals + +Efficiently cache top-level global variables outside the loop for optimized performance: + +```cs +// Cache global variables for faster access +var playerVehicle = omsi.Globals.PlayerVehicle; +var time = omsi.Globals.Time; +var map = omsi.Globals.Map; +var weather = omsi.Globals.Weather; +``` + +By caching these variables outside the loop, you significantly enhance access speed during subsequent iterations. \ No newline at end of file diff --git a/OmsiHook/docs/articles/toc.yml b/OmsiHook/docs/articles/toc.yml index f2ba49b..de1b476 100644 --- a/OmsiHook/docs/articles/toc.yml +++ b/OmsiHook/docs/articles/toc.yml @@ -3,4 +3,8 @@ - name: Building Native Omsi Plugins href: building-native-plugins.md - name: Performance Tips - href: performance-tips.md \ No newline at end of file + href: performance-tips.md +- name: Examples + items: + - name: Basic CLI Example + href: examples\Basic_CLI.md \ No newline at end of file diff --git a/OmsiHook/docs/docfx_log.txt b/OmsiHook/docs/docfx_log.txt index 39bf1a6..25deefc 100644 --- a/OmsiHook/docs/docfx_log.txt +++ b/OmsiHook/docs/docfx_log.txt @@ -165,3 +165,120 @@ {"message":"Completed Scope:BuildCommand in 2476.8351 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T05:09:51.3972323Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.2.4"} {"message":"System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nFile name: 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\r\n at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)\r\n at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()\r\n at System.Reflection.RuntimeMethodInfo.GetParameters()\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.GetCallbackMethodsForType(Type type, List`1& onSerializing, List`1& onSerialized, List`1& onDeserializing, List`1& onDeserialized, List`1& onError)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveCallbackMethods(JsonContract contract, Type t)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type objectType)\r\n at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.ComputeConfigHash(DocumentBuildParameters parameter, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.Create(DocumentBuildParameters parameters, BuildInfo cb, BuildInfo lb, String intermediateFolder, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Prepare(DocumentBuildParameters parameters, DocumentBuildContext context, TemplateProcessor templateProcessor, String markdownServiceContextHash, IHostServiceCreator& hostServiceCreator, PhaseProcessor& phaseProcessor)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.BuildCore(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Build(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.BuildCore(DocumentBuildParameters parameter, IMarkdownServiceProvider markdownServiceProvider, BuildInfo currentBuildInfo, BuildInfo lastBuildInfo)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.Build(IList`1 parameters, String outputDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument(BuildJsonConfig config, TemplateManager templateManager, String baseDirectory, String outputDirectory, String pluginDirectory, String templateDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument()\r\n\r\nWRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].\r\n","date_time":"2023-12-29T05:09:51.3972323Z","message_severity":"error","code":"FatalError","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.3"} {"message":"Completed in 24280.1555 milliseconds","date_time":"2023-12-29T05:09:51.3972323Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.4"} +{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T19:47:48.375178Z","message_severity":"info","correlation_id":"F84686BF-1473-452B-9335-FC7F16DF72D6.1.1.1"} +{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T19:47:49.1943377Z","message_severity":"info","correlation_id":"F84686BF-1473-452B-9335-FC7F16DF72D6.1.1.2"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: c1: (0, 0): Cannot open source file: 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c': No such file or directory","source":"MetadataCommand.ExtractMetadata","file":"C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T19:47:57.984227Z","message_severity":"warning","correlation_id":"F84686BF-1473-452B-9335-FC7F16DF72D6.1.1.5"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\build\\DNNE.targets: (150, 5): The command \"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\Hostx64\\x86\\cl.exe\" /O2 /LD /TC /MT /GS /Zi /D DNNE_ASSEMBLY_NAME=OmsiHookRPCPlugin /D DNNE_COMPILE_AS_SOURCE /I \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\include\" /I \"C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\" /I \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\8.0.0\\runtimes\\win-x86\\native\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt\" \"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c\" \"C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\\platform.c\" /link /DLL /LTCG /LIBPATH:\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\lib\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22621.0\\um\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22621.0\\ucrt\\x86\" \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\8.0.0\\runtimes\\win-x86\\native\\libnethost.lib\" Advapi32.lib /IGNORE:4099 /IMPLIB:\"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.lib\" /OUT:\"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.dll\" \" exited with code 2.","source":"MetadataCommand.ExtractMetadata","file":"C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T19:47:57.9847946Z","message_severity":"warning","correlation_id":"F84686BF-1473-452B-9335-FC7F16DF72D6.1.1.6"} +{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T19:47:58.3700186Z","message_severity":"info","correlation_id":"F84686BF-1473-452B-9335-FC7F16DF72D6.1.1.9"} +{"message":"Completed Scope:MetadataCommand in 19927.4389 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T19:48:08.1447821Z","message_severity":"info","correlation_id":"F84686BF-1473-452B-9335-FC7F16DF72D6.1.2"} +{"message":"Plug-in directory: C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_4sq1eaj4.ylf\\plugins, configuration file: C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_4sq1eaj4.ylf\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T19:48:08.1887803Z","message_severity":"info","correlation_id":"F84686BF-1473-452B-9335-FC7F16DF72D6.2.2"} +{"message":"Searching custom plugins in directory C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_4sq1eaj4.ylf\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T19:48:08.7788091Z","message_severity":"info","correlation_id":"BF963218-C314-4057-9474-F783591AC682.215.1"} +{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T19:48:09.4816473Z","message_severity":"info","correlation_id":"BF963218-C314-4057-9474-F783591AC682.216"} +{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T19:48:09.4848775Z","message_severity":"info","correlation_id":"BF963218-C314-4057-9474-F783591AC682.223"} +{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T19:48:09.7199653Z","message_severity":"info","correlation_id":"BF963218-C314-4057-9474-F783591AC682.224"} +{"message":"Markdown engine is markdig","date_time":"2023-12-29T19:48:09.7362121Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"BF963218-C314-4057-9474-F783591AC682.226"} +{"message":"Cannot load build info: 'build.info' not found under 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\docs\\obj\\.cache\\build'","date_time":"2023-12-29T19:48:09.9372557Z","message_severity":"info","correlation_id":"BF963218-C314-4057-9474-F783591AC682.229"} +{"message":"Max parallelism is 20.","source":"BuildCore.Build Document","date_time":"2023-12-29T19:48:09.9882424Z","message_severity":"info","correlation_id":"BF963218-C314-4057-9474-F783591AC682.267.1.1"} +{"message":"Completed building documents in 889.9004 milliseconds.","date_time":"2023-12-29T19:48:10.3748944Z","message_severity":"info","correlation_id":"BF963218-C314-4057-9474-F783591AC682.268"} +{"message":"Cleaning up temporary plugin folder \"C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_4sq1eaj4.ylf\"","source":"BuildCommand","date_time":"2023-12-29T19:48:10.4097571Z","message_severity":"info","correlation_id":"F84686BF-1473-452B-9335-FC7F16DF72D6.2.3"} +{"message":"Completed Scope:BuildCommand in 2268.8274 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T19:48:10.4133459Z","message_severity":"info","correlation_id":"F84686BF-1473-452B-9335-FC7F16DF72D6.2.4"} +{"message":"System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nFile name: 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\r\n at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)\r\n at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()\r\n at System.Reflection.RuntimeMethodInfo.GetParameters()\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.GetCallbackMethodsForType(Type type, List`1& onSerializing, List`1& onSerialized, List`1& onDeserializing, List`1& onDeserialized, List`1& onError)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveCallbackMethods(JsonContract contract, Type t)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type objectType)\r\n at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.ComputeConfigHash(DocumentBuildParameters parameter, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.Create(DocumentBuildParameters parameters, BuildInfo cb, BuildInfo lb, String intermediateFolder, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Prepare(DocumentBuildParameters parameters, DocumentBuildContext context, TemplateProcessor templateProcessor, String markdownServiceContextHash, IHostServiceCreator& hostServiceCreator, PhaseProcessor& phaseProcessor)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.BuildCore(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Build(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.BuildCore(DocumentBuildParameters parameter, IMarkdownServiceProvider markdownServiceProvider, BuildInfo currentBuildInfo, BuildInfo lastBuildInfo)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.Build(IList`1 parameters, String outputDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument(BuildJsonConfig config, TemplateManager templateManager, String baseDirectory, String outputDirectory, String pluginDirectory, String templateDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument()\r\n\r\nWRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].\r\n","date_time":"2023-12-29T19:48:10.4138643Z","message_severity":"error","code":"FatalError","correlation_id":"F84686BF-1473-452B-9335-FC7F16DF72D6.3"} +{"message":"Completed in 22198.9732 milliseconds","date_time":"2023-12-29T19:48:10.4143939Z","message_severity":"info","correlation_id":"F84686BF-1473-452B-9335-FC7F16DF72D6.4"} +{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T19:50:45.5713111Z","message_severity":"info","correlation_id":"A1E611E6-3B0B-4D95-B4B8-CC311CDA4488.1.1.1"} +{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T19:50:45.7530961Z","message_severity":"info","correlation_id":"A1E611E6-3B0B-4D95-B4B8-CC311CDA4488.1.1.2"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: c1: (0, 0): Cannot open source file: 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c': No such file or directory","source":"MetadataCommand.ExtractMetadata","file":"C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T19:50:53.2792241Z","message_severity":"warning","correlation_id":"A1E611E6-3B0B-4D95-B4B8-CC311CDA4488.1.1.5"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\build\\DNNE.targets: (150, 5): The command \"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\Hostx64\\x86\\cl.exe\" /O2 /LD /TC /MT /GS /Zi /D DNNE_ASSEMBLY_NAME=OmsiHookRPCPlugin /D DNNE_COMPILE_AS_SOURCE /I \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\include\" /I \"C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\" /I \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\8.0.0\\runtimes\\win-x86\\native\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt\" \"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c\" \"C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\\platform.c\" /link /DLL /LTCG /LIBPATH:\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\lib\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22621.0\\um\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22621.0\\ucrt\\x86\" \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\8.0.0\\runtimes\\win-x86\\native\\libnethost.lib\" Advapi32.lib /IGNORE:4099 /IMPLIB:\"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.lib\" /OUT:\"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.dll\" \" exited with code 2.","source":"MetadataCommand.ExtractMetadata","file":"C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T19:50:53.2797705Z","message_severity":"warning","correlation_id":"A1E611E6-3B0B-4D95-B4B8-CC311CDA4488.1.1.6"} +{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T19:50:53.7185872Z","message_severity":"info","correlation_id":"A1E611E6-3B0B-4D95-B4B8-CC311CDA4488.1.1.88"} +{"message":"'C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj' keep up-to-date since '29/12/2023 19:47:59', cached intermediate result 'C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/obj/xdoc/cache/obj\\gdbep5qu.ocz' is used.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T19:50:54.9863847Z","message_severity":"info","correlation_id":"A1E611E6-3B0B-4D95-B4B8-CC311CDA4488.1.1.328"} +{"message":"Completed Scope:MetadataCommand in 16192.6508 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T19:51:01.7326073Z","message_severity":"info","correlation_id":"A1E611E6-3B0B-4D95-B4B8-CC311CDA4488.1.2"} +{"message":"Plug-in directory: C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_ejihd1zs.thm\\plugins, configuration file: C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_ejihd1zs.thm\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T19:51:01.7684593Z","message_severity":"info","correlation_id":"A1E611E6-3B0B-4D95-B4B8-CC311CDA4488.2.2"} +{"message":"Searching custom plugins in directory C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_ejihd1zs.thm\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T19:51:01.9942595Z","message_severity":"info","correlation_id":"83498D42-34F3-4788-862C-0628B1A9A9BB.215.1"} +{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T19:51:02.2287247Z","message_severity":"info","correlation_id":"83498D42-34F3-4788-862C-0628B1A9A9BB.216"} +{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T19:51:02.2330033Z","message_severity":"info","correlation_id":"83498D42-34F3-4788-862C-0628B1A9A9BB.223"} +{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T19:51:02.4559788Z","message_severity":"info","correlation_id":"83498D42-34F3-4788-862C-0628B1A9A9BB.224"} +{"message":"Markdown engine is markdig","date_time":"2023-12-29T19:51:02.4780631Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"83498D42-34F3-4788-862C-0628B1A9A9BB.226"} +{"message":"Cannot load build info: 'build.info' not found under 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\docs\\obj\\.cache\\build'","date_time":"2023-12-29T19:51:02.5699533Z","message_severity":"info","correlation_id":"83498D42-34F3-4788-862C-0628B1A9A9BB.229"} +{"message":"Max parallelism is 20.","source":"BuildCore.Build Document","date_time":"2023-12-29T19:51:02.592496Z","message_severity":"info","correlation_id":"83498D42-34F3-4788-862C-0628B1A9A9BB.267.1.1"} +{"message":"Completed building documents in 652.2883 milliseconds.","date_time":"2023-12-29T19:51:02.8853796Z","message_severity":"info","correlation_id":"83498D42-34F3-4788-862C-0628B1A9A9BB.268"} +{"message":"Cleaning up temporary plugin folder \"C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_ejihd1zs.thm\"","source":"BuildCommand","date_time":"2023-12-29T19:51:02.9161102Z","message_severity":"info","correlation_id":"A1E611E6-3B0B-4D95-B4B8-CC311CDA4488.2.3"} +{"message":"Completed Scope:BuildCommand in 1187.2413 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T19:51:02.9199962Z","message_severity":"info","correlation_id":"A1E611E6-3B0B-4D95-B4B8-CC311CDA4488.2.4"} +{"message":"System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nFile name: 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\r\n at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)\r\n at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()\r\n at System.Reflection.RuntimeMethodInfo.GetParameters()\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.GetCallbackMethodsForType(Type type, List`1& onSerializing, List`1& onSerialized, List`1& onDeserializing, List`1& onDeserialized, List`1& onError)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveCallbackMethods(JsonContract contract, Type t)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type objectType)\r\n at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.ComputeConfigHash(DocumentBuildParameters parameter, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.Create(DocumentBuildParameters parameters, BuildInfo cb, BuildInfo lb, String intermediateFolder, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Prepare(DocumentBuildParameters parameters, DocumentBuildContext context, TemplateProcessor templateProcessor, String markdownServiceContextHash, IHostServiceCreator& hostServiceCreator, PhaseProcessor& phaseProcessor)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.BuildCore(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Build(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.BuildCore(DocumentBuildParameters parameter, IMarkdownServiceProvider markdownServiceProvider, BuildInfo currentBuildInfo, BuildInfo lastBuildInfo)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.Build(IList`1 parameters, String outputDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument(BuildJsonConfig config, TemplateManager templateManager, String baseDirectory, String outputDirectory, String pluginDirectory, String templateDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument()\r\n\r\nWRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].\r\n","date_time":"2023-12-29T19:51:02.9206206Z","message_severity":"error","code":"FatalError","correlation_id":"A1E611E6-3B0B-4D95-B4B8-CC311CDA4488.3"} +{"message":"Completed in 17383.0407 milliseconds","date_time":"2023-12-29T19:51:02.9206206Z","message_severity":"info","correlation_id":"A1E611E6-3B0B-4D95-B4B8-CC311CDA4488.4"} +{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T19:52:46.3760895Z","message_severity":"info","correlation_id":"5EA5D6E4-BF25-474D-A951-C3182E2744BB.1.1.1"} +{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T19:52:46.5533883Z","message_severity":"info","correlation_id":"5EA5D6E4-BF25-474D-A951-C3182E2744BB.1.1.2"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: c1: (0, 0): Cannot open source file: 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c': No such file or directory","source":"MetadataCommand.ExtractMetadata","file":"C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T19:52:54.1019545Z","message_severity":"warning","correlation_id":"5EA5D6E4-BF25-474D-A951-C3182E2744BB.1.1.5"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\build\\DNNE.targets: (150, 5): The command \"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\Hostx64\\x86\\cl.exe\" /O2 /LD /TC /MT /GS /Zi /D DNNE_ASSEMBLY_NAME=OmsiHookRPCPlugin /D DNNE_COMPILE_AS_SOURCE /I \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\include\" /I \"C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\" /I \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\8.0.0\\runtimes\\win-x86\\native\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt\" \"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c\" \"C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\\platform.c\" /link /DLL /LTCG /LIBPATH:\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\lib\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22621.0\\um\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22621.0\\ucrt\\x86\" \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\8.0.0\\runtimes\\win-x86\\native\\libnethost.lib\" Advapi32.lib /IGNORE:4099 /IMPLIB:\"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.lib\" /OUT:\"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.dll\" \" exited with code 2.","source":"MetadataCommand.ExtractMetadata","file":"C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T19:52:54.1024731Z","message_severity":"warning","correlation_id":"5EA5D6E4-BF25-474D-A951-C3182E2744BB.1.1.6"} +{"message":"'C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj' keep up-to-date since '29/12/2023 19:50:45', cached result from 'C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/docs/api' is used.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T19:52:54.5541908Z","message_severity":"info","correlation_id":"5EA5D6E4-BF25-474D-A951-C3182E2744BB.1.1.248"} +{"message":"Completed Scope:MetadataCommand in 8207.9976 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T19:52:54.5563812Z","message_severity":"info","correlation_id":"5EA5D6E4-BF25-474D-A951-C3182E2744BB.1.2"} +{"message":"Plug-in directory: C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_4d1mykzm.1zw\\plugins, configuration file: C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_4d1mykzm.1zw\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T19:52:54.5932934Z","message_severity":"info","correlation_id":"5EA5D6E4-BF25-474D-A951-C3182E2744BB.2.2"} +{"message":"Searching custom plugins in directory C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_4d1mykzm.1zw\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T19:52:54.8114874Z","message_severity":"info","correlation_id":"24CFEC8C-49C5-448E-BA1D-82FD2928CCA4.215.1"} +{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T19:52:55.1030399Z","message_severity":"info","correlation_id":"24CFEC8C-49C5-448E-BA1D-82FD2928CCA4.216"} +{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T19:52:55.1066797Z","message_severity":"info","correlation_id":"24CFEC8C-49C5-448E-BA1D-82FD2928CCA4.223"} +{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T19:52:55.3193408Z","message_severity":"info","correlation_id":"24CFEC8C-49C5-448E-BA1D-82FD2928CCA4.224"} +{"message":"Markdown engine is markdig","date_time":"2023-12-29T19:52:55.3339952Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"24CFEC8C-49C5-448E-BA1D-82FD2928CCA4.226"} +{"message":"Cannot load build info: 'build.info' not found under 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\docs\\obj\\.cache\\build'","date_time":"2023-12-29T19:52:55.4171132Z","message_severity":"info","correlation_id":"24CFEC8C-49C5-448E-BA1D-82FD2928CCA4.229"} +{"message":"Max parallelism is 20.","source":"BuildCore.Build Document","date_time":"2023-12-29T19:52:55.4385307Z","message_severity":"info","correlation_id":"24CFEC8C-49C5-448E-BA1D-82FD2928CCA4.267.1.1"} +{"message":"Completed building documents in 615.0274 milliseconds.","date_time":"2023-12-29T19:52:55.721763Z","message_severity":"info","correlation_id":"24CFEC8C-49C5-448E-BA1D-82FD2928CCA4.268"} +{"message":"Cleaning up temporary plugin folder \"C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_4d1mykzm.1zw\"","source":"BuildCommand","date_time":"2023-12-29T19:52:55.750635Z","message_severity":"info","correlation_id":"5EA5D6E4-BF25-474D-A951-C3182E2744BB.2.3"} +{"message":"Completed Scope:BuildCommand in 1197.7706 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T19:52:55.7540445Z","message_severity":"info","correlation_id":"5EA5D6E4-BF25-474D-A951-C3182E2744BB.2.4"} +{"message":"System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nFile name: 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\r\n at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)\r\n at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()\r\n at System.Reflection.RuntimeMethodInfo.GetParameters()\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.GetCallbackMethodsForType(Type type, List`1& onSerializing, List`1& onSerialized, List`1& onDeserializing, List`1& onDeserialized, List`1& onError)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveCallbackMethods(JsonContract contract, Type t)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type objectType)\r\n at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.ComputeConfigHash(DocumentBuildParameters parameter, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.Create(DocumentBuildParameters parameters, BuildInfo cb, BuildInfo lb, String intermediateFolder, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Prepare(DocumentBuildParameters parameters, DocumentBuildContext context, TemplateProcessor templateProcessor, String markdownServiceContextHash, IHostServiceCreator& hostServiceCreator, PhaseProcessor& phaseProcessor)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.BuildCore(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Build(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.BuildCore(DocumentBuildParameters parameter, IMarkdownServiceProvider markdownServiceProvider, BuildInfo currentBuildInfo, BuildInfo lastBuildInfo)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.Build(IList`1 parameters, String outputDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument(BuildJsonConfig config, TemplateManager templateManager, String baseDirectory, String outputDirectory, String pluginDirectory, String templateDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument()\r\n\r\nWRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].\r\n","date_time":"2023-12-29T19:52:55.7540445Z","message_severity":"error","code":"FatalError","correlation_id":"5EA5D6E4-BF25-474D-A951-C3182E2744BB.3"} +{"message":"Completed in 9409.2273 milliseconds","date_time":"2023-12-29T19:52:55.7546662Z","message_severity":"info","correlation_id":"5EA5D6E4-BF25-474D-A951-C3182E2744BB.4"} +{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T19:53:17.6995654Z","message_severity":"info","correlation_id":"478804AE-7853-4101-BA15-2BC0F6FAD75C.1.1.1"} +{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T19:53:17.8808187Z","message_severity":"info","correlation_id":"478804AE-7853-4101-BA15-2BC0F6FAD75C.1.1.2"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: c1: (0, 0): Cannot open source file: 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c': No such file or directory","source":"MetadataCommand.ExtractMetadata","file":"C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T19:53:25.3261278Z","message_severity":"warning","correlation_id":"478804AE-7853-4101-BA15-2BC0F6FAD75C.1.1.5"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\build\\DNNE.targets: (150, 5): The command \"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\Hostx64\\x86\\cl.exe\" /O2 /LD /TC /MT /GS /Zi /D DNNE_ASSEMBLY_NAME=OmsiHookRPCPlugin /D DNNE_COMPILE_AS_SOURCE /I \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\include\" /I \"C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\" /I \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\8.0.0\\runtimes\\win-x86\\native\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt\" \"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c\" \"C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\\platform.c\" /link /DLL /LTCG /LIBPATH:\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\lib\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22621.0\\um\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22621.0\\ucrt\\x86\" \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\8.0.0\\runtimes\\win-x86\\native\\libnethost.lib\" Advapi32.lib /IGNORE:4099 /IMPLIB:\"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.lib\" /OUT:\"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.dll\" \" exited with code 2.","source":"MetadataCommand.ExtractMetadata","file":"C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T19:53:25.3261278Z","message_severity":"warning","correlation_id":"478804AE-7853-4101-BA15-2BC0F6FAD75C.1.1.6"} +{"message":"'C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj' keep up-to-date since '29/12/2023 19:50:45', cached result from 'C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/docs/api' is used.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T19:53:25.7733742Z","message_severity":"info","correlation_id":"478804AE-7853-4101-BA15-2BC0F6FAD75C.1.1.248"} +{"message":"Completed Scope:MetadataCommand in 8105.3812 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T19:53:25.7756456Z","message_severity":"info","correlation_id":"478804AE-7853-4101-BA15-2BC0F6FAD75C.1.2"} +{"message":"Plug-in directory: C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_jzkkdtzf.2ty\\plugins, configuration file: C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_jzkkdtzf.2ty\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T19:53:25.8127576Z","message_severity":"info","correlation_id":"478804AE-7853-4101-BA15-2BC0F6FAD75C.2.2"} +{"message":"Searching custom plugins in directory C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_jzkkdtzf.2ty\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T19:53:26.0329874Z","message_severity":"info","correlation_id":"A299D834-39DC-46B6-9B5E-17B02863FAB0.215.1"} +{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T19:53:26.2633183Z","message_severity":"info","correlation_id":"A299D834-39DC-46B6-9B5E-17B02863FAB0.216"} +{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T19:53:26.2672125Z","message_severity":"info","correlation_id":"A299D834-39DC-46B6-9B5E-17B02863FAB0.223"} +{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T19:53:26.481267Z","message_severity":"info","correlation_id":"A299D834-39DC-46B6-9B5E-17B02863FAB0.224"} +{"message":"Markdown engine is markdig","date_time":"2023-12-29T19:53:26.4955444Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"A299D834-39DC-46B6-9B5E-17B02863FAB0.226"} +{"message":"Cannot load build info: 'build.info' not found under 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\docs\\obj\\.cache\\build'","date_time":"2023-12-29T19:53:26.5768072Z","message_severity":"info","correlation_id":"A299D834-39DC-46B6-9B5E-17B02863FAB0.229"} +{"message":"Max parallelism is 20.","source":"BuildCore.Build Document","date_time":"2023-12-29T19:53:26.5991959Z","message_severity":"info","correlation_id":"A299D834-39DC-46B6-9B5E-17B02863FAB0.267.1.1"} +{"message":"Completed building documents in 618.7746 milliseconds.","date_time":"2023-12-29T19:53:26.8862935Z","message_severity":"info","correlation_id":"A299D834-39DC-46B6-9B5E-17B02863FAB0.268"} +{"message":"Cleaning up temporary plugin folder \"C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_jzkkdtzf.2ty\"","source":"BuildCommand","date_time":"2023-12-29T19:53:26.9145651Z","message_severity":"info","correlation_id":"478804AE-7853-4101-BA15-2BC0F6FAD75C.2.3"} +{"message":"Completed Scope:BuildCommand in 1141.9956 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T19:53:26.9179975Z","message_severity":"info","correlation_id":"478804AE-7853-4101-BA15-2BC0F6FAD75C.2.4"} +{"message":"System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nFile name: 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\r\n at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)\r\n at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()\r\n at System.Reflection.RuntimeMethodInfo.GetParameters()\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.GetCallbackMethodsForType(Type type, List`1& onSerializing, List`1& onSerialized, List`1& onDeserializing, List`1& onDeserialized, List`1& onError)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveCallbackMethods(JsonContract contract, Type t)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type objectType)\r\n at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.ComputeConfigHash(DocumentBuildParameters parameter, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.Create(DocumentBuildParameters parameters, BuildInfo cb, BuildInfo lb, String intermediateFolder, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Prepare(DocumentBuildParameters parameters, DocumentBuildContext context, TemplateProcessor templateProcessor, String markdownServiceContextHash, IHostServiceCreator& hostServiceCreator, PhaseProcessor& phaseProcessor)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.BuildCore(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Build(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.BuildCore(DocumentBuildParameters parameter, IMarkdownServiceProvider markdownServiceProvider, BuildInfo currentBuildInfo, BuildInfo lastBuildInfo)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.Build(IList`1 parameters, String outputDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument(BuildJsonConfig config, TemplateManager templateManager, String baseDirectory, String outputDirectory, String pluginDirectory, String templateDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument()\r\n\r\nWRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].\r\n","date_time":"2023-12-29T19:53:26.9185709Z","message_severity":"error","code":"FatalError","correlation_id":"478804AE-7853-4101-BA15-2BC0F6FAD75C.3"} +{"message":"Completed in 9251.3869 milliseconds","date_time":"2023-12-29T19:53:26.9185709Z","message_severity":"info","correlation_id":"478804AE-7853-4101-BA15-2BC0F6FAD75C.4"} +{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T20:24:00.924813Z","message_severity":"info","correlation_id":"E1A43B6A-E33E-4CCF-A3EB-7CCA3E6E0AD5.1.1.1"} +{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T20:24:01.094565Z","message_severity":"info","correlation_id":"E1A43B6A-E33E-4CCF-A3EB-7CCA3E6E0AD5.1.1.2"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: c1: (0, 0): Cannot open source file: 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c': No such file or directory","source":"MetadataCommand.ExtractMetadata","file":"C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T20:24:08.6445526Z","message_severity":"warning","correlation_id":"E1A43B6A-E33E-4CCF-A3EB-7CCA3E6E0AD5.1.1.5"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\build\\DNNE.targets: (150, 5): The command \"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\Hostx64\\x86\\cl.exe\" /O2 /LD /TC /MT /GS /Zi /D DNNE_ASSEMBLY_NAME=OmsiHookRPCPlugin /D DNNE_COMPILE_AS_SOURCE /I \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\include\" /I \"C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\" /I \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\8.0.0\\runtimes\\win-x86\\native\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt\" \"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c\" \"C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\\platform.c\" /link /DLL /LTCG /LIBPATH:\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\lib\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22621.0\\um\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22621.0\\ucrt\\x86\" \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\8.0.0\\runtimes\\win-x86\\native\\libnethost.lib\" Advapi32.lib /IGNORE:4099 /IMPLIB:\"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.lib\" /OUT:\"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.dll\" \" exited with code 2.","source":"MetadataCommand.ExtractMetadata","file":"C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T20:24:08.6445526Z","message_severity":"warning","correlation_id":"E1A43B6A-E33E-4CCF-A3EB-7CCA3E6E0AD5.1.1.6"} +{"message":"'C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj' keep up-to-date since '29/12/2023 19:50:45', cached result from 'C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/docs/api' is used.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T20:24:09.1205962Z","message_severity":"info","correlation_id":"E1A43B6A-E33E-4CCF-A3EB-7CCA3E6E0AD5.1.1.248"} +{"message":"Completed Scope:MetadataCommand in 8223.7491 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T20:24:09.1227505Z","message_severity":"info","correlation_id":"E1A43B6A-E33E-4CCF-A3EB-7CCA3E6E0AD5.1.2"} +{"message":"Plug-in directory: C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_4jndgnb3.pz3\\plugins, configuration file: C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_4jndgnb3.pz3\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T20:24:09.162601Z","message_severity":"info","correlation_id":"E1A43B6A-E33E-4CCF-A3EB-7CCA3E6E0AD5.2.2"} +{"message":"Searching custom plugins in directory C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_4jndgnb3.pz3\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T20:24:09.3951932Z","message_severity":"info","correlation_id":"AAEE9ED1-4A41-4D12-9608-DBF31AD2E1EB.215.1"} +{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T20:24:09.6489306Z","message_severity":"info","correlation_id":"AAEE9ED1-4A41-4D12-9608-DBF31AD2E1EB.216"} +{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T20:24:09.6560594Z","message_severity":"info","correlation_id":"AAEE9ED1-4A41-4D12-9608-DBF31AD2E1EB.223"} +{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T20:24:09.8736877Z","message_severity":"info","correlation_id":"AAEE9ED1-4A41-4D12-9608-DBF31AD2E1EB.224"} +{"message":"Markdown engine is markdig","date_time":"2023-12-29T20:24:09.8879152Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"AAEE9ED1-4A41-4D12-9608-DBF31AD2E1EB.226"} +{"message":"Cannot load build info: 'build.info' not found under 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\docs\\obj\\.cache\\build'","date_time":"2023-12-29T20:24:09.9727772Z","message_severity":"info","correlation_id":"AAEE9ED1-4A41-4D12-9608-DBF31AD2E1EB.229"} +{"message":"Max parallelism is 20.","source":"BuildCore.Build Document","date_time":"2023-12-29T20:24:09.9954389Z","message_severity":"info","correlation_id":"AAEE9ED1-4A41-4D12-9608-DBF31AD2E1EB.267.1.1"} +{"message":"Completed building documents in 622.7476 milliseconds.","date_time":"2023-12-29T20:24:10.2792347Z","message_severity":"info","correlation_id":"AAEE9ED1-4A41-4D12-9608-DBF31AD2E1EB.268"} +{"message":"Cleaning up temporary plugin folder \"C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_4jndgnb3.pz3\"","source":"BuildCommand","date_time":"2023-12-29T20:24:10.315978Z","message_severity":"info","correlation_id":"E1A43B6A-E33E-4CCF-A3EB-7CCA3E6E0AD5.2.3"} +{"message":"Completed Scope:BuildCommand in 1196.3048 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T20:24:10.3187791Z","message_severity":"info","correlation_id":"E1A43B6A-E33E-4CCF-A3EB-7CCA3E6E0AD5.2.4"} +{"message":"System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nFile name: 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\r\n at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)\r\n at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()\r\n at System.Reflection.RuntimeMethodInfo.GetParameters()\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.GetCallbackMethodsForType(Type type, List`1& onSerializing, List`1& onSerialized, List`1& onDeserializing, List`1& onDeserialized, List`1& onError)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveCallbackMethods(JsonContract contract, Type t)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type objectType)\r\n at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.ComputeConfigHash(DocumentBuildParameters parameter, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.Create(DocumentBuildParameters parameters, BuildInfo cb, BuildInfo lb, String intermediateFolder, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Prepare(DocumentBuildParameters parameters, DocumentBuildContext context, TemplateProcessor templateProcessor, String markdownServiceContextHash, IHostServiceCreator& hostServiceCreator, PhaseProcessor& phaseProcessor)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.BuildCore(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Build(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.BuildCore(DocumentBuildParameters parameter, IMarkdownServiceProvider markdownServiceProvider, BuildInfo currentBuildInfo, BuildInfo lastBuildInfo)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.Build(IList`1 parameters, String outputDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument(BuildJsonConfig config, TemplateManager templateManager, String baseDirectory, String outputDirectory, String pluginDirectory, String templateDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument()\r\n\r\nWRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].\r\n","date_time":"2023-12-29T20:24:10.3193201Z","message_severity":"error","code":"FatalError","correlation_id":"E1A43B6A-E33E-4CCF-A3EB-7CCA3E6E0AD5.3"} +{"message":"Completed in 9423.3227 milliseconds","date_time":"2023-12-29T20:24:10.3193201Z","message_severity":"info","correlation_id":"E1A43B6A-E33E-4CCF-A3EB-7CCA3E6E0AD5.4"} +{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T20:41:16.1455362Z","message_severity":"info","correlation_id":"DE45AA54-D017-4DB8-BFBC-77AF2D9FD3DA.1.1.1"} +{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T20:41:16.305236Z","message_severity":"info","correlation_id":"DE45AA54-D017-4DB8-BFBC-77AF2D9FD3DA.1.1.2"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' with message: C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj: (0, 0): OmsiHook depends on System.Memory (>= 4.0.1.1) but System.Memory 4.0.1.1 was not found. An approximate best match of System.Memory 4.5.0 was resolved.","source":"MetadataCommand.ExtractMetadata","file":"C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T20:41:18.9044694Z","message_severity":"warning","correlation_id":"DE45AA54-D017-4DB8-BFBC-77AF2D9FD3DA.1.1.5"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: c1: (0, 0): Cannot open source file: 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c': No such file or directory","source":"MetadataCommand.ExtractMetadata","file":"C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T20:41:23.8680423Z","message_severity":"warning","correlation_id":"DE45AA54-D017-4DB8-BFBC-77AF2D9FD3DA.1.1.6"} +{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\build\\DNNE.targets: (150, 5): The command \"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\Hostx64\\x86\\cl.exe\" /O2 /LD /TC /MT /GS /Zi /D DNNE_ASSEMBLY_NAME=OmsiHookRPCPlugin /D DNNE_COMPILE_AS_SOURCE /I \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\include\" /I \"C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\" /I \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\8.0.0\\runtimes\\win-x86\\native\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt\" \"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c\" \"C:\\Users\\AdamM\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\\platform.c\" /link /DLL /LTCG /LIBPATH:\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\lib\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22621.0\\um\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22621.0\\ucrt\\x86\" \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\8.0.0\\runtimes\\win-x86\\native\\libnethost.lib\" Advapi32.lib /IGNORE:4099 /IMPLIB:\"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.lib\" /OUT:\"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.dll\" \" exited with code 2.","source":"MetadataCommand.ExtractMetadata","file":"C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T20:41:23.8690985Z","message_severity":"warning","correlation_id":"DE45AA54-D017-4DB8-BFBC-77AF2D9FD3DA.1.1.7"} +{"message":"Cache for C:/Users/AdamM/Source/Repos/space928/Omsi-Extensions/OmsiHook/OmsiHook.csproj in C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\obj\\xdoc\\cache\\final\\-600167790 is corrupted, rebuild...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T20:41:24.37946Z","message_severity":"info","correlation_id":"DE45AA54-D017-4DB8-BFBC-77AF2D9FD3DA.1.1.10"} +{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T20:41:24.37946Z","message_severity":"info","correlation_id":"DE45AA54-D017-4DB8-BFBC-77AF2D9FD3DA.1.1.11"} +{"message":"Completed Scope:MetadataCommand in 18337.1497 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T20:41:34.4556498Z","message_severity":"info","correlation_id":"DE45AA54-D017-4DB8-BFBC-77AF2D9FD3DA.1.2"} +{"message":"Plug-in directory: C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_rdi3meq1.t1i\\plugins, configuration file: C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_rdi3meq1.t1i\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T20:41:34.4942319Z","message_severity":"info","correlation_id":"DE45AA54-D017-4DB8-BFBC-77AF2D9FD3DA.2.2"} +{"message":"Searching custom plugins in directory C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_rdi3meq1.t1i\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T20:41:34.7118105Z","message_severity":"info","correlation_id":"563E2547-58A0-43B5-A7D3-62A2563E5C61.215.1"} +{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T20:41:34.9427245Z","message_severity":"info","correlation_id":"563E2547-58A0-43B5-A7D3-62A2563E5C61.216"} +{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T20:41:34.9465855Z","message_severity":"info","correlation_id":"563E2547-58A0-43B5-A7D3-62A2563E5C61.223"} +{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T20:41:35.1544256Z","message_severity":"info","correlation_id":"563E2547-58A0-43B5-A7D3-62A2563E5C61.224"} +{"message":"Markdown engine is markdig","date_time":"2023-12-29T20:41:35.1703833Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"563E2547-58A0-43B5-A7D3-62A2563E5C61.226"} +{"message":"Cannot load build info: 'build.info' not found under 'C:\\Users\\AdamM\\Source\\Repos\\space928\\Omsi-Extensions\\OmsiHook\\docs\\obj\\.cache\\build'","date_time":"2023-12-29T20:41:35.2549365Z","message_severity":"info","correlation_id":"563E2547-58A0-43B5-A7D3-62A2563E5C61.229"} +{"message":"Max parallelism is 20.","source":"BuildCore.Build Document","date_time":"2023-12-29T20:41:35.2787194Z","message_severity":"info","correlation_id":"563E2547-58A0-43B5-A7D3-62A2563E5C61.267.1.1"} +{"message":"Completed building documents in 611.7575 milliseconds.","date_time":"2023-12-29T20:41:35.5582216Z","message_severity":"info","correlation_id":"563E2547-58A0-43B5-A7D3-62A2563E5C61.268"} +{"message":"Cleaning up temporary plugin folder \"C:\\Users\\AdamM\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_rdi3meq1.t1i\"","source":"BuildCommand","date_time":"2023-12-29T20:41:35.5850807Z","message_severity":"info","correlation_id":"DE45AA54-D017-4DB8-BFBC-77AF2D9FD3DA.2.3"} +{"message":"Completed Scope:BuildCommand in 1132.1782 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T20:41:35.587392Z","message_severity":"info","correlation_id":"DE45AA54-D017-4DB8-BFBC-77AF2D9FD3DA.2.4"} +{"message":"System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nFile name: 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\r\n at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)\r\n at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()\r\n at System.Reflection.RuntimeMethodInfo.GetParameters()\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.GetCallbackMethodsForType(Type type, List`1& onSerializing, List`1& onSerialized, List`1& onDeserializing, List`1& onDeserialized, List`1& onError)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveCallbackMethods(JsonContract contract, Type t)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type objectType)\r\n at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.ComputeConfigHash(DocumentBuildParameters parameter, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.Create(DocumentBuildParameters parameters, BuildInfo cb, BuildInfo lb, String intermediateFolder, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Prepare(DocumentBuildParameters parameters, DocumentBuildContext context, TemplateProcessor templateProcessor, String markdownServiceContextHash, IHostServiceCreator& hostServiceCreator, PhaseProcessor& phaseProcessor)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.BuildCore(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Build(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.BuildCore(DocumentBuildParameters parameter, IMarkdownServiceProvider markdownServiceProvider, BuildInfo currentBuildInfo, BuildInfo lastBuildInfo)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.Build(IList`1 parameters, String outputDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument(BuildJsonConfig config, TemplateManager templateManager, String baseDirectory, String outputDirectory, String pluginDirectory, String templateDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument()\r\n\r\nWRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].\r\n","date_time":"2023-12-29T20:41:35.5881571Z","message_severity":"error","code":"FatalError","correlation_id":"DE45AA54-D017-4DB8-BFBC-77AF2D9FD3DA.3"} +{"message":"Completed in 19472.396 milliseconds","date_time":"2023-12-29T20:41:35.5881571Z","message_severity":"info","correlation_id":"DE45AA54-D017-4DB8-BFBC-77AF2D9FD3DA.4"} diff --git a/_OmsiHookExamples/Basic_CLI/Program.cs b/_OmsiHookExamples/Basic_CLI/Program.cs index de1797c..70f604b 100644 --- a/_OmsiHookExamples/Basic_CLI/Program.cs +++ b/_OmsiHookExamples/Basic_CLI/Program.cs @@ -15,14 +15,14 @@ static void Main(string[] args) omsi.AttachToOMSI().Wait(); var playerVehicle = omsi.Globals.PlayerVehicle; var time = omsi.Globals.Time; + var map = omsi.Globals.Map; + var weather = omsi.Globals.Weather; Console.OutputEncoding = System.Text.Encoding.UTF8; while (true) { playerVehicle ??= omsi.Globals.PlayerVehicle; var pos = playerVehicle?.Position ?? default; var rot = playerVehicle?.Rotation ?? default; - var map = omsi.Globals.Map; - var weather = omsi.Globals.Weather; Console.SetCursorPosition(0, 1); Console.WriteLine($"Map: {map?.FriendlyName}".PadRight(Console.WindowWidth - 17) + $"Date: {time.Day:00}/{time.Month:00}/{time.Year:0000}"); From 67b68ba582428cf06aed39078902742f7fe5e313 Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Sat, 30 Dec 2023 00:13:47 +0100 Subject: [PATCH 06/36] Fixed docfx build issue (maybe) --- .gitignore | 1 + OmsiHook/.gitignore | 3 +- OmsiHook/OmsiHook.csproj | 21 +++-- OmsiHook/OmsiRemoteMethods.cs | 2 +- OmsiHook/docs/docfx_log.txt | 167 ---------------------------------- 5 files changed, 16 insertions(+), 178 deletions(-) delete mode 100644 OmsiHook/docs/docfx_log.txt diff --git a/.gitignore b/.gitignore index 3457c6c..3416106 100644 --- a/.gitignore +++ b/.gitignore @@ -349,3 +349,4 @@ MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ /OmsiHook/log.txt +docfx_log.txt diff --git a/OmsiHook/.gitignore b/OmsiHook/.gitignore index 4378419..260486e 100644 --- a/OmsiHook/.gitignore +++ b/OmsiHook/.gitignore @@ -6,4 +6,5 @@ /**/packages/ /**/bin/ /**/obj/ -_site +/**/_site/ +docfx_log.txt diff --git a/OmsiHook/OmsiHook.csproj b/OmsiHook/OmsiHook.csproj index c79e638..e50d6c1 100644 --- a/OmsiHook/OmsiHook.csproj +++ b/OmsiHook/OmsiHook.csproj @@ -25,7 +25,7 @@ - + true $(MSBuildProjectDirectory)/docs/docfx.json @@ -66,15 +66,12 @@ \lib\net6.0 - + - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + True @@ -86,4 +83,10 @@ + + + + + diff --git a/OmsiHook/OmsiRemoteMethods.cs b/OmsiHook/OmsiRemoteMethods.cs index 2ee83c8..c2ce069 100644 --- a/OmsiHook/OmsiRemoteMethods.cs +++ b/OmsiHook/OmsiRemoteMethods.cs @@ -511,7 +511,7 @@ public static async Task OmsiSoundTrigger(OmsiComplMapObjInst mapObj, string tri { var triggerPtr = memory.AllocateString(trigger); var filenamePtr = memory.AllocateString(filename); - Task.WaitAll(triggerPtr, filenamePtr); + await Task.WhenAll(triggerPtr, filenamePtr); await OmsiSoundTrigger(mapObj, triggerPtr.Result, filenamePtr.Result); } diff --git a/OmsiHook/docs/docfx_log.txt b/OmsiHook/docs/docfx_log.txt deleted file mode 100644 index 39bf1a6..0000000 --- a/OmsiHook/docs/docfx_log.txt +++ /dev/null @@ -1,167 +0,0 @@ -{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T03:57:15.3209935Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.1.1"} -{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T03:57:15.8974533Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.1.2"} -{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' with message: Method not found: 'System.ReadOnlySpan`1 Microsoft.IO.Path.GetFileName(System.ReadOnlySpan`1)'.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T03:57:20.1576112Z","message_severity":"warning","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.1.5"} -{"message":"Project 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' does not contain any documents.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T03:57:21.9498446Z","message_severity":"warning","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.1.8"} -{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T03:57:22.0206788Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.1.9"} -{"message":"No metadata is generated for OmsiHook.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T03:57:34.2744443Z","message_severity":"warning","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.1.13"} -{"message":"Completed Scope:MetadataCommand in 19008.5051 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T03:57:34.2784348Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.1.2"} -{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_lpnt5z4o.rrx\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_lpnt5z4o.rrx\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T03:57:37.0040601Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.2.2"} -{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_lpnt5z4o.rrx\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T03:57:38.3450637Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.215.1"} -{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T03:57:38.8576627Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.216"} -{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T03:57:38.8646434Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.223"} -{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T03:57:39.2466233Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.224"} -{"message":"Markdown engine is markdig","date_time":"2023-12-29T03:57:39.2725546Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.226"} -{"message":"Cannot load build info: 'build.info' not found under 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\\obj\\.cache\\build'","date_time":"2023-12-29T03:57:39.451077Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.229"} -{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T03:57:39.5208901Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.1"} -{"message":"Building 195 file(s) in ManagedReferenceDocumentProcessor(BuildManagedReferenceDocument=>ValidateManagedReferenceDocumentMetadata=>SplitClassPageToMemberLevel=>ApplyOverwriteDocumentForMref=>FillReferenceInformation)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ManagedReferenceDocumentProcessor","date_time":"2023-12-29T03:57:51.8142477Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.33.8.1"} -{"message":"Building 2 file(s) in ResourceDocumentProcessor(ValidateResourceMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ResourceDocumentProcessor","date_time":"2023-12-29T03:57:51.8182365Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.33.9.1"} -{"message":"Building 3 file(s) in TocDocumentProcessor(BuildTocDocument)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor","date_time":"2023-12-29T03:57:51.8192346Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.33.10.1"} -{"message":"Building 5 file(s) in ConceptualDocumentProcessor(BuildConceptualDocument=>CountWord=>ValidateConceptualDocumentMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ConceptualDocumentProcessor","date_time":"2023-12-29T03:57:51.8192346Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.33.11.1"} -{"message":"0 external references found in 1 xref maps.","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.UpdateContext","date_time":"2023-12-29T03:59:07.4622494Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.34.13.1"} -{"message":"Applying templates to 2137 model(s)...","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","date_time":"2023-12-29T03:59:10.0224247Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.34.18.1"} -{"message":"XRef map exported.","source":"BuildCore.Build Document","date_time":"2023-12-29T03:59:50.8388963Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.267.1.36"} -{"message":"Extracting index data from 2132 html files","source":"Postprocess.HandlePostProcessorsWithIncremental.HandlePostProcessors.Processing ExtractSearchIndex","date_time":"2023-12-29T04:03:06.3976295Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.268.1.3.2.1"} -{"message":"Manifest file saved to manifest.json.","source":"Postprocess","date_time":"2023-12-29T04:06:18.4571706Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.268.4"} -{"message":"Completed building documents in 519900.7932 milliseconds.","date_time":"2023-12-29T04:06:18.7663361Z","message_severity":"info","correlation_id":"6C02D0B1-74A4-4337-9C69-1D118125DB1D.269"} -{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_lpnt5z4o.rrx\"","source":"BuildCommand","date_time":"2023-12-29T04:06:18.7743154Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.2.3"} -{"message":"Completed Scope:BuildCommand in 524504.8694 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T04:06:18.7832917Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.2.5"} -{"message":"Completed in 543519.3372 milliseconds","date_time":"2023-12-29T04:06:18.7832917Z","message_severity":"info","correlation_id":"BDACD780-738D-4EA8-98D7-8D6CC1FDD9D1.3"} -{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:24:25.7279481Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.1.1"} -{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:24:26.1343963Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.1.2"} -{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' with message: Method not found: 'System.ReadOnlySpan`1 Microsoft.IO.Path.GetFileName(System.ReadOnlySpan`1)'.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T04:24:28.4241796Z","message_severity":"warning","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.1.5"} -{"message":"Project 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' does not contain any documents.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:24:29.007166Z","message_severity":"warning","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.1.8"} -{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:24:29.0301048Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.1.9"} -{"message":"No metadata is generated for OmsiHook.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:24:29.58464Z","message_severity":"warning","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.1.13"} -{"message":"Completed Scope:MetadataCommand in 3922.8275 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T04:24:29.5866357Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.1.2"} -{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_dnuis0t4.yem\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_dnuis0t4.yem\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T04:24:30.1046401Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.2.2"} -{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_dnuis0t4.yem\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T04:24:30.7135581Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.215.1"} -{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T04:24:31.0664413Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.216"} -{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T04:24:31.0714282Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.223"} -{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T04:24:31.44686Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.224"} -{"message":"Markdown engine is markdig","date_time":"2023-12-29T04:24:31.4715421Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.226"} -{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T04:24:33.1342816Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.1"} -{"message":"Building 5 file(s) in ConceptualDocumentProcessor(BuildConceptualDocument=>CountWord=>ValidateConceptualDocumentMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ConceptualDocumentProcessor","date_time":"2023-12-29T04:24:38.8537347Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.33.8.1"} -{"message":"Building 194 file(s) in ManagedReferenceDocumentProcessor(BuildManagedReferenceDocument=>ValidateManagedReferenceDocumentMetadata=>SplitClassPageToMemberLevel=>ApplyOverwriteDocumentForMref=>FillReferenceInformation)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ManagedReferenceDocumentProcessor","date_time":"2023-12-29T04:24:38.8547329Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.33.9.1"} -{"message":"Building 3 file(s) in TocDocumentProcessor(BuildTocDocument)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor","date_time":"2023-12-29T04:24:38.8547329Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.33.10.1"} -{"message":"Building 2 file(s) in ResourceDocumentProcessor(ValidateResourceMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ResourceDocumentProcessor","date_time":"2023-12-29T04:24:38.8961292Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.33.11.1"} -{"message":"0 external references found in 1 xref maps.","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.UpdateContext","date_time":"2023-12-29T04:25:11.2851448Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.34.13.1"} -{"message":"Applying templates to 2135 model(s)...","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","date_time":"2023-12-29T04:25:14.0152956Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.34.18.1"} -{"message":"Error transforming model generated from \"api/OmsiHook.yml\" using \"ManagedReference.html.primary.js\". To get the detailed raw model, please run docfx with debug mode --debug. Error running Transform function inside template preprocessor: type is undefined ","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","file":"api/OmsiHook.yml","date_time":"2023-12-29T04:25:33.9117684Z","message_severity":"error","code":"ApplyTemplatePreprocessorError","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.266.1.34.18.1697"} -{"message":"Completed building documents in 68483.6267 milliseconds.","date_time":"2023-12-29T04:25:39.5564609Z","message_severity":"info","correlation_id":"C55EDDE1-14DE-4886-B3CB-A807CE1D63E7.267"} -{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_dnuis0t4.yem\"","source":"BuildCommand","date_time":"2023-12-29T04:25:39.6054527Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.2.3"} -{"message":"Completed Scope:BuildCommand in 70067.6237 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T04:25:39.6544165Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.2.4"} -{"message":"Completed in 73997.2055 milliseconds","date_time":"2023-12-29T04:25:39.6544165Z","message_severity":"info","correlation_id":"C1ECA550-3CF7-49EB-85CF-CC5AA0A628F1.3"} -{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:28:09.1293656Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.1.1"} -{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:28:09.4615248Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.1.2"} -{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' with message: Method not found: 'System.ReadOnlySpan`1 Microsoft.IO.Path.GetFileName(System.ReadOnlySpan`1)'.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T04:28:11.7565696Z","message_severity":"warning","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.1.5"} -{"message":"Project 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' does not contain any documents.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:28:12.3367196Z","message_severity":"warning","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.1.8"} -{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:28:12.362651Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.1.9"} -{"message":"No metadata is generated for OmsiHook.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:28:12.8154999Z","message_severity":"warning","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.1.13"} -{"message":"Completed Scope:MetadataCommand in 3736.7786 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T04:28:12.8174961Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.1.2"} -{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_iaepe2fv.15b\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_iaepe2fv.15b\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T04:28:12.8783325Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.2.2"} -{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_iaepe2fv.15b\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T04:28:13.3290135Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.215.1"} -{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T04:28:13.6753591Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.216"} -{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T04:28:13.6833366Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.223"} -{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T04:28:14.0756317Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.224"} -{"message":"Markdown engine is markdig","date_time":"2023-12-29T04:28:14.1119867Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.226"} -{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T04:28:14.8317387Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.1"} -{"message":"Building 5 file(s) in ConceptualDocumentProcessor(BuildConceptualDocument=>CountWord=>ValidateConceptualDocumentMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ConceptualDocumentProcessor","date_time":"2023-12-29T04:28:18.2531981Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.33.8.1"} -{"message":"Building 2 file(s) in ResourceDocumentProcessor(ValidateResourceMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ResourceDocumentProcessor","date_time":"2023-12-29T04:28:18.2541956Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.33.9.1"} -{"message":"Building 3 file(s) in TocDocumentProcessor(BuildTocDocument)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor","date_time":"2023-12-29T04:28:18.2551933Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.33.10.1"} -{"message":"Building 194 file(s) in ManagedReferenceDocumentProcessor(BuildManagedReferenceDocument=>ValidateManagedReferenceDocumentMetadata=>SplitClassPageToMemberLevel=>ApplyOverwriteDocumentForMref=>FillReferenceInformation)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ManagedReferenceDocumentProcessor","date_time":"2023-12-29T04:28:18.2551933Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.33.11.1"} -{"message":"0 external references found in 1 xref maps.","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.UpdateContext","date_time":"2023-12-29T04:28:43.5359793Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.34.13.1"} -{"message":"Applying templates to 2135 model(s)...","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","date_time":"2023-12-29T04:28:46.6147195Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.34.18.1"} -{"message":"Error transforming model generated from \"api/OmsiHook.yml\" using \"ManagedReference.html.primary.js\". To get the detailed raw model, please run docfx with debug mode --debug. Error running Transform function inside template preprocessor: type is undefined ","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","file":"api/OmsiHook.yml","date_time":"2023-12-29T04:29:12.8059023Z","message_severity":"error","code":"ApplyTemplatePreprocessorError","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.266.1.34.18.2187"} -{"message":"Completed building documents in 60206.3874 milliseconds.","date_time":"2023-12-29T04:29:13.8897021Z","message_severity":"info","correlation_id":"1244BC88-9600-4699-A0E4-4E26936162F2.267"} -{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_iaepe2fv.15b\"","source":"BuildCommand","date_time":"2023-12-29T04:29:13.934708Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.2.3"} -{"message":"Completed Scope:BuildCommand in 61120.5417 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T04:29:13.9376994Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.2.4"} -{"message":"Completed in 64863.9961 milliseconds","date_time":"2023-12-29T04:29:13.9386974Z","message_severity":"info","correlation_id":"7405F052-3E70-447D-8D98-2CB9816F2F1E.3"} -{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:36:18.5174384Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.1.1"} -{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:36:18.8695193Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.1.2"} -{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' with message: Method not found: 'System.ReadOnlySpan`1 Microsoft.IO.Path.GetFileName(System.ReadOnlySpan`1)'.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T04:36:21.3468096Z","message_severity":"warning","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.1.5"} -{"message":"Project 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' does not contain any documents.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:36:21.9217804Z","message_severity":"warning","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.1.8"} -{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:36:21.9407302Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.1.9"} -{"message":"No metadata is generated for OmsiHook.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T04:36:22.3701249Z","message_severity":"warning","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.1.13"} -{"message":"Completed Scope:MetadataCommand in 3897.5363 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T04:36:22.3721208Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.1.2"} -{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_n1od150q.w0j\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_n1od150q.w0j\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T04:36:22.4449253Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.2.2"} -{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_n1od150q.w0j\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T04:36:22.8747969Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.215.1"} -{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T04:36:23.2662855Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.216"} -{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T04:36:23.2732665Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.223"} -{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T04:36:23.7495274Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.224"} -{"message":"Markdown engine is markdig","date_time":"2023-12-29T04:36:23.7844357Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.226"} -{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T04:36:24.5240836Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.1"} -{"message":"Building 5 file(s) in ConceptualDocumentProcessor(BuildConceptualDocument=>CountWord=>ValidateConceptualDocumentMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ConceptualDocumentProcessor","date_time":"2023-12-29T04:36:28.1046742Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.33.8.1"} -{"message":"Building 194 file(s) in ManagedReferenceDocumentProcessor(BuildManagedReferenceDocument=>ValidateManagedReferenceDocumentMetadata=>SplitClassPageToMemberLevel=>ApplyOverwriteDocumentForMref=>FillReferenceInformation)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ManagedReferenceDocumentProcessor","date_time":"2023-12-29T04:36:28.1046742Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.33.9.1"} -{"message":"Building 3 file(s) in TocDocumentProcessor(BuildTocDocument)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor","date_time":"2023-12-29T04:36:28.1066693Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.33.10.1"} -{"message":"Building 2 file(s) in ResourceDocumentProcessor(ValidateResourceMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ResourceDocumentProcessor","date_time":"2023-12-29T04:36:28.1420821Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.33.11.1"} -{"message":"0 external references found in 1 xref maps.","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.UpdateContext","date_time":"2023-12-29T04:36:58.8103469Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.34.13.1"} -{"message":"Applying templates to 2135 model(s)...","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","date_time":"2023-12-29T04:37:01.8754515Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.34.18.1"} -{"message":"Error transforming model generated from \"api/OmsiHook.yml\" using \"ManagedReference.html.primary.js\". To get the detailed raw model, please run docfx with debug mode --debug. Error running Transform function inside template preprocessor: type is undefined ","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","file":"api/OmsiHook.yml","date_time":"2023-12-29T04:37:16.7711967Z","message_severity":"error","code":"ApplyTemplatePreprocessorError","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.266.1.34.18.793"} -{"message":"Completed building documents in 68414.5093 milliseconds.","date_time":"2023-12-29T04:37:31.6883566Z","message_severity":"info","correlation_id":"537D17F6-F2EC-4640-AFE4-D8CB0618CD55.267"} -{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_n1od150q.w0j\"","source":"BuildCommand","date_time":"2023-12-29T04:37:31.7392206Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.2.3"} -{"message":"Completed Scope:BuildCommand in 69413.0149 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T04:37:31.7850981Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.2.4"} -{"message":"Completed in 73314.7086 milliseconds","date_time":"2023-12-29T04:37:31.7850981Z","message_severity":"info","correlation_id":"7AB7D5BC-6A47-4EB5-820D-95095DD110F5.3"} -{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:02:49.4374203Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.1.1"} -{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:02:49.9203605Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.1.2"} -{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' with message: Method not found: 'System.ReadOnlySpan`1 Microsoft.IO.Path.GetFileName(System.ReadOnlySpan`1)'.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T05:02:52.5408121Z","message_severity":"warning","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.1.5"} -{"message":"Project 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\OmsiHook.csproj' does not contain any documents.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:02:53.1394715Z","message_severity":"warning","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.1.8"} -{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:02:53.1923229Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.1.9"} -{"message":"No metadata is generated for OmsiHook.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:02:53.7529433Z","message_severity":"warning","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.1.13"} -{"message":"Completed Scope:MetadataCommand in 4366.2148 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T05:02:53.7539409Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.1.2"} -{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_zdlaufy3.ubn\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_zdlaufy3.ubn\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T05:02:54.1670783Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.2.2"} -{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_zdlaufy3.ubn\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T05:02:54.9756197Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.215.1"} -{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T05:02:55.3727164Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.216"} -{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T05:02:55.3826899Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.223"} -{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T05:02:55.8408702Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.224"} -{"message":"Markdown engine is markdig","date_time":"2023-12-29T05:02:55.8747798Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.226"} -{"message":"Cannot load build info: 'build.info' not found under 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\\obj\\.cache\\build'","date_time":"2023-12-29T05:02:56.1208292Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.229"} -{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T05:02:56.1776779Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.1"} -{"message":"Building 5 file(s) in ConceptualDocumentProcessor(BuildConceptualDocument=>CountWord=>ValidateConceptualDocumentMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ConceptualDocumentProcessor","date_time":"2023-12-29T05:02:57.2154931Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.33.7.1"} -{"message":"Building 2 file(s) in ResourceDocumentProcessor(ValidateResourceMetadata)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ResourceDocumentProcessor","date_time":"2023-12-29T05:02:57.2154931Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.33.9.1"} -{"message":"Building 2 file(s) in TocDocumentProcessor(BuildTocDocument)...","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor","date_time":"2023-12-29T05:02:57.2154931Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.33.8.1"} -{"message":"Unable to find either toc.yml or toc.md inside api/. Make sure the file is included in config file docfx.json!","source":"BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor.Prebuild.BuildTocDocument","file":"toc.yml","date_time":"2023-12-29T05:02:57.2394292Z","message_severity":"warning","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.33.8.3.2.1"} -{"message":"Applying templates to 9 model(s)...","source":"BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates","date_time":"2023-12-29T05:02:58.3279572Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.34.16.1"} -{"message":"XRef map exported.","source":"BuildCore.Build Document","date_time":"2023-12-29T05:02:58.6083935Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.267.1.36"} -{"message":"Extracting index data from 5 html files","source":"Postprocess.HandlePostProcessorsWithIncremental.HandlePostProcessors.Processing ExtractSearchIndex","date_time":"2023-12-29T05:02:58.7093118Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.268.1.3.2.1"} -{"message":"Manifest file saved to manifest.json.","source":"Postprocess","date_time":"2023-12-29T05:02:58.8075275Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.268.4"} -{"message":"Completed building documents in 3496.8746 milliseconds.","date_time":"2023-12-29T05:02:58.8798455Z","message_severity":"info","correlation_id":"B9156965-F32A-48BD-B7FB-4DE769F2BA3E.269"} -{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.2\\tools\\plugins_zdlaufy3.ubn\"","source":"BuildCommand","date_time":"2023-12-29T05:02:58.8888222Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.2.3"} -{"message":"Completed Scope:BuildCommand in 5140.7362 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T05:02:58.8948063Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.2.5"} -{"message":"Completed in 9510.4268 milliseconds","date_time":"2023-12-29T05:02:58.8948063Z","message_severity":"info","correlation_id":"4FF5231C-BEE0-4E8B-A540-E2A4D25A60E3.3"} -{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:07:31.0182535Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.1.1"} -{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:07:33.5169205Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.1.2"} -{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: c1: (0, 0): Cannot open source file: 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c': No such file or directory","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T05:07:49.3572923Z","message_severity":"warning","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.1.5"} -{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: C:\\Users\\Thoma\\.nuget\\packages\\dnne\\1.0.30\\build\\DNNE.targets: (150, 5): The command \"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\bin\\Hostx64\\x86\\cl.exe\" /O2 /LD /TC /MT /GS /Zi /D DNNE_ASSEMBLY_NAME=OmsiHookRPCPlugin /D DNNE_COMPILE_AS_SOURCE /I \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\include\" /I \"C:\\Users\\Thoma\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\" /I \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\7.0.5\\runtimes\\win-x86\\native\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\shared\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\um\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\ucrt\" \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c\" \"C:\\Users\\Thoma\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\\platform.c\" /link /DLL /LTCG /LIBPATH:\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\lib\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\um\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\ucrt\\x86\" \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\7.0.5\\runtimes\\win-x86\\native\\libnethost.lib\" Advapi32.lib /IGNORE:4099 /IMPLIB:\"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.lib\" /OUT:\"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.dll\" \" exited with code 2.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T05:07:49.3582898Z","message_severity":"warning","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.1.6"} -{"message":"Cache for D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj in D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\obj\\xdoc\\cache\\final\\587067676 is corrupted, rebuild...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:07:50.0355742Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.1.9"} -{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:07:50.0355742Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.1.10"} -{"message":"Completed Scope:MetadataCommand in 48889.9882 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T05:08:19.3309115Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.1.2"} -{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_z5fpqjn5.was\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_z5fpqjn5.was\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T05:08:19.3837698Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.2.2"} -{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_z5fpqjn5.was\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T05:08:20.4053382Z","message_severity":"info","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.215.1"} -{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T05:08:21.4161791Z","message_severity":"info","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.216"} -{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T05:08:21.4221629Z","message_severity":"info","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.223"} -{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T05:08:21.7902104Z","message_severity":"info","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.224"} -{"message":"Markdown engine is markdig","date_time":"2023-12-29T05:08:21.8191028Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.226"} -{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T05:08:22.6569651Z","message_severity":"info","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.266.1.1"} -{"message":"Completed building documents in 1884.1256 milliseconds.","date_time":"2023-12-29T05:08:23.3072678Z","message_severity":"info","correlation_id":"026CD770-D804-4542-BC86-8E74DBBA8D99.267"} -{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_z5fpqjn5.was\"","source":"BuildCommand","date_time":"2023-12-29T05:08:23.3581318Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.2.3"} -{"message":"Completed Scope:BuildCommand in 4034.7653 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T05:08:23.3661102Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.2.4"} -{"message":"System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nFile name: 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\r\n at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)\r\n at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()\r\n at System.Reflection.RuntimeMethodInfo.GetParameters()\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.GetCallbackMethodsForType(Type type, List`1& onSerializing, List`1& onSerialized, List`1& onDeserializing, List`1& onDeserialized, List`1& onError)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveCallbackMethods(JsonContract contract, Type t)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type objectType)\r\n at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.ComputeConfigHash(DocumentBuildParameters parameter, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.Create(DocumentBuildParameters parameters, BuildInfo cb, BuildInfo lb, String intermediateFolder, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Prepare(DocumentBuildParameters parameters, DocumentBuildContext context, TemplateProcessor templateProcessor, String markdownServiceContextHash, IHostServiceCreator& hostServiceCreator, PhaseProcessor& phaseProcessor)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.BuildCore(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Build(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.BuildCore(DocumentBuildParameters parameter, IMarkdownServiceProvider markdownServiceProvider, BuildInfo currentBuildInfo, BuildInfo lastBuildInfo)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.Build(IList`1 parameters, String outputDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument(BuildJsonConfig config, TemplateManager templateManager, String baseDirectory, String outputDirectory, String pluginDirectory, String templateDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument()\r\n\r\nWRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].\r\n","date_time":"2023-12-29T05:08:23.3671078Z","message_severity":"error","code":"FatalError","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.3"} -{"message":"Completed in 52929.2734 milliseconds","date_time":"2023-12-29T05:08:23.3671078Z","message_severity":"info","correlation_id":"12EAE41D-3F43-47AB-AE01-4A4817F92C0B.4"} -{"message":"Using msbuild C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin as inner compiler.","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:09:27.1614424Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.1.1.1"} -{"message":"Loading projects...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:09:27.467623Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.1.1.2"} -{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: c1: (0, 0): Cannot open source file: 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c': No such file or directory","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T05:09:32.7556986Z","message_severity":"warning","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.1.1.5"} -{"message":"Workspace failed with: [Failure] Msbuild failed when processing the file 'D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\OmsiHookRPCPlugin.csproj' with message: C:\\Users\\Thoma\\.nuget\\packages\\dnne\\1.0.30\\build\\DNNE.targets: (150, 5): The command \"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\bin\\Hostx64\\x86\\cl.exe\" /O2 /LD /TC /MT /GS /Zi /D DNNE_ASSEMBLY_NAME=OmsiHookRPCPlugin /D DNNE_COMPILE_AS_SOURCE /I \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\include\" /I \"C:\\Users\\Thoma\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\" /I \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\7.0.5\\runtimes\\win-x86\\native\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\shared\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\um\" /I \"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\ucrt\" \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\OmsiHookRPCPlugin.g.c\" \"C:\\Users\\Thoma\\.nuget\\packages\\dnne\\1.0.30\\tools\\platform\\platform.c\" /link /DLL /LTCG /LIBPATH:\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\lib\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\um\\x86\" /LIBPATH:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\ucrt\\x86\" \"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Host.win-x86\\7.0.5\\runtimes\\win-x86\\native\\libnethost.lib\" Advapi32.lib /IGNORE:4099 /IMPLIB:\"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.lib\" /OUT:\"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHookRPCPlugin\\obj\\Release\\net6.0-windows\\dnne\\bin\\OmsiHookRPCPluginNE.dll\" \" exited with code 2.","source":"MetadataCommand.ExtractMetadata","file":"D:/Thoma/Documents/OneDrive/Computer Sync/visual studio 2015/Projects/Omsi-Extensions/OmsiHook/OmsiHook.csproj","date_time":"2023-12-29T05:09:32.7566964Z","message_severity":"warning","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.1.1.6"} -{"message":"Generating metadata for each project...","source":"MetadataCommand.ExtractMetadata","date_time":"2023-12-29T05:09:33.3829129Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.1.1.9"} -{"message":"Completed Scope:MetadataCommand in 21799.2343 milliseconds.","source":"MetadataCommand","date_time":"2023-12-29T05:09:48.9202811Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.1.2"} -{"message":"Plug-in directory: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_pynjgtyr.eaz\\plugins, configuration file: C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_pynjgtyr.eaz\\plugins\\docfx.plugins.config","source":"BuildCommand","date_time":"2023-12-29T05:09:48.980122Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.2.2"} -{"message":"Searching custom plugins in directory C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_pynjgtyr.eaz\\plugins...","source":"ImportPlugins","date_time":"2023-12-29T05:09:49.5596134Z","message_severity":"info","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.215.1"} -{"message":"6 plug-in(s) loaded.","date_time":"2023-12-29T05:09:49.9949609Z","message_severity":"info","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.216"} -{"message":"Post processor ExtractSearchIndex loaded.","date_time":"2023-12-29T05:09:49.9999463Z","message_severity":"info","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.223"} -{"message":"No files are found with glob pattern apidoc/**.md, excluding obj/**,_site/**, under directory \"D:\\Thoma\\Documents\\OneDrive\\Computer Sync\\visual studio 2015\\Projects\\Omsi-Extensions\\OmsiHook\\docs\"","date_time":"2023-12-29T05:09:50.455242Z","message_severity":"info","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.224"} -{"message":"Markdown engine is markdig","date_time":"2023-12-29T05:09:50.4891514Z","message_severity":"info","code":"MarkdownEngineName","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.226"} -{"message":"Max parallelism is 4.","source":"BuildCore.Build Document","date_time":"2023-12-29T05:09:50.9479249Z","message_severity":"info","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.266.1.1"} -{"message":"Completed building documents in 1348.2741 milliseconds.","date_time":"2023-12-29T05:09:51.3483625Z","message_severity":"info","correlation_id":"5F0C44C2-8FBB-4EC9-8BFE-AFF6F8B7730B.267"} -{"message":"Cleaning up temporary plugin folder \"C:\\Users\\Thoma\\.nuget\\packages\\docfx.console\\2.59.4\\tools\\plugins_pynjgtyr.eaz\"","source":"BuildCommand","date_time":"2023-12-29T05:09:51.39025Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.2.3"} -{"message":"Completed Scope:BuildCommand in 2476.8351 milliseconds.","source":"BuildCommand","date_time":"2023-12-29T05:09:51.3972323Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.2.4"} -{"message":"System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nFile name: 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\r\n at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)\r\n at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()\r\n at System.Reflection.RuntimeMethodInfo.GetParameters()\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.GetCallbackMethodsForType(Type type, List`1& onSerializing, List`1& onSerialized, List`1& onDeserializing, List`1& onDeserialized, List`1& onError)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveCallbackMethods(JsonContract contract, Type t)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type objectType)\r\n at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.ComputeConfigHash(DocumentBuildParameters parameter, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.Incrementals.IncrementalBuildContext.Create(DocumentBuildParameters parameters, BuildInfo cb, BuildInfo lb, String intermediateFolder, String markdownServiceContextHash)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Prepare(DocumentBuildParameters parameters, DocumentBuildContext context, TemplateProcessor templateProcessor, String markdownServiceContextHash, IHostServiceCreator& hostServiceCreator, PhaseProcessor& phaseProcessor)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.BuildCore(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Build(DocumentBuildParameters parameters)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.BuildCore(DocumentBuildParameters parameter, IMarkdownServiceProvider markdownServiceProvider, BuildInfo currentBuildInfo, BuildInfo lastBuildInfo)\r\n at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.Build(IList`1 parameters, String outputDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument(BuildJsonConfig config, TemplateManager templateManager, String baseDirectory, String outputDirectory, String pluginDirectory, String templateDirectory)\r\n at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument()\r\n\r\nWRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].\r\n","date_time":"2023-12-29T05:09:51.3972323Z","message_severity":"error","code":"FatalError","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.3"} -{"message":"Completed in 24280.1555 milliseconds","date_time":"2023-12-29T05:09:51.3972323Z","message_severity":"info","correlation_id":"B75722BB-BF4F-4498-8B29-AB65FD6ABD04.4"} From 6a3effa9628ff3d803cc067c507653ef1ca66665 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Fri, 29 Dec 2023 20:42:05 +0100 Subject: [PATCH 07/36] + Basic CLI Example Code --- OmsiExtensions.sln | 14 ++++++ _OmsiHookExamples/Basic_CLI/Basic_CLI.csproj | 16 +++++++ _OmsiHookExamples/Basic_CLI/Program.cs | 47 ++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 _OmsiHookExamples/Basic_CLI/Basic_CLI.csproj create mode 100644 _OmsiHookExamples/Basic_CLI/Program.cs diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index 84f3749..221cf64 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -15,6 +15,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OmsiHookInvoker", "OmsiHook EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OmsiHookRPCPlugin", "OmsiHookRPCPlugin\OmsiHookRPCPlugin.csproj", "{CDB17143-5653-48BE-AAC8-8419D5B4FD2C}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OHExamples - Basic_CLI", "_OmsiHookExamples\Basic_CLI\Basic_CLI.csproj", "{BA833C68-E8BD-4C86-9555-85542DF02015}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -93,6 +95,18 @@ Global {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x64.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.Build.0 = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.ActiveCfg = Debug|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.Build.0 = Debug|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.ActiveCfg = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.Build.0 = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.Build.0 = Release|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.ActiveCfg = Release|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.Build.0 = Release|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/_OmsiHookExamples/Basic_CLI/Basic_CLI.csproj b/_OmsiHookExamples/Basic_CLI/Basic_CLI.csproj new file mode 100644 index 0000000..33fd140 --- /dev/null +++ b/_OmsiHookExamples/Basic_CLI/Basic_CLI.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0-windows10.0.22621.0 + disable + enable + x86 + Basic_CLI.Program + + + + + + + diff --git a/_OmsiHookExamples/Basic_CLI/Program.cs b/_OmsiHookExamples/Basic_CLI/Program.cs new file mode 100644 index 0000000..de1797c --- /dev/null +++ b/_OmsiHookExamples/Basic_CLI/Program.cs @@ -0,0 +1,47 @@ +using System; +using System.Threading; +using OmsiHook; + +namespace Basic_CLI +{ + // Most Basic example of reading various values exposed by OMSIHook + class Program + { + static void Main(string[] args) + { + Console.WriteLine("#=#=#=#=#=# OMSIHook Basic CLI Sample #=#=#=#=#=#"); + + OmsiHook.OmsiHook omsi = new(); + omsi.AttachToOMSI().Wait(); + var playerVehicle = omsi.Globals.PlayerVehicle; + var time = omsi.Globals.Time; + Console.OutputEncoding = System.Text.Encoding.UTF8; + while (true) + { + playerVehicle ??= omsi.Globals.PlayerVehicle; + var pos = playerVehicle?.Position ?? default; + var rot = playerVehicle?.Rotation ?? default; + var map = omsi.Globals.Map; + var weather = omsi.Globals.Weather; + + Console.SetCursorPosition(0, 1); + Console.WriteLine($"Map: {map?.FriendlyName}".PadRight(Console.WindowWidth - 17) + $"Date: {time.Day:00}/{time.Month:00}/{time.Year:0000}"); + Console.WriteLine($"Weather: {weatherEmoji(weather)}".PadRight(Console.WindowWidth - 15) + $"Time: {time.Hour:00}:{time.Minute:00}:{time.Second:00}"); + Console.WriteLine($"Bus: {playerVehicle?.RoadVehicle?.FileName}".PadRight(Console.WindowWidth - 1)); + Console.WriteLine(($"Position: {pos.x:F2},{pos.y:F2},{pos.z:F2}".PadRight(Console.WindowWidth - 8) + + $"Tile: {playerVehicle?.Kachel ?? 0}")); + Console.WriteLine(($"Rotation: {rot.w:F2},{rot.x:F2},{rot.y:F2},{rot.z:F2}".PadRight(Console.WindowWidth - 1))); + + Thread.Sleep(20); + } + } + static string weatherEmoji(OmsiWeather weather) + { + if (weather?.ActWeather.fogDensity < 900) + return "🌫️"; + if (weather?.ActWeather.percipitation > 0) + return "🌧️"; + return "☀️"; + } + } +} From 6faca3a1c003278cc6696c864e937b0324129513 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Fri, 29 Dec 2023 21:58:37 +0100 Subject: [PATCH 08/36] + Basic CLI Documentation --- OmsiExtensions.sln | 11 +++++--- OmsiHook/docs/articles/examples/Basic_CLI.md | 28 ++++++++++++++++++++ OmsiHook/docs/articles/toc.yml | 6 ++++- _OmsiHookExamples/Basic_CLI/Program.cs | 4 +-- 4 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 OmsiHook/docs/articles/examples/Basic_CLI.md diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index 221cf64..b488af9 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -14,8 +14,14 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OmsiHookInvoker", "OmsiHookInvoker\OmsiHookInvoker.vcxproj", "{CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OmsiHookRPCPlugin", "OmsiHookRPCPlugin\OmsiHookRPCPlugin.csproj", "{CDB17143-5653-48BE-AAC8-8419D5B4FD2C}" + ProjectSection(ProjectDependencies) = postProject + {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B} = {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B} + EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OHExamples - Basic_CLI", "_OmsiHookExamples\Basic_CLI\Basic_CLI.csproj", "{BA833C68-E8BD-4C86-9555-85542DF02015}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basic_CLI", "_OmsiHookExamples\Basic_CLI\Basic_CLI.csproj", "{BA833C68-E8BD-4C86-9555-85542DF02015}" + ProjectSection(ProjectDependencies) = postProject + {2E750CBE-F868-4AB7-96C2-27560F53E06B} = {2E750CBE-F868-4AB7-96C2-27560F53E06B} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -49,7 +55,6 @@ Global {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x64.ActiveCfg = Release|Any CPU {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x64.Build.0 = Release|Any CPU {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.ActiveCfg = Release|Any CPU - {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.Build.0 = Release|Any CPU {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.Build.0 = Debug|Any CPU {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -61,7 +66,6 @@ Global {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x64.ActiveCfg = Release|Any CPU {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x64.Build.0 = Release|Any CPU {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.ActiveCfg = Release|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.Build.0 = Release|Any CPU {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|Any CPU.ActiveCfg = Debug|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|Any CPU.Build.0 = Debug|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x64.ActiveCfg = Debug|x86 @@ -106,7 +110,6 @@ Global {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.ActiveCfg = Release|Any CPU {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.Build.0 = Release|Any CPU {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/OmsiHook/docs/articles/examples/Basic_CLI.md b/OmsiHook/docs/articles/examples/Basic_CLI.md new file mode 100644 index 0000000..e62f9a1 --- /dev/null +++ b/OmsiHook/docs/articles/examples/Basic_CLI.md @@ -0,0 +1,28 @@ +# Basic CLI Example + +This article provides a basic understanding to a basic C# .NET example leveraging the OMSIHook library. The example focuses on retrieving crucial information about the map, weather, date, and the current vehicle. + +_This article is in direct relation to the Sample Project available [here](https://github.com/space928/Omsi-Extensions/tree/main/_OmsiHookExamples/Basic_CLI)._ + +## Initialization + +Initialize an instance of the `OmsiHook` class and establish a connection to the OMSI game: + +```cs +OmsiHook.OmsiHook omsi = new(); +omsi.AttachToOMSI().Wait(); +``` + +## Caching of Globals + +Efficiently cache top-level global variables outside the loop for optimized performance: + +```cs +// Cache global variables for faster access +var playerVehicle = omsi.Globals.PlayerVehicle; +var time = omsi.Globals.Time; +var map = omsi.Globals.Map; +var weather = omsi.Globals.Weather; +``` + +By caching these variables outside the loop, you significantly enhance access speed during subsequent iterations. \ No newline at end of file diff --git a/OmsiHook/docs/articles/toc.yml b/OmsiHook/docs/articles/toc.yml index f2ba49b..de1b476 100644 --- a/OmsiHook/docs/articles/toc.yml +++ b/OmsiHook/docs/articles/toc.yml @@ -3,4 +3,8 @@ - name: Building Native Omsi Plugins href: building-native-plugins.md - name: Performance Tips - href: performance-tips.md \ No newline at end of file + href: performance-tips.md +- name: Examples + items: + - name: Basic CLI Example + href: examples\Basic_CLI.md \ No newline at end of file diff --git a/_OmsiHookExamples/Basic_CLI/Program.cs b/_OmsiHookExamples/Basic_CLI/Program.cs index de1797c..70f604b 100644 --- a/_OmsiHookExamples/Basic_CLI/Program.cs +++ b/_OmsiHookExamples/Basic_CLI/Program.cs @@ -15,14 +15,14 @@ static void Main(string[] args) omsi.AttachToOMSI().Wait(); var playerVehicle = omsi.Globals.PlayerVehicle; var time = omsi.Globals.Time; + var map = omsi.Globals.Map; + var weather = omsi.Globals.Weather; Console.OutputEncoding = System.Text.Encoding.UTF8; while (true) { playerVehicle ??= omsi.Globals.PlayerVehicle; var pos = playerVehicle?.Position ?? default; var rot = playerVehicle?.Rotation ?? default; - var map = omsi.Globals.Map; - var weather = omsi.Globals.Weather; Console.SetCursorPosition(0, 1); Console.WriteLine($"Map: {map?.FriendlyName}".PadRight(Console.WindowWidth - 17) + $"Date: {time.Day:00}/{time.Month:00}/{time.Year:0000}"); From d6c79e853334175529149d3916104a54981e52d0 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Sat, 30 Dec 2023 00:33:35 +0100 Subject: [PATCH 09/36] + Name conventions --- _OmsiHookExamples/Basic_CLI/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_OmsiHookExamples/Basic_CLI/Program.cs b/_OmsiHookExamples/Basic_CLI/Program.cs index 70f604b..6bfb2fa 100644 --- a/_OmsiHookExamples/Basic_CLI/Program.cs +++ b/_OmsiHookExamples/Basic_CLI/Program.cs @@ -26,7 +26,7 @@ static void Main(string[] args) Console.SetCursorPosition(0, 1); Console.WriteLine($"Map: {map?.FriendlyName}".PadRight(Console.WindowWidth - 17) + $"Date: {time.Day:00}/{time.Month:00}/{time.Year:0000}"); - Console.WriteLine($"Weather: {weatherEmoji(weather)}".PadRight(Console.WindowWidth - 15) + $"Time: {time.Hour:00}:{time.Minute:00}:{time.Second:00}"); + Console.WriteLine($"Weather: {WeatherEmoji(weather)}".PadRight(Console.WindowWidth - 15) + $"Time: {time.Hour:00}:{time.Minute:00}:{time.Second:00}"); Console.WriteLine($"Bus: {playerVehicle?.RoadVehicle?.FileName}".PadRight(Console.WindowWidth - 1)); Console.WriteLine(($"Position: {pos.x:F2},{pos.y:F2},{pos.z:F2}".PadRight(Console.WindowWidth - 8) + $"Tile: {playerVehicle?.Kachel ?? 0}")); @@ -35,7 +35,7 @@ static void Main(string[] args) Thread.Sleep(20); } } - static string weatherEmoji(OmsiWeather weather) + static string WeatherEmoji(OmsiWeather weather) { if (weather?.ActWeather.fogDensity < 900) return "🌫️"; From 4d60f285162ff833d8a5aae8d2050fc1bc5e6979 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Sat, 30 Dec 2023 01:01:29 +0100 Subject: [PATCH 10/36] + Resolve weather caching issue --- _OmsiHookExamples/Basic_CLI/Program.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/_OmsiHookExamples/Basic_CLI/Program.cs b/_OmsiHookExamples/Basic_CLI/Program.cs index 79ebb1f..3e36dcc 100644 --- a/_OmsiHookExamples/Basic_CLI/Program.cs +++ b/_OmsiHookExamples/Basic_CLI/Program.cs @@ -20,6 +20,7 @@ static void Main(string[] args) Console.OutputEncoding = System.Text.Encoding.UTF8; while (true) { + weather ??= omsi.Globals.Weather; playerVehicle ??= omsi.Globals.PlayerVehicle; var pos = playerVehicle?.Position ?? default; var rot = playerVehicle?.Rotation ?? default; From 3e1e60dafebb1b31e77aaf20fd3c20646476d4dc Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Sat, 30 Dec 2023 03:35:38 +0100 Subject: [PATCH 11/36] + Trigger Tests and Samples w/ Docs --- OmsiExtensions.sln | 36 ++++++++++++------- OmsiHook/docs/articles/examples/Basic_CLI.md | 2 +- OmsiHook/docs/articles/examples/Triggers.md | 23 ++++++++++++ _OmsiHookExamples/trigger_sample/Program.cs | 35 ++++++++++++++++++ .../trigger_sample/trigger_sample.csproj | 16 +++++++++ 5 files changed, 99 insertions(+), 13 deletions(-) create mode 100644 OmsiHook/docs/articles/examples/Triggers.md create mode 100644 _OmsiHookExamples/trigger_sample/Program.cs create mode 100644 _OmsiHookExamples/trigger_sample/trigger_sample.csproj diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index b488af9..a835447 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -19,9 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OmsiHookRPCPlugin", "OmsiHo EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basic_CLI", "_OmsiHookExamples\Basic_CLI\Basic_CLI.csproj", "{BA833C68-E8BD-4C86-9555-85542DF02015}" - ProjectSection(ProjectDependencies) = postProject - {2E750CBE-F868-4AB7-96C2-27560F53E06B} = {2E750CBE-F868-4AB7-96C2-27560F53E06B} - EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "trigger_sample", "_OmsiHookExamples\trigger_sample\trigger_sample.csproj", "{8950E419-6895-46E4-8CBE-68E24844D644}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -99,17 +98,30 @@ Global {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x64.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.Build.0 = Release|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.ActiveCfg = Debug|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.Build.0 = Debug|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.ActiveCfg = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.Build.0 = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.ActiveCfg = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.Build.0 = Debug|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.ActiveCfg = Debug|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.Build.0 = Debug|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.Build.0 = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.ActiveCfg = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.Build.0 = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.Build.0 = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.Build.0 = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.Build.0 = Release|x86 + {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|x64.ActiveCfg = Debug|Any CPU + {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|x64.Build.0 = Debug|Any CPU + {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|x86.ActiveCfg = Debug|Any CPU + {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|x86.Build.0 = Debug|Any CPU + {8950E419-6895-46E4-8CBE-68E24844D644}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8950E419-6895-46E4-8CBE-68E24844D644}.Release|Any CPU.Build.0 = Release|Any CPU + {8950E419-6895-46E4-8CBE-68E24844D644}.Release|x64.ActiveCfg = Release|Any CPU + {8950E419-6895-46E4-8CBE-68E24844D644}.Release|x64.Build.0 = Release|Any CPU + {8950E419-6895-46E4-8CBE-68E24844D644}.Release|x86.ActiveCfg = Release|Any CPU + {8950E419-6895-46E4-8CBE-68E24844D644}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/OmsiHook/docs/articles/examples/Basic_CLI.md b/OmsiHook/docs/articles/examples/Basic_CLI.md index e62f9a1..7bdfc35 100644 --- a/OmsiHook/docs/articles/examples/Basic_CLI.md +++ b/OmsiHook/docs/articles/examples/Basic_CLI.md @@ -1,4 +1,4 @@ -# Basic CLI Example +# Basic Trigger & Sound Trigger Example This article provides a basic understanding to a basic C# .NET example leveraging the OMSIHook library. The example focuses on retrieving crucial information about the map, weather, date, and the current vehicle. diff --git a/OmsiHook/docs/articles/examples/Triggers.md b/OmsiHook/docs/articles/examples/Triggers.md new file mode 100644 index 0000000..9d61a06 --- /dev/null +++ b/OmsiHook/docs/articles/examples/Triggers.md @@ -0,0 +1,23 @@ +# Basic Trigger & Sound Trigger Example + +This article offers a foundational exploration of a C# .NET example that utilizes the OMSIHook library. The focus of this example is on activating existing OMSI Mouse Events (triggers) and initiating sound playback (sound triggers). + +_For a hands-on experience, you can access the associated Sample Project [here](https://github.com/space928/Omsi-Extensions/tree/main/_OmsiHookExamples/trigger_sample)._ + +## Mouse Triggers + +To manipulate the state of any trigger within OMSI, a straightforward remote call to the `SetTrigger` method is employed. This method allows you to alter the boolean state of a specific trigger identified by its name. The code snippet below illustrates this process: + +```cs +playerVehicle.SetTrigger("bus_doorfront0", true); +``` + +## Sound Triggers + +In a similar fashion, sound manipulation is achieved through a remote call to OMSI's `SoundTrigger` method. This method facilitates the playback of any sound by referencing its file name and the designated point specified in the \`sound.cfg\` file. The following code snippet demonstrates this operation: + +```cs +playerVehicle.SoundTrigger("ev_IBIS_Ansagen", @"..\..\MAN_NL_NG\Sound\Matrix_Ziel.wav"); +``` + +These examples showcase the simplicity and effectiveness of leveraging the OMSIHook library to interact with mouse events and sound triggers within OMSI, enhancing the extensibility and functionality of your C# .NET applications. \ No newline at end of file diff --git a/_OmsiHookExamples/trigger_sample/Program.cs b/_OmsiHookExamples/trigger_sample/Program.cs new file mode 100644 index 0000000..dde688c --- /dev/null +++ b/_OmsiHookExamples/trigger_sample/Program.cs @@ -0,0 +1,35 @@ +using System; +using System.Threading; +using OmsiHook; + +namespace Trigger_Sample +{ + // Basic sample of Triggers with OMSIHook + class Program + { + OmsiHook.OmsiHook omsi; + static void Main(string[] args) + { + Console.WriteLine("#=#=#=#=#=# OMSIHook Trigger Sample #=#=#=#=#=#"); + Console.OutputEncoding = System.Text.Encoding.UTF8; + + OmsiHook.OmsiHook omsi = new(); + omsi.AttachToOMSI().Wait(); + var playerVehicle = omsi.Globals.PlayerVehicle; + bool trigger_state = false; + + Thread.Sleep(500); + while (true) + { + playerVehicle ??= omsi.Globals.PlayerVehicle; + Console.SetCursorPosition(0, 1); + Console.WriteLine($"Trigger State: {trigger_state}".PadRight(Console.WindowWidth - 1)); + Console.WriteLine($"Playing Sound...".PadRight(Console.WindowWidth - 1)); + playerVehicle.SetTrigger("bus_doorfront0", trigger_state); + playerVehicle.SoundTrigger("ev_IBIS_Ansagen", @"..\..\MAN_NL_NG\Sound\Matrix_Ziel.wav"); + trigger_state = !trigger_state; + Thread.Sleep(1000); + } + } + } +} diff --git a/_OmsiHookExamples/trigger_sample/trigger_sample.csproj b/_OmsiHookExamples/trigger_sample/trigger_sample.csproj new file mode 100644 index 0000000..e571d93 --- /dev/null +++ b/_OmsiHookExamples/trigger_sample/trigger_sample.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0-windows + enable + enable + Trigger_Sample.Program + x86 + + + + + + + From 135b641879e69eaa54b2ca0ae568a61bcbae73f5 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Sat, 30 Dec 2023 03:38:55 +0100 Subject: [PATCH 12/36] + TOC Updates --- OmsiHook/docs/articles/toc.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OmsiHook/docs/articles/toc.yml b/OmsiHook/docs/articles/toc.yml index de1b476..e13db71 100644 --- a/OmsiHook/docs/articles/toc.yml +++ b/OmsiHook/docs/articles/toc.yml @@ -7,4 +7,6 @@ - name: Examples items: - name: Basic CLI Example - href: examples\Basic_CLI.md \ No newline at end of file + href: examples\Basic_CLI.md + - name: Basic Mouse Trigger & Sound Trigger Example + href: examples\Triggers.md \ No newline at end of file From 381a5ca63b89daf6986c2ee4cadb2bf83e144f4d Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Sun, 31 Dec 2023 01:15:01 +0100 Subject: [PATCH 13/36] + Events Sample Code --- OmsiExtensions.sln | 36 ++++++---- OmsiHook/OmsiHook.cs | 3 +- .../Event_Sample/Event_Sample.csproj | 16 +++++ _OmsiHookExamples/Event_Sample/Program.cs | 65 +++++++++++++++++++ 4 files changed, 107 insertions(+), 13 deletions(-) create mode 100644 _OmsiHookExamples/Event_Sample/Event_Sample.csproj create mode 100644 _OmsiHookExamples/Event_Sample/Program.cs diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index b488af9..e1a9c58 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -19,9 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OmsiHookRPCPlugin", "OmsiHo EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basic_CLI", "_OmsiHookExamples\Basic_CLI\Basic_CLI.csproj", "{BA833C68-E8BD-4C86-9555-85542DF02015}" - ProjectSection(ProjectDependencies) = postProject - {2E750CBE-F868-4AB7-96C2-27560F53E06B} = {2E750CBE-F868-4AB7-96C2-27560F53E06B} - EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Event_Sample", "_OmsiHookExamples\Event_Sample\Event_Sample.csproj", "{47659503-9923-4E74-AD26-103C1F9FF2B0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -99,17 +98,30 @@ Global {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x64.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.Build.0 = Release|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.ActiveCfg = Debug|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.Build.0 = Debug|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.ActiveCfg = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.Build.0 = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.ActiveCfg = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.Build.0 = Debug|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.ActiveCfg = Debug|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.Build.0 = Debug|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.Build.0 = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.ActiveCfg = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.Build.0 = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.Build.0 = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.Build.0 = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.Build.0 = Release|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x64.ActiveCfg = Debug|Any CPU + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x64.Build.0 = Debug|Any CPU + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.ActiveCfg = Debug|Any CPU + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.Build.0 = Debug|Any CPU + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|Any CPU.Build.0 = Release|Any CPU + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x64.ActiveCfg = Release|Any CPU + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x64.Build.0 = Release|Any CPU + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.ActiveCfg = Release|Any CPU + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/OmsiHook/OmsiHook.cs b/OmsiHook/OmsiHook.cs index be8ff12..95e5908 100644 --- a/OmsiHook/OmsiHook.cs +++ b/OmsiHook/OmsiHook.cs @@ -173,8 +173,9 @@ private void OmsiHook_OnOmsiGotD3DContext(object sender, EventArgs e) [Obsolete("This will be obselete once TMyOMSIList is wrapped! The list of vehicles will be moved to OmsiGlobals.")] public OmsiRoadVehicleInst GetRoadVehicleInst(int index) { + // TODO: A More permanant fix should be done at some point. var vehPtr = GetListItem(0x00861508, index); - return vehPtr == 0 ? null : new OmsiRoadVehicleInst(omsiMemory, vehPtr); + return vehPtr < 1000 ? null : new OmsiRoadVehicleInst(omsiMemory, vehPtr); } /// diff --git a/_OmsiHookExamples/Event_Sample/Event_Sample.csproj b/_OmsiHookExamples/Event_Sample/Event_Sample.csproj new file mode 100644 index 0000000..f900fe8 --- /dev/null +++ b/_OmsiHookExamples/Event_Sample/Event_Sample.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0-windows + enable + enable + Event_Sample.Program + x86 + + + + + + + diff --git a/_OmsiHookExamples/Event_Sample/Program.cs b/_OmsiHookExamples/Event_Sample/Program.cs new file mode 100644 index 0000000..f008fe2 --- /dev/null +++ b/_OmsiHookExamples/Event_Sample/Program.cs @@ -0,0 +1,65 @@ +using System; +using System.Threading; +using OmsiHook; + +namespace Event_Sample +{ + // Most Basic example of reading various values exposed by OMSIHook + class Program + { + static void Main(string[] args) + { + Console.OutputEncoding = System.Text.Encoding.UTF8; + Console.WriteLine("#=#=#=#=#=# OMSIHook Events Sample #=#=#=#=#=#"); + + OmsiHook.OmsiHook omsi = new(); + omsi.AttachToOMSI().Wait(); + omsi.OnMapChange += Omsi_OnMapChange; + omsi.OnMapLoaded += Omsi_OnMapLoaded; + // Await callbacks + while (true) + { + Thread.Sleep(1000); + } + } + + private static void Omsi_OnOmsiLostD3DContext(object? sender, EventArgs e) + { + Console.WriteLine("💻 D3D Context Lost"); + } + + private static void Omsi_OnOmsiGotD3DContext(object? sender, EventArgs e) + { + Console.WriteLine("💻 D3D Context Secured"); + } + + private static void Omsi_OnOmsiExited(object? sender, EventArgs e) + { + Console.WriteLine("🛑 OMSI Has Exited"); + } + + private static void Omsi_OnMapLoaded(object? sender, bool e) + { + if (sender != null) + Console.WriteLine($"🗺️ Map Loaded: {e}"); + } + + private static void Omsi_OnMapChange(object? sender, EventArgs e) + { + if (sender != null) + { + var omsi = sender as OmsiHook.OmsiHook; + Console.WriteLine($"🗺️ Map Changed: {omsi.Globals.Map.FriendlyName}"); + omsi.OnActiveVehicleChanged += Omsi_OnActiveVehicleChanged; + omsi.OnOmsiExited += Omsi_OnOmsiExited; + omsi.OnOmsiGotD3DContext += Omsi_OnOmsiGotD3DContext; + omsi.OnOmsiLostD3DContext += Omsi_OnOmsiLostD3DContext; + } + } + + private static void Omsi_OnActiveVehicleChanged(object? sender, OmsiRoadVehicleInst e) + { + Console.WriteLine($"🚌 Active Vehicle Changed: {e.RoadVehicle.FriendlyName}"); + } + } +} From 7ede5eb64c0aef92b22584f84fecf8a68f9aee15 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Sun, 31 Dec 2023 01:15:39 +0100 Subject: [PATCH 14/36] + Slightly more resonable event handlers --- _OmsiHookExamples/Event_Sample/Program.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_OmsiHookExamples/Event_Sample/Program.cs b/_OmsiHookExamples/Event_Sample/Program.cs index f008fe2..e6ef41e 100644 --- a/_OmsiHookExamples/Event_Sample/Program.cs +++ b/_OmsiHookExamples/Event_Sample/Program.cs @@ -16,6 +16,10 @@ static void Main(string[] args) omsi.AttachToOMSI().Wait(); omsi.OnMapChange += Omsi_OnMapChange; omsi.OnMapLoaded += Omsi_OnMapLoaded; + omsi.OnActiveVehicleChanged += Omsi_OnActiveVehicleChanged; + omsi.OnOmsiExited += Omsi_OnOmsiExited; + omsi.OnOmsiGotD3DContext += Omsi_OnOmsiGotD3DContext; + omsi.OnOmsiLostD3DContext += Omsi_OnOmsiLostD3DContext; // Await callbacks while (true) { @@ -50,10 +54,6 @@ private static void Omsi_OnMapChange(object? sender, EventArgs e) { var omsi = sender as OmsiHook.OmsiHook; Console.WriteLine($"🗺️ Map Changed: {omsi.Globals.Map.FriendlyName}"); - omsi.OnActiveVehicleChanged += Omsi_OnActiveVehicleChanged; - omsi.OnOmsiExited += Omsi_OnOmsiExited; - omsi.OnOmsiGotD3DContext += Omsi_OnOmsiGotD3DContext; - omsi.OnOmsiLostD3DContext += Omsi_OnOmsiLostD3DContext; } } From c4ff5db54b707bc11ffb80a9b288fe8f2b650f4c Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Sun, 31 Dec 2023 02:59:52 +0100 Subject: [PATCH 15/36] + Documentation for the sample --- .../docs/articles/examples/Event_Sample.md | 62 +++++++++++++++++++ OmsiHook/docs/articles/toc.yml | 4 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 OmsiHook/docs/articles/examples/Event_Sample.md diff --git a/OmsiHook/docs/articles/examples/Event_Sample.md b/OmsiHook/docs/articles/examples/Event_Sample.md new file mode 100644 index 0000000..4805cfd --- /dev/null +++ b/OmsiHook/docs/articles/examples/Event_Sample.md @@ -0,0 +1,62 @@ +# Basic Events Example + +This article provides a basic understanding to a basic C# .NET example leveraging the OMSIHook library. The example focuses using the event handlers provided by OMSIHook. + +_This article is in direct relation to the Sample Project available [here](https://github.com/space928/Omsi-Extensions/tree/main/_OmsiHookExamples/Event_Sample)._ + +## Basic Usage +Similar to most C# .NET event handlers, you simply need to append the handler to the field as demonstraited below. + +```cs +OmsiHook.OmsiHook omsi = new(); +omsi.OnMapChange += Omsi_OnMapChange; +omsi.OnMapLoaded += Omsi_OnMapLoaded; +omsi.OnActiveVehicleChanged += Omsi_OnActiveVehicleChanged; +omsi.OnOmsiExited += Omsi_OnOmsiExited; +omsi.OnOmsiGotD3DContext += Omsi_OnOmsiGotD3DContext; +omsi.OnOmsiLostD3DContext += Omsi_OnOmsiLostD3DContext; +``` + +## Event Descriptions +The events all provide the current `OMSIHook` object as well as several of them provide references to the object that has changed. +### _MapChange_ Event +Triggered any time the current map has changed. +```cs +Omsi_OnMapChange(object? sender, EventArgs e) +``` +The `sender` object as with all the other events refers to the current `OMSIHook` object, the `e` object is not used for this event. + +### _MapLoaded_ Event +Triggered any time a map is loaded or unloaded. +```cs +Omsi_OnMapLoaded(object? sender, bool e) +``` +The `sender` object as with all the other events refers to the current `OMSIHook` object, the `e` is a bool that contains weather or not the event if for a map loading or unloading. + +### _ActiveVehicleChanged_ Event +Triggered any time a player changes vehicle. +```cs +Omsi_OnActiveVehicleChanged(object? sender, OmsiRoadVehicleInst e) +``` +The `sender` object as with all the other events refers to the current `OMSIHook` object, the `e` is a reference to the current player vehicle instance. + +### _OmsiExited_ Event +Triggered upon OMSI exiting. +```cs +Omsi_OnOmsiExited(object? sender, EventArgs e) +``` +The `sender` object as with all the other events refers to the current `OMSIHook` object, the `e` object is not used for this event. + +### _OmsiGotD3DContext_ Event +Triggered upon OMSI's Direct3D context being initialised. +```cs +Omsi_OnOmsiGotD3DContext(object? sender, EventArgs e) +``` +The `sender` object as with all the other events refers to the current `OMSIHook` object, the `e` object is not used for this event. + +### _OmsiLostD3DContext_ Event +Triggered upon OMSI's Direct3D context being lost. +```cs +Omsi_OnOmsiLostD3DContext(object? sender, EventArgs e) +``` +The `sender` object as with all the other events refers to the current `OMSIHook` object, the `e` object is not used for this event. diff --git a/OmsiHook/docs/articles/toc.yml b/OmsiHook/docs/articles/toc.yml index de1b476..a5fb87d 100644 --- a/OmsiHook/docs/articles/toc.yml +++ b/OmsiHook/docs/articles/toc.yml @@ -7,4 +7,6 @@ - name: Examples items: - name: Basic CLI Example - href: examples\Basic_CLI.md \ No newline at end of file + href: examples\Basic_CLI.md + - name: Basic Events Example + href: examples\Event_Sample.md \ No newline at end of file From 729bdf409714e504a45d5db0e7682cce4e474428 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Mon, 1 Jan 2024 02:40:51 +0100 Subject: [PATCH 16/36] + Video Demo Project --- OmsiExtensions.sln | 36 ++++++--- OmsiHook/docs/articles/examples/Video_Demo.md | 25 ++++++ OmsiHook/docs/articles/toc.yml | 4 +- .../Video_Demo/DXTextureManager.cs | 79 +++++++++++++++++++ _OmsiHookExamples/Video_Demo/Program.cs | 67 ++++++++++++++++ .../Video_Demo/Video_Demo.csproj | 17 ++++ 6 files changed, 215 insertions(+), 13 deletions(-) create mode 100644 OmsiHook/docs/articles/examples/Video_Demo.md create mode 100644 _OmsiHookExamples/Video_Demo/DXTextureManager.cs create mode 100644 _OmsiHookExamples/Video_Demo/Program.cs create mode 100644 _OmsiHookExamples/Video_Demo/Video_Demo.csproj diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index b488af9..f96762d 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -19,9 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OmsiHookRPCPlugin", "OmsiHo EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basic_CLI", "_OmsiHookExamples\Basic_CLI\Basic_CLI.csproj", "{BA833C68-E8BD-4C86-9555-85542DF02015}" - ProjectSection(ProjectDependencies) = postProject - {2E750CBE-F868-4AB7-96C2-27560F53E06B} = {2E750CBE-F868-4AB7-96C2-27560F53E06B} - EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Video_Demo", "_OmsiHookExamples\Video_Demo\Video_Demo.csproj", "{D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -99,17 +98,30 @@ Global {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x64.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.Build.0 = Release|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.ActiveCfg = Debug|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.Build.0 = Debug|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.ActiveCfg = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.Build.0 = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.ActiveCfg = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.Build.0 = Debug|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.ActiveCfg = Debug|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.Build.0 = Debug|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.Build.0 = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.ActiveCfg = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.Build.0 = Release|Any CPU - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|Any CPU + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.Build.0 = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.Build.0 = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.Build.0 = Release|x86 + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x64.ActiveCfg = Debug|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x64.Build.0 = Debug|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x86.ActiveCfg = Debug|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x86.Build.0 = Debug|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|Any CPU.Build.0 = Release|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x64.ActiveCfg = Release|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x64.Build.0 = Release|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x86.ActiveCfg = Release|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/OmsiHook/docs/articles/examples/Video_Demo.md b/OmsiHook/docs/articles/examples/Video_Demo.md new file mode 100644 index 0000000..7b3cce9 --- /dev/null +++ b/OmsiHook/docs/articles/examples/Video_Demo.md @@ -0,0 +1,25 @@ +# Video Playback Demo + +This article provides a basic understanding to a basic C# .NET example leveraging the OMSIHook library. This demo is a more advanced demo using FFMPEG's library to decode video files then pipe the frame data into OMSI's ScriptTextures. + +_This article is in direct relation to the Sample Project available [here](https://github.com/space928/Omsi-Extensions/tree/main/_OmsiHookExamples/Video_Demo)._ + +[!Video https://www.youtube.com/embed/61sMzpSCn0M] + +## First Steps +Before trying the project, the FFmpeg binaries need to be compiled - they should be compiled for **Win32** with shared libraries. Prebuilt binaries are available [here](https://rwijnsma.home.xs4all.nl/files/ffmpeg/). +A video file is also required to demonstraight it, MPEG4/H.264 format is reccomended however many formats are compatible with FFmpeg. + +Once the required resources are accuired, some configuration is needed; At the top of `Program.cs` the consts are defined as follows: +```cs +const string VIDEO_PATH = @"sample.mp4"; // Path to the video file +const string FFMPEG_PATH = @"ffmpeg-shared\bin"; // Path to FFmpeg's Binaries +const int ST_INDEX = 0; // Script Texture index to replace +``` + +## What's Going On + +The main program is split in two main classes `Program` and `DXTextureManager`. + - `Program` is the entry point to the demo, it initialises OMSIHook and FFmpeg as well as loads the video file. + - `DXTextureManager` handles initialising textures in OMSI, assigning them to ScriptTextures and updating them. + diff --git a/OmsiHook/docs/articles/toc.yml b/OmsiHook/docs/articles/toc.yml index de1b476..835fca2 100644 --- a/OmsiHook/docs/articles/toc.yml +++ b/OmsiHook/docs/articles/toc.yml @@ -7,4 +7,6 @@ - name: Examples items: - name: Basic CLI Example - href: examples\Basic_CLI.md \ No newline at end of file + href: examples\Basic_CLI.md + - name: Video Playback Demo + href: examples\Video_Demo.md \ No newline at end of file diff --git a/_OmsiHookExamples/Video_Demo/DXTextureManager.cs b/_OmsiHookExamples/Video_Demo/DXTextureManager.cs new file mode 100644 index 0000000..0dea459 --- /dev/null +++ b/_OmsiHookExamples/Video_Demo/DXTextureManager.cs @@ -0,0 +1,79 @@ +using FFMediaToolkit.Decoding; +using OmsiHook; + +namespace Video_Demo +{ + public class DXTextureManager + { + private readonly ManualResetEventSlim d3dGotContext = new(false); + private OmsiHook.OmsiHook? omsi; + + // Width and height of the texture + private uint texWidth; + private uint texHeight; + + private D3DTexture? texture = null; + + public bool IsReady => texture != null && texture.IsValid; + + // Initialize the DXTextureManager with an OmsiHook instance + public void Init(OmsiHook.OmsiHook omsi) + { + texture = omsi.CreateTextureObject(); + this.omsi = omsi; + + // Subscribe to the OnMapLoaded event + omsi.OnMapLoaded += Omsi_OnMapLoaded; + } + + // Method to create a Direct3D texture based on video stream information + public bool CreateTexture(VideoStreamInfo info, int script_texture_index) + { + if (omsi == null || !omsi.IsD3DReady || texture == null) + return false; + + // Set the texture width and height based on the video stream information + texWidth = (uint)info.FrameSize.Width; + texHeight = (uint)info.FrameSize.Height; + + try + { + texture.CreateD3DTexture(texWidth, texHeight); + } + catch (Exception ex) + { + Console.WriteLine(ex); + return false; + } + + // Access the script textures of the player vehicle in OmsiHook + var scriptTexes = omsi.Globals.PlayerVehicle.ComplObjInst.ScriptTextures; + + // Check if the provided script_texture_index is within bounds + if (script_texture_index >= scriptTexes.Count) + return false; + + // Update the script texture at the specified index with the new Direct3D texture information + var old = scriptTexes[script_texture_index]; + scriptTexes[script_texture_index] = new() + { + TexPn = old.TexPn, + color = old.color, + tex = unchecked((IntPtr)texture.TextureAddress) + }; + return true; + } + + // Method to update the contents of the Direct3D texture with new video frame data + public void UpdateTexture(Memory data) + { + texture?.UpdateTexture(data); + } + + // Event handler for the OnMapLoaded event, signals when the Direct3D context is obtained + private void Omsi_OnMapLoaded(object? sender, bool e) + { + d3dGotContext.Set(); + } + } +} \ No newline at end of file diff --git a/_OmsiHookExamples/Video_Demo/Program.cs b/_OmsiHookExamples/Video_Demo/Program.cs new file mode 100644 index 0000000..90d1e37 --- /dev/null +++ b/_OmsiHookExamples/Video_Demo/Program.cs @@ -0,0 +1,67 @@ +using System; +using System.Threading; +using FFMediaToolkit; +using FFMediaToolkit.Decoding; +using FFMediaToolkit.Graphics; +using OmsiHook; + +namespace Video_Demo +{ + class Program + { + const string VIDEO_PATH = @"sample.mp4"; + const string FFMPEG_PATH = @"C:\Users\AdamM\source\repos\space928\Omsi-Extensions\_OmsiHookExamples\Video_Demo\bin\Debug\net6.0-windows\ffmpeg-shared\bin"; + const int ST_INDEX = 0; + static void Main(string[] args) + { + Console.OutputEncoding = System.Text.Encoding.UTF8; + Console.WriteLine("#=#=#=#=#=# OMSIHook Video Playback Demo #=#=#=#=#=#"); + + OmsiHook.OmsiHook omsi = new(); + omsi.AttachToOMSI().Wait(); + DXTextureManager texture_manager = new(); + texture_manager.Init(omsi); + var marker = false; + // Configure the FFmpeg path to accelerate the video decode + FFmpegLoader.FFmpegPath = FFMPEG_PATH; + var video_file = MediaFile.Open(VIDEO_PATH, new MediaOptions() + { + VideoPixelFormat = ImagePixelFormat.Bgra32 + }); + var frameBuffer = new byte[video_file.Video.Info.FrameSize.Width * video_file.Video.Info.FrameSize.Height * 4]; + var FPS = video_file.Video.Info.AvgFrameRate; + while (true) + { + if (!texture_manager.IsReady) + { + Console.SetCursorPosition(0, 1); + if (texture_manager.CreateTexture(video_file.Video.Info, ST_INDEX)) + { + Console.WriteLine("💻 Successfully created a texture... " + (marker ? "🔴" : "⚫")); + } + else + { + Console.WriteLine("💻 Trying to create texture... " + (marker ? "🔴" : "⚫")); + } + } + if (texture_manager.IsReady) + { + int counter = 0; + while (video_file.Video.TryGetNextFrame(frameBuffer.AsSpan())) + { + texture_manager.UpdateTexture(frameBuffer); + Console.SetCursorPosition(0, 2); + Console.WriteLine("💿 Video Playing... " + (marker ? "🔴" : "⚫")); + if (counter % 10 == 0) + marker = !marker; + counter++; + Thread.Sleep((int)Math.Round((1.0 / FPS) * 1000)); + } + return; + } + marker = !marker; + Thread.Sleep(20); + } + } + } +} diff --git a/_OmsiHookExamples/Video_Demo/Video_Demo.csproj b/_OmsiHookExamples/Video_Demo/Video_Demo.csproj new file mode 100644 index 0000000..fd9d224 --- /dev/null +++ b/_OmsiHookExamples/Video_Demo/Video_Demo.csproj @@ -0,0 +1,17 @@ + + + + Exe + net6.0-windows + enable + enable + Video_Demo.Program + x86 + + + + + + + + From b1433ee8d33c7bcf8d8534d9a3a0ff4713af2d7f Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Mon, 1 Jan 2024 02:51:46 +0100 Subject: [PATCH 17/36] + Happy New Year +Video Embeds Correctly --- OmsiHook/docs/articles/examples/Video_Demo.md | 2 +- OmsiHook/docs/docfx.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OmsiHook/docs/articles/examples/Video_Demo.md b/OmsiHook/docs/articles/examples/Video_Demo.md index 7b3cce9..6333c3f 100644 --- a/OmsiHook/docs/articles/examples/Video_Demo.md +++ b/OmsiHook/docs/articles/examples/Video_Demo.md @@ -4,7 +4,7 @@ This article provides a basic understanding to a basic C# .NET example leveragin _This article is in direct relation to the Sample Project available [here](https://github.com/space928/Omsi-Extensions/tree/main/_OmsiHookExamples/Video_Demo)._ -[!Video https://www.youtube.com/embed/61sMzpSCn0M] +![youtube.com/embed 1](https://www.youtube.com/embed/61sMzpSCn0M) ## First Steps Before trying the project, the FFmpeg binaries need to be compiled - they should be compiled for **Win32** with shared libraries. Prebuilt binaries are available [here](https://rwijnsma.home.xs4all.nl/files/ffmpeg/). diff --git a/OmsiHook/docs/docfx.json b/OmsiHook/docs/docfx.json index 9b17209..2d5add2 100644 --- a/OmsiHook/docs/docfx.json +++ b/OmsiHook/docs/docfx.json @@ -23,7 +23,7 @@ "_appFaviconPath": "images/favicon.ico", "_appLogoPath": "images/logo.svg", "_appFooter": "DocFX + OmsiHook = ♥", - "_copyrightFooter": "© Thomas/Adam Mathieson 2023. All rights reserved.", + "_copyrightFooter": "© Thomas/Adam Mathieson 2024. All rights reserved.", "_enableSearch": true, "_disableSideFilter": false, "_enableNewTab": true, From 75f9c22291bd976391c75b54eca2e9df5bfc813e Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Tue, 2 Jan 2024 06:24:41 +0100 Subject: [PATCH 18/36] Refactored some stuff & fixed some bugs: - Renamed examples to fit Thomas' ludicrous naming standards - Replaced all OmsiObject getters with Memory.ReadMemoryObject() calls which protect against null references - Misc refactoring - Fixed some other minor bugs --- .filenesting.json | 3 + OmsiExtensions.sln | 59 +++++++++---------- OmsiExtensionsCLI/OmsiExtensionsCLI.csproj | 1 + OmsiExtensionsUI/OmsiExtensionsUI.csproj | 1 + OmsiHook/Memory.cs | 30 ++++++++++ OmsiHook/OmsiGlobals.cs | 2 +- OmsiHook/OmsiHook.csproj | 6 +- .../WrappedOmsiClasses/OmsiAnimSubMeshInst.cs | 2 +- OmsiHook/WrappedOmsiClasses/OmsiChrono.cs | 2 +- .../WrappedOmsiClasses/OmsiComplMapObj.cs | 6 +- .../WrappedOmsiClasses/OmsiComplMapObjInst.cs | 10 ++-- .../WrappedOmsiClasses/OmsiComplObjInst.cs | 2 +- OmsiHook/WrappedOmsiClasses/OmsiFileObject.cs | 8 +-- OmsiHook/WrappedOmsiClasses/OmsiFileSpline.cs | 4 +- OmsiHook/WrappedOmsiClasses/OmsiHumanBeing.cs | 2 +- .../WrappedOmsiClasses/OmsiHumanBeingInst.cs | 14 ++--- .../WrappedOmsiClasses/OmsiKachelForest.cs | 2 +- OmsiHook/WrappedOmsiClasses/OmsiMap.cs | 12 ++-- OmsiHook/WrappedOmsiClasses/OmsiMapKachel.cs | 10 ++-- .../OmsiMovingMapObjInst.cs | 10 ++-- .../WrappedOmsiClasses/OmsiPathManager.cs | 2 +- .../WrappedOmsiClasses/OmsiPathSegment.cs | 6 +- .../WrappedOmsiClasses/OmsiPhysObjInst.cs | 2 +- OmsiHook/WrappedOmsiClasses/OmsiProgMan.cs | 22 +++---- .../WrappedOmsiClasses/OmsiRoadVehicleInst.cs | 6 +- OmsiHook/WrappedOmsiClasses/OmsiSound.cs | 6 +- OmsiHook/WrappedOmsiClasses/OmsiSoundPack.cs | 2 +- .../WrappedOmsiClasses/OmsiVehicleInst.cs | 6 +- OmsiHook/WrappedOmsiClasses/OmsiWeather.cs | 2 +- .../examples/{Basic_CLI.md => basic-cli.md} | 4 +- .../{Triggers.md => triggers-sample.md} | 6 +- OmsiHook/docs/articles/toc.yml | 4 +- OmsiHook/docs/docfx.json | 2 +- .../BasicCLI.csproj} | 6 +- .../{Basic_CLI => BasicCLI}/Program.cs | 25 ++++++-- .../Program.cs | 13 ++-- .../TriggersSample.csproj} | 7 ++- 37 files changed, 173 insertions(+), 134 deletions(-) create mode 100644 .filenesting.json rename OmsiHook/docs/articles/examples/{Basic_CLI.md => basic-cli.md} (92%) rename OmsiHook/docs/articles/examples/{Triggers.md => triggers-sample.md} (66%) rename _OmsiHookExamples/{Basic_CLI/Basic_CLI.csproj => BasicCLI/BasicCLI.csproj} (59%) rename _OmsiHookExamples/{Basic_CLI => BasicCLI}/Program.cs (57%) rename _OmsiHookExamples/{trigger_sample => TriggersSample}/Program.cs (76%) rename _OmsiHookExamples/{trigger_sample/trigger_sample.csproj => TriggersSample/TriggersSample.csproj} (60%) diff --git a/.filenesting.json b/.filenesting.json new file mode 100644 index 0000000..0b71966 --- /dev/null +++ b/.filenesting.json @@ -0,0 +1,3 @@ +{ + "help":"https://go.microsoft.com/fwlink/?linkid=866610" +} \ No newline at end of file diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index a835447..96def76 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -14,13 +14,12 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OmsiHookInvoker", "OmsiHookInvoker\OmsiHookInvoker.vcxproj", "{CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OmsiHookRPCPlugin", "OmsiHookRPCPlugin\OmsiHookRPCPlugin.csproj", "{CDB17143-5653-48BE-AAC8-8419D5B4FD2C}" - ProjectSection(ProjectDependencies) = postProject - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B} = {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B} - EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basic_CLI", "_OmsiHookExamples\Basic_CLI\Basic_CLI.csproj", "{BA833C68-E8BD-4C86-9555-85542DF02015}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicCLI", "_OmsiHookExamples\BasicCLI\BasicCLI.csproj", "{BA833C68-E8BD-4C86-9555-85542DF02015}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "trigger_sample", "_OmsiHookExamples\trigger_sample\trigger_sample.csproj", "{8950E419-6895-46E4-8CBE-68E24844D644}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TriggersSample", "_OmsiHookExamples\TriggersSample\TriggersSample.csproj", "{8950E419-6895-46E4-8CBE-68E24844D644}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{58156BDC-C261-460F-B8BA-749E994CC743}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -43,28 +42,25 @@ Global {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x64.ActiveCfg = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.ActiveCfg = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.Build.0 = Release|x86 - {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|Any CPU.ActiveCfg = Debug|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|Any CPU.Build.0 = Debug|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x64.ActiveCfg = Debug|Any CPU {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x64.Build.0 = Debug|Any CPU {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.ActiveCfg = Debug|Any CPU {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.Build.0 = Debug|Any CPU - {28DA0165-EAA7-4171-A065-319409682BD1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28DA0165-EAA7-4171-A065-319409682BD1}.Release|Any CPU.Build.0 = Release|Any CPU + {28DA0165-EAA7-4171-A065-319409682BD1}.Release|Any CPU.ActiveCfg = Release|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.Release|Any CPU.Build.0 = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x64.ActiveCfg = Release|Any CPU {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x64.Build.0 = Release|Any CPU {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.ActiveCfg = Release|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x64.ActiveCfg = Debug|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x64.Build.0 = Debug|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x86.ActiveCfg = Debug|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x86.Build.0 = Debug|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|Any CPU.Build.0 = Release|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x64.ActiveCfg = Release|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x64.Build.0 = Release|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.ActiveCfg = Release|Any CPU + {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.Build.0 = Release|Any CPU + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.ActiveCfg = Debug|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.Build.0 = Debug|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x64.ActiveCfg = Debug|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x86.ActiveCfg = Debug|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|Any CPU.ActiveCfg = Release|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x64.ActiveCfg = Release|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.ActiveCfg = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|Any CPU.ActiveCfg = Debug|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|Any CPU.Build.0 = Debug|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x64.ActiveCfg = Debug|x86 @@ -110,22 +106,21 @@ Global {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.Build.0 = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.Build.0 = Release|x86 - {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|x64.ActiveCfg = Debug|Any CPU - {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|x64.Build.0 = Debug|Any CPU - {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|x86.ActiveCfg = Debug|Any CPU - {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|x86.Build.0 = Debug|Any CPU - {8950E419-6895-46E4-8CBE-68E24844D644}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8950E419-6895-46E4-8CBE-68E24844D644}.Release|Any CPU.Build.0 = Release|Any CPU - {8950E419-6895-46E4-8CBE-68E24844D644}.Release|x64.ActiveCfg = Release|Any CPU - {8950E419-6895-46E4-8CBE-68E24844D644}.Release|x64.Build.0 = Release|Any CPU - {8950E419-6895-46E4-8CBE-68E24844D644}.Release|x86.ActiveCfg = Release|Any CPU - {8950E419-6895-46E4-8CBE-68E24844D644}.Release|x86.Build.0 = Release|Any CPU + {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|Any CPU.ActiveCfg = Debug|x86 + {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|Any CPU.Build.0 = Debug|x86 + {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|x64.ActiveCfg = Debug|x86 + {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|x86.ActiveCfg = Debug|x86 + {8950E419-6895-46E4-8CBE-68E24844D644}.Release|Any CPU.ActiveCfg = Release|x86 + {8950E419-6895-46E4-8CBE-68E24844D644}.Release|x64.ActiveCfg = Release|x86 + {8950E419-6895-46E4-8CBE-68E24844D644}.Release|x86.ActiveCfg = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {BA833C68-E8BD-4C86-9555-85542DF02015} = {58156BDC-C261-460F-B8BA-749E994CC743} + {8950E419-6895-46E4-8CBE-68E24844D644} = {58156BDC-C261-460F-B8BA-749E994CC743} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A5F55305-C8FF-444C-9B98-FD487ADC583A} EndGlobalSection diff --git a/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj b/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj index 8af62ea..4d5bef0 100644 --- a/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj +++ b/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj @@ -4,6 +4,7 @@ Exe net6.0-windows x86 + x86 diff --git a/OmsiExtensionsUI/OmsiExtensionsUI.csproj b/OmsiExtensionsUI/OmsiExtensionsUI.csproj index 871c1a7..ced68a6 100644 --- a/OmsiExtensionsUI/OmsiExtensionsUI.csproj +++ b/OmsiExtensionsUI/OmsiExtensionsUI.csproj @@ -3,6 +3,7 @@ WinExe net6.0-windows enable + x86 diff --git a/OmsiHook/Memory.cs b/OmsiHook/Memory.cs index 9dcf187..f064a3b 100644 --- a/OmsiHook/Memory.cs +++ b/OmsiHook/Memory.cs @@ -488,6 +488,36 @@ public T ReadMemory(uint address) where T : unmanaged return obj; } + /// + /// Reads and constructs an OmsiObject from unmanaged memory. + /// + /// + /// This version of the method performs a null-check on the base address before the offset is applied + /// to prevent attempting to dereference an objject belonging to a null-parent. + /// + /// The type of OmsiObject to construct + /// The address of the object this field belongs to. + /// The offset from the base address of the object. + /// When false, dereferences the object pointer again before construcing the new object. + /// A new OmsiObject. + public T ReadMemoryObject(int address, int offset, bool raw=true) where T : OmsiObject, new() + { + if (address == 0) + return null; + var addr = ReadMemory(address + offset); + if (addr == 0) + return null; + if (raw) + { + addr = ReadMemory(addr); + if (addr == 0) + return null; + } + var obj = new T(); + obj.InitObject(this, addr); + return obj; + } + /// /// Returns the value of a null terminated/length prefixed string at a given address. /// diff --git a/OmsiHook/OmsiGlobals.cs b/OmsiHook/OmsiGlobals.cs index 57397fc..f670d12 100644 --- a/OmsiHook/OmsiGlobals.cs +++ b/OmsiHook/OmsiGlobals.cs @@ -28,7 +28,7 @@ public class OmsiGlobals : OmsiObject /// /// Current Weather /// - public OmsiWeather Weather => new(Memory, Memory.ReadMemory(0x008617D0)); + public OmsiWeather Weather => Memory.ReadMemoryObject(0x008617D0); /// /// Current Map diff --git a/OmsiHook/OmsiHook.csproj b/OmsiHook/OmsiHook.csproj index e50d6c1..d6c43c6 100644 --- a/OmsiHook/OmsiHook.csproj +++ b/OmsiHook/OmsiHook.csproj @@ -10,9 +10,9 @@ OmsiHook is a simple library for hooking into Omsi's memory for modding. true true - 2.4.1.1 - 2.4.1.1 - 2.4.1 + 2.4.3.1 + 2.4.3.1 + 2.4.3 LGPL-3.0-only False README.md diff --git a/OmsiHook/WrappedOmsiClasses/OmsiAnimSubMeshInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiAnimSubMeshInst.cs index fb0ac4e..ac742d3 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiAnimSubMeshInst.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiAnimSubMeshInst.cs @@ -16,7 +16,7 @@ public OmsiAnimSubMeshInst() : base() { } public D3DTransformObject ShadowObject // TODO: Should be a D3DShadowObject { - get => new(Memory, Address + 0x4); + get => Memory.ReadMemoryObject(Address, 0x4); } public D3DMatrix Matrix { diff --git a/OmsiHook/WrappedOmsiClasses/OmsiChrono.cs b/OmsiHook/WrappedOmsiClasses/OmsiChrono.cs index d64e31c..b20d4a9 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiChrono.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiChrono.cs @@ -6,7 +6,7 @@ public class OmsiChrono : OmsiObject { internal OmsiChrono(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } - internal OmsiChrono() : base() { } + public OmsiChrono() : base() { } /* TODO: public Array? Timeline diff --git a/OmsiHook/WrappedOmsiClasses/OmsiComplMapObj.cs b/OmsiHook/WrappedOmsiClasses/OmsiComplMapObj.cs index 7a0e0e0..7e88626 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiComplMapObj.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiComplMapObj.cs @@ -20,7 +20,7 @@ public string Model_Int get => Memory.ReadMemoryString(Address + 0x18c); set => Memory.WriteMemory(Address + 0x18c, value); } - public OmsiPassengerCabin PassengerCabin => new(Memory, Memory.ReadMemory(Address + 0x190)); + public OmsiPassengerCabin PassengerCabin => Memory.ReadMemoryObject(Address, 0x190, false); public bool AbsHeight { get => Memory.ReadMemory(Address + 0x194); @@ -102,7 +102,7 @@ public bool Depot get => Memory.ReadMemory(Address + 0x1c5); set => Memory.WriteMemory(Address + 0x1c5, value); } - public D3DMeshFileObject HeightDeform => new(Memory, Address + 0x1c8); + public D3DMeshFileObject HeightDeform => Memory.ReadMemoryObject(Address, 0x1c8); public string HeightDeform_FileName { get => Memory.ReadMemoryString(Address + 0x1cc); @@ -241,7 +241,7 @@ public OmsiComplObjPtr ComplObj }*/ public OmsiPathManager ComplObj { - get => new(Memory, Memory.ReadMemory(Address + 0x250)); + get => Memory.ReadMemoryObject(Address, 0x250, false); } public MemArray Paths { diff --git a/OmsiHook/WrappedOmsiClasses/OmsiComplMapObjInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiComplMapObjInst.cs index f521a05..6743b46 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiComplMapObjInst.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiComplMapObjInst.cs @@ -33,7 +33,7 @@ public uint IDCode } public OmsiObject MyFileObject { - get => new(Memory, Address + 0x1e8); + get => Memory.ReadMemoryObject(Address, 0x1e8); } public float EinsVar { @@ -81,12 +81,12 @@ public float FarbSchema } public OmsiComplMapObj ComplMapObj { - get => new(Memory, Memory.ReadMemory(Address + 0x210)); + get => Memory.ReadMemoryObject(Address, 0x210, false); } public OmsiComplObjInst ComplObjInst { - get => new(Memory, Memory.ReadMemory(Address + 0x214)); + get => Memory.ReadMemoryObject(Address, 0x214, false); } public bool UseSound { @@ -95,7 +95,7 @@ public bool UseSound } public OmsiSoundPack SoundPack { - get => new(Memory, Memory.ReadMemory(Address + 0x21c)); + get => Memory.ReadMemoryObject(Address, 0x21c, false); } public OmsiCamera[] ReflCameras { @@ -121,7 +121,7 @@ public MemArrayPtr PublicVars } public OmsiComplMapObjInst ScriptShareParent { - get => new(Memory, Memory.ReadMemory(Address + 0x240)); + get => Memory.ReadMemoryObject(Address, 0x240, false); } public float[] UserVars { diff --git a/OmsiHook/WrappedOmsiClasses/OmsiComplObjInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiComplObjInst.cs index ca2b9ee..e20331e 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiComplObjInst.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiComplObjInst.cs @@ -61,7 +61,7 @@ public float Refresh_OFT } public OmsiComplObj ComplObj { - get => new(Memory, Memory.ReadMemory(Address + 0x20)); + get => Memory.ReadMemoryObject(Address, 0x20, false); } public byte ViewPoint_Opt { diff --git a/OmsiHook/WrappedOmsiClasses/OmsiFileObject.cs b/OmsiHook/WrappedOmsiClasses/OmsiFileObject.cs index d6d463b..412d03f 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiFileObject.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiFileObject.cs @@ -11,7 +11,7 @@ internal OmsiFileObject(Memory memory, int address) : base(memory, address) { } public OmsiComplMapObj MyComplMapObj { - get => new(Memory, Memory.ReadMemory(Address + 0x4)); + get => Memory.ReadMemoryObject(Address, 0x4, false); } public uint IDCode { @@ -70,11 +70,11 @@ public float Bank } public OmsiFileObject AttObj { - get => new(Memory, Memory.ReadMemory(Address + 0x34)); + get => Memory.ReadMemoryObject(Address, 0x34, false); } public OmsiFileSpline AttSpln { - get => new(Memory, Memory.ReadMemory(Address + 0x38)); + get => Memory.ReadMemoryObject(Address, 0x38, false); } public int AttPnt { @@ -149,7 +149,7 @@ public OmsiChronoChange[] Chrono_Changes } public OmsiObjChronoVars Chrono_Active { - get => new(Memory, Memory.ReadMemory(Address + 0x70)); + get => Memory.ReadMemoryObject(Address, 0x70, false); } public bool Chrono_Own { diff --git a/OmsiHook/WrappedOmsiClasses/OmsiFileSpline.cs b/OmsiHook/WrappedOmsiClasses/OmsiFileSpline.cs index 0e88567..acf1cc5 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiFileSpline.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiFileSpline.cs @@ -123,7 +123,7 @@ public bool Mirror get => Memory.ReadMemory(Address + 0x58); set => Memory.WriteMemory(Address + 0x58, value); } - public OmsiSplineSegment MySegment => new(Memory, Memory.ReadMemory(Address + 0x5c)); + public OmsiSplineSegment MySegment => Memory.ReadMemoryObject(Address, 0x5c, false); public MemArray Paths => new(Memory, Memory.ReadMemory(Address + 0x60), true); public int Chrono_Origin { @@ -131,6 +131,6 @@ public int Chrono_Origin set => Memory.WriteMemory(Address + 0x64, value); } public OmsiChronoChange[] Chrono_Changes => Memory.ReadMemoryObjArray(Address + 0x68); - public OmsiObjChronoVars Chrono_Active => new(Memory, Memory.ReadMemory(Address + 0x6c)); + public OmsiObjChronoVars Chrono_Active => Memory.ReadMemoryObject(Address, 0x6c, false); } } \ No newline at end of file diff --git a/OmsiHook/WrappedOmsiClasses/OmsiHumanBeing.cs b/OmsiHook/WrappedOmsiClasses/OmsiHumanBeing.cs index e59680e..3c0f2f1 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiHumanBeing.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiHumanBeing.cs @@ -8,7 +8,7 @@ namespace OmsiHook public class OmsiHumanBeing : OmsiComplMapObj { internal OmsiHumanBeing(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } - internal OmsiHumanBeing() : base() { } + public OmsiHumanBeing() : base() { } public string Voice { diff --git a/OmsiHook/WrappedOmsiClasses/OmsiHumanBeingInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiHumanBeingInst.cs index 74b14f9..221d83e 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiHumanBeingInst.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiHumanBeingInst.cs @@ -31,14 +31,14 @@ public bool Tutorial_Created get => Memory.ReadMemory(Address + 0x5a8); set => Memory.WriteMemory(Address + 0x5a8, value); } - public int Index + public int HBIndex { get => Memory.ReadMemory(Address + 0x5ac); set => Memory.WriteMemory(Address + 0x5ac, value); } public OmsiHumanBeing Human { - get => new(Memory, Memory.ReadMemory(Address + 0x5b0)); + get => Memory.ReadMemoryObject(Address, 0x5b0, false); } public float FreeDist { @@ -92,19 +92,19 @@ public D3DMatrix TargetMat } public OmsiPathManager PathManager { - get => new(Memory, Memory.ReadMemory(Address + 0x5dc)); + get => Memory.ReadMemoryObject(Address, 0x5dc, false); } public OmsiPathPointBasic PathPointTarget { - get => new(Memory, Memory.ReadMemory(Address + 0x5e0)); + get => Memory.ReadMemoryObject(Address, 0x5e0, false); } public OmsiPathPointBasic PathPointNext { - get => new(Memory, Memory.ReadMemory(Address + 0x5e4)); + get => Memory.ReadMemoryObject(Address, 0x5e4, false); } public OmsiPathPointBasic ActPathPoint { - get => new(Memory, Memory.ReadMemory(Address + 0x5e8)); + get => Memory.ReadMemoryObject(Address, 0x5e8, false); } public bool WaitBeforeEnd { @@ -380,7 +380,7 @@ public int MyBusIndex_Temp } public OmsiRoadVehicleInst MyBus { - get => new(Memory, Memory.ReadMemory(Address + 0x6b4)); + get => Memory.ReadMemoryObject(Address, 0x6b4, false); } public uint MyBusCode { diff --git a/OmsiHook/WrappedOmsiClasses/OmsiKachelForest.cs b/OmsiHook/WrappedOmsiClasses/OmsiKachelForest.cs index d50fffa..ac9ecd1 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiKachelForest.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiKachelForest.cs @@ -41,6 +41,6 @@ public bool Visible } public OmsiTree[] Trees => Memory.ReadMemoryStructArray(Address + 0x18); - public D3DMeshObject MeshObject => new(Memory, Memory.ReadMemory(Address + 0x1c)); + public D3DMeshObject MeshObject => Memory.ReadMemoryObject(Address, 0x1c, false); } } \ No newline at end of file diff --git a/OmsiHook/WrappedOmsiClasses/OmsiMap.cs b/OmsiHook/WrappedOmsiClasses/OmsiMap.cs index 9abde2f..aa7e508 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiMap.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiMap.cs @@ -64,7 +64,7 @@ public bool Ignore_TruckFlags set => Memory.WriteMemory(Address + 0x24, value); } - public OmsiChrono Chrono => new(Memory, Memory.ReadMemory(Address + 0x28)); + public OmsiChrono Chrono => Memory.ReadMemoryObject(Address, 0x28, false); public bool Splines_Refreshed { @@ -127,12 +127,12 @@ public bool DynHelperActive public OmsiFuncClass Func_TrafficDensity_Passenger { - get => new(Memory, Memory.ReadMemory(Address + 0x104)); + get => Memory.ReadMemoryObject(Address, 0x104, false); } public OmsiFuncClass Func_TrafficDensity_Road { - get => new(Memory, Memory.ReadMemory(Address + 0x108)); + get => Memory.ReadMemoryObject(Address, 0x108, false); } public float Acct_TrafficDensity_Passenger @@ -279,13 +279,13 @@ public float WellenAnimation //TODO: This is meant to be an array of pointers to floats, which can't be marshalled yet //public float[] WellenAnimation_P => Memory.ReadMemoryStructArray(Address + 0x190); - public OmsiStringList Registers => new(Memory, Memory.ReadMemory(Address + 0x194)); + public OmsiStringList Registers => Memory.ReadMemoryObject(Address, 0x194, false); public OmsiStringList[] CarsParked_Array => Memory.ReadMemoryObjArray(Address + 0x198); - public OmsiStringList Humans => new(Memory, Memory.ReadMemory(Address + 0x19c)); + public OmsiStringList Humans => Memory.ReadMemoryObject(Address, 0x19c, false); - public OmsiStringList Drivers => new(Memory, Memory.ReadMemory(Address + 0x1a0)); + public OmsiStringList Drivers => Memory.ReadMemoryObject(Address, 0x1a0, false); /*TODO: There's a bug when dereferencing this public OmsiAIList AIList diff --git a/OmsiHook/WrappedOmsiClasses/OmsiMapKachel.cs b/OmsiHook/WrappedOmsiClasses/OmsiMapKachel.cs index 87ec262..ba0dd96 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiMapKachel.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiMapKachel.cs @@ -98,8 +98,8 @@ public float Width_N } public OmsiFileObject[] ObjectsFromFile => Memory.ReadMemoryObjArray(Address + 0x48); - public OmsiFileTerrain TerrainFromFile => new(Memory, Memory.ReadMemory(Address + 0x4c)); - public OmsiFileWater WaterFromFile => new(Memory, Memory.ReadMemory(Address + 0x50)); + public OmsiFileTerrain TerrainFromFile => Memory.ReadMemoryObject(Address, 0x4c, false); + public OmsiFileWater WaterFromFile => Memory.ReadMemoryObject(Address, 0x50, false); public OmsiFileSpline[] SplinesFromFile => Memory.ReadMemoryObjArray(Address + 0x54); public bool Splines_Refreshed @@ -130,7 +130,7 @@ public bool PathsLinkedWithFstrn } public OmsiAmpelGroup[] AmpelGroups => Memory.MarshalStructs( Memory.ReadMemoryStructArray(Address + 0x6c)); - public D3DMeshFileObject TileMesh => new(Memory, Memory.ReadMemory(Address + 0x70)); + public D3DMeshFileObject TileMesh => Memory.ReadMemoryObject(Address, 0x70, false); public string TexPath { get => Memory.ReadMemoryString(Address + 0x74); @@ -145,8 +145,8 @@ public bool Trees_Refreshed get => Memory.ReadMemory(Address + 0x80); set => Memory.WriteMemory(Address + 0x80, value); } - public OmsiKachelForest MyForest => new(Memory, Memory.ReadMemory(Address + 0x84)); - public OmsiKachelForest MyScrubs => new(Memory, Memory.ReadMemory(Address + 0x88)); + public OmsiKachelForest MyForest => Memory.ReadMemoryObject(Address, 0x84, false); + public OmsiKachelForest MyScrubs => Memory.ReadMemoryObject(Address, 0x88, false); //TODO: Many more... } } \ No newline at end of file diff --git a/OmsiHook/WrappedOmsiClasses/OmsiMovingMapObjInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiMovingMapObjInst.cs index 2dd8055..039de74 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiMovingMapObjInst.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiMovingMapObjInst.cs @@ -199,19 +199,19 @@ public float Sound_Reverb_Dist } public OmsiMovingMapObjInst VB_First { - get => new (Memory, Memory.ReadMemory(Address + 0x4d0)); + get => Memory.ReadMemoryObject(Address, 0x4d0, false); } public OmsiMovingMapObjInst VB_Last { - get => new(Memory, Memory.ReadMemory(Address + 0x4d4)); + get => Memory.ReadMemoryObject(Address, 0x4d4, false); } public OmsiMovingMapObjInst VB_Next { - get => new(Memory, Memory.ReadMemory(Address + 0x4d8)); + get => Memory.ReadMemoryObject(Address, 0x4d8, false); } public OmsiMovingMapObjInst VB_Prev { - get => new(Memory, Memory.ReadMemory(Address + 0x4dc)); + get => Memory.ReadMemoryObject(Address, 0x4dc, false); } public bool VB_Me_Reverse { @@ -230,7 +230,7 @@ public bool VB_Leading } public OmsiMovingMapObjInst VB_SoundRef { - get => new(Memory, Memory.ReadMemory(Address + 0x4e4)); + get => Memory.ReadMemoryObject(Address, 0x4e4, false); } public bool RL_ExitReq { diff --git a/OmsiHook/WrappedOmsiClasses/OmsiPathManager.cs b/OmsiHook/WrappedOmsiClasses/OmsiPathManager.cs index 2c0675c..8dc5e42 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiPathManager.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiPathManager.cs @@ -14,7 +14,7 @@ public int StepSoundPacks } public OmsiPathPointBasic MyClass { - get => new OmsiPathPointBasic(Memory, Memory.ReadMemory(Address + 0x8)); + get => Memory.ReadMemoryObject(Address, 0x8, false); } /* TODO: public OmsiPathPoint[] PathPoints diff --git a/OmsiHook/WrappedOmsiClasses/OmsiPathSegment.cs b/OmsiHook/WrappedOmsiClasses/OmsiPathSegment.cs index 79e3734..ff57104 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiPathSegment.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiPathSegment.cs @@ -27,7 +27,7 @@ public int Parent_PathIndex } public OmsiObject Parent { - get => new(Memory, Memory.ReadMemory(Address + 0x140)); + get => Memory.ReadMemoryObject(Address, 0x140, false); } public byte Type { @@ -36,7 +36,7 @@ public byte Type } public OmsiCoordSystem CoordSystem { - get => new(Memory, Memory.ReadMemory(Address + 0x148)); + get => Memory.ReadMemoryObject(Address, 0x148, false); } public bool CoordSystemIsMine { @@ -199,7 +199,7 @@ public float[] AIDensRel }*/ public OmsiSplineSegment Helper { - get => new(Memory, Memory.ReadMemory(Address + 0x1c4)); + get => Memory.ReadMemoryObject(Address, 0x1c4, false); } /* WAITING FOR PR#25 public OmsiPathRule[] Rules diff --git a/OmsiHook/WrappedOmsiClasses/OmsiPhysObjInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiPhysObjInst.cs index 2944e0a..f7d9860 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiPhysObjInst.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiPhysObjInst.cs @@ -130,6 +130,6 @@ public byte Contact set => Memory.WriteMemory(Address + 0x1d8, value); } - public OmsiCamera Camera => new(Memory, Memory.ReadMemory(Address + 0x1dc)); + public OmsiCamera Camera => Memory.ReadMemoryObject(Address, 0x1dc, false); } } diff --git a/OmsiHook/WrappedOmsiClasses/OmsiProgMan.cs b/OmsiHook/WrappedOmsiClasses/OmsiProgMan.cs index d0085bc..8c6128a 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiProgMan.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiProgMan.cs @@ -51,7 +51,7 @@ public D3DText Text2D_Hinweise_H }*/ public OmsiCamera MapCam { - get => new(Memory, Memory.ReadMemory(Address + 0x14)); + get => Memory.ReadMemoryObject(Address, 0x14, false); } public D3DVector MapCamTargetPos { @@ -205,15 +205,15 @@ public bool Maus_Last_Clicked } public OmsiFileObject SelObjPri { - get => new(Memory, Memory.ReadMemory(Address + 0xf0)); + get => Memory.ReadMemoryObject(Address, 0xf0, false); } public OmsiFileObject SelObjSec { - get => new(Memory, Memory.ReadMemory(Address + 0xf4)); + get => Memory.ReadMemoryObject(Address, 0xf4, false); } public OmsiFileObject OrgObj { - get => new(Memory, Memory.ReadMemory(Address + 0xf8)); + get => Memory.ReadMemoryObject(Address, 0xf8, false); } public int SelObjEscInst { @@ -222,15 +222,15 @@ public int SelObjEscInst } public OmsiFileSpline SelSplPri { - get => new(Memory, Memory.ReadMemory(Address + 0x100)); + get => Memory.ReadMemoryObject(Address, 0x100, false); } public OmsiFileSpline SelSplSec { - get => new(Memory, Memory.ReadMemory(Address + 0x104)); + get => Memory.ReadMemoryObject(Address, 0x104, false); } public OmsiFileSpline OrgSpl { - get => new(Memory, Memory.ReadMemory(Address + 0x108)); + get => Memory.ReadMemoryObject(Address, 0x108, false); } public OmsiFileSpline[] SelSplExp { @@ -287,7 +287,7 @@ public bool Path_Deact } public D3DMeshFileObject SplHelper { - get => new(Memory, Memory.ReadMemory(Address + 0x134)); + get => Memory.ReadMemoryObject(Address, 0x134, false); } public D3DOBB SplHelperBounding { @@ -296,7 +296,7 @@ public D3DOBB SplHelperBounding } public OmsiDynHelperMan DynHelperMan { - get => new(Memory, Memory.ReadMemory(0x174)); + get => Memory.ReadMemoryObject(Address, 0x174, false); } /* TODO: public OmsiSplineObject PathHelperSplines @@ -321,7 +321,7 @@ public IntPtr[] PathHelperTextures } public OmsiVisu_OBB Visu_OBB { - get => new(Memory, Memory.ReadMemory(Address + 0x19c)); + get => Memory.ReadMemoryObject(Address, 0x19c, false); } public float Coll_Pos_X_Var { @@ -345,7 +345,7 @@ public float Coll_Energy_Var } public OmsiObjBlackRect ScreenRect { - get => new(Memory, Memory.ReadMemory(0x1b0)); + get => Memory.ReadMemoryObject(Address, 0x1b0, false); } // TODO: Write internal structs for these so that they can be marhsalled /*public OmsiCriticalSection CS_MakeVehicle diff --git a/OmsiHook/WrappedOmsiClasses/OmsiRoadVehicleInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiRoadVehicleInst.cs index 33497f9..8ba6e3c 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiRoadVehicleInst.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiRoadVehicleInst.cs @@ -8,7 +8,7 @@ namespace OmsiHook public class OmsiRoadVehicleInst : OmsiVehicleInst { internal OmsiRoadVehicleInst(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } - internal OmsiRoadVehicleInst() : base() { } + public OmsiRoadVehicleInst() : base() { } /* TODO: public OmsiCriticalSection CS_Ticket_Items { @@ -17,7 +17,7 @@ public OmsiCriticalSection CS_Ticket_Items }*/ public OmsiRoadVehicle RoadVehicle { - get => new(Memory, Memory.ReadMemory(Address + 0x710)); + get => Memory.ReadMemoryObject(Address, 0x710, false); } public bool OnLoadedKachel { @@ -393,7 +393,7 @@ public float VB_Var_Me_Reverse get => Memory.ReadMemory(Address + 0x8bc); set => Memory.WriteMemory(Address + 0x8bc, value); } - public OmsiRoadVehicleInst ScriptParent => new(Memory, Memory.ReadMemory(Address + 0x8c0)); + public OmsiRoadVehicleInst ScriptParent => Memory.ReadMemoryObject(Address, 0x8c0, false); public D3DXVector2 Wagenkasten_RotZPhys { get => Memory.ReadMemory(Address + 0x8c4); diff --git a/OmsiHook/WrappedOmsiClasses/OmsiSound.cs b/OmsiHook/WrappedOmsiClasses/OmsiSound.cs index baf608a..54f527b 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiSound.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiSound.cs @@ -179,7 +179,7 @@ public OmsiFuncClass[] VolCurves } public OmsiBoolClass BoolClass { - get => new(Memory, Memory.ReadMemory(Address + 0x78)); + get => Memory.ReadMemoryObject(Address, 0x78, false); } public bool Playing { @@ -204,9 +204,5 @@ public IntPtr Int3D get => new(Memory.ReadMemory(Address + 0x80)); set => Memory.WriteMemory(Address + 0x80, value.ToInt32()); } - - - - } } \ No newline at end of file diff --git a/OmsiHook/WrappedOmsiClasses/OmsiSoundPack.cs b/OmsiHook/WrappedOmsiClasses/OmsiSoundPack.cs index e4f23a5..7587589 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiSoundPack.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiSoundPack.cs @@ -6,7 +6,7 @@ public class OmsiSoundPack : OmsiObject { internal OmsiSoundPack(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } - internal OmsiSoundPack() : base() { } + public OmsiSoundPack() : base() { } /*public DirectSound8 Device { diff --git a/OmsiHook/WrappedOmsiClasses/OmsiVehicleInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiVehicleInst.cs index 5f84c87..6faedce 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiVehicleInst.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiVehicleInst.cs @@ -70,9 +70,9 @@ public float CS_AI_BusStopData public OmsiCamera[] Cameras_Pax => Memory.ReadMemoryObjArray(Address + 0x5b4); - public OmsiCamera Camera_Driver => new(Memory, Memory.ReadMemory(Address + 0x5b8)); + public OmsiCamera Camera_Driver => Memory.ReadMemoryObject(Address, 0x5b8, false); - public OmsiCamera Camera_Pax => new(Memory, Memory.ReadMemory(Address + 0x5bc)); + public OmsiCamera Camera_Pax => Memory.ReadMemoryObject(Address, 0x5bc, false); public int Act_Camera_Driver { @@ -215,7 +215,7 @@ public D3DVector A_Rot set => Memory.WriteMemory(Address + 0x614, value); } - public OmsiCamera OutsideCamera => new(Memory, Memory.ReadMemory(Address + 0x620)); + public OmsiCamera OutsideCamera => Memory.ReadMemoryObject(Address, 0x620, false); public bool PAI { diff --git a/OmsiHook/WrappedOmsiClasses/OmsiWeather.cs b/OmsiHook/WrappedOmsiClasses/OmsiWeather.cs index be61e3b..8c6ba9b 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiWeather.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiWeather.cs @@ -8,7 +8,7 @@ namespace OmsiHook public class OmsiWeather : OmsiObject { internal OmsiWeather(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } - internal OmsiWeather() : base() { } + public OmsiWeather() : base() { } //Todo: WeatherSchemes - OmsiWeatherProp[] @ 0x4 diff --git a/OmsiHook/docs/articles/examples/Basic_CLI.md b/OmsiHook/docs/articles/examples/basic-cli.md similarity index 92% rename from OmsiHook/docs/articles/examples/Basic_CLI.md rename to OmsiHook/docs/articles/examples/basic-cli.md index 7bdfc35..aadb9a7 100644 --- a/OmsiHook/docs/articles/examples/Basic_CLI.md +++ b/OmsiHook/docs/articles/examples/basic-cli.md @@ -2,7 +2,7 @@ This article provides a basic understanding to a basic C# .NET example leveraging the OMSIHook library. The example focuses on retrieving crucial information about the map, weather, date, and the current vehicle. -_This article is in direct relation to the Sample Project available [here](https://github.com/space928/Omsi-Extensions/tree/main/_OmsiHookExamples/Basic_CLI)._ +_This article is in direct relation to the Sample Project available [here](https://github.com/space928/Omsi-Extensions/tree/main/_OmsiHookExamples/BasicCLI)._ ## Initialization @@ -25,4 +25,4 @@ var map = omsi.Globals.Map; var weather = omsi.Globals.Weather; ``` -By caching these variables outside the loop, you significantly enhance access speed during subsequent iterations. \ No newline at end of file +By caching these variables outside the loop, you significantly enhance access speed during subsequent iterations. diff --git a/OmsiHook/docs/articles/examples/Triggers.md b/OmsiHook/docs/articles/examples/triggers-sample.md similarity index 66% rename from OmsiHook/docs/articles/examples/Triggers.md rename to OmsiHook/docs/articles/examples/triggers-sample.md index 9d61a06..3e67b27 100644 --- a/OmsiHook/docs/articles/examples/Triggers.md +++ b/OmsiHook/docs/articles/examples/triggers-sample.md @@ -2,11 +2,11 @@ This article offers a foundational exploration of a C# .NET example that utilizes the OMSIHook library. The focus of this example is on activating existing OMSI Mouse Events (triggers) and initiating sound playback (sound triggers). -_For a hands-on experience, you can access the associated Sample Project [here](https://github.com/space928/Omsi-Extensions/tree/main/_OmsiHookExamples/trigger_sample)._ +_For a hands-on experience, you can access the associated Sample Project [here](https://github.com/space928/Omsi-Extensions/tree/main/_OmsiHookExamples/TriggersSample)._ ## Mouse Triggers -To manipulate the state of any trigger within OMSI, a straightforward remote call to the `SetTrigger` method is employed. This method allows you to alter the boolean state of a specific trigger identified by its name. The code snippet below illustrates this process: +To manipulate the state of any trigger within OMSI, a straightforward remote call to the `SetTrigger()` method is employed. This method allows you to alter the boolean state of a specific trigger identified by its name. The code snippet below illustrates this process: ```cs playerVehicle.SetTrigger("bus_doorfront0", true); @@ -14,7 +14,7 @@ playerVehicle.SetTrigger("bus_doorfront0", true); ## Sound Triggers -In a similar fashion, sound manipulation is achieved through a remote call to OMSI's `SoundTrigger` method. This method facilitates the playback of any sound by referencing its file name and the designated point specified in the \`sound.cfg\` file. The following code snippet demonstrates this operation: +In a similar fashion, sound manipulation is achieved through a remote call to OMSI's `SoundTrigger()` method. This method facilitates the playback of any sound by referencing its file name and the designated point specified in the `\sound.cfg\` file. The following code snippet demonstrates this operation: ```cs playerVehicle.SoundTrigger("ev_IBIS_Ansagen", @"..\..\MAN_NL_NG\Sound\Matrix_Ziel.wav"); diff --git a/OmsiHook/docs/articles/toc.yml b/OmsiHook/docs/articles/toc.yml index e13db71..3a578ad 100644 --- a/OmsiHook/docs/articles/toc.yml +++ b/OmsiHook/docs/articles/toc.yml @@ -7,6 +7,6 @@ - name: Examples items: - name: Basic CLI Example - href: examples\Basic_CLI.md + href: examples\basic-cli.md - name: Basic Mouse Trigger & Sound Trigger Example - href: examples\Triggers.md \ No newline at end of file + href: examples\triggers-sample.md \ No newline at end of file diff --git a/OmsiHook/docs/docfx.json b/OmsiHook/docs/docfx.json index 9b17209..66fb4f9 100644 --- a/OmsiHook/docs/docfx.json +++ b/OmsiHook/docs/docfx.json @@ -29,7 +29,7 @@ "_enableNewTab": true, "_disableContribution": true, "_disableBreadcrumb": false, - "_DocumentationVersion": "2.4.1" + "_DocumentationVersion": "2.4.3" }, "content": [ { diff --git a/_OmsiHookExamples/Basic_CLI/Basic_CLI.csproj b/_OmsiHookExamples/BasicCLI/BasicCLI.csproj similarity index 59% rename from _OmsiHookExamples/Basic_CLI/Basic_CLI.csproj rename to _OmsiHookExamples/BasicCLI/BasicCLI.csproj index 33fd140..5875e3c 100644 --- a/_OmsiHookExamples/Basic_CLI/Basic_CLI.csproj +++ b/_OmsiHookExamples/BasicCLI/BasicCLI.csproj @@ -2,15 +2,15 @@ Exe - net6.0-windows10.0.22621.0 + net6.0-windows disable enable x86 - Basic_CLI.Program + BasicCLI.Program - + diff --git a/_OmsiHookExamples/Basic_CLI/Program.cs b/_OmsiHookExamples/BasicCLI/Program.cs similarity index 57% rename from _OmsiHookExamples/Basic_CLI/Program.cs rename to _OmsiHookExamples/BasicCLI/Program.cs index 3e36dcc..729e36e 100644 --- a/_OmsiHookExamples/Basic_CLI/Program.cs +++ b/_OmsiHookExamples/BasicCLI/Program.cs @@ -2,24 +2,36 @@ using System.Threading; using OmsiHook; -namespace Basic_CLI +namespace BasicCLI { - // Most Basic example of reading various values exposed by OMSIHook + // Most basic example of reading various values exposed by OMSIHook class Program { static void Main(string[] args) { Console.WriteLine("#=#=#=#=#=# OMSIHook Basic CLI Sample #=#=#=#=#=#"); + // Attach OmsiHook to the running instance of Omsi; this method is async and will complete when a running + // instance of Omsi is detected and has been connected to. We can wait synchronously for the method to + // complete by either using the await operator or calling it's Wait() method. OmsiHook.OmsiHook omsi = new(); omsi.AttachToOMSI().Wait(); + + // Set the console output encoding to support emoji + Console.OutputEncoding = System.Text.Encoding.UTF8; + var playerVehicle = omsi.Globals.PlayerVehicle; var time = omsi.Globals.Time; var map = omsi.Globals.Map; var weather = omsi.Globals.Weather; - Console.OutputEncoding = System.Text.Encoding.UTF8; while (true) { + // These variables will return null until they have a valid value (they will become null if Omsi is in + // the title screen or is changing map). By using the null assignment operator, we can continously + // check if the object is valid, if so we get it only if it doesn't already exist; which saves + // constructing a new wrapper object every iteration of the while loop. + map ??= omsi.Globals.Map; + time ??= omsi.Globals.Time; weather ??= omsi.Globals.Weather; playerVehicle ??= omsi.Globals.PlayerVehicle; var pos = playerVehicle?.Position ?? default; @@ -29,9 +41,8 @@ static void Main(string[] args) Console.WriteLine($"Map: {map?.FriendlyName}".PadRight(Console.WindowWidth - 17) + $"Date: {time.Day:00}/{time.Month:00}/{time.Year:0000}"); Console.WriteLine($"Weather: {WeatherEmoji(weather)}".PadRight(Console.WindowWidth - 15) + $"Time: {time.Hour:00}:{time.Minute:00}:{time.Second:00}"); Console.WriteLine($"Bus: {playerVehicle?.RoadVehicle?.FileName}".PadRight(Console.WindowWidth - 1)); - Console.WriteLine(($"Position: {pos.x:F2},{pos.y:F2},{pos.z:F2}".PadRight(Console.WindowWidth - 8) + - $"Tile: {playerVehicle?.Kachel ?? 0}")); - Console.WriteLine(($"Rotation: {rot.w:F2},{rot.x:F2},{rot.y:F2},{rot.z:F2}".PadRight(Console.WindowWidth - 1))); + Console.WriteLine($"Position: {pos}".PadRight(Console.WindowWidth - 10) + $"Tile: {playerVehicle?.Kachel ?? 0, 3}"); + Console.WriteLine(($"Rotation: {rot}".PadRight(Console.WindowWidth - 1))); Thread.Sleep(20); } @@ -40,6 +51,8 @@ static void Main(string[] args) // Pick an emoji to show for the weather static string WeatherEmoji(OmsiWeather weather) { + if (weather == null) + return "N/A"; if (weather?.ActWeather.fogDensity < 900) return "🌫️"; if (weather?.ActWeather.percipitation > 0) diff --git a/_OmsiHookExamples/trigger_sample/Program.cs b/_OmsiHookExamples/TriggersSample/Program.cs similarity index 76% rename from _OmsiHookExamples/trigger_sample/Program.cs rename to _OmsiHookExamples/TriggersSample/Program.cs index dde688c..4afad05 100644 --- a/_OmsiHookExamples/trigger_sample/Program.cs +++ b/_OmsiHookExamples/TriggersSample/Program.cs @@ -2,12 +2,11 @@ using System.Threading; using OmsiHook; -namespace Trigger_Sample +namespace TriggersSample { // Basic sample of Triggers with OMSIHook class Program { - OmsiHook.OmsiHook omsi; static void Main(string[] args) { Console.WriteLine("#=#=#=#=#=# OMSIHook Trigger Sample #=#=#=#=#=#"); @@ -15,19 +14,19 @@ static void Main(string[] args) OmsiHook.OmsiHook omsi = new(); omsi.AttachToOMSI().Wait(); + var playerVehicle = omsi.Globals.PlayerVehicle; - bool trigger_state = false; + bool triggerState = false; - Thread.Sleep(500); while (true) { playerVehicle ??= omsi.Globals.PlayerVehicle; Console.SetCursorPosition(0, 1); - Console.WriteLine($"Trigger State: {trigger_state}".PadRight(Console.WindowWidth - 1)); + Console.WriteLine($"Trigger State: {triggerState}".PadRight(Console.WindowWidth - 1)); Console.WriteLine($"Playing Sound...".PadRight(Console.WindowWidth - 1)); - playerVehicle.SetTrigger("bus_doorfront0", trigger_state); + playerVehicle.SetTrigger("bus_doorfront0", triggerState); playerVehicle.SoundTrigger("ev_IBIS_Ansagen", @"..\..\MAN_NL_NG\Sound\Matrix_Ziel.wav"); - trigger_state = !trigger_state; + triggerState = !triggerState; Thread.Sleep(1000); } } diff --git a/_OmsiHookExamples/trigger_sample/trigger_sample.csproj b/_OmsiHookExamples/TriggersSample/TriggersSample.csproj similarity index 60% rename from _OmsiHookExamples/trigger_sample/trigger_sample.csproj rename to _OmsiHookExamples/TriggersSample/TriggersSample.csproj index e571d93..b8f0151 100644 --- a/_OmsiHookExamples/trigger_sample/trigger_sample.csproj +++ b/_OmsiHookExamples/TriggersSample/TriggersSample.csproj @@ -1,16 +1,17 @@ - + Exe net6.0-windows enable enable - Trigger_Sample.Program + TriggersSample.Program x86 + x86 - + From d685c95a6f907a712c236176df53b9e5919c6e0a Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Tue, 2 Jan 2024 09:53:24 +0100 Subject: [PATCH 19/36] Somme refactoring and some fixes: - Refactored sample project to meet Thomas' draconian naming requirements - OnMapChange now provides the new OmsiMap objject as event args - Added separate ReleaseAndDocs build config to allow release builds to be built without having to wait for the docs to compile - Updated readme - Fixed solution file --- OmsiExtensions.sln | 120 ++++++------------ OmsiExtensionsCLI/OmsiExtensionsCLI.csproj | 7 +- OmsiExtensionsCLI/favicon.ico | Bin 0 -> 6518 bytes OmsiHook/OmsiHook.cs | 6 +- OmsiHook/OmsiHook.csproj | 52 +++++--- .../{Event_Sample.md => event-sample.md} | 5 +- OmsiHook/docs/articles/toc.yml | 2 +- README.md | 12 +- .../EventSample.csproj} | 7 +- .../{Event_Sample => EventSample}/Program.cs | 14 +- 10 files changed, 106 insertions(+), 119 deletions(-) create mode 100644 OmsiExtensionsCLI/favicon.ico rename OmsiHook/docs/articles/examples/{Event_Sample.md => event-sample.md} (94%) rename _OmsiHookExamples/{Event_Sample/Event_Sample.csproj => EventSample/EventSample.csproj} (60%) rename _OmsiHookExamples/{Event_Sample => EventSample}/Program.cs (85%) diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index babc37f..90fed48 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -17,119 +17,81 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OmsiHookRPCPlugin", "OmsiHo EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicCLI", "_OmsiHookExamples\BasicCLI\BasicCLI.csproj", "{BA833C68-E8BD-4C86-9555-85542DF02015}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Event_Sample", "_OmsiHookExamples\Event_Sample\Event_Sample.csproj", "{47659503-9923-4E74-AD26-103C1F9FF2B0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventSample", "_OmsiHookExamples\EventSample\EventSample.csproj", "{47659503-9923-4E74-AD26-103C1F9FF2B0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{3F0BF441-D76C-4E0D-A5A8-B20895438EA5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TriggersSample", "_OmsiHookExamples\TriggersSample\TriggersSample.csproj", "{1DF326AE-4D10-4545-B36A-5622B76987EC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 Release|x86 = Release|x86 + ReleaseAndDocs|x86 = ReleaseAndDocs|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|Any CPU.ActiveCfg = Debug|x86 - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|Any CPU.Build.0 = Debug|x86 - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|x64.ActiveCfg = Debug|x86 - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|x64.Build.0 = Debug|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|x86.ActiveCfg = Debug|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|x86.Build.0 = Debug|x86 - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|Any CPU.ActiveCfg = Release|x86 - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|Any CPU.Build.0 = Release|x86 - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x64.ActiveCfg = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.ActiveCfg = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.Build.0 = Release|x86 - {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|Any CPU.ActiveCfg = Debug|x86 - {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|Any CPU.Build.0 = Debug|x86 - {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x64.ActiveCfg = Debug|Any CPU - {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x64.Build.0 = Debug|Any CPU - {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.ActiveCfg = Debug|Any CPU - {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.Build.0 = Debug|Any CPU - {28DA0165-EAA7-4171-A065-319409682BD1}.Release|Any CPU.ActiveCfg = Release|x86 - {28DA0165-EAA7-4171-A065-319409682BD1}.Release|Any CPU.Build.0 = Release|x86 - {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x64.ActiveCfg = Release|Any CPU - {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x64.Build.0 = Release|Any CPU - {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.ActiveCfg = Release|Any CPU - {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.Build.0 = Release|Any CPU - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.ActiveCfg = Debug|x86 - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.Build.0 = Debug|x86 - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x64.ActiveCfg = Debug|x86 + {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|x86.ActiveCfg = ReleaseAndDocs|x86 + {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|x86.Build.0 = ReleaseAndDocs|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.ActiveCfg = Debug|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.Build.0 = Debug|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.ActiveCfg = Release|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.Build.0 = Release|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|x86.Build.0 = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x86.ActiveCfg = Debug|x86 - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|Any CPU.ActiveCfg = Release|x86 - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x64.ActiveCfg = Release|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x86.Build.0 = Debug|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.ActiveCfg = Release|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|Any CPU.ActiveCfg = Debug|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|Any CPU.Build.0 = Debug|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x64.ActiveCfg = Debug|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x64.Build.0 = Debug|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.Build.0 = Release|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|x86.Build.0 = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x86.ActiveCfg = Debug|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x86.Build.0 = Debug|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|Any CPU.ActiveCfg = Release|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|Any CPU.Build.0 = Release|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|x64.ActiveCfg = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|x86.ActiveCfg = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|x86.Build.0 = Release|x86 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|Any CPU.Build.0 = Debug|Win32 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|x64.ActiveCfg = Debug|Win32 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|x64.Build.0 = Debug|Win32 + {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 + {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|x86.Build.0 = Release|x86 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|x86.ActiveCfg = Debug|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|x86.Build.0 = Debug|Win32 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|Any CPU.ActiveCfg = Release|Win32 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|Any CPU.Build.0 = Release|Win32 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|x64.ActiveCfg = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|x86.ActiveCfg = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|x86.Build.0 = Release|Win32 - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|Any CPU.ActiveCfg = Debug|x86 - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|Any CPU.Build.0 = Debug|x86 - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|x64.ActiveCfg = Debug|x86 - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|x64.Build.0 = Debug|x86 + {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|x86.ActiveCfg = Release|Win32 + {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|x86.Build.0 = Release|Win32 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|x86.ActiveCfg = Debug|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|x86.Build.0 = Debug|x86 - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|Any CPU.ActiveCfg = Release|x86 - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|Any CPU.Build.0 = Release|x86 - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x64.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.Build.0 = Release|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.ActiveCfg = Debug|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.Build.0 = Debug|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.ActiveCfg = Debug|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x64.Build.0 = Debug|x86 + {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 + {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|x86.Build.0 = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.ActiveCfg = Debug|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.Build.0 = Debug|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.ActiveCfg = Release|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.Build.0 = Release|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.ActiveCfg = Release|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x64.Build.0 = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.Build.0 = Release|x86 - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x64.ActiveCfg = Debug|Any CPU - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x64.Build.0 = Debug|Any CPU - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.ActiveCfg = Debug|Any CPU - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.Build.0 = Debug|Any CPU - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|Any CPU.Build.0 = Release|Any CPU - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x64.ActiveCfg = Release|Any CPU - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x64.Build.0 = Release|Any CPU - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.ActiveCfg = Release|Any CPU - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.Build.0 = Release|Any CPU - {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|Any CPU.ActiveCfg = Debug|x86 - {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|Any CPU.Build.0 = Debug|x86 - {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|x64.ActiveCfg = Debug|x86 - {8950E419-6895-46E4-8CBE-68E24844D644}.Debug|x86.ActiveCfg = Debug|x86 - {8950E419-6895-46E4-8CBE-68E24844D644}.Release|Any CPU.ActiveCfg = Release|x86 - {8950E419-6895-46E4-8CBE-68E24844D644}.Release|x64.ActiveCfg = Release|x86 - {8950E419-6895-46E4-8CBE-68E24844D644}.Release|x86.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|x86.Build.0 = Release|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.ActiveCfg = Debug|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.Build.0 = Debug|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.ActiveCfg = Release|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.Build.0 = Release|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|x86.Build.0 = Release|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|x86.ActiveCfg = Debug|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|x86.Build.0 = Debug|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|x86.ActiveCfg = Release|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|x86.Build.0 = Release|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {BA833C68-E8BD-4C86-9555-85542DF02015} = {58156BDC-C261-460F-B8BA-749E994CC743} - {8950E419-6895-46E4-8CBE-68E24844D644} = {58156BDC-C261-460F-B8BA-749E994CC743} + {BA833C68-E8BD-4C86-9555-85542DF02015} = {3F0BF441-D76C-4E0D-A5A8-B20895438EA5} + {47659503-9923-4E74-AD26-103C1F9FF2B0} = {3F0BF441-D76C-4E0D-A5A8-B20895438EA5} + {1DF326AE-4D10-4545-B36A-5622B76987EC} = {3F0BF441-D76C-4E0D-A5A8-B20895438EA5} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A5F55305-C8FF-444C-9B98-FD487ADC583A} diff --git a/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj b/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj index 4d5bef0..0bfd17a 100644 --- a/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj +++ b/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj @@ -1,14 +1,19 @@ - + Exe net6.0-windows x86 x86 + favicon.ico + + + + diff --git a/OmsiExtensionsCLI/favicon.ico b/OmsiExtensionsCLI/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..b407cbdb4dbc1e0bcdec0473c797afff2fba084c GIT binary patch literal 6518 zcmdT|`8yO2(BCD5NbYMb9mstrEi2^Ma^JDYk&yd7S0pMVXXK0}v5VZ+T1h0wW*u9U zCFj~$_szb2-@oF0XP$Xx=9ynU^UU*^d7c3PfdBMA0Rlt;E&>1m@4xuDnTY`#iy+It zkj=Uxo{Js=7YIb4AH-OJBuH z&r1e6>Vz96j6NUKOVhuCRb2jcT(T6<-g-RKVNE-v%ur*CsnwO_j@FTCjbmHdPk-n? zDF2V-X}m4TOh?LC8c~OMi<7-Q0_1qrgJSi|x42ndd!NS}nb`@&phvAPtd;mmu`Fl- z{8*!na+g7~6KcY!`$t^aCg!yD=Dd?$bK2Qeq+2%o-pBWl&ZD(!Hb}sLwb!|2>#))n zDFkziRE921dL`cVqh}(p#2mCmL2bw@LKX}!x7ji#m#v%&t zg(6rWnR5KB165?xF@;I5 zXh4v+VV>8EjQbmF5f`ll>tCIy;3)UvifR65;$Oq5quQZy-WvP4q))WPt=2OqC=MF?Umzjmtz_gtCSjLp|oW zPqLZS>RQTR*80 z#jHf=i0uKoKB#2%ZGLiahuXk@hN|e-5_rm*JNcPH%jWT*h3U`0y7tQp+kLkTkC*es zKeI;U50h9qIhQox#MUSQY(*AfIEBW?kcd8k0c4s@Ok8 z){dw;>;k0jF-%n_qH-sUZH@Ycgck+}|8)Ra*w()pC71sE?wo1JzJaN!oqIpwV8*E< zQK=?p%L}<6WP%E0HNF?PIBc3!5v#GSTxJW<;`Rrcv{+5wee@W?XdhtwDLGO+I=?ux z*ioo@Ja1eA<*j@&^Od?l3%2w}o~hhyp8im;9%9+;v(C2_iC2y`-U*D9xqs?S+wYjD zvpf=FiF5Kc+SKj_s$YW=T{5=MArZL;&$U8NE{DR$G<(g~y_;ERj|Ibh_zLP&2A+hl zLd?m)!JPgaz7q4PVC+)0SV?$QqNg@E*^mk>^c08;v!Az5rEF&fYN00@*q;8P1Wx|Q zmIhBU8)5omXwa&lapOX_4$6ltAp{8FOX&H&p(7RT1 zBnqi{Jx$JrfPpFhNQl_Dpx;5+-V9+F;L zjYpU-oRi%Hr(Yv+p(1s>n~bHqfSn3HE(P)M8t~ZZ`>*_q>W4l1isC`YmlHUWnOjAb#kk_UIxfgednQc*-u|eo z97c8bOd{Ri|K)o#^AGRKx_0{JUIk;6jc`}4-qVGtXHu2Ru1>HR4R%dA_Y+#|((+_4 zZs8Tj;^A5nLcF7-;k)ehhNB)ULa5zzfM}9paE=;L5kPEDLCm@nUWKq@(>szn@~6+i zoQXCaeW=_Wobx*YA5fcx|I{Ycs%+S-Ll@^@^7^@2YsoS-^vvcHS#1io$qlaEEB~qV zZIwB!s&lHZP@aA(Q0`fvh%C_0{a#~S7|j5qHK+CM0kWsEvP&`GLEA?WzguQ8Ns@}| zb@|zkj2>E2+O%CRV3V$5&$XmF>1lk-5;3k^ck+4`yeBc1JhMd!%#GRDPUpKJW$D3B zP}<0O9NA#dn3SFNdI*0&_l=V1Si5hUKG0?xo+W3ip^?x!)5LDuai5&{W}$yRYQ2vY zVK5csEv%+KMX%i>6yFG{IJHzeZd4ti=qh(sAFmn(c9T8oY$p=q#B9IVX#F5N1sK|7vG9xPm~*~ zjPhM03*G2wMse0Rk2uOw4N-+RQeqs82Sc{6tbo`{=LIX9(C?Nv&lC5fLtRe`*@-}RlT~ zt9{$r?y-xzdpgttSYDv4bY3~ir&YL(*!fHg8;mR7=5V@3{0S&^%$WSP4*aD<tU^kyjsWjs=Ek1jSDI@P%SkxW6 z;e9&Unxr|Wc?%v8AIsn%lw#Bk0R;{m&q~a6=;amKj+GZ5QjJW?+31?m(TlFpahJuV z0pd_kGlspw`Oa|?4e~`+a#-2-;kyIQ+JQz`v~1L8VBP*dJ z&jR&G|MP?RcCYO*yrOt9DFD(pf8rmcuXzkjdngCpckiu_MgnH4AGxPyYhx#g1( zHIV#XTllxN2)6b#Co{n}0oRY7Z255%(XK3cBH7rxU4%;AZyl2o?=$!QOcc%6xcP0J zhI@^}eaV`$i!N~`l841VjmqI z9~L!E4^Q$f($!W_?61g}g5N<<-^PANfbP48!3B2@5Jfz}_|U%{p*HpS2sG{ZxrZ8- zvJq8j7g+S=^|Xt~yV7)6O{+TZrT8DA!i6wEykQjJ#wh1()YeN(rXSMDsz6t~Ad`Qo z+Ur{K*e!sN@G@DyBfSdS(Wm>@3D!OLM~vH<1Eo~Xs^E?J(9}v>zwDe4Sd-JI_b>*9 z=(4mc_S^IplCD*cZ?8lpq|+;kcoI$D$($IN7q-~|11UqP%irl%;J%!H04mZPS-LRd z#8BYnaC@=2pu-WJAVBfwMOt|K%+y1VSste#qBY2&u1@)|BK-_OC6PPFZ+(p`qVs?~ ze?P8&+iAp5U7B*s$ToH=gsrqm_F)L1pwmanm8oge8(Wpa7zv4MZw^lcD~l~yCdi)bGCpuj05WJQG$V_#Zb@-$9dRb z=YmLB!%LbcID}%22z{Y zPG97}#s)g%Mq}OQUMS@9DvOJhV|<27Z0}(#@!qAJJ<}_cQ#+n`dty!#!-0DgU+K1b zypk&oetXbOR_8uq45n!q$n3La=&XwLXAGXYCm8pqZ4sB7&=J%71EcJP5dEf@Rt;FH zQ183CQo)b@@QX6=6KF@NgBc{h>GED$?(GCdRK!QuNZf{QU!DQpOpD$=k>s+z-Cx4| zcMqOl<&!4A?z|OI+zpBO5f$;-aNaU~N%6y0+fx0=t^QF>h?WIW5QNi}>z3$Tm9K1$QWV(roQe5${&NSEv^uYlsI608x@!BOknvuAI;Z@S-%hAOxB-KgZNw@P^_ zJHcG3jOa>fa8Y`?=aV~Tq9c;89$E5%LJ=8NRvH`NZ|f?niQlAMrKIVZ?9W#_UTkil zM>t1>n-Tk%#%e%a>Y z&9+3vzl1MM(FK=3r?xnHc{rVmW)#<&_Lr>Ln@%=>zh`iiS3nFkpE$yUZMhod7v>(^ zc)^cNxbC!|be|PWjXEW*0wKDZ?&+Sf9+$N|eNXm2yHijVieA}^!SmI#*;Ru(s}=eB zwIF4`+m=sylMOWw$|)@rrr2VFjeNT@)#kyJ4zW4E!eP;E&kMV+7UVwFraXGbCJCcr z{6r(o3EGUi>l*j?9Xc}2$W~9}wcwJc&hq{ste+(SAfkgWG9UN45eZ4a@F;Er#`Mzt zm6=2%ZOQ#jHdsVy6HztHx&+aofh(@98g`1w9dIg(eEkCAdg>9>o8SKQPCB6l5l>++ zxR^f@yvyify3W!)M89Kp^tRMG{vHNfFntH=x`mbNi z`NL~!t26kn(X|~shey@fLX&G2JkurkW~B^x@G?LuVCX@d-#roM`52=CCFoyHEwGu) z)SZ1d#qI6xcDE+->sXE?+!gI9YQSvV<6uGBcb1?)z|Ds5*Rsm3bAMJ{?g3>EryeM( zAbN^MJh3NX9_*CPr1WPIi)bG$Wq|`z*sI6^cp^BdaOKkK7O9+Av3C4Xy!qaprnq|$xvwYQ+!_Xl@zWaIB%JM2mf_1Q#b9wXrkXU+^2^1JCnfF%*tau(@nFU$db3}I zB&WXAUT|gMCn7a)_p`c;&>eP$l^<_qdIFV(dwtVL+)X9b#kN#Eh!##$oa7?TR<=QM z)4UBBlJ-e(Q0XO16ml%_D>h>?D^r3Y&G_J9O`rZX4wIVJ zx8hHBoKnh-G=3fM*bn08{FNyVA#70+bITyTPrkgIzzC5>`tLFLl+&wj!|Vw8#YF+h z9}y&VSqauoq64HW_VQ5pW3J4-=R^L0mhT%KFLziyTe-C>SVTBvz_&hJ#b_v zT;op{WlyzyMrm7;~n5lD}P(M-*+feL4^ME3FdhTIHD2feX733-Iy=r!Fi=4n8f!xdC z+K#^y#Fu71{o{JN**0gW?~STn3u!gqcL#oTV_I~<18^Hb554)$bx&UmbzVza3qF46 zUYylTmNI0*@0^#O`NLbe<8PeiD}X5mB&8SgHbz7V6Ox>%wZZRs>YE(9BcNj@gUQwN z$Lw2VAL5U3qEkf z(r>_r{*AS9M@>v59-hjsJx||`$yj25SxO~XlFOoQ4X631KW}au?wH}d;8U8R+R7nu z{_dK9-)U|Z!K0~n%jsFJwob;#cxf5=zRqdpkRS^b9WGm38gj*p&dc%9mhMUIkf3Ql z)GqQnZ^KY{%++2RE?03)-?)#};=MG(@n5_7300ArxNybcRDX)7W4O@R^rNCAdgAY% zJT7_iRn$jksqfLD9A7Gy(II@yMl?%y!dbtoy^>6s{SqM?DWNGelNH4T6)jKoOFCP9 z&$PkZ{xSFaTdzFH*lVHBKWJ(S-{L;LhY=;J2_w`09mQu-(8V@`sABgvv>8J$pw@~Q zE{852r4z(8l=uqKMZOB%vM2D%6cu3CQKA*jXsvy8Y%;Vk z)R_CiWdnJItGes)#;p^JJuLHWmpyVCU$1_nyT=={cjKB)@fQoG8P?v2zfBfj nsdL}<3g1cn{lEVCzkP_f*mVEU!#rH*Kd44`O!Uw?E(!kwMh#gq literal 0 HcmV?d00001 diff --git a/OmsiHook/OmsiHook.cs b/OmsiHook/OmsiHook.cs index 95e5908..3e04aa7 100644 --- a/OmsiHook/OmsiHook.cs +++ b/OmsiHook/OmsiHook.cs @@ -70,7 +70,7 @@ public class OmsiHook /// /// /// - public event EventHandler OnMapChange; + public event EventHandler OnMapChange; /// /// An event raised when Omsi has loaded or unloaded a new map. The EventArgs is a boolean representing whether the map is loaded. /// @@ -149,7 +149,7 @@ public D3DTexture CreateTextureObject() return new D3DTexture(omsiMemory, 0); } - private void OmsiHook_OnMapChange(object sender, EventArgs e) + private void OmsiHook_OnMapChange(object sender, OmsiMap e) { Task.Run(() => { while(!isD3DReady) @@ -223,7 +223,7 @@ private void MonitorStateTask() if(lastMapState != currentMapName) { if(currentMapName != 0) - OnMapChange?.Invoke(this, new()); + OnMapChange?.Invoke(this, Globals.Map); lastMapState = currentMapName; } if(lastMapLoaded != currentMapLoaded) diff --git a/OmsiHook/OmsiHook.csproj b/OmsiHook/OmsiHook.csproj index d6c43c6..b97d414 100644 --- a/OmsiHook/OmsiHook.csproj +++ b/OmsiHook/OmsiHook.csproj @@ -3,16 +3,16 @@ net6.0-windows Thomas Mathieson et al - Copyright Thomas Mathieson 2023 all rights reserved + Copyright Thomas Mathieson 2022-2024 all rights reserved https://github.com/space928/Omsi-Extensions https://github.com/space928/Omsi-Extensions OmsiHook is a simple library for hooking into Omsi's memory for modding. true true - 2.4.3.1 - 2.4.3.1 - 2.4.3 + 2.4.4.1 + 2.4.4.1 + 2.4.4 LGPL-3.0-only False README.md @@ -22,18 +22,34 @@ disable x86 False + Debug;Release;ReleaseAndDocs - - - true - $(MSBuildProjectDirectory)/docs/docfx.json - $(MSBuildProjectDirectory)/docs/_site - $(MSBuildProjectDirectory)/docs - $(MSBuildProjectDirectory)/docs/docfx_log.txt - Info - + + + + + + <_ConfigurationNormalized>$(Configuration) + false + + + + + <_ConfigurationNormalized>Release + $(MSBuildProjectDirectory)/bin/$(Platform)/Release/$(TargetFramework)/ + $(MSBuildProjectDirectory)/bin/$(Platform)/Release/ + + true + $(MSBuildProjectDirectory)/docs/docfx.json + $(MSBuildProjectDirectory)/docs/_site + $(MSBuildProjectDirectory)/docs + $(MSBuildProjectDirectory)/docs/docfx_log.txt + Info + + + @@ -45,22 +61,22 @@ True \ - + PreserveNewest True \lib\net6.0 - + PreserveNewest True \lib\net6.0 - + PreserveNewest True \lib\net6.0 - + PreserveNewest True \lib\net6.0 @@ -85,7 +101,7 @@ - + diff --git a/OmsiHook/docs/articles/examples/Event_Sample.md b/OmsiHook/docs/articles/examples/event-sample.md similarity index 94% rename from OmsiHook/docs/articles/examples/Event_Sample.md rename to OmsiHook/docs/articles/examples/event-sample.md index 4805cfd..9db7a42 100644 --- a/OmsiHook/docs/articles/examples/Event_Sample.md +++ b/OmsiHook/docs/articles/examples/event-sample.md @@ -19,12 +19,13 @@ omsi.OnOmsiLostD3DContext += Omsi_OnOmsiLostD3DContext; ## Event Descriptions The events all provide the current `OMSIHook` object as well as several of them provide references to the object that has changed. + ### _MapChange_ Event Triggered any time the current map has changed. ```cs -Omsi_OnMapChange(object? sender, EventArgs e) +Omsi_OnMapChange(object? sender, OmsiMap e) ``` -The `sender` object as with all the other events refers to the current `OMSIHook` object, the `e` object is not used for this event. +The `sender` object as with all the other events refers to the current `OMSIHook` object, the `e` object is a reference to the new `OmsiMap` object or `null`. ### _MapLoaded_ Event Triggered any time a map is loaded or unloaded. diff --git a/OmsiHook/docs/articles/toc.yml b/OmsiHook/docs/articles/toc.yml index 7a5c830..89d1cc9 100644 --- a/OmsiHook/docs/articles/toc.yml +++ b/OmsiHook/docs/articles/toc.yml @@ -11,4 +11,4 @@ - name: Basic Mouse Trigger & Sound Trigger Example href: examples\triggers-sample.md - name: Basic Events Example - href: examples\Event_Sample.md \ No newline at end of file + href: examples\event-sample.md \ No newline at end of file diff --git a/README.md b/README.md index 721c612..36cd720 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Omsi hooking and modding sdk. [![.NET](https://github.com/space928/Omsi-Extensions/actions/workflows/dotnet.yml/badge.svg)](https://github.com/space928/Omsi-Extensions/actions/workflows/dotnet.yml) -[![DocFX](https://github.com/space928/Omsi-Extensions/actions/workflows/docs.yml/badge.svg)](https://github.com/space928/Omsi-Extensions/actions/workflows/docs.yml) +[![DocFX](https://github.com/space928/Omsi-Extensions/actions/workflows/docs.yml/badge.svg)](https://space928.github.io/Omsi-Extensions/index.html) [![Nuget](https://img.shields.io/nuget/v/omsihook)](https://www.nuget.org/packages/OmsiHook/) [![OMSI Version](https://img.shields.io/badge/OMSI%20Version-2.3.004-orange)](https://store.steampowered.com/app/252530/OMSI_2_Steam_Edition/) @@ -25,9 +25,9 @@ class Program { static void Main(string[] args) { - // Create an OmsiHook and attach to any running instance of Omsi + // Create an OmsiHook and attach to any running instance of OMSI OmsiHook.OmsiHook omsi = new(); - omsi.AttachToOMSI(); + omsi.AttachToOMSI().Wait(); while (true) { @@ -35,7 +35,7 @@ class Program var pos = omsi.Globals.PlayerVehicle.Position; // Print the position to the console - Console.WriteLine($"Player vehicle pos: x:{pos.x:F3}\ty:{pos.y:F3}\tz:{pos.z:F3}"); + Console.WriteLine($"Player vehicle pos: {pos}"); Thread.Sleep(500); } @@ -52,6 +52,8 @@ Here's a summary of the project structure: ``` \Omsi-Extensions\ ┃ +┠─► \_OmsiHookExamples\ -> A collection of sample projects demonstrating various OmsiHook +┃ features. ┠─► \OmsiHook\ -> Base library containing all the Omsi hooking code and ┃ exposing Omsi's internal data. ┠─► \OmsiHookInvoker\ -> C++ plugin for invoking native Omsi methods from OmsiHook, @@ -63,7 +65,7 @@ Here's a summary of the project structure: ┠─► \OmsiExtensionsUI\ -> Example Avalonia UI (similar to WPF) application that uses ┃ OmsiHook; runs outside of Omsi. ┖─► \OmsiHookPlugin\ -> Example plugin that uses OmsiHook and compiles to a native - Omsi plugin by using DNNE. + Omsi plugin by using DNNE. ``` ## Building diff --git a/_OmsiHookExamples/Event_Sample/Event_Sample.csproj b/_OmsiHookExamples/EventSample/EventSample.csproj similarity index 60% rename from _OmsiHookExamples/Event_Sample/Event_Sample.csproj rename to _OmsiHookExamples/EventSample/EventSample.csproj index f900fe8..1b40390 100644 --- a/_OmsiHookExamples/Event_Sample/Event_Sample.csproj +++ b/_OmsiHookExamples/EventSample/EventSample.csproj @@ -1,16 +1,17 @@ - + Exe net6.0-windows enable enable - Event_Sample.Program + EventSample.Program x86 + x86 - + diff --git a/_OmsiHookExamples/Event_Sample/Program.cs b/_OmsiHookExamples/EventSample/Program.cs similarity index 85% rename from _OmsiHookExamples/Event_Sample/Program.cs rename to _OmsiHookExamples/EventSample/Program.cs index e6ef41e..b724624 100644 --- a/_OmsiHookExamples/Event_Sample/Program.cs +++ b/_OmsiHookExamples/EventSample/Program.cs @@ -2,7 +2,7 @@ using System.Threading; using OmsiHook; -namespace Event_Sample +namespace EventSample { // Most Basic example of reading various values exposed by OMSIHook class Program @@ -14,6 +14,9 @@ static void Main(string[] args) OmsiHook.OmsiHook omsi = new(); omsi.AttachToOMSI().Wait(); + + Console.WriteLine("Waiting for events..."); + omsi.OnMapChange += Omsi_OnMapChange; omsi.OnMapLoaded += Omsi_OnMapLoaded; omsi.OnActiveVehicleChanged += Omsi_OnActiveVehicleChanged; @@ -48,13 +51,10 @@ private static void Omsi_OnMapLoaded(object? sender, bool e) Console.WriteLine($"🗺️ Map Loaded: {e}"); } - private static void Omsi_OnMapChange(object? sender, EventArgs e) + private static void Omsi_OnMapChange(object? sender, OmsiMap e) { - if (sender != null) - { - var omsi = sender as OmsiHook.OmsiHook; - Console.WriteLine($"🗺️ Map Changed: {omsi.Globals.Map.FriendlyName}"); - } + if (e != null) + Console.WriteLine($"🗺️ Map Changed: {e.FriendlyName}"); } private static void Omsi_OnActiveVehicleChanged(object? sender, OmsiRoadVehicleInst e) From 1b0835e1af23228802a5fe1cd95fcdae6a7ce5b6 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Tue, 2 Jan 2024 12:53:19 +0100 Subject: [PATCH 20/36] + Remove absolute path --- _OmsiHookExamples/Video_Demo/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_OmsiHookExamples/Video_Demo/Program.cs b/_OmsiHookExamples/Video_Demo/Program.cs index 90d1e37..59b7f7d 100644 --- a/_OmsiHookExamples/Video_Demo/Program.cs +++ b/_OmsiHookExamples/Video_Demo/Program.cs @@ -10,7 +10,7 @@ namespace Video_Demo class Program { const string VIDEO_PATH = @"sample.mp4"; - const string FFMPEG_PATH = @"C:\Users\AdamM\source\repos\space928\Omsi-Extensions\_OmsiHookExamples\Video_Demo\bin\Debug\net6.0-windows\ffmpeg-shared\bin"; + const string FFMPEG_PATH = @"ffmpeg-shared\bin"; const int ST_INDEX = 0; static void Main(string[] args) { From 1192a94b70b9cfa8a25f6cc74a0551080045fe29 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Tue, 2 Jan 2024 18:34:24 +0100 Subject: [PATCH 21/36] + thomas complains --- _OmsiHookExamples/Video_Demo/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_OmsiHookExamples/Video_Demo/Program.cs b/_OmsiHookExamples/Video_Demo/Program.cs index 59b7f7d..1d7e2ef 100644 --- a/_OmsiHookExamples/Video_Demo/Program.cs +++ b/_OmsiHookExamples/Video_Demo/Program.cs @@ -9,7 +9,7 @@ namespace Video_Demo { class Program { - const string VIDEO_PATH = @"sample.mp4"; + const string VIDEO_PATH = @"https://adam.mathieson.dev/sample.mp4"; const string FFMPEG_PATH = @"ffmpeg-shared\bin"; const int ST_INDEX = 0; static void Main(string[] args) From 159ad921bababe472d2a1095b9552e7027c5e3a8 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Wed, 3 Jan 2024 11:12:07 +0100 Subject: [PATCH 22/36] + Video Demo Rename --- OmsiExtensions.sln | 72 ++++++++++++++++++- .../{Video_Demo.csproj => VideoDemo.csproj} | 0 2 files changed, 71 insertions(+), 1 deletion(-) rename _OmsiHookExamples/Video_Demo/{Video_Demo.csproj => VideoDemo.csproj} (100%) diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index 0772b60..0d46243 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -23,69 +23,138 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{3F EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TriggersSample", "_OmsiHookExamples\TriggersSample\TriggersSample.csproj", "{1DF326AE-4D10-4545-B36A-5622B76987EC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoDemo", "_OmsiHookExamples\Video_Demo\Video_Demo.csproj", "{D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VideoDemo", "_OmsiHookExamples\Video_Demo\VideoDemo.csproj", "{D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU Release|x86 = Release|x86 + ReleaseAndDocs|Any CPU = ReleaseAndDocs|Any CPU ReleaseAndDocs|x86 = ReleaseAndDocs|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|Any CPU.ActiveCfg = Debug|x86 + {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|Any CPU.Build.0 = Debug|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|x86.ActiveCfg = Debug|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|x86.Build.0 = Debug|x86 + {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|Any CPU.ActiveCfg = Release|x86 + {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|Any CPU.Build.0 = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.ActiveCfg = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.Build.0 = Release|x86 + {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|Any CPU.ActiveCfg = ReleaseAndDocs|x86 + {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|Any CPU.Build.0 = ReleaseAndDocs|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|x86.ActiveCfg = ReleaseAndDocs|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|x86.Build.0 = ReleaseAndDocs|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|Any CPU.ActiveCfg = Debug|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|Any CPU.Build.0 = Debug|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.ActiveCfg = Debug|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.Build.0 = Debug|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.Release|Any CPU.ActiveCfg = Release|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.Release|Any CPU.Build.0 = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.ActiveCfg = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.Build.0 = Release|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|Any CPU.Build.0 = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|x86.Build.0 = Release|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.ActiveCfg = Debug|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.Build.0 = Debug|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x86.ActiveCfg = Debug|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x86.Build.0 = Debug|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|Any CPU.ActiveCfg = Release|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|Any CPU.Build.0 = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.ActiveCfg = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.Build.0 = Release|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|Any CPU.Build.0 = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|x86.Build.0 = Release|x86 + {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|Any CPU.ActiveCfg = Debug|x86 + {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|Any CPU.Build.0 = Debug|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x86.ActiveCfg = Debug|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x86.Build.0 = Debug|x86 + {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|Any CPU.ActiveCfg = Release|x86 + {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|Any CPU.Build.0 = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|x86.ActiveCfg = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|x86.Build.0 = Release|x86 + {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|x86 + {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|Any CPU.Build.0 = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|x86.Build.0 = Release|x86 + {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|Any CPU.Build.0 = Debug|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|x86.ActiveCfg = Debug|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|x86.Build.0 = Debug|Win32 + {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|Any CPU.ActiveCfg = Release|Win32 + {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|Any CPU.Build.0 = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|x86.ActiveCfg = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|x86.Build.0 = Release|Win32 + {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|Win32 + {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|Any CPU.Build.0 = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|x86.ActiveCfg = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|x86.Build.0 = Release|Win32 + {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|Any CPU.Build.0 = Debug|Any CPU {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|x86.ActiveCfg = Debug|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|x86.Build.0 = Debug|x86 + {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|Any CPU.Build.0 = Release|Any CPU {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.Build.0 = Release|x86 + {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|Any CPU + {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|Any CPU.Build.0 = Release|Any CPU {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|x86.Build.0 = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.ActiveCfg = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.Build.0 = Debug|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.ActiveCfg = Debug|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.Build.0 = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.Build.0 = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.Build.0 = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|Any CPU.Build.0 = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|x86.Build.0 = Release|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|Any CPU.ActiveCfg = Debug|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|Any CPU.Build.0 = Debug|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.ActiveCfg = Debug|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.Build.0 = Debug|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|Any CPU.ActiveCfg = Release|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|Any CPU.Build.0 = Release|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.ActiveCfg = Release|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.Build.0 = Release|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|Any CPU.Build.0 = Release|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|x86.Build.0 = Release|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|Any CPU.ActiveCfg = Debug|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|Any CPU.Build.0 = Debug|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|x86.ActiveCfg = Debug|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|x86.Build.0 = Debug|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|Any CPU.ActiveCfg = Release|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|Any CPU.Build.0 = Release|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|x86.ActiveCfg = Release|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|x86.Build.0 = Release|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|Any CPU.Build.0 = Release|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|x86.Build.0 = Release|x86 + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x86.ActiveCfg = Debug|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x86.Build.0 = Debug|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|Any CPU.Build.0 = Release|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x86.ActiveCfg = Release|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x86.Build.0 = Release|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|Any CPU.Build.0 = Release|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|x86.ActiveCfg = Release|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -94,6 +163,7 @@ Global {BA833C68-E8BD-4C86-9555-85542DF02015} = {3F0BF441-D76C-4E0D-A5A8-B20895438EA5} {47659503-9923-4E74-AD26-103C1F9FF2B0} = {3F0BF441-D76C-4E0D-A5A8-B20895438EA5} {1DF326AE-4D10-4545-B36A-5622B76987EC} = {3F0BF441-D76C-4E0D-A5A8-B20895438EA5} + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96} = {3F0BF441-D76C-4E0D-A5A8-B20895438EA5} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A5F55305-C8FF-444C-9B98-FD487ADC583A} diff --git a/_OmsiHookExamples/Video_Demo/Video_Demo.csproj b/_OmsiHookExamples/Video_Demo/VideoDemo.csproj similarity index 100% rename from _OmsiHookExamples/Video_Demo/Video_Demo.csproj rename to _OmsiHookExamples/Video_Demo/VideoDemo.csproj From 338e030ac979d3e159ed70eb4526edc56bc37159 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Thu, 4 Jan 2024 00:35:25 +0100 Subject: [PATCH 23/36] Consts (#87) * + Const files & Curves * + Curve Calulations are improved * + Thomas is a little pedantic --- .../WrappedOmsiClasses/OmsiComplMapObj.cs | 9 ++- .../WrappedOmsiClasses/OmsiComplMapObjInst.cs | 58 +++++++++++++++++++ OmsiHook/WrappedOmsiClasses/OmsiConstBlock.cs | 26 +++++++++ 3 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 OmsiHook/WrappedOmsiClasses/OmsiConstBlock.cs diff --git a/OmsiHook/WrappedOmsiClasses/OmsiComplMapObj.cs b/OmsiHook/WrappedOmsiClasses/OmsiComplMapObj.cs index 7e88626..b7944e5 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiComplMapObj.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiComplMapObj.cs @@ -190,12 +190,11 @@ public OmsiXPC_CreateReturn Script_Return get => Memory.ReadMemory(Address + 0x208); set => Memory.WriteMemory(Address + 0x208, value); } */ - /* TODO: - public OmsiXPC_ConstBlock Script_ConstBlock + + public OmsiConstBlock Script_ConstBlock { - get => Memory.ReadMemory(Address + 0x220); - set => Memory.WriteMemory(Address + 0x220, value); - } */ + get => Memory.ReadMemoryObject(Address, 0x220, false); + } public D3DMatrix[] AttatchmentPnts { get => Memory.ReadMemoryStructArray(Address + 0x224); diff --git a/OmsiHook/WrappedOmsiClasses/OmsiComplMapObjInst.cs b/OmsiHook/WrappedOmsiClasses/OmsiComplMapObjInst.cs index 6743b46..f4e8d89 100644 --- a/OmsiHook/WrappedOmsiClasses/OmsiComplMapObjInst.cs +++ b/OmsiHook/WrappedOmsiClasses/OmsiComplMapObjInst.cs @@ -11,6 +11,10 @@ public class OmsiComplMapObjInst : OmsiPhysObjInst private MemArrayStringDict varStrings; private MemArrayPtr publicVars; private MemArrayStringDict sVarStrings; + private MemArrayStringDict constStrings; + private MemArrayStringDict funcsStrings; + private OmsiFuncClass[] funcs; + private float[] consts; private MemArray stringVars; internal OmsiComplMapObjInst(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } @@ -24,6 +28,10 @@ internal override void InitObject(Memory memory, int address) publicVars = PublicVars; sVarStrings = ComplMapObj.SVarStrings; stringVars = ComplObjInst.StringVars; + constStrings = ComplMapObj.Script_ConstBlock.Consts_str; + funcsStrings = ComplMapObj.Script_ConstBlock.Funcs_str; + consts = ComplMapObj.Script_ConstBlock.Consts; + funcs = ComplMapObj.Script_ConstBlock.Funcs; } public uint IDCode @@ -205,6 +213,56 @@ public void SetStringVariable(string varName, string value) stringVars[index] = new(value); } + /// + /// Get a constant for an object from its name. + /// + /// Const Name + /// requested float value + /// + public float GetConst(string varName) + { + int index = constStrings[varName]; + if (index >= consts.Length || index < 0) + throw new KeyNotFoundException($"Const Variable '{varName}' not found in object. - Index Out Of Bounds"); + return consts[index]; + } + + /// + /// Get a value at a point for a predifined curve for an object from its name. + /// + /// Const Name + /// X Coordinate to read on curve + /// requested float value + /// + public float GetCurve(string varName, float x) + { + int index = funcsStrings[varName]; + if (index >= consts.Length || index < 0) + throw new KeyNotFoundException($"Curve Variable '{varName}' not found in object. - Index Out Of Bounds"); + + var curve = funcs[index].Pnts; + for (int i = 0; i < curve.Length - 1; i++) + { + float x1 = curve[i].x; + float y1 = curve[i].y; + + float x2 = curve[i + 1].x; + float y2 = curve[i + 1].y; + + if (x >= x1 && x <= x2) + { + // Perform linear interpolation + float y = y1 + (x - x1) * (y2 - y1) / (x2 - x1); + return y; + } + } + if (x <= curve[0].x) + return curve[0].y; + if (x >= curve[curve.Length-1].x) + return curve[curve.Length - 1].y; + return float.NaN; + } + /// public async void SoundTrigger(string trigger, string filename) { diff --git a/OmsiHook/WrappedOmsiClasses/OmsiConstBlock.cs b/OmsiHook/WrappedOmsiClasses/OmsiConstBlock.cs new file mode 100644 index 0000000..1ce9e6c --- /dev/null +++ b/OmsiHook/WrappedOmsiClasses/OmsiConstBlock.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OmsiHook +{ + /// + /// An object's ConstFile Structure + /// + public class OmsiConstBlock : OmsiObject + { + internal OmsiConstBlock(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } + public OmsiConstBlock() : base() { } + public float[] Consts => Memory.ReadMemoryStructArray(Address + 0x4); + + private MemArrayStringDict consts_str; + public MemArrayStringDict Consts_str => consts_str ??= new (Memory, Address + 0x8, true); + + public OmsiFuncClass[] Funcs => Memory.ReadMemoryObjArray(Address + 0xc); + + private MemArrayStringDict funcs_str; + public MemArrayStringDict Funcs_str => funcs_str ??= new(Memory, Address + 0x10, true); + } +} From faff9a20e266619754166226d23a6c2cdfd8e1aa Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Thu, 4 Jan 2024 01:22:54 +0100 Subject: [PATCH 24/36] Thomas is pedantic: - Renamed some stuff - Updated OmsiHook package version Co-authored-by: amathieson --- OmsiExtensions.sln | 2 +- _OmsiHookExamples/BasicCLI/BasicCLI.csproj | 2 +- .../TriggersSample/TriggersSample.csproj | 2 +- .../DXTextureManager.cs | 10 ++--- .../{Video_Demo => VideoDemo}/Program.cs | 38 ++++++++++--------- .../VideoDemo.csproj | 5 ++- 6 files changed, 31 insertions(+), 28 deletions(-) rename _OmsiHookExamples/{Video_Demo => VideoDemo}/DXTextureManager.cs (92%) rename _OmsiHookExamples/{Video_Demo => VideoDemo}/Program.cs (63%) rename _OmsiHookExamples/{Video_Demo => VideoDemo}/VideoDemo.csproj (73%) diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index 0d46243..f549823 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -23,7 +23,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{3F EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TriggersSample", "_OmsiHookExamples\TriggersSample\TriggersSample.csproj", "{1DF326AE-4D10-4545-B36A-5622B76987EC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VideoDemo", "_OmsiHookExamples\Video_Demo\VideoDemo.csproj", "{D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VideoDemo", "_OmsiHookExamples\VideoDemo\VideoDemo.csproj", "{D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/_OmsiHookExamples/BasicCLI/BasicCLI.csproj b/_OmsiHookExamples/BasicCLI/BasicCLI.csproj index 5875e3c..c66fed0 100644 --- a/_OmsiHookExamples/BasicCLI/BasicCLI.csproj +++ b/_OmsiHookExamples/BasicCLI/BasicCLI.csproj @@ -10,7 +10,7 @@ - + diff --git a/_OmsiHookExamples/TriggersSample/TriggersSample.csproj b/_OmsiHookExamples/TriggersSample/TriggersSample.csproj index b8f0151..1ee32ba 100644 --- a/_OmsiHookExamples/TriggersSample/TriggersSample.csproj +++ b/_OmsiHookExamples/TriggersSample/TriggersSample.csproj @@ -11,7 +11,7 @@ - + diff --git a/_OmsiHookExamples/Video_Demo/DXTextureManager.cs b/_OmsiHookExamples/VideoDemo/DXTextureManager.cs similarity index 92% rename from _OmsiHookExamples/Video_Demo/DXTextureManager.cs rename to _OmsiHookExamples/VideoDemo/DXTextureManager.cs index 0dea459..daf154f 100644 --- a/_OmsiHookExamples/Video_Demo/DXTextureManager.cs +++ b/_OmsiHookExamples/VideoDemo/DXTextureManager.cs @@ -1,7 +1,7 @@ using FFMediaToolkit.Decoding; using OmsiHook; -namespace Video_Demo +namespace VideoDemo { public class DXTextureManager { @@ -27,7 +27,7 @@ public void Init(OmsiHook.OmsiHook omsi) } // Method to create a Direct3D texture based on video stream information - public bool CreateTexture(VideoStreamInfo info, int script_texture_index) + public bool CreateTexture(VideoStreamInfo info, int scriptTextureIndex) { if (omsi == null || !omsi.IsD3DReady || texture == null) return false; @@ -50,12 +50,12 @@ public bool CreateTexture(VideoStreamInfo info, int script_texture_index) var scriptTexes = omsi.Globals.PlayerVehicle.ComplObjInst.ScriptTextures; // Check if the provided script_texture_index is within bounds - if (script_texture_index >= scriptTexes.Count) + if (scriptTextureIndex >= scriptTexes.Count) return false; // Update the script texture at the specified index with the new Direct3D texture information - var old = scriptTexes[script_texture_index]; - scriptTexes[script_texture_index] = new() + var old = scriptTexes[scriptTextureIndex]; + scriptTexes[scriptTextureIndex] = new() { TexPn = old.TexPn, color = old.color, diff --git a/_OmsiHookExamples/Video_Demo/Program.cs b/_OmsiHookExamples/VideoDemo/Program.cs similarity index 63% rename from _OmsiHookExamples/Video_Demo/Program.cs rename to _OmsiHookExamples/VideoDemo/Program.cs index 1d7e2ef..0fc92ea 100644 --- a/_OmsiHookExamples/Video_Demo/Program.cs +++ b/_OmsiHookExamples/VideoDemo/Program.cs @@ -5,13 +5,14 @@ using FFMediaToolkit.Graphics; using OmsiHook; -namespace Video_Demo +namespace VideoDemo { class Program { const string VIDEO_PATH = @"https://adam.mathieson.dev/sample.mp4"; const string FFMPEG_PATH = @"ffmpeg-shared\bin"; const int ST_INDEX = 0; + static void Main(string[] args) { Console.OutputEncoding = System.Text.Encoding.UTF8; @@ -19,47 +20,48 @@ static void Main(string[] args) OmsiHook.OmsiHook omsi = new(); omsi.AttachToOMSI().Wait(); - DXTextureManager texture_manager = new(); - texture_manager.Init(omsi); - var marker = false; + + DXTextureManager textureManager = new(); + textureManager.Init(omsi); + + var markerBlink = false; // Configure the FFmpeg path to accelerate the video decode FFmpegLoader.FFmpegPath = FFMPEG_PATH; - var video_file = MediaFile.Open(VIDEO_PATH, new MediaOptions() + var videoFile = MediaFile.Open(VIDEO_PATH, new MediaOptions() { VideoPixelFormat = ImagePixelFormat.Bgra32 }); - var frameBuffer = new byte[video_file.Video.Info.FrameSize.Width * video_file.Video.Info.FrameSize.Height * 4]; - var FPS = video_file.Video.Info.AvgFrameRate; + var frameBuffer = new byte[videoFile.Video.Info.FrameSize.Width * videoFile.Video.Info.FrameSize.Height * 4]; + var FPS = videoFile.Video.Info.AvgFrameRate; while (true) { - if (!texture_manager.IsReady) + if (!textureManager.IsReady) { Console.SetCursorPosition(0, 1); - if (texture_manager.CreateTexture(video_file.Video.Info, ST_INDEX)) + if (textureManager.CreateTexture(videoFile.Video.Info, ST_INDEX)) { - Console.WriteLine("💻 Successfully created a texture... " + (marker ? "🔴" : "⚫")); + Console.WriteLine("💻 Successfully created a texture... " + (markerBlink ? "🔴" : "⚫")); } else { - Console.WriteLine("💻 Trying to create texture... " + (marker ? "🔴" : "⚫")); + Console.WriteLine("💻 Trying to create texture... " + (markerBlink ? "🔴" : "⚫")); } - } - if (texture_manager.IsReady) + } else { int counter = 0; - while (video_file.Video.TryGetNextFrame(frameBuffer.AsSpan())) + while (videoFile.Video.TryGetNextFrame(frameBuffer.AsSpan())) { - texture_manager.UpdateTexture(frameBuffer); + textureManager.UpdateTexture(frameBuffer); Console.SetCursorPosition(0, 2); - Console.WriteLine("💿 Video Playing... " + (marker ? "🔴" : "⚫")); + Console.WriteLine("💿 Video Playing... " + (markerBlink ? "🔴" : "⚫")); if (counter % 10 == 0) - marker = !marker; + markerBlink = !markerBlink; counter++; Thread.Sleep((int)Math.Round((1.0 / FPS) * 1000)); } return; } - marker = !marker; + markerBlink = !markerBlink; Thread.Sleep(20); } } diff --git a/_OmsiHookExamples/Video_Demo/VideoDemo.csproj b/_OmsiHookExamples/VideoDemo/VideoDemo.csproj similarity index 73% rename from _OmsiHookExamples/Video_Demo/VideoDemo.csproj rename to _OmsiHookExamples/VideoDemo/VideoDemo.csproj index fd9d224..a9498e9 100644 --- a/_OmsiHookExamples/Video_Demo/VideoDemo.csproj +++ b/_OmsiHookExamples/VideoDemo/VideoDemo.csproj @@ -5,13 +5,14 @@ net6.0-windows enable enable - Video_Demo.Program + VideoDemo.Program x86 + x86 - + From 7466df4ae4707d4707e0b613f9459c30232bf1f6 Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Thu, 4 Jan 2024 12:42:16 +0100 Subject: [PATCH 25/36] Material upgrades among other things... (#88) * + Material Manager ! Note - MaterialMan.MaterialItems appears to remain null the whole time @space928 look at it? * Fixed some bugs & Added TextureMan: - Tidied up OmsiExtensionsCLI - MaterialMan now uses a MemArray - Implemented OmsiTextureMan - D3DTextures are now automatically initialised when constructed with a pointer - D3DTextures can now be initialised for read-only - Improved D3DVector (and related structs) ToString - Reformatted OmsiStructs - Added OmsiTextureItem * Added proper support for MyOmsiList: - Road vehicle lists are now properly supported - Fixed OmsiPathInfo - Fixed CriticalSection * Documentation improvements --------- Co-authored-by: Adam Mathieson --- OmsiExtensions.sln | 75 +------ OmsiExtensionsCLI/Program.cs | 55 +++-- OmsiHook/D3DTexture.cs | 43 +++- OmsiHook/Memory.cs | 12 +- OmsiHook/OmsiGlobals.cs | 17 +- OmsiHook/OmsiStructs.cs | 205 ++++++++++++++---- .../WrappedOmsiClasses/OmsiCSReadWrite.cs | 16 ++ .../OmsiCriticalSectionClass.cs | 19 ++ .../WrappedOmsiClasses/OmsiMaterialMan.cs | 26 +++ OmsiHook/WrappedOmsiClasses/OmsiMyOmsiList.cs | 18 ++ OmsiHook/WrappedOmsiClasses/OmsiTextureMan.cs | 18 ++ .../examples/{Video_Demo.md => video-demo.md} | 19 +- OmsiHook/docs/articles/toc.yml | 2 +- 13 files changed, 367 insertions(+), 158 deletions(-) create mode 100644 OmsiHook/WrappedOmsiClasses/OmsiCSReadWrite.cs create mode 100644 OmsiHook/WrappedOmsiClasses/OmsiCriticalSectionClass.cs create mode 100644 OmsiHook/WrappedOmsiClasses/OmsiMaterialMan.cs create mode 100644 OmsiHook/WrappedOmsiClasses/OmsiMyOmsiList.cs create mode 100644 OmsiHook/WrappedOmsiClasses/OmsiTextureMan.cs rename OmsiHook/docs/articles/examples/{Video_Demo.md => video-demo.md} (57%) diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index f549823..fd2db97 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -27,134 +27,71 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VideoDemo", "_OmsiHookExamp EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU Release|x86 = Release|x86 - ReleaseAndDocs|Any CPU = ReleaseAndDocs|Any CPU ReleaseAndDocs|x86 = ReleaseAndDocs|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|Any CPU.ActiveCfg = Debug|x86 - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|Any CPU.Build.0 = Debug|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|x86.ActiveCfg = Debug|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|x86.Build.0 = Debug|x86 - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|Any CPU.ActiveCfg = Release|x86 - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|Any CPU.Build.0 = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.ActiveCfg = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.Build.0 = Release|x86 - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|Any CPU.ActiveCfg = ReleaseAndDocs|x86 - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|Any CPU.Build.0 = ReleaseAndDocs|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|x86.ActiveCfg = ReleaseAndDocs|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|x86.Build.0 = ReleaseAndDocs|x86 - {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|Any CPU.ActiveCfg = Debug|x86 - {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|Any CPU.Build.0 = Debug|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.ActiveCfg = Debug|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.Build.0 = Debug|x86 - {28DA0165-EAA7-4171-A065-319409682BD1}.Release|Any CPU.ActiveCfg = Release|x86 - {28DA0165-EAA7-4171-A065-319409682BD1}.Release|Any CPU.Build.0 = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.ActiveCfg = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.Build.0 = Release|x86 - {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|x86 - {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|Any CPU.Build.0 = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|x86.Build.0 = Release|x86 - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.ActiveCfg = Debug|x86 - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|Any CPU.Build.0 = Debug|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x86.ActiveCfg = Debug|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x86.Build.0 = Debug|x86 - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|Any CPU.ActiveCfg = Release|x86 - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|Any CPU.Build.0 = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.ActiveCfg = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.Build.0 = Release|x86 - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|x86 - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|Any CPU.Build.0 = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|x86.Build.0 = Release|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|Any CPU.ActiveCfg = Debug|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|Any CPU.Build.0 = Debug|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x86.ActiveCfg = Debug|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x86.Build.0 = Debug|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|Any CPU.ActiveCfg = Release|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|Any CPU.Build.0 = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|x86.ActiveCfg = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|x86.Build.0 = Release|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|Any CPU.Build.0 = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|x86.Build.0 = Release|x86 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|Any CPU.Build.0 = Debug|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|x86.ActiveCfg = Debug|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|x86.Build.0 = Debug|Win32 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|Any CPU.ActiveCfg = Release|Win32 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|Any CPU.Build.0 = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|x86.ActiveCfg = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|x86.Build.0 = Release|Win32 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|Win32 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|Any CPU.Build.0 = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|x86.ActiveCfg = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|x86.Build.0 = Release|Win32 - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|Any CPU.Build.0 = Debug|Any CPU {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|x86.ActiveCfg = Debug|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|x86.Build.0 = Debug|x86 - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|Any CPU.Build.0 = Release|Any CPU {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.Build.0 = Release|x86 - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|Any CPU - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|Any CPU.Build.0 = Release|Any CPU {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|x86.Build.0 = Release|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.ActiveCfg = Debug|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|Any CPU.Build.0 = Debug|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.ActiveCfg = Debug|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.Build.0 = Debug|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.ActiveCfg = Release|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|Any CPU.Build.0 = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.Build.0 = Release|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|Any CPU.Build.0 = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|x86.Build.0 = Release|x86 - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|Any CPU.ActiveCfg = Debug|x86 - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|Any CPU.Build.0 = Debug|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.ActiveCfg = Debug|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.Build.0 = Debug|x86 - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|Any CPU.ActiveCfg = Release|x86 - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|Any CPU.Build.0 = Release|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.ActiveCfg = Release|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.Build.0 = Release|x86 - {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|x86 - {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|Any CPU.Build.0 = Release|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|x86.Build.0 = Release|x86 - {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|Any CPU.ActiveCfg = Debug|x86 - {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|Any CPU.Build.0 = Debug|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|x86.ActiveCfg = Debug|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|x86.Build.0 = Debug|x86 - {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|Any CPU.ActiveCfg = Release|x86 - {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|Any CPU.Build.0 = Release|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|x86.ActiveCfg = Release|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|x86.Build.0 = Release|x86 - {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|x86 - {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|Any CPU.Build.0 = Release|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|x86.Build.0 = Release|x86 - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x86.ActiveCfg = Debug|Any CPU - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x86.Build.0 = Debug|Any CPU - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|Any CPU.Build.0 = Release|Any CPU - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x86.ActiveCfg = Release|Any CPU - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x86.Build.0 = Release|Any CPU - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|Any CPU.ActiveCfg = Release|Any CPU - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|Any CPU.Build.0 = Release|Any CPU - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|x86.ActiveCfg = Release|Any CPU - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|x86.Build.0 = Release|Any CPU + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x86.ActiveCfg = Debug|x86 + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x86.Build.0 = Debug|x86 + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x86.ActiveCfg = Release|x86 + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x86.Build.0 = Release|x86 + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/OmsiExtensionsCLI/Program.cs b/OmsiExtensionsCLI/Program.cs index d354179..9a59d3e 100644 --- a/OmsiExtensionsCLI/Program.cs +++ b/OmsiExtensionsCLI/Program.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using System.Numerics; +using System.Reflection; using System.Threading; using OmsiHook; @@ -22,27 +23,37 @@ static void Main(string[] args) var progMan = omsi.Globals.ProgamManager; var meshes = playerVehicle?.ComplObjInst?.ComplObj?.Meshes; var meshInsts = playerVehicle?.ComplObjInst?.AnimSubMeshInsts; + var map = omsi.Globals.Map; + var cam = omsi.Globals.Camera; + var weather = omsi.Globals.Weather; + var tickets = omsi.Globals.TicketPack; + var materialMan = omsi.Globals.MaterialMan; + var textureMan = omsi.Globals.TextureMan; + var textures = textureMan?.TextureItems; + var roadVehicles = omsi.Globals.RoadVehicles; while (true) { playerVehicle ??= omsi.Globals.PlayerVehicle; - var pos = playerVehicle?.Position ?? default; - var posa = playerVehicle?.AbsPosition ?? default; - var vel = playerVehicle?.Velocity ?? default; - var map = omsi.Globals.Map; - var cam = omsi.Globals.Camera; - var camPos = cam?.Pos ?? default; - var weather = omsi.Globals.Weather; - var tickets = omsi.Globals.TicketPack; + progMan ??= omsi.Globals.ProgamManager; + meshes ??= playerVehicle?.ComplObjInst?.ComplObj?.Meshes; + meshInsts ??= playerVehicle?.ComplObjInst?.AnimSubMeshInsts; + map ??= omsi.Globals.Map; + cam ??= omsi.Globals.Camera; + weather ??= omsi.Globals.Weather; + tickets = omsi.Globals.TicketPack; + materialMan ??= omsi.Globals.MaterialMan; + textureMan ??= omsi.Globals.TextureMan; + textures ??= textureMan?.TextureItems; + roadVehicles ??= omsi.Globals.RoadVehicles; Console.SetCursorPosition(0, 0); - Console.WriteLine(($"Read data: x:{pos.x:F3} y:{pos.y:F3} z:{pos.z:F3} " + - $"tile:{playerVehicle?.Kachel ?? 0}").PadRight(Console.WindowWidth - 1)); - Console.WriteLine($"Read data: vx:{vel.x:F3} vy:{vel.y:F3} vz:{vel.z:F3}".PadRight(Console.WindowWidth - 1)); - Console.WriteLine($"Read data: ax:{posa._30:F3} ay:{posa._31:F3} az:{posa._32:F3}".PadRight(Console.WindowWidth - 1)); + Console.WriteLine($"Vehicle pos: {playerVehicle.Position} tile: {playerVehicle?.Kachel ?? 0}".PadRight(Console.WindowWidth - 1)); + Console.WriteLine($"Vehicle vel: {playerVehicle.Velocity}".PadRight(Console.WindowWidth - 1)); + Console.WriteLine($"Vehicle pos_abs: {playerVehicle.AbsPosition.Position}".PadRight(Console.WindowWidth - 1)); Console.WriteLine($"Read data: map:{map?.Name} path:{map?.Filename} friendly:{map?.FriendlyName}".PadRight(Console.WindowWidth - 1)); - Console.WriteLine($"{omsi.Globals.Time.Day}/{omsi.Globals.Time.Month}/{omsi.Globals.Time.Year} - {omsi.Globals.Time.Hour}:{omsi.Globals.Time.Minute}:{omsi.Globals.Time.Second:F2}"); - Console.WriteLine($"Camera data: x:{camPos.x:F3} y:{camPos.y:F3} z:{camPos.z:F3} ".PadRight(Console.WindowWidth - 1)); + Console.WriteLine($"Time: {omsi.Globals.Time.Day}/{omsi.Globals.Time.Month}/{omsi.Globals.Time.Year} - {omsi.Globals.Time.Hour}:{omsi.Globals.Time.Minute}:{omsi.Globals.Time.Second:F2} "); + Console.WriteLine($"Camera pos: {cam.Pos} ".PadRight(Console.WindowWidth - 1)); Console.WriteLine($"{omsi.Globals.Drivers}".PadRight(Console.WindowWidth - 1)); /*if(!dXTests.IsReady) @@ -50,14 +61,14 @@ static void Main(string[] args) if(dXTests.IsReady) dXTests.UpdateTexture();*/ - progMan ??= omsi.Globals.ProgamManager; - meshes ??= playerVehicle?.ComplObjInst?.ComplObj?.Meshes; - meshInsts ??= playerVehicle?.ComplObjInst?.AnimSubMeshInsts; - - Console.WriteLine($"[MOUSE] pos: {progMan.MausPos} ray_pos: {progMan.MausLine3DPos} ray_dir: {progMan.MausLine3DDir}".PadRight(Console.WindowWidth - 1)); - Console.WriteLine($"[MOUSE] {progMan.MausCrossObjFlat} {progMan.MausCrossObjFlat_ObjHeight} {progMan.Maus_MeshEvent}".PadRight(Console.WindowWidth - 1)); + Console.WriteLine($"[MOUSE] pos: {progMan.MausPos}".PadRight(Console.WindowWidth - 1)); + Console.WriteLine($"[MOUSE] ray_pos: {progMan.MausLine3DPos} ray_dir: {progMan.MausLine3DDir}".PadRight(Console.WindowWidth - 1)); + Console.WriteLine($"[MOUSE] mouse_mesh_event: {progMan.Maus_MeshEvent}".PadRight(Console.WindowWidth - 1)); CheckClickPos(progMan, meshes, meshInsts); + Console.WriteLine($"Loaded textures: {textures.Count}"); + Console.WriteLine($"Path id: {playerVehicle.PathInfo.path.path}"); + /*Console.WriteLine("".PadRight(Console.WindowWidth-1)); try { @@ -81,7 +92,7 @@ private static void CheckClickPos(OmsiProgMan progMan, MemArrayList /// Returns true if this object is initialised. /// - public bool IsValid => TextureAddress != 0; + public bool IsValid => TextureAddress != 0 && isCreated; + /// + /// Returns true if this texture is valid and can be written too. + /// + public bool CanWrite => IsValid && remoteStagingBufferPtr != 0; + + private volatile bool isCreated = false; + + internal override void InitObject(Memory memory, int address) + { + base.InitObject(memory, address); + // This method may be called repeadedly when marshalling an array of textures. To save performance, + // we don't await the texture creation (which reads the width/height/... of the texture) and don't + // enable writing by default. + if(address != 0) + _ = CreateFromExisting((uint)address, false); + } /// /// Initialises this from an existing IDirect3DTexture9. /// /// the address of the existing texture + /// whether to allow writing to this texture /// /// - public async Task CreateFromExisting(uint address) + public async Task CreateFromExisting(uint address, bool initialiseForWriting = true) { if (Address == 0) throw new NullReferenceException("Texture was already null!"); @@ -67,6 +84,18 @@ public async Task CreateFromExisting(uint address) Address = unchecked((int)address); stagingBufferSize = (int)width * (int)height * BitsPerPixel(format) / 8; //stagingBuffer = new byte[stagingBufferSize]; + if(initialiseForWriting) + remoteStagingBufferPtr = unchecked((uint)await Memory.AllocRemoteMemory(stagingBufferSize, fastAlloc: true)); + isCreated = true; + } + + /// + /// Initialises the texture for writing operations. + /// + public async Task InitialiseForWriting() + { + if (!IsValid) + throw new NotInitialisedException("The texture has not been created yet! Make sure to call CreateD3DTexture()."); remoteStagingBufferPtr = unchecked((uint)await Memory.AllocRemoteMemory(stagingBufferSize, fastAlloc: true)); } @@ -76,8 +105,9 @@ public async Task CreateFromExisting(uint address) /// the width of the texture /// the height of the texture /// the of the texture + /// whether to allow writing to this texture /// - public async Task CreateD3DTexture(uint width, uint height, D3DFORMAT format = D3DFORMAT.D3DFMT_A8R8G8B8) + public async Task CreateD3DTexture(uint width, uint height, D3DFORMAT format = D3DFORMAT.D3DFMT_A8R8G8B8, bool initialiseForWriting = true) { if(Address != 0) await ReleaseTexture(); @@ -92,7 +122,9 @@ public async Task CreateD3DTexture(uint width, uint height, D3DFORMAT format = D Address = unchecked((int)pTexture); stagingBufferSize = (int)width * (int)height * BitsPerPixel(format) / 8; //stagingBuffer = new byte[stagingBufferSize]; - remoteStagingBufferPtr = unchecked((uint)await Memory.AllocRemoteMemory(stagingBufferSize, fastAlloc: true)); + if (initialiseForWriting) + remoteStagingBufferPtr = unchecked((uint)await Memory.AllocRemoteMemory(stagingBufferSize, fastAlloc: true)); + isCreated = true; } /// @@ -105,6 +137,7 @@ public async Task ReleaseTexture() if(Address == 0) throw new NullReferenceException("Texture was already null!"); + isCreated = false; HRESULT hr = await OmsiReleaseTextureAsync(unchecked((uint)Address)); if(HRESULTFailed(hr)) throw new Exception(hr.ToString()); @@ -125,6 +158,8 @@ public async Task ReleaseTexture() /// public async Task UpdateTexture(Memory textureData, Rectangle? updateArea = null) where T : unmanaged { + if (!IsInitialised || remoteStagingBufferPtr == 0) + throw new NotInitialisedException("D3DTexture object must be initialised for write before it can be updated! "); if((textureData.Length * Marshal.SizeOf()) > stagingBufferSize) throw new ArgumentOutOfRangeException(nameof(textureData)); Memory.WriteMemory(remoteStagingBufferPtr, textureData); diff --git a/OmsiHook/Memory.cs b/OmsiHook/Memory.cs index f064a3b..87f0bf3 100644 --- a/OmsiHook/Memory.cs +++ b/OmsiHook/Memory.cs @@ -442,17 +442,17 @@ public T ReadMemory(int address) where T : unmanaged { int byteSize = Marshal.SizeOf(typeof(T)); if (byteSize > readBuffer.Value.Length) - throw new ArgumentException($"Couldn't read memory for object of type {typeof(T).Name} @ {address}; it wouldn't fit in the read buffer!"); + throw new ArgumentException($"Couldn't read memory for object of type {typeof(T).Name} @ 0x{address:X8}; it wouldn't fit in the read buffer!"); int bytesRead = -1; if (!Imports.ReadProcessMemory((int)omsiProcessHandle, address, readBuffer.Value, byteSize, ref bytesRead)) #if DEBUG && SILENCE_ACCESS_VIOLATION { - Debug.WriteLine($"Couldn't read {byteSize} bytes of process memory @ {address:X}!\n{new System.Diagnostics.StackTrace(true)}"); + Debug.WriteLine($"Couldn't read {byteSize} bytes of process memory @ 0x{address:X8}!\n{new System.Diagnostics.StackTrace(true)}"); return new T(); } #else - throw new MemoryAccessException($"Couldn't read {byteSize} bytes of process memory @ {address:X}!"); + throw new MemoryAccessException($"Couldn't read {byteSize} bytes of process memory @ 0x{address:X8}!"); #endif return ByteArrayToStructure(readBuffer.Value); @@ -553,10 +553,12 @@ public string ReadMemoryString(int address, bool wide = false, bool raw = false, if (pascalString) { - int strLen = ReadMemory(i - 4); + uint strLen = ReadMemory(i - 4); + if (strLen > 4096) + throw new MemoryAccessException($"Tried reading a very long string ({strLen} > 4096 characters long). This is probably not a valid string"); if(wide) strLen *= 2; - var bytes = ReadMemory(i, strLen, readBuffer.Value); + var bytes = ReadMemory(i, (int)strLen, readBuffer.Value); sb.Append(wide ? Encoding.Unicode.GetString(bytes) : Encoding.ASCII.GetString(bytes)); } else diff --git a/OmsiHook/OmsiGlobals.cs b/OmsiHook/OmsiGlobals.cs index f670d12..cef2732 100644 --- a/OmsiHook/OmsiGlobals.cs +++ b/OmsiHook/OmsiGlobals.cs @@ -16,10 +16,15 @@ public class OmsiGlobals : OmsiObject private OmsiHook hook; + private MemArrayList roadVehicles = null; + /// + /// Gets the list of active road vehicles. + /// + public OmsiMyOmsiList RoadVehicles => Memory.ReadMemoryObject>(0x00861508); /// /// Gets the vehicle instance being driven by the player. /// - public OmsiRoadVehicleInst PlayerVehicle => hook.GetRoadVehicleInst(PlayerVehicleIndex); + public OmsiRoadVehicleInst PlayerVehicle => roadVehicles == null ? (roadVehicles = RoadVehicles.FList)[PlayerVehicleIndex] : roadVehicles[PlayerVehicleIndex]; /// /// Gets the current vehicle index driven by the player. /// @@ -84,5 +89,15 @@ public class OmsiGlobals : OmsiObject /// Main Camera Object /// public OmsiCamera Camera => Memory.ReadMemoryObject(0x008616e0); + + /// + /// Central Material Manager + /// + public OmsiMaterialMan MaterialMan => Memory.ReadMemoryObject(0x00861ca8); + + /// + /// Central Texture Manager + /// + public OmsiTextureMan TextureMan => Memory.ReadMemoryObject(0x00861bc4); } } diff --git a/OmsiHook/OmsiStructs.cs b/OmsiHook/OmsiStructs.cs index 2efbd77..0929197 100644 --- a/OmsiHook/OmsiStructs.cs +++ b/OmsiHook/OmsiStructs.cs @@ -13,16 +13,27 @@ public struct D3DVector { public float x, y, z; - public override readonly string ToString() => $"[{x:F3}, {y:F3}, {z:F3}]"; + public D3DVector() + { + x = y = z = 0; + } + public D3DVector(float x, float y, float z) + { + this.x = x; + this.y = y; + this.z = z; + } + + public override readonly string ToString() => $"[{x,8:F3}, {y,8:F3}, {z,8:F3}]"; public static implicit operator Vector3(D3DVector v) => new(v.x, v.y, v.z); - public static implicit operator D3DVector(Vector3 v) => new() { x=v.X, y=v.Y, z=v.Z }; + public static implicit operator D3DVector(Vector3 v) => new() { x = v.X, y = v.Y, z = v.Z }; } public struct D3DXVector2 { public float x, y; - public override readonly string ToString() => $"[{x:F3}, {y:F3}]"; + public override readonly string ToString() => $"[{x,8:F3}, {y,8:F3}]"; } /// @@ -34,10 +45,12 @@ public struct D3DMatrix _10, _11, _12, _13, _20, _21, _22, _23, _30, _31, _32, _33; - public override readonly string ToString() => $"[ [{_00:F3}, {_01:F3}, {_02:F3}, {_03:F3}],\n" + - $"[{_10:F3}, {_11:F3}, {_12:F3}, {_13:F3}],\n" + - $"[{_20:F3}, {_21:F3}, {_22:F3}, {_23:F3}],\n" + - $"[{_30:F3}, {_31:F3}, {_32:F3}, {_33:F3}] ]"; + public override readonly string ToString() => $"[ [{_00,8:F3}, {_01,8:F3}, {_02,8:F3}, {_03,8:F3}],\n" + + $"[{_10,8:F3}, {_11,8:F3}, {_12,8:F3}, {_13,8:F3}],\n" + + $"[{_20,8:F3}, {_21,8:F3}, {_22,8:F3}, {_23,8:F3}],\n" + + $"[{_30,8:F3}, {_31,8:F3}, {_32,8:F3}, {_33,8:F3}] ]"; + + public readonly D3DVector Position => new(_30, _31, _32); public static implicit operator Matrix4x4(D3DMatrix m) { @@ -93,7 +106,7 @@ public struct D3DXQuaternion { public float x, y, z, w; - public override readonly string ToString() => $"[{x:F3}, {y:F3}, {z:F3}, {w:F3}]"; + public override readonly string ToString() => $"[{x,8:F3}, {y,8:F3}, {z,8:F3}, {w,8:F3}]"; } /// @@ -103,7 +116,7 @@ public struct D3DXPlane { public float a, b, c, d; - public override readonly string ToString() => $"[{a:F3}, {b:F3}, {c:F3}, {d:F3}]"; + public override readonly string ToString() => $"[{a,8:F3}, {b,8:F3}, {c,8:F3}, {d,8:F3}]"; } /// @@ -113,7 +126,7 @@ public struct D3DColorValue { public float r, g, b, a; - public override readonly string ToString() => $"[{r:F3}, {g:F3}, {b:F3}, {a:F3}]"; + public override readonly string ToString() => $"[{r,8:F3}, {g,8:F3}, {b,8:F3}, {a,8:F3}]"; } /// @@ -141,7 +154,7 @@ public struct OmsiPoint public int x, y; } - internal struct OmsiMaterialPropInternal + public struct OmsiMaterialPropInternal { public int mainTexture; public bool standard; @@ -151,7 +164,8 @@ internal struct OmsiMaterialPropInternal public bool horizontal; public bool water; public bool useEnvirReflx, useEnvirMask, useBumpMap, useRainDropAreaMap, - useTransMap, useTextTexture, useScriptTexture; + useTransMap; + public int useTextTexture, useScriptTexture; public int texCoordTransX, texCoordTransY; public int raindropAreaMapVar; public int alphaScale_Var; @@ -192,7 +206,8 @@ public struct OmsiMaterialProp public bool horizontal; public bool water; public bool useEnvirReflx, useEnvirMask, useBumpMap, useRainDropAreaMap, - useTransMap, useTextTexture, useScriptTexture; + useTransMap; + public int useTextTexture, useScriptTexture; public int texCoordTransX, texCoordTransY; public int raindropAreaMapVar; public int alphaScale_Var; @@ -436,17 +451,17 @@ public struct OmsiTicketPack internal struct OmsiTicketInternal { //TODO: I don't think these are decoding correctly (I saw nothing when I looked), check this actually works. - [FieldOffset(0x0)] [OmsiStrPtr(StrPtrType.RawDelphiAnsiString)] public int name; - [FieldOffset(0x4)] [OmsiStrPtr(StrPtrType.RawDelphiAnsiString)] public int name_english; - [FieldOffset(0x8)] [OmsiStrPtr(StrPtrType.RawDelphiAnsiString)] public int name_display; + [FieldOffset(0x0)][OmsiStrPtr(StrPtrType.RawDelphiAnsiString)] public int name; + [FieldOffset(0x4)][OmsiStrPtr(StrPtrType.RawDelphiAnsiString)] public int name_english; + [FieldOffset(0x8)][OmsiStrPtr(StrPtrType.RawDelphiAnsiString)] public int name_display; [FieldOffset(0xc)] public int max_stations; [FieldOffset(0x10)] public int age_min; [FieldOffset(0x14)] public int age_max; [FieldOffset(0x18)] public float value; [FieldOffset(0x1c)] public bool dayTicket; [FieldOffset(0x20)] public float propability; - [FieldOffset(0x24)] [OmsiObjPtr(typeof(D3DMeshFileObject))] public int mesh_block; - [FieldOffset(0x28)] [OmsiObjPtr(typeof(D3DMeshFileObject))] public int mesh_single; + [FieldOffset(0x24)][OmsiObjPtr(typeof(D3DMeshFileObject))] public int mesh_block; + [FieldOffset(0x28)][OmsiObjPtr(typeof(D3DMeshFileObject))] public int mesh_single; } public struct OmsiTicket @@ -713,8 +728,8 @@ internal struct OmsiPathInfoInternal [FieldOffset(0x18)] public int subPath; [FieldOffset(0x1c)] public bool reverse; [FieldOffset(0x20)] public float hdg; - [FieldOffset(0x24)] [OmsiStructPtr(typeof(uint))] public int idCode; - [FieldOffset(0x28)] [OmsiObjPtr(typeof(OmsiObject))] public int vehicle; + [FieldOffset(0x24)][OmsiStructPtr(typeof(uint))] public int idCode; + [FieldOffset(0x28)][OmsiObjPtr(typeof(OmsiObject))] public int vehicle; [FieldOffset(0x2c)] public float veloc; [FieldOffset(0x30)] public float x_L; [FieldOffset(0x34)] public float x_R; @@ -722,7 +737,7 @@ internal struct OmsiPathInfoInternal [FieldOffset(0x3c)] public float z_F; [FieldOffset(0x40)] public float radius; [FieldOffset(0x44)] public float drehpunkt; - [FieldOffset(0x48)] [OmsiStructPtr(typeof(D3DMatrix))] public int absPosition; + [FieldOffset(0x48)][OmsiStructPtr(typeof(D3DMatrix))] public int absPosition; [FieldOffset(0x4c)] public byte waitMode; [FieldOffset(0x50)] public int reserveGroup; [FieldOffset(0x54)] public byte blinker; @@ -736,7 +751,7 @@ internal struct OmsiPathInfoInternal [FieldOffset(0x68)] public int nextPath_e; [FieldOffset(0x6c)] public OmsiNextPathSegment nextPathSeg; [FieldOffset(0x94)] public OmsiNextPathID nextPathID; - [FieldOffset(0xbc)] [OmsiStructArrayPtr(typeof(OmsiPathID))] public int reservePaths; + [FieldOffset(0xbc)][OmsiStructArrayPtr(typeof(OmsiPathID), raw: true)] public int reservePaths; [FieldOffset(0xc0)] public int spurwechsel; //TODO: Check data type [FieldOffset(0xc4)] public uint spurwechselTime; [FieldOffset(0xc8)] public bool spurwechselAuto; @@ -760,7 +775,7 @@ internal struct OmsiPathInfoInternal [FieldOffset(0x100)] public bool zwangsEinsetzen; [FieldOffset(0x104)] public float normBrakedDist; [FieldOffset(0x108)] public bool allowHupen; - [FieldOffset(0x10c)] [OmsiStrPtr] public int debug_aiData_limit; + [FieldOffset(0x10c)][OmsiStrPtr(StrPtrType.RawDelphiString)] public int debug_aiData_limit; } public struct OmsiPathInfo @@ -793,7 +808,7 @@ public struct OmsiPathInfo /// /// Order /// - public byte einordnen;//TODO: Check data type + public byte einOrdnen;//TODO: Check data type public bool prevVisible_logical; //TODO: Determine actual type public int nextPath_a, nextPath_b, nextPath_c, nextPath_d, nextPath_e; @@ -828,7 +843,7 @@ public struct OmsiPathInfo /// /// Emergency vehicles /// - public bool einsatzfahrzeug; + public bool einSatzFahrzeug; /// /// Siren /// @@ -836,7 +851,7 @@ public struct OmsiPathInfo /// /// Driven by emergency? /// - public float getrieben_von_einsatz; + public float getrieben_von_einSatz; /// /// Driven by emergency time? /// @@ -1188,13 +1203,13 @@ public struct OmsiHOFTarget internal struct OmsiHOFTargetInternal { public int nummer; - [OmsiStrPtr(raw:true)] public int name; // ANSI String + [OmsiStrPtr(raw: true)] public int name; // ANSI String /// /// Terminus /// [OmsiStrPtr(raw: true)] public int endstelle; // ANSI String public int texNummer; - [OmsiStrArrayPtr(wide:true, raw:true)] public int strings; + [OmsiStrArrayPtr(wide: true, raw: true)] public int strings; public byte allExit; } @@ -1223,7 +1238,7 @@ internal struct OmsiHofFISTripInternal [OmsiStrPtr(raw: true)] public int name; // ANSI String public int target; [OmsiStrPtr(raw: true)] public int line; // ANSI String - [OmsiStrArrayPtr(raw:true)] public int busstops; + [OmsiStrArrayPtr(raw: true)] public int busstops; } public struct OmsiCollFeedback { @@ -1405,7 +1420,7 @@ internal struct OmsiDriverInternal [FieldOffset(0x54)] public uint passCount; [FieldOffset(0x58)] public uint ticket_cnt; [FieldOffset(0x5c)] public float tickets_cash; - [FieldOffset(0x60)][OmsiStructArrayPtr(typeof(OmsiPerbus),typeof(OmsiPerbusInternal), true)] public int perbus; + [FieldOffset(0x60)][OmsiStructArrayPtr(typeof(OmsiPerbus), typeof(OmsiPerbusInternal), true)] public int perbus; } public struct OmsiTTLogDetailed { @@ -1500,9 +1515,9 @@ internal struct OmsiTTTrackEntryInternal [FieldOffset(0x14)] public float dist; [FieldOffset(0x18)] public bool valid; [FieldOffset(0x19)] public byte pathOrderCheck; - [FieldOffset(0x1c)] [OmsiStructArrayPtr(typeof(int), raw: true)] public int fstrn_allowed; + [FieldOffset(0x1c)][OmsiStructArrayPtr(typeof(int), raw: true)] public int fstrn_allowed; [FieldOffset(0x20)] public int chronon_origin; - [FieldOffset(0x24)] [OmsiStrArrayPtr(raw: true)] public int chronos_bad; + [FieldOffset(0x24)][OmsiStrArrayPtr(raw: true)] public int chronos_bad; } public struct OmsiTTTrack @@ -1556,7 +1571,7 @@ internal struct OmsiTTBusstopInternal public uint IDCode_real; public int index; public int index_ownList; - [OmsiStructArrayPtr(typeof(int), raw:true)] public int index_alternatives; + [OmsiStructArrayPtr(typeof(int), raw: true)] public int index_alternatives; public float preset_Aussteiger; // Dropouts? [OmsiStruct(typeof(OmsiPathID))] public OmsiPathID pathIndex; public int trackEntry; @@ -1588,7 +1603,7 @@ internal struct OmsiTTProfileInternal [OmsiStrPtr(raw: true)] public int name; public float time_all; [OmsiStructArrayPtr(typeof(OmsiTTStopTime), raw: true)] public int stop_times; - [OmsiStructArrayPtr(typeof(float), raw:true)] public int TrackEntryTime; + [OmsiStructArrayPtr(typeof(float), raw: true)] public int TrackEntryTime; public bool serviceTrip; } @@ -1608,7 +1623,7 @@ public struct OmsiTTTrip } internal struct OmsiTTTripInternal { - [OmsiStrPtr(raw:true)] public int filename; + [OmsiStrPtr(raw: true)] public int filename; public int chrono_origin; [OmsiStrPtr(raw: true)] public int target; [OmsiStrPtr(raw: true)] public int linie; @@ -1800,10 +1815,10 @@ public struct OmsiTTLine internal struct OmsiTTLineInternal { [FieldOffset(0x0)][OmsiStrPtr(raw: true)] public int name; - [FieldOffset(0x4)]public byte userAllowed; - [FieldOffset(0x5)]public byte priority; + [FieldOffset(0x4)] public byte userAllowed; + [FieldOffset(0x5)] public byte priority; [FieldOffset(0x8)][OmsiStructArrayPtr(typeof(OmsiTTTour), typeof(OmsiTTTourInternal), raw: true)] public int tours; - [FieldOffset(0xc)]public int chrono_origin; + [FieldOffset(0xc)] public int chrono_origin; } public struct OmsiRVNumTour @@ -1937,9 +1952,13 @@ public struct OmsiScriptTex { public OmsiPoint size; } - /// - /// This is a place holder struct, confirmation of exact struct data TBC - /// + [StructLayout(LayoutKind.Explicit, Size = 0x20)] + public struct OmsiCriticalSectionInternal + { + [FieldOffset(0x00)] public RTL_CRITICAL_SECTION cs; + [FieldOffset(0x18)] [OmsiStrPtr(StrPtrType.RawDelphiString)] public int name; + [FieldOffset(0x1c)] public uint ident; + } public struct OmsiCriticalSection { public RTL_CRITICAL_SECTION cs; @@ -2019,12 +2038,12 @@ public struct OmsiFileSplinePathInfoInternal public struct OmsiBoogieInternal { [OmsiStruct(typeof(OmsiPathInfo), typeof(OmsiPathInfoInternal))] - [FieldOffset(0x0)]internal OmsiPathInfoInternal pathInfo; - [FieldOffset(0x110)]internal D3DVector pos; - [FieldOffset(0x11c)]internal D3DXVector2 y_soll; - [FieldOffset(0x124)]internal D3DXVector2 y_harmon; - [FieldOffset(0x12c)]internal float y_gleisfehler; - [FieldOffset(0x130)]internal float z_gleisfehler; + [FieldOffset(0x0)] internal OmsiPathInfoInternal pathInfo; + [FieldOffset(0x110)] internal D3DVector pos; + [FieldOffset(0x11c)] internal D3DXVector2 y_soll; + [FieldOffset(0x124)] internal D3DXVector2 y_harmon; + [FieldOffset(0x12c)] internal float y_gleisfehler; + [FieldOffset(0x130)] internal float z_gleisfehler; } public struct OmsiBoogie @@ -2044,5 +2063,97 @@ public struct OmsiPathSollwerte { public float v, x, curve_x_offset, ai_stdbrems; } + + public struct OmsiMaterialItemInternal + { + [OmsiStruct(typeof(OmsiMaterialProp), typeof(OmsiMaterialPropInternal))] + public OmsiMaterialPropInternal Properties; + } + + public struct OmsiMaterialItem + { + public OmsiMaterialProp Properties; + } + + [StructLayout(LayoutKind.Explicit, Size = 0x68)] + public struct OmsiTextureItemInternal + { + [FieldOffset(0x0)] public ushort size_x; + [FieldOffset(0x2)] public ushort size_y; + [FieldOffset(0x8)] public double mem; + [FieldOffset(0x10)] public int datasize; + [FieldOffset(0x14)] public bool dataready; + [FieldOffset(0x18)] [OmsiObjPtr(typeof(D3DTexture))] public int Texture; + [FieldOffset(0x1c)] [OmsiObjPtr(typeof(D3DTexture))] public int oldTexture; + [FieldOffset(0x20)] [OmsiStrPtr(StrPtrType.RawDelphiAnsiString)] public int path; + [FieldOffset(0x24)] [OmsiStrPtr(StrPtrType.RawDelphiAnsiString)] public int justfilename; + [FieldOffset(0x28)] [OmsiStrPtr(StrPtrType.RawDelphiAnsiString)] public int loadpath; + [FieldOffset(0x2c)] public byte loaded; + [FieldOffset(0x2d)] public byte load_request; + [FieldOffset(0x2e)] public bool managed; + [FieldOffset(0x30)] public uint failed; + [FieldOffset(0x34)] public ushort used; + [FieldOffset(0x36)] public ushort used_highres; + [FieldOffset(0x38)] public bool threadloading; + [FieldOffset(0x39)] public bool hasspecials; + [FieldOffset(0x3a)] public bool no_unload; + [FieldOffset(0x3b)] public bool onlyalpha; + [FieldOffset(0x3c)] public int NightMap; + [FieldOffset(0x40)] public int WinterSnowMap; + [FieldOffset(0x44)] public int WinterSnowfallMap; + [FieldOffset(0x48)] public int FallMap; + [FieldOffset(0x4c)] public int SpringMap; + [FieldOffset(0x50)] public int WinterMap; + [FieldOffset(0x54)] public int SummerDryMap; + [FieldOffset(0x58)] public int SurfMap; + [FieldOffset(0x5c)] public bool moisture; + [FieldOffset(0x5d)] public bool puddles; + [FieldOffset(0x5e)] public bool moisture_ic; + [FieldOffset(0x5f)] public bool puddles_ic; + [FieldOffset(0x60)] public byte surface; + [FieldOffset(0x61)] public byte surface_ic; + [FieldOffset(0x62)] public bool terrainmapping; + [FieldOffset(0x63)] public bool terrainmapping_alpha; + } + + public struct OmsiTextureItem + { + public ushort size_x; + public ushort size_y; + public double mem; + public int datasize; + public bool dataready; + public D3DTexture Texture; + public D3DTexture oldTexture; + public string path; + public string justfilename; + public string loadpath; + public byte loaded; + public byte load_request; + public bool managed; + public uint failed; + public ushort used; + public ushort used_highres; + public bool threadloading; + public bool hasspecials; + public bool no_unload; + public bool onlyalpha; + public int NightMap; + public int WinterSnowMap; + public int WinterSnowfallMap; + public int FallMap; + public int SpringMap; + public int WinterMap; + public int SummerDryMap; + public int SurfMap; + public bool moisture; + public bool puddles; + public bool moisture_ic; + public bool puddles_ic; + public byte surface; + public byte surface_ic; + public bool terrainmapping; + public bool terrainmapping_alpha; + } } diff --git a/OmsiHook/WrappedOmsiClasses/OmsiCSReadWrite.cs b/OmsiHook/WrappedOmsiClasses/OmsiCSReadWrite.cs new file mode 100644 index 0000000..e7b62d3 --- /dev/null +++ b/OmsiHook/WrappedOmsiClasses/OmsiCSReadWrite.cs @@ -0,0 +1,16 @@ +namespace OmsiHook +{ + /// + /// Base class for all lockable objects supporting read/write. + /// + public class OmsiCSReadWrite : OmsiCriticalSectionClass + { + internal OmsiCSReadWrite(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } + public OmsiCSReadWrite() : base() { } + + public OmsiCriticalSection[] LockCounter + { + get => Memory.MarshalStructs(Memory.ReadMemoryStructArray(Address + 0x24)); + } + } +} \ No newline at end of file diff --git a/OmsiHook/WrappedOmsiClasses/OmsiCriticalSectionClass.cs b/OmsiHook/WrappedOmsiClasses/OmsiCriticalSectionClass.cs new file mode 100644 index 0000000..778031e --- /dev/null +++ b/OmsiHook/WrappedOmsiClasses/OmsiCriticalSectionClass.cs @@ -0,0 +1,19 @@ +using System.Net; + +namespace OmsiHook +{ + /// + /// Base class for all lockable objects. + /// + public class OmsiCriticalSectionClass : OmsiObject + { + internal OmsiCriticalSectionClass(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } + public OmsiCriticalSectionClass() : base() { } + + public OmsiCriticalSection CS + { + get => Memory.MarshalStruct(Memory.ReadMemory(Address + 0x4)); + set => Memory.WriteMemory(Address + 0x4, Memory.UnMarshalStruct(value)); + } + } +} \ No newline at end of file diff --git a/OmsiHook/WrappedOmsiClasses/OmsiMaterialMan.cs b/OmsiHook/WrappedOmsiClasses/OmsiMaterialMan.cs new file mode 100644 index 0000000..bd87646 --- /dev/null +++ b/OmsiHook/WrappedOmsiClasses/OmsiMaterialMan.cs @@ -0,0 +1,26 @@ +namespace OmsiHook +{ + /// + /// In material manager + /// + public class OmsiMaterialMan : OmsiObject + { + internal OmsiMaterialMan(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } + public OmsiMaterialMan() : base() { } + + /// + /// Note that this field seems to be mostly unused by Omsi, hence it's always empty... + /// + public MemArray MaterialItems => new(Memory, Address + 0x4); + public D3DMaterial9 StdMaterial + { + get => Memory.ReadMemory(Address + 0x8); + set => Memory.WriteMemory(Address + 0x8, value); + } + public D3DMaterial9 ReflMaterial + { + get => Memory.ReadMemory(Address + 0x4c); + set => Memory.WriteMemory(Address + 0x4c, value); + } + } +} \ No newline at end of file diff --git a/OmsiHook/WrappedOmsiClasses/OmsiMyOmsiList.cs b/OmsiHook/WrappedOmsiClasses/OmsiMyOmsiList.cs new file mode 100644 index 0000000..6312dd0 --- /dev/null +++ b/OmsiHook/WrappedOmsiClasses/OmsiMyOmsiList.cs @@ -0,0 +1,18 @@ +using System.Net; + +namespace OmsiHook +{ + /// + /// A somewhat specialised version of a generic list; used to store road vehicles. + /// + public class OmsiMyOmsiList : OmsiCSReadWrite where T : OmsiObject, new() + { + internal OmsiMyOmsiList(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } + public OmsiMyOmsiList() : base() { } + + public MemArrayList FList => new(Memory, Address + 0x28, false); + public int FCount => Memory.ReadMemory(Address + 0x2c); + public string Name => Memory.ReadMemoryString(Address + 0x30, StrPtrType.DelphiString); + public bool FAI => Memory.ReadMemory(Address + 0x34); + } +} \ No newline at end of file diff --git a/OmsiHook/WrappedOmsiClasses/OmsiTextureMan.cs b/OmsiHook/WrappedOmsiClasses/OmsiTextureMan.cs new file mode 100644 index 0000000..4693ea0 --- /dev/null +++ b/OmsiHook/WrappedOmsiClasses/OmsiTextureMan.cs @@ -0,0 +1,18 @@ +namespace OmsiHook +{ + /// + /// The global texture manager + /// + public class OmsiTextureMan : OmsiObject + { + internal OmsiTextureMan(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { } + public OmsiTextureMan() : base() { } + + public byte LoadFlag + { + get => Memory.ReadMemory(Address + 0x4); + set => Memory.WriteMemory(Address + 0x4, value); + } + public MemArray TextureItems => new(Memory, Address + 0x8, false); + } +} \ No newline at end of file diff --git a/OmsiHook/docs/articles/examples/Video_Demo.md b/OmsiHook/docs/articles/examples/video-demo.md similarity index 57% rename from OmsiHook/docs/articles/examples/Video_Demo.md rename to OmsiHook/docs/articles/examples/video-demo.md index 6333c3f..01b3d2b 100644 --- a/OmsiHook/docs/articles/examples/Video_Demo.md +++ b/OmsiHook/docs/articles/examples/video-demo.md @@ -1,25 +1,26 @@ # Video Playback Demo -This article provides a basic understanding to a basic C# .NET example leveraging the OMSIHook library. This demo is a more advanced demo using FFMPEG's library to decode video files then pipe the frame data into OMSI's ScriptTextures. +This article provides a basic understanding to a basic C# .NET example leveraging the OMSIHook library. This demo is a more advanced +demo using FFmpeg's library to decode video files then pipe the frame data into OMSI's ScriptTextures. _This article is in direct relation to the Sample Project available [here](https://github.com/space928/Omsi-Extensions/tree/main/_OmsiHookExamples/Video_Demo)._ ![youtube.com/embed 1](https://www.youtube.com/embed/61sMzpSCn0M) ## First Steps -Before trying the project, the FFmpeg binaries need to be compiled - they should be compiled for **Win32** with shared libraries. Prebuilt binaries are available [here](https://rwijnsma.home.xs4all.nl/files/ffmpeg/). -A video file is also required to demonstraight it, MPEG4/H.264 format is reccomended however many formats are compatible with FFmpeg. +Before trying the project, the FFmpeg binaries need to be compiled - they should be compiled for **Win32** with shared libraries. +Prebuilt binaries are available [here](https://rwijnsma.home.xs4all.nl/files/ffmpeg/). A video file is also required to +demonstrate it, MPEG-4/H.264 format is recommended however many formats are compatible with FFmpeg. -Once the required resources are accuired, some configuration is needed; At the top of `Program.cs` the consts are defined as follows: +Once the required resources are acquired, some configuration is needed; At the top of `Program.cs` the consts are defined as follows: ```cs -const string VIDEO_PATH = @"sample.mp4"; // Path to the video file -const string FFMPEG_PATH = @"ffmpeg-shared\bin"; // Path to FFmpeg's Binaries -const int ST_INDEX = 0; // Script Texture index to replace +const string VIDEO_PATH = @"sample.mp4"; // Path/URL to the video file +const string FFMPEG_PATH = @"ffmpeg-shared\bin"; // Path to your FFmpeg binaries +const int ST_INDEX = 0; // The index of the Script Texture to replace ``` ## What's Going On - The main program is split in two main classes `Program` and `DXTextureManager`. - - `Program` is the entry point to the demo, it initialises OMSIHook and FFmpeg as well as loads the video file. + - `Program` is the entry point to the demo, it initialises OMSIHook and FFmpeg, and loads the video file. - `DXTextureManager` handles initialising textures in OMSI, assigning them to ScriptTextures and updating them. diff --git a/OmsiHook/docs/articles/toc.yml b/OmsiHook/docs/articles/toc.yml index 0c75bdc..f2d29ea 100644 --- a/OmsiHook/docs/articles/toc.yml +++ b/OmsiHook/docs/articles/toc.yml @@ -13,4 +13,4 @@ - name: Basic Events Example href: examples\event-sample.md - name: Video Playback Demo - href: examples\Video_Demo.md \ No newline at end of file + href: examples\video-demo.md \ No newline at end of file From 0c620c949bb83ea37fc4ea023ec45f62deef33df Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Thu, 4 Jan 2024 13:15:46 +0100 Subject: [PATCH 26/36] Consts (#89) * + Const files & Curves * + Curve Calulations are improved * + Thomas is a little pedantic From 66b33afefc3b1473466d342370fc6196f049e2c1 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Thu, 4 Jan 2024 14:02:32 +0100 Subject: [PATCH 27/36] + Remove Dependency on examples for main Release Builds --- OmsiExtensions.sln | 23 ++++++---- OmsiExtensionsCLI/OmsiExtensionsCLI.csproj | 1 + OmsiExtensionsUI/OmsiExtensionsUI.csproj | 1 + OmsiHook/OmsiHook.csproj | 2 +- OmsiHookInvoker/OmsiHookInvoker.vcxproj | 42 +++++++++++++++++++ .../OmsiHookInvoker.vcxproj.filters | 6 +++ OmsiHookPlugin/OmsiHookPlugin.cs | 2 +- OmsiHookPlugin/OmsiHookPlugin.csproj | 1 + OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj | 1 + _OmsiHookExamples/BasicCLI/BasicCLI.csproj | 1 + .../EventSample/EventSample.csproj | 1 + .../TriggersSample/TriggersSample.csproj | 1 + _OmsiHookExamples/VideoDemo/VideoDemo.csproj | 1 + 13 files changed, 73 insertions(+), 10 deletions(-) diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index fd2db97..90dac8b 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -28,70 +28,77 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 + Examples|x86 = Examples|x86 Release|x86 = Release|x86 ReleaseAndDocs|x86 = ReleaseAndDocs|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|x86.ActiveCfg = Debug|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|x86.Build.0 = Debug|x86 + {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Examples|x86.ActiveCfg = Examples|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.ActiveCfg = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.Build.0 = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|x86.ActiveCfg = ReleaseAndDocs|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|x86.Build.0 = ReleaseAndDocs|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.ActiveCfg = Debug|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.Build.0 = Debug|x86 + {28DA0165-EAA7-4171-A065-319409682BD1}.Examples|x86.ActiveCfg = Examples|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.ActiveCfg = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.Build.0 = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|x86.Build.0 = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x86.ActiveCfg = Debug|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x86.Build.0 = Debug|x86 + {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Examples|x86.ActiveCfg = Examples|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.ActiveCfg = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.Build.0 = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|x86.Build.0 = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x86.ActiveCfg = Debug|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x86.Build.0 = Debug|x86 + {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Examples|x86.ActiveCfg = Examples|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|x86.ActiveCfg = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|x86.Build.0 = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|x86.Build.0 = Release|x86 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|x86.ActiveCfg = Debug|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|x86.Build.0 = Debug|Win32 + {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Examples|x86.ActiveCfg = Examples|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|x86.ActiveCfg = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|x86.Build.0 = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|x86.ActiveCfg = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|x86.Build.0 = Release|Win32 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|x86.ActiveCfg = Debug|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|x86.Build.0 = Debug|x86 + {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Examples|x86.ActiveCfg = Examples|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.Build.0 = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|x86.Build.0 = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.ActiveCfg = Debug|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.Build.0 = Debug|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Examples|x86.ActiveCfg = Examples|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Examples|x86.Build.0 = Examples|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.Build.0 = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|x86.Build.0 = Release|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.ActiveCfg = Debug|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.Build.0 = Debug|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Examples|x86.ActiveCfg = Examples|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Examples|x86.Build.0 = Examples|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.ActiveCfg = Release|x86 - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.Build.0 = Release|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 - {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|x86.Build.0 = Release|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|x86.ActiveCfg = Debug|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|x86.Build.0 = Debug|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.Examples|x86.ActiveCfg = Examples|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.Examples|x86.Build.0 = Examples|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|x86.ActiveCfg = Release|x86 - {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|x86.Build.0 = Release|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 - {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|x86.Build.0 = Release|x86 {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x86.ActiveCfg = Debug|x86 {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x86.Build.0 = Debug|x86 + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Examples|x86.ActiveCfg = Examples|x86 + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Examples|x86.Build.0 = Examples|x86 {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x86.ActiveCfg = Release|x86 - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x86.Build.0 = Release|x86 {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj b/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj index 0bfd17a..da935e8 100644 --- a/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj +++ b/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj @@ -6,6 +6,7 @@ x86 x86 favicon.ico + Debug;Release;Examples diff --git a/OmsiExtensionsUI/OmsiExtensionsUI.csproj b/OmsiExtensionsUI/OmsiExtensionsUI.csproj index ced68a6..e884512 100644 --- a/OmsiExtensionsUI/OmsiExtensionsUI.csproj +++ b/OmsiExtensionsUI/OmsiExtensionsUI.csproj @@ -4,6 +4,7 @@ net6.0-windows enable x86 + Debug;Release;Examples diff --git a/OmsiHook/OmsiHook.csproj b/OmsiHook/OmsiHook.csproj index b97d414..dd09f15 100644 --- a/OmsiHook/OmsiHook.csproj +++ b/OmsiHook/OmsiHook.csproj @@ -22,7 +22,7 @@ disable x86 False - Debug;Release;ReleaseAndDocs + Debug;Release;ReleaseAndDocs;Examples diff --git a/OmsiHookInvoker/OmsiHookInvoker.vcxproj b/OmsiHookInvoker/OmsiHookInvoker.vcxproj index 05d662f..82565d9 100644 --- a/OmsiHookInvoker/OmsiHookInvoker.vcxproj +++ b/OmsiHookInvoker/OmsiHookInvoker.vcxproj @@ -5,6 +5,10 @@ Debug Win32 + + Examples + Win32 + Release Win32 @@ -31,6 +35,13 @@ true Unicode + + DynamicLibrary + false + v143 + true + Unicode + @@ -42,6 +53,9 @@ + + + true @@ -49,6 +63,9 @@ false + + false + Level3 @@ -89,6 +106,30 @@ + + + Level3 + true + true + true + WIN32;NDEBUG;OMSIHOOKINVOKER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + $(OutDir)$(TargetName)$(TargetExt) + + + + + + @@ -103,6 +144,7 @@ Create Create + Create diff --git a/OmsiHookInvoker/OmsiHookInvoker.vcxproj.filters b/OmsiHookInvoker/OmsiHookInvoker.vcxproj.filters index 0028927..c2457aa 100644 --- a/OmsiHookInvoker/OmsiHookInvoker.vcxproj.filters +++ b/OmsiHookInvoker/OmsiHookInvoker.vcxproj.filters @@ -27,6 +27,9 @@ Header Files + + Header Files + @@ -38,5 +41,8 @@ Source Files + + Source Files + \ No newline at end of file diff --git a/OmsiHookPlugin/OmsiHookPlugin.cs b/OmsiHookPlugin/OmsiHookPlugin.cs index 7d15fa0..ac1cf40 100644 --- a/OmsiHookPlugin/OmsiHookPlugin.cs +++ b/OmsiHookPlugin/OmsiHookPlugin.cs @@ -52,7 +52,7 @@ private static void Hook_OnOmsiExited(object sender, EventArgs e) Log($"Omsi exited!"); } - private static void Hook_OnMapChange(object sender, EventArgs e) + private static void Hook_OnMapChange(object sender, OmsiMap e) { Log($"Map changed!"); } diff --git a/OmsiHookPlugin/OmsiHookPlugin.csproj b/OmsiHookPlugin/OmsiHookPlugin.csproj index 103edf6..5e1a870 100644 --- a/OmsiHookPlugin/OmsiHookPlugin.csproj +++ b/OmsiHookPlugin/OmsiHookPlugin.csproj @@ -2,6 +2,7 @@ net6.0-windows x86 + Debug;Release;Examples True diff --git a/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj b/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj index 30059cc..00b157c 100644 --- a/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj +++ b/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj @@ -2,6 +2,7 @@ net6.0-windows AnyCPU;x86 + Debug;Release;Examples Thomas Mathieson diff --git a/_OmsiHookExamples/BasicCLI/BasicCLI.csproj b/_OmsiHookExamples/BasicCLI/BasicCLI.csproj index c66fed0..4e84637 100644 --- a/_OmsiHookExamples/BasicCLI/BasicCLI.csproj +++ b/_OmsiHookExamples/BasicCLI/BasicCLI.csproj @@ -7,6 +7,7 @@ enable x86 BasicCLI.Program + Debug;Release;Examples diff --git a/_OmsiHookExamples/EventSample/EventSample.csproj b/_OmsiHookExamples/EventSample/EventSample.csproj index 1b40390..d93b426 100644 --- a/_OmsiHookExamples/EventSample/EventSample.csproj +++ b/_OmsiHookExamples/EventSample/EventSample.csproj @@ -8,6 +8,7 @@ EventSample.Program x86 x86 + Debug;Release;Examples diff --git a/_OmsiHookExamples/TriggersSample/TriggersSample.csproj b/_OmsiHookExamples/TriggersSample/TriggersSample.csproj index 1ee32ba..ab02237 100644 --- a/_OmsiHookExamples/TriggersSample/TriggersSample.csproj +++ b/_OmsiHookExamples/TriggersSample/TriggersSample.csproj @@ -8,6 +8,7 @@ TriggersSample.Program x86 x86 + Debug;Release;Examples diff --git a/_OmsiHookExamples/VideoDemo/VideoDemo.csproj b/_OmsiHookExamples/VideoDemo/VideoDemo.csproj index a9498e9..8811da8 100644 --- a/_OmsiHookExamples/VideoDemo/VideoDemo.csproj +++ b/_OmsiHookExamples/VideoDemo/VideoDemo.csproj @@ -8,6 +8,7 @@ VideoDemo.Program x86 x86 + Debug;Release;Examples From cc3ad28a8124939b07871e201dda396c1e69f3f3 Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Thu, 4 Jan 2024 15:55:27 +0100 Subject: [PATCH 28/36] + Update icons --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 36cd720..dbf9a08 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,9 @@ Omsi hooking and modding sdk. [![.NET](https://github.com/space928/Omsi-Extensions/actions/workflows/dotnet.yml/badge.svg)](https://github.com/space928/Omsi-Extensions/actions/workflows/dotnet.yml) [![DocFX](https://github.com/space928/Omsi-Extensions/actions/workflows/docs.yml/badge.svg)](https://space928.github.io/Omsi-Extensions/index.html) -[![Nuget](https://img.shields.io/nuget/v/omsihook)](https://www.nuget.org/packages/OmsiHook/) -[![OMSI Version](https://img.shields.io/badge/OMSI%20Version-2.3.004-orange)](https://store.steampowered.com/app/252530/OMSI_2_Steam_Edition/) +[![Discord](https://img.shields.io/discord/1192462752527163503?logo=Discord&logoColor=fff&label=Discord)](https://discord.gg/FG9P6PW23w) +[![Nuget](https://img.shields.io/nuget/v/omsihook?logo=Nuget&logoColor=fff)](https://www.nuget.org/packages/OmsiHook/) +[![OMSI Version](https://img.shields.io/badge/OMSI%20Version-2.3.004-orange?logo=steam&logoColor=fff)](https://store.steampowered.com/app/252530/OMSI_2_Steam_Edition/) The dead simple way to hook into Omsi and fiddle with it's memory. In it's current state we only have mappings for a limited number of Omsi objects, but it's easy to extend. Allows both reading and writing From 0e429dc764f60e589f5f9be98c954575e47ccf96 Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Thu, 4 Jan 2024 21:33:30 +0100 Subject: [PATCH 29/36] Revert " + Remove Dependency on examples for main Release Builds" This reverts parts of commit 66b33afefc3b1473466d342370fc6196f049e2c1. --- OmsiExtensions.sln | 23 ++++------ OmsiExtensionsCLI/OmsiExtensionsCLI.csproj | 1 - OmsiExtensionsUI/OmsiExtensionsUI.csproj | 1 - OmsiHook/OmsiHook.csproj | 2 +- OmsiHookInvoker/OmsiHookInvoker.vcxproj | 42 ------------------- .../OmsiHookInvoker.vcxproj.filters | 6 --- OmsiHookPlugin/OmsiHookPlugin.cs | 2 +- OmsiHookPlugin/OmsiHookPlugin.csproj | 1 - OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj | 1 - _OmsiHookExamples/BasicCLI/BasicCLI.csproj | 1 - .../EventSample/EventSample.csproj | 1 - .../TriggersSample/TriggersSample.csproj | 1 - _OmsiHookExamples/VideoDemo/VideoDemo.csproj | 1 - 13 files changed, 10 insertions(+), 73 deletions(-) diff --git a/OmsiExtensions.sln b/OmsiExtensions.sln index 90dac8b..fd2db97 100644 --- a/OmsiExtensions.sln +++ b/OmsiExtensions.sln @@ -28,77 +28,70 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 - Examples|x86 = Examples|x86 Release|x86 = Release|x86 ReleaseAndDocs|x86 = ReleaseAndDocs|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|x86.ActiveCfg = Debug|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Debug|x86.Build.0 = Debug|x86 - {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Examples|x86.ActiveCfg = Examples|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.ActiveCfg = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.Release|x86.Build.0 = Release|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|x86.ActiveCfg = ReleaseAndDocs|x86 {2E750CBE-F868-4AB7-96C2-27560F53E06B}.ReleaseAndDocs|x86.Build.0 = ReleaseAndDocs|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.ActiveCfg = Debug|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Debug|x86.Build.0 = Debug|x86 - {28DA0165-EAA7-4171-A065-319409682BD1}.Examples|x86.ActiveCfg = Examples|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.ActiveCfg = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.Release|x86.Build.0 = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {28DA0165-EAA7-4171-A065-319409682BD1}.ReleaseAndDocs|x86.Build.0 = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x86.ActiveCfg = Debug|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Debug|x86.Build.0 = Debug|x86 - {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Examples|x86.ActiveCfg = Examples|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.ActiveCfg = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.Release|x86.Build.0 = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {FDA9A525-9722-46D3-B80C-8D2A76ABCA2D}.ReleaseAndDocs|x86.Build.0 = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x86.ActiveCfg = Debug|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Debug|x86.Build.0 = Debug|x86 - {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Examples|x86.ActiveCfg = Examples|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|x86.ActiveCfg = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.Release|x86.Build.0 = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {D5CA6EEA-D436-456E-BCA5-34C3DFD5BFC7}.ReleaseAndDocs|x86.Build.0 = Release|x86 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|x86.ActiveCfg = Debug|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Debug|x86.Build.0 = Debug|Win32 - {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Examples|x86.ActiveCfg = Examples|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|x86.ActiveCfg = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.Release|x86.Build.0 = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|x86.ActiveCfg = Release|Win32 {CBCB99EF-DD1A-4D4D-A9A8-9BF251FDCD1B}.ReleaseAndDocs|x86.Build.0 = Release|Win32 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|x86.ActiveCfg = Debug|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Debug|x86.Build.0 = Debug|x86 - {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Examples|x86.ActiveCfg = Examples|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.Release|x86.Build.0 = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 {CDB17143-5653-48BE-AAC8-8419D5B4FD2C}.ReleaseAndDocs|x86.Build.0 = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.ActiveCfg = Debug|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Debug|x86.Build.0 = Debug|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Examples|x86.ActiveCfg = Examples|x86 - {BA833C68-E8BD-4C86-9555-85542DF02015}.Examples|x86.Build.0 = Examples|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.Release|x86.Build.0 = Release|x86 {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 + {BA833C68-E8BD-4C86-9555-85542DF02015}.ReleaseAndDocs|x86.Build.0 = Release|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.ActiveCfg = Debug|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Debug|x86.Build.0 = Debug|x86 - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Examples|x86.ActiveCfg = Examples|x86 - {47659503-9923-4E74-AD26-103C1F9FF2B0}.Examples|x86.Build.0 = Examples|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.ActiveCfg = Release|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.Release|x86.Build.0 = Release|x86 {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 + {47659503-9923-4E74-AD26-103C1F9FF2B0}.ReleaseAndDocs|x86.Build.0 = Release|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|x86.ActiveCfg = Debug|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Debug|x86.Build.0 = Debug|x86 - {1DF326AE-4D10-4545-B36A-5622B76987EC}.Examples|x86.ActiveCfg = Examples|x86 - {1DF326AE-4D10-4545-B36A-5622B76987EC}.Examples|x86.Build.0 = Examples|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|x86.ActiveCfg = Release|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.Release|x86.Build.0 = Release|x86 {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 + {1DF326AE-4D10-4545-B36A-5622B76987EC}.ReleaseAndDocs|x86.Build.0 = Release|x86 {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x86.ActiveCfg = Debug|x86 {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Debug|x86.Build.0 = Debug|x86 - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Examples|x86.ActiveCfg = Examples|x86 - {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Examples|x86.Build.0 = Examples|x86 {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x86.ActiveCfg = Release|x86 + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.Release|x86.Build.0 = Release|x86 {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|x86.ActiveCfg = Release|x86 + {D94FF6D3-08AA-41CB-B9B9-F82E860E6E96}.ReleaseAndDocs|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj b/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj index da935e8..0bfd17a 100644 --- a/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj +++ b/OmsiExtensionsCLI/OmsiExtensionsCLI.csproj @@ -6,7 +6,6 @@ x86 x86 favicon.ico - Debug;Release;Examples diff --git a/OmsiExtensionsUI/OmsiExtensionsUI.csproj b/OmsiExtensionsUI/OmsiExtensionsUI.csproj index e884512..ced68a6 100644 --- a/OmsiExtensionsUI/OmsiExtensionsUI.csproj +++ b/OmsiExtensionsUI/OmsiExtensionsUI.csproj @@ -4,7 +4,6 @@ net6.0-windows enable x86 - Debug;Release;Examples diff --git a/OmsiHook/OmsiHook.csproj b/OmsiHook/OmsiHook.csproj index dd09f15..b97d414 100644 --- a/OmsiHook/OmsiHook.csproj +++ b/OmsiHook/OmsiHook.csproj @@ -22,7 +22,7 @@ disable x86 False - Debug;Release;ReleaseAndDocs;Examples + Debug;Release;ReleaseAndDocs diff --git a/OmsiHookInvoker/OmsiHookInvoker.vcxproj b/OmsiHookInvoker/OmsiHookInvoker.vcxproj index 82565d9..05d662f 100644 --- a/OmsiHookInvoker/OmsiHookInvoker.vcxproj +++ b/OmsiHookInvoker/OmsiHookInvoker.vcxproj @@ -5,10 +5,6 @@ Debug Win32 - - Examples - Win32 - Release Win32 @@ -35,13 +31,6 @@ true Unicode - - DynamicLibrary - false - v143 - true - Unicode - @@ -53,9 +42,6 @@ - - - true @@ -63,9 +49,6 @@ false - - false - Level3 @@ -106,30 +89,6 @@ - - - Level3 - true - true - true - WIN32;NDEBUG;OMSIHOOKINVOKER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - true - true - false - $(OutDir)$(TargetName)$(TargetExt) - - - - - - @@ -144,7 +103,6 @@ Create Create - Create diff --git a/OmsiHookInvoker/OmsiHookInvoker.vcxproj.filters b/OmsiHookInvoker/OmsiHookInvoker.vcxproj.filters index c2457aa..0028927 100644 --- a/OmsiHookInvoker/OmsiHookInvoker.vcxproj.filters +++ b/OmsiHookInvoker/OmsiHookInvoker.vcxproj.filters @@ -27,9 +27,6 @@ Header Files - - Header Files - @@ -41,8 +38,5 @@ Source Files - - Source Files - \ No newline at end of file diff --git a/OmsiHookPlugin/OmsiHookPlugin.cs b/OmsiHookPlugin/OmsiHookPlugin.cs index ac1cf40..7d15fa0 100644 --- a/OmsiHookPlugin/OmsiHookPlugin.cs +++ b/OmsiHookPlugin/OmsiHookPlugin.cs @@ -52,7 +52,7 @@ private static void Hook_OnOmsiExited(object sender, EventArgs e) Log($"Omsi exited!"); } - private static void Hook_OnMapChange(object sender, OmsiMap e) + private static void Hook_OnMapChange(object sender, EventArgs e) { Log($"Map changed!"); } diff --git a/OmsiHookPlugin/OmsiHookPlugin.csproj b/OmsiHookPlugin/OmsiHookPlugin.csproj index 5e1a870..103edf6 100644 --- a/OmsiHookPlugin/OmsiHookPlugin.csproj +++ b/OmsiHookPlugin/OmsiHookPlugin.csproj @@ -2,7 +2,6 @@ net6.0-windows x86 - Debug;Release;Examples True diff --git a/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj b/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj index 00b157c..30059cc 100644 --- a/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj +++ b/OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj @@ -2,7 +2,6 @@ net6.0-windows AnyCPU;x86 - Debug;Release;Examples Thomas Mathieson diff --git a/_OmsiHookExamples/BasicCLI/BasicCLI.csproj b/_OmsiHookExamples/BasicCLI/BasicCLI.csproj index 4e84637..c66fed0 100644 --- a/_OmsiHookExamples/BasicCLI/BasicCLI.csproj +++ b/_OmsiHookExamples/BasicCLI/BasicCLI.csproj @@ -7,7 +7,6 @@ enable x86 BasicCLI.Program - Debug;Release;Examples diff --git a/_OmsiHookExamples/EventSample/EventSample.csproj b/_OmsiHookExamples/EventSample/EventSample.csproj index d93b426..1b40390 100644 --- a/_OmsiHookExamples/EventSample/EventSample.csproj +++ b/_OmsiHookExamples/EventSample/EventSample.csproj @@ -8,7 +8,6 @@ EventSample.Program x86 x86 - Debug;Release;Examples diff --git a/_OmsiHookExamples/TriggersSample/TriggersSample.csproj b/_OmsiHookExamples/TriggersSample/TriggersSample.csproj index ab02237..1ee32ba 100644 --- a/_OmsiHookExamples/TriggersSample/TriggersSample.csproj +++ b/_OmsiHookExamples/TriggersSample/TriggersSample.csproj @@ -8,7 +8,6 @@ TriggersSample.Program x86 x86 - Debug;Release;Examples diff --git a/_OmsiHookExamples/VideoDemo/VideoDemo.csproj b/_OmsiHookExamples/VideoDemo/VideoDemo.csproj index 8811da8..a9498e9 100644 --- a/_OmsiHookExamples/VideoDemo/VideoDemo.csproj +++ b/_OmsiHookExamples/VideoDemo/VideoDemo.csproj @@ -8,7 +8,6 @@ VideoDemo.Program x86 x86 - Debug;Release;Examples From 617b26bdef6c77d8e8bd4ff52ccb7b448c4c8193 Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Thu, 4 Jan 2024 21:39:20 +0100 Subject: [PATCH 30/36] Cherry-picked some fixes from 66b33afe --- OmsiHookInvoker/OmsiHookInvoker.vcxproj.filters | 6 ++++++ OmsiHookPlugin/OmsiHookPlugin.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/OmsiHookInvoker/OmsiHookInvoker.vcxproj.filters b/OmsiHookInvoker/OmsiHookInvoker.vcxproj.filters index 0028927..c2457aa 100644 --- a/OmsiHookInvoker/OmsiHookInvoker.vcxproj.filters +++ b/OmsiHookInvoker/OmsiHookInvoker.vcxproj.filters @@ -27,6 +27,9 @@ Header Files + + Header Files + @@ -38,5 +41,8 @@ Source Files + + Source Files + \ No newline at end of file diff --git a/OmsiHookPlugin/OmsiHookPlugin.cs b/OmsiHookPlugin/OmsiHookPlugin.cs index 7d15fa0..ac1cf40 100644 --- a/OmsiHookPlugin/OmsiHookPlugin.cs +++ b/OmsiHookPlugin/OmsiHookPlugin.cs @@ -52,7 +52,7 @@ private static void Hook_OnOmsiExited(object sender, EventArgs e) Log($"Omsi exited!"); } - private static void Hook_OnMapChange(object sender, EventArgs e) + private static void Hook_OnMapChange(object sender, OmsiMap e) { Log($"Map changed!"); } From 35a02d5da2662f0c2a72ad13d33b104419bd3f37 Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Thu, 4 Jan 2024 22:29:30 +0100 Subject: [PATCH 31/36] Updated github actions --- .github/workflows/dotnet.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 50bbc69..a748e68 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -11,6 +11,9 @@ jobs: runs-on: windows-2022 + env: + BuildProjects: \'OmsiExtensionsCLI/OmsiExtensionsCLI.csproj\',\'OmsiExtensionsUI/OmsiExtensionsUI.csproj\',\'OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj\' + steps: - uses: actions/checkout@v3 - name: Setup .NET @@ -22,6 +25,16 @@ jobs: - name: Setup Windows 10 SDK uses: GuillaumeFalourd/setup-windows10-sdk-action@v1.4 - name: Restore dependencies - run: dotnet restore + shell: pwsh + run: | + foreach($proj in $env.BuildProjects) + \{ + dotnet restore ${{ github.workspace }}$proj + \} - name: Build - run: msbuild D:\a\Omsi-Extensions\Omsi-Extensions\OmsiExtensions.sln -t:rebuild -property:Configuration=Release + shell: pwsh + run: | + foreach($proj in $env.BuildProjects) + \{ + msbuild ${{ github.workspace }}$proj -t:rebuild -property:Configuration=Release + \} From 7c5a39aa27e681503adf49b3607c7c49881ac3c2 Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Thu, 4 Jan 2024 22:39:07 +0100 Subject: [PATCH 32/36] Maybe? --- .github/workflows/dotnet.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index a748e68..840a548 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -27,14 +27,12 @@ jobs: - name: Restore dependencies shell: pwsh run: | - foreach($proj in $env.BuildProjects) - \{ + foreach($proj in $env.BuildProjects) { dotnet restore ${{ github.workspace }}$proj - \} + } - name: Build shell: pwsh run: | - foreach($proj in $env.BuildProjects) - \{ + foreach($proj in $env.BuildProjects) { msbuild ${{ github.workspace }}$proj -t:rebuild -property:Configuration=Release - \} + } From c3445c420f1b9c9430efb092cf50f7eeef2e5e0a Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Thu, 4 Jan 2024 22:49:48 +0100 Subject: [PATCH 33/36] Fixed the array? --- .github/workflows/dotnet.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 840a548..5636906 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -12,7 +12,7 @@ jobs: runs-on: windows-2022 env: - BuildProjects: \'OmsiExtensionsCLI/OmsiExtensionsCLI.csproj\',\'OmsiExtensionsUI/OmsiExtensionsUI.csproj\',\'OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj\' + BuildProjects: "['OmsiExtensionsCLI/OmsiExtensionsCLI.csproj', 'OmsiExtensionsUI/OmsiExtensionsUI.csproj','OmsiHookRPCPlugin/OmsiHookRPCPlugin.csproj']" steps: - uses: actions/checkout@v3 @@ -27,12 +27,12 @@ jobs: - name: Restore dependencies shell: pwsh run: | - foreach($proj in $env.BuildProjects) { + foreach($proj in @($env.BuildProjects)) { dotnet restore ${{ github.workspace }}$proj } - name: Build shell: pwsh run: | - foreach($proj in $env.BuildProjects) { + foreach($proj in @($env.BuildProjects)) { msbuild ${{ github.workspace }}$proj -t:rebuild -property:Configuration=Release } From ed46c3107d68d3427042c1c56a902674df303259 Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Thu, 4 Jan 2024 23:00:17 +0100 Subject: [PATCH 34/36] Ok, but this timme for real, it should work --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 5636906..d8fb75b 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -27,12 +27,12 @@ jobs: - name: Restore dependencies shell: pwsh run: | - foreach($proj in @($env.BuildProjects)) { + foreach($proj in (ConvertFrom-JSON $env.BuildProjects)) { dotnet restore ${{ github.workspace }}$proj } - name: Build shell: pwsh run: | - foreach($proj in @($env.BuildProjects)) { + foreach($proj in (ConvertFrom-JSON $env.BuildProjects)) { msbuild ${{ github.workspace }}$proj -t:rebuild -property:Configuration=Release } From 6fe56a4f652793761954e99ee0dc63b273040c96 Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Thu, 4 Jan 2024 23:05:15 +0100 Subject: [PATCH 35/36] Github actions... --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index d8fb75b..27cfa0e 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -27,12 +27,12 @@ jobs: - name: Restore dependencies shell: pwsh run: | - foreach($proj in (ConvertFrom-JSON $env.BuildProjects)) { + foreach($proj in (ConvertFrom-JSON "${{env.BuildProjects}}")) { dotnet restore ${{ github.workspace }}$proj } - name: Build shell: pwsh run: | - foreach($proj in (ConvertFrom-JSON $env.BuildProjects)) { + foreach($proj in (ConvertFrom-JSON "${{env.BuildProjects}}")) { msbuild ${{ github.workspace }}$proj -t:rebuild -property:Configuration=Release } From 53873b16facfc002d88548d35be2987160b9ceb2 Mon Sep 17 00:00:00 2001 From: Thomas Mathieson Date: Thu, 4 Jan 2024 23:09:38 +0100 Subject: [PATCH 36/36] Accursed path separators --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 27cfa0e..c83badd 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -28,11 +28,11 @@ jobs: shell: pwsh run: | foreach($proj in (ConvertFrom-JSON "${{env.BuildProjects}}")) { - dotnet restore ${{ github.workspace }}$proj + dotnet restore ${{ github.workspace }}/$proj } - name: Build shell: pwsh run: | foreach($proj in (ConvertFrom-JSON "${{env.BuildProjects}}")) { - msbuild ${{ github.workspace }}$proj -t:rebuild -property:Configuration=Release + msbuild ${{ github.workspace }}/$proj -t:rebuild -property:Configuration=Release }