├── .gitmodules ├── D2Map.DllWrapper ├── stdafx.h ├── DllMain.cpp ├── exports.h ├── D2Map.DllWrapper.vcxproj.filters ├── d2ptrs.h ├── D2Structs.h ├── exports.cpp └── D2Map.DllWrapper.vcxproj ├── D2Map.Api ├── D2Map.DllWrapper.dll ├── appsettings.Development.json ├── appsettings.json ├── Controllers │ ├── Models │ │ └── MapParameters.cs │ └── MapApiController.cs ├── Program.cs ├── Properties │ └── launchSettings.json ├── D2Map.Api.csproj └── Startup.cs ├── D2Map.Core ├── Models │ ├── Act.cs │ ├── Difficulty.cs │ ├── Point.cs │ ├── AdjacentLevel.cs │ ├── CollissionMap.cs │ ├── Session.cs │ └── Area.cs ├── IMapService.cs ├── D2Map.Core.csproj ├── Extensions │ └── CoreExtensions.cs ├── MapService.cs ├── Wrapper │ ├── MapDll.cs │ └── Structs.cs └── Helpers │ └── MapHelpers.cs ├── README.md ├── D2Map.sln ├── .gitattributes └── .gitignore /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /D2Map.DllWrapper/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define WIN32_LEAN_AND_MEAN 3 | #include 4 | -------------------------------------------------------------------------------- /D2Map.Api/D2Map.DllWrapper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcageman/d2mapapi/HEAD/D2Map.Api/D2Map.DllWrapper.dll -------------------------------------------------------------------------------- /D2Map.Core/Models/Act.cs: -------------------------------------------------------------------------------- 1 | namespace D2Map.Core.Models 2 | { 3 | public enum Act : byte 4 | { 5 | Act1 = 0, 6 | Act2, 7 | Act3, 8 | Act4, 9 | Act5 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /D2Map.Core/Models/Difficulty.cs: -------------------------------------------------------------------------------- 1 | namespace D2Map.Core.Models 2 | { 3 | public enum Difficulty : byte 4 | { 5 | Normal = 0x00, 6 | Nightmare = 0x01, 7 | Hell = 0x02 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /D2Map.Api/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /D2Map.Core/IMapService.cs: -------------------------------------------------------------------------------- 1 | using D2Map.Core.Models; 2 | 3 | namespace D2Map.Core 4 | { 5 | public interface IMapService 6 | { 7 | CollisionMap GetCollisionMap(uint mapId, Difficulty difficulty, Area area); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /D2Map.DllWrapper/DllMain.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | BOOL APIENTRY DllMain( 4 | HMODULE hmodule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved) { 7 | if (ul_reason_for_call == DLL_PROCESS_ATTACH) 8 | DisableThreadLibraryCalls(hmodule); 9 | return TRUE; 10 | } -------------------------------------------------------------------------------- /D2Map.Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Diablo2Directory": "C:\\Diablo II", 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | }, 10 | "AllowedHosts": "*" 11 | } 12 | -------------------------------------------------------------------------------- /D2Map.Core/Models/Point.cs: -------------------------------------------------------------------------------- 1 | namespace D2Map.Core.Models 2 | { 3 | public struct Point 4 | { 5 | public Point(uint x, uint y) 6 | { 7 | X = x; 8 | Y = y; 9 | } 10 | 11 | public uint X { get; set; } 12 | 13 | public uint Y { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /D2Map.Core/Models/AdjacentLevel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace D2Map.Core.Models 4 | { 5 | public class AdjacentLevel 6 | { 7 | public List Exits { get; set; } = new List(); 8 | public Point LevelOrigin { get; set; } 9 | public int Width { get; set; } 10 | public int Height { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /D2Map.Api/Controllers/Models/MapParameters.cs: -------------------------------------------------------------------------------- 1 | using D2Map.Core.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | namespace D2Map.Api.Controllers.Models 6 | { 7 | public class MapParameters 8 | { 9 | [Required] 10 | [FromQuery] 11 | public uint MapId { get; set; } 12 | 13 | [Required] 14 | [FromQuery] 15 | public Difficulty? Difficulty { get; set; } 16 | 17 | [Required] 18 | [FromQuery] 19 | public Area? Area { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /D2Map.DllWrapper/exports.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "D2Structs.h" 3 | #include 4 | 5 | #define API_EXPORT __declspec(dllexport) 6 | extern "C" { 7 | API_EXPORT bool Initialize(const wchar_t* path); 8 | API_EXPORT Level* GetLevel(ActMisc* misc, uint32_t levelno); 9 | API_EXPORT void InitLevel(Level* pLevel); 10 | API_EXPORT void AddRoomData(Act* pAct, int32_t levelid, int32_t xpos, int32_t ypos, Room1* pRoom); 11 | API_EXPORT void RemoveRoomData(Act* pAct, int32_t levelid, int32_t xpos, int32_t ypos, Room1* pRoom); 12 | API_EXPORT Act* LoadAct(uint32_t actno, uint32_t seed, uint32_t difficulty, uint32_t TownLevelId); 13 | API_EXPORT void UnloadAct(Act* pAct); 14 | } -------------------------------------------------------------------------------- /D2Map.Core/Models/CollissionMap.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace D2Map.Core.Models 5 | { 6 | public class CollisionMap 7 | { 8 | public Point LevelOrigin { get; set; } 9 | [JsonPropertyName("mapRows")] 10 | public List> Map { get; set; } 11 | public Dictionary AdjacentLevels { get; set; } = new Dictionary(); 12 | public Dictionary> Npcs { get; set; } = new Dictionary>(); 13 | public Dictionary> Objects { get; set; } = new Dictionary>(); 14 | public Area? TombArea { get; set; } 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /D2Map.Core/D2Map.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | true 9 | x86 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /D2Map.Api/Controllers/MapApiController.cs: -------------------------------------------------------------------------------- 1 | using D2Map.Api.Controllers.Models; 2 | using D2Map.Core; 3 | using Microsoft.AspNetCore.Mvc; 4 | 5 | namespace D2Map.Api.Controllers 6 | { 7 | [ApiController] 8 | [Route("/maps")] 9 | public class MapApiController : ControllerBase 10 | { 11 | private readonly IMapService _mapService; 12 | 13 | public MapApiController(IMapService mapService) 14 | { 15 | _mapService = mapService; 16 | } 17 | 18 | [HttpGet] 19 | public IActionResult Get([FromQuery] MapParameters parameters) 20 | { 21 | return Ok(_mapService.GetCollisionMap(parameters.MapId, parameters.Difficulty.GetValueOrDefault(), parameters.Area.GetValueOrDefault())); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /D2Map.Core/Extensions/CoreExtensions.cs: -------------------------------------------------------------------------------- 1 | using D2Map.Core.Wrapper; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using System.IO; 5 | 6 | namespace D2Map.Core.Extensions 7 | { 8 | public static class CoreExtensions 9 | { 10 | public static void RegisterCoreServices(this IServiceCollection services, IConfiguration config) 11 | { 12 | services.AddSingleton(); 13 | if(!Directory.Exists(config["Diablo2Directory"])) 14 | { 15 | throw new System.Exception($"Provided invalid diablo 2 directory: {config["Diablo2Directory"]}"); 16 | } 17 | MapDll.Initialize(config["Diablo2Directory"]); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /D2Map.Api/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.Hosting; 4 | using Microsoft.Extensions.Logging; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace D2Map.Api 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /D2Map.Api/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "IIS Express": { 4 | "commandName": "IISExpress", 5 | "environmentVariables": { 6 | "ASPNETCORE_ENVIRONMENT": "Development" 7 | } 8 | }, 9 | "D2Map.Api": { 10 | "commandName": "Project", 11 | "environmentVariables": { 12 | "ASPNETCORE_ENVIRONMENT": "Development" 13 | }, 14 | "applicationUrl": "https://localhost:8080" 15 | }, 16 | "Container (.NET SDK)": { 17 | "commandName": "SdkContainer", 18 | "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", 19 | "environmentVariables": { 20 | "ASPNETCORE_HTTPS_PORTS": "8081", 21 | "ASPNETCORE_HTTP_PORTS": "8080" 22 | }, 23 | "publishAllPorts": true, 24 | "useSSL": true 25 | } 26 | }, 27 | "$schema": "http://json.schemastore.org/launchsettings.json", 28 | "iisSettings": { 29 | "windowsAuthentication": false, 30 | "anonymousAuthentication": true, 31 | "iisExpress": { 32 | "applicationUrl": "http://localhost:8081", 33 | "sslPort": 8080 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /D2Map.Api/D2Map.Api.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 2 9 | x86 10 | 46077897-d1da-4aff-9d89-04249b76d0be 11 | linux-x64 12 | True 13 | mcr.microsoft.com/dotnet/aspnet:10.0-alpine 14 | Linux 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Always 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /D2Map.Core/MapService.cs: -------------------------------------------------------------------------------- 1 | using D2Map.Core.Models; 2 | using Microsoft.Extensions.Caching.Memory; 3 | using System; 4 | 5 | namespace D2Map.Core 6 | { 7 | public class MapService : IMapService 8 | { 9 | private readonly IMemoryCache _cache; 10 | private static object syncObject = new object(); 11 | public MapService(IMemoryCache cache) 12 | { 13 | _cache = cache; 14 | } 15 | public CollisionMap GetCollisionMap(uint mapId, Difficulty difficulty, Area area) 16 | { 17 | var session = _cache.GetOrCreate(Tuple.Create("map", mapId, difficulty), (cacheEntry) => 18 | { 19 | cacheEntry.RegisterPostEvictionCallback(DeleteSession); 20 | cacheEntry.SlidingExpiration = TimeSpan.FromMinutes(5); 21 | return new Session(mapId, difficulty); 22 | }); 23 | lock (syncObject) 24 | { 25 | return session.GetMap(area); 26 | } 27 | } 28 | 29 | private void DeleteSession(object key, object value, EvictionReason reason, object state) 30 | { 31 | var item = value as IDisposable; 32 | if (item != null) 33 | item.Dispose(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /D2Map.Core/Models/Session.cs: -------------------------------------------------------------------------------- 1 | using D2Map.Core.Helpers; 2 | using D2Map.Core.Wrapper; 3 | using System; 4 | 5 | namespace D2Map.Core.Models 6 | { 7 | public unsafe class Session : IDisposable 8 | { 9 | public Session(uint mapId, Difficulty difficulty) 10 | { 11 | Acts = new Wrapper.Act*[5]; 12 | MapId = mapId; 13 | Difficulty = difficulty; 14 | } 15 | 16 | public uint MapId { get; private set; } 17 | 18 | public Difficulty Difficulty { get; private set; } 19 | 20 | private readonly unsafe Wrapper.Act*[] Acts; 21 | 22 | public CollisionMap GetMap(Area area) 23 | { 24 | var act = MapHelpers.GetAct(area); 25 | var actIndex = (int)act; 26 | if (Acts[actIndex] == null) 27 | { 28 | Acts[actIndex] = MapDll.LoadAct((uint)actIndex, MapId, (uint)Difficulty, MapHelpers.ActLevels[actIndex]); 29 | } 30 | return MapHelpers.BuildCollissionMap(Acts[actIndex], area); 31 | } 32 | 33 | public void Dispose() 34 | { 35 | foreach (var act in Acts) 36 | { 37 | if (act != null) 38 | { 39 | MapDll.UnloadAct(act); 40 | } 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /D2Map.Core/Wrapper/MapDll.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace D2Map.Core.Wrapper 4 | { 5 | internal static class MapDll 6 | { 7 | [DllImport("D2Map.DllWrapper.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)] 8 | internal extern static bool Initialize(string path); 9 | 10 | [DllImport("D2Map.DllWrapper.dll", CallingConvention = CallingConvention.Cdecl)] 11 | internal extern static unsafe Level* GetLevel(ActMisc* misc, uint levelno); 12 | 13 | [DllImport("D2Map.DllWrapper.dll", CallingConvention = CallingConvention.Cdecl)] 14 | internal extern static unsafe void InitLevel(Level* pLevel); 15 | 16 | [DllImport("D2Map.DllWrapper.dll", CallingConvention = CallingConvention.Cdecl)] 17 | internal extern static unsafe void AddRoomData(Act* pAct, uint levelid, uint xpos, uint ypos, Room1* pRoom); 18 | 19 | [DllImport("D2Map.DllWrapper.dll", CallingConvention = CallingConvention.Cdecl)] 20 | internal extern static unsafe void RemoveRoomData(Act* pAct, uint levelid, uint xpos, uint ypos, Room1* pRoom); 21 | 22 | [DllImport("D2Map.DllWrapper.dll", CallingConvention = CallingConvention.Cdecl)] 23 | internal extern static unsafe Act* LoadAct(uint actno, uint seed, uint difficulty, uint TownLevelId); 24 | 25 | [DllImport("D2Map.DllWrapper.dll", CallingConvention = CallingConvention.Cdecl)] 26 | internal extern static unsafe void UnloadAct(Act* pAct); 27 | 28 | [DllImport("kernel32.dll")] 29 | internal extern static uint GetLastError(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /D2Map.DllWrapper/D2Map.DllWrapper.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | Header Files 28 | 29 | 30 | Header Files 31 | 32 | 33 | Header Files 34 | 35 | 36 | Header Files 37 | 38 | 39 | -------------------------------------------------------------------------------- /D2Map.Api/Startup.cs: -------------------------------------------------------------------------------- 1 | using D2Map.Core; 2 | using D2Map.Core.Extensions; 3 | using Microsoft.AspNetCore.Builder; 4 | using Microsoft.AspNetCore.Hosting; 5 | using Microsoft.AspNetCore.HttpsPolicy; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.Extensions.Configuration; 8 | using Microsoft.Extensions.DependencyInjection; 9 | using Microsoft.Extensions.Hosting; 10 | using Microsoft.Extensions.Logging; 11 | using System; 12 | using System.Collections.Generic; 13 | using System.Linq; 14 | using System.Text.Json.Serialization; 15 | using System.Threading.Tasks; 16 | 17 | namespace D2Map.Api 18 | { 19 | public class Startup 20 | { 21 | public Startup(IConfiguration configuration) 22 | { 23 | Configuration = configuration; 24 | } 25 | 26 | public IConfiguration Configuration { get; } 27 | 28 | public void ConfigureServices(IServiceCollection services) 29 | { 30 | services.AddControllers() 31 | .AddJsonOptions(options => 32 | { 33 | options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); 34 | }); 35 | services.AddMemoryCache(); 36 | services.RegisterCoreServices(Configuration); 37 | } 38 | 39 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 40 | { 41 | if (env.IsDevelopment()) 42 | { 43 | app.UseDeveloperExceptionPage(); 44 | } 45 | 46 | app.UseHttpsRedirection(); 47 | 48 | app.UseRouting(); 49 | 50 | app.UseAuthorization(); 51 | 52 | app.UseEndpoints(endpoints => 53 | { 54 | endpoints.MapControllers(); 55 | }); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # d2mapapi 2 | Diablo II map rest API to retrieve the map layout per area given a map id. 3 | 4 | A diablo 2 1.13C installation is required, but the result returned by this API should work for all versions of diablo 2, since the map generation has stayed the same across all verisons. 5 | 6 | Note: for 1.09 and lower, higher difficulties do not generate larger maps, hence when interfacing with the API, always use difficulty normal. 7 | 8 | ## Installation 9 | 10 | This project assumes you have VS2022 installed with .NET 8.0 and C++ workloads. 11 | 12 | ## Usage Examples 13 | ``` 14 | ./D2Map.Api.exe Diablo2Directory="C:\Diablo II1.13c" 15 | ./D2Map.Api.exe --urls https://localhost:8080 Diablo2Directory="C:\Diablo II1.13c" 16 | ./D2Map.Api.exe --urls https://0.0.0.0:8080 Diablo2Directory="C:\Diablo II1.13c" 17 | ``` 18 | 19 | Note: to run from source use dotnet run or simply start the project from visual studio. 20 | 21 | ## Running in Docker 22 | 23 | This requires [Docker Desktop](https://www.docker.com/products/docker-desktop) 24 | 25 | Example Dockerfile: 26 | ``` 27 | FROM tianon/wine 28 | ENV WINEARCH=win32 29 | ENV WINEDEBUG=-all 30 | # change this to your Diablo 2 installation 31 | COPY [ "C:\Diablo II1.13c", "/app/game" ] 32 | WORKDIR /app 33 | # d2mapapi should be in the same folder as your dockerfile 34 | COPY ./d2mapapi . 35 | EXPOSE 8080 36 | CMD ["wine", "D2Map.Api.exe", "Diablo2Directory=/app/game", "--urls=https://0.0.0.0:8080"] 37 | ``` 38 | 39 | [Download the latest release](https://github.com/jcageman/d2mapapi/releases) 40 | 41 | Place the d2mapapi folder the dockerfile in the same folder, and navigate their via command line then run `docker build -t d2mapapi .` 42 | 43 | Once that completes run `docker run d2mapapi` 44 | ## API 45 | 46 | GET https://localhost:5001/maps?mapid=1053646565&area=BloodMoor&difficulty=Normal 47 | 48 | GET https://localhost:5001/maps?mapid=1053646565&area=2&difficulty=0 49 | 50 | [List Of Areas](/D2Map.Core/Models/Area.cs) 51 | 52 | -------------------------------------------------------------------------------- /D2Map.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31702.278 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "D2Map.DllWrapper", "D2Map.DllWrapper\D2Map.DllWrapper.vcxproj", "{016346A9-C02E-4AF2-BF0F-6C4593B43352}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D2Map.Core", "D2Map.Core\D2Map.Core.csproj", "{662A9A5B-E110-446C-A300-F732BF6871E9}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D2Map.Api", "D2Map.Api\D2Map.Api.csproj", "{3BD13340-4C26-414B-91AB-5978AA369DD2}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|x86 = Debug|x86 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {016346A9-C02E-4AF2-BF0F-6C4593B43352}.Debug|x86.ActiveCfg = Debug|Win32 19 | {016346A9-C02E-4AF2-BF0F-6C4593B43352}.Debug|x86.Build.0 = Debug|Win32 20 | {016346A9-C02E-4AF2-BF0F-6C4593B43352}.Release|x86.ActiveCfg = Release|Win32 21 | {016346A9-C02E-4AF2-BF0F-6C4593B43352}.Release|x86.Build.0 = Release|Win32 22 | {662A9A5B-E110-446C-A300-F732BF6871E9}.Debug|x86.ActiveCfg = Debug|Any CPU 23 | {662A9A5B-E110-446C-A300-F732BF6871E9}.Debug|x86.Build.0 = Debug|Any CPU 24 | {662A9A5B-E110-446C-A300-F732BF6871E9}.Release|x86.ActiveCfg = Release|Any CPU 25 | {662A9A5B-E110-446C-A300-F732BF6871E9}.Release|x86.Build.0 = Release|Any CPU 26 | {3BD13340-4C26-414B-91AB-5978AA369DD2}.Debug|x86.ActiveCfg = Debug|Any CPU 27 | {3BD13340-4C26-414B-91AB-5978AA369DD2}.Debug|x86.Build.0 = Debug|Any CPU 28 | {3BD13340-4C26-414B-91AB-5978AA369DD2}.Release|x86.ActiveCfg = Release|Any CPU 29 | {3BD13340-4C26-414B-91AB-5978AA369DD2}.Release|x86.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {349C633E-A4AC-44D4-AE1B-B2B671722D09} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /D2Map.DllWrapper/d2ptrs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "D2Structs.h" 3 | #include 4 | 5 | #ifdef _DEFINE_VARS 6 | 7 | enum { DLLNO_D2CLIENT, DLLNO_D2COMMON, DLLNO_D2GFX, DLLNO_D2LANG, DLLNO_D2WIN, DLLNO_D2NET, DLLNO_D2GAME, DLLNO_D2LAUNCH, DLLNO_FOG, DLLNO_BNCLIENT, DLLNO_STORM, DLLNO_D2CMP, DLLNO_D2MULTI, DLLNO_D2SOUND }; 8 | 9 | #define DLLOFFSET(a1,b1) ((DLLNO_##a1)|((b1)<<8)) 10 | #define FUNCPTR(d1,v1,t1,t2,o1) typedef t1 d1##_##v1##_t t2; d1##_##v1##_t *d1##_##v1 = (d1##_##v1##_t *)DLLOFFSET(d1,o1); 11 | #define VARPTR(d1,v1,t1,o1) typedef t1 d1##_##v1##_t; d1##_##v1##_t *p_##d1##_##v1 = (d1##_##v1##_t *)DLLOFFSET(d1,o1); 12 | #define ASMPTR(d1,v1,o1) uint32_t d1##_##v1 = DLLOFFSET(d1,o1); 13 | 14 | #else 15 | 16 | #define FUNCPTR(d1, v1, t1, t2, o1) typedef t1 d1##_##v1##_t t2; extern d1##_##v1##_t *d1##_##v1; 17 | #define VARPTR(d1, v1, t1, o1) typedef t1 d1##_##v1##_t; extern d1##_##v1##_t *p_##d1##_##v1; 18 | #define ASMPTR(d1, v1, o1) extern uint32_t d1##_##v1; 19 | 20 | #endif 21 | 22 | FUNCPTR(D2CLIENT, InitGameMisc_I, void __stdcall, (uint32_t Dummy1, uint32_t Dummy2, uint32_t Dummy3), 0x4454B) // Updated 23 | VARPTR(STORM, MPQHashTable, uint32_t, 0x53120) // Updated 24 | ASMPTR(D2CLIENT, LoadAct_1, 0x62AA0) // Updated 25 | ASMPTR(D2CLIENT, LoadAct_2, 0x62760) // Updated 26 | FUNCPTR(D2COMMON, 27 | AddRoomData, 28 | void __stdcall, 29 | (Act* ptAct, int LevelId, int Xpos, int Ypos, Room1* pRoom), 30 | -10401)//Updated // 1.12 -10184 31 | FUNCPTR(D2COMMON, 32 | RemoveRoomData, 33 | void __stdcall, 34 | (Act* ptAct, int LevelId, int Xpos, int Ypos, Room1* pRoom), 35 | -11099)//Updated // 1.12 -11009 36 | FUNCPTR(D2COMMON, GetLevel, Level* __fastcall, (ActMisc* pMisc, uint32_t dwLevelNo), -10207)//Updated // 1.12 -11020 37 | 38 | FUNCPTR(D2COMMON, InitLevel, void __stdcall, (Level* pLevel), -10322)//Updated // 1.12 -10721 39 | FUNCPTR(D2COMMON, 40 | LoadAct, 41 | Act* __stdcall, 42 | (uint32_t ActNumber, uint32_t Seed, uint32_t Unk, void* pGame, uint32_t Difficulty, void* pMempool, uint32_t TownLevelId, uint32_t Func_1, uint32_t Func_2), 43 | -10951)//Updated 1.13 0x3CB30 // 1.12 0x56780 44 | FUNCPTR(D2COMMON, UnloadAct, void __stdcall, (Act* pAct), -10868) //Updated // 1.12 -10710 45 | 46 | FUNCPTR(FOG, 10021, void __fastcall, (const char* szProg), -10021) // 1.12 & 1.13 47 | FUNCPTR(FOG, 10101, uint32_t __fastcall, (uint32_t _1, uint32_t _2), -10101) // 1.12 & 1.13 48 | FUNCPTR(FOG, 10089, uint32_t __fastcall, (uint32_t _1), -10089) // 1.12 & 1.13 49 | FUNCPTR(FOG, 10218, uint32_t __fastcall, (void), -10218) // 1.12 & 1.13 50 | 51 | FUNCPTR(D2WIN, 10086, uint32_t __fastcall, (void), -10086) // Updated 52 | FUNCPTR(D2WIN, 10005, uint32_t __fastcall, (uint32_t _1, uint32_t _2, uint32_t _3, d2client_struct* pD2Client), -10005) //Updated 53 | 54 | FUNCPTR(D2LANG, 10008, uint32_t __fastcall, (uint32_t _1, const char* _2, uint32_t _3), -10008) //Updated 55 | FUNCPTR(D2COMMON, InitDataTables, uint32_t __stdcall, (uint32_t _1, uint32_t _2, uint32_t _3), -10943)//Updated //1.12 -10797 56 | 57 | #undef FUNCPTR 58 | #undef VARPTR 59 | #undef ASMPTR -------------------------------------------------------------------------------- /D2Map.DllWrapper/D2Structs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | struct UnitAny; 5 | struct Room1; 6 | struct Room2; 7 | struct Level; 8 | struct Act; 9 | struct ActMisc; 10 | struct RosterUnit; 11 | struct OverheadMsg; 12 | 13 | struct CollMap { //1.13? 14 | DWORD dwPosGameX; //0x00 15 | DWORD dwPosGameY; //0x04 16 | DWORD dwSizeGameX; //0x08 17 | DWORD dwSizeGameY; //0x0C 18 | DWORD dwPosRoomX; //0x10 19 | DWORD dwPosRoomY; //0x14 20 | DWORD dwSizeRoomX; //0x18 21 | DWORD dwSizeRoomY; //0x1C 22 | WORD* pMapStart; //0x20 23 | WORD* pMapEnd; //0x22 24 | }; 25 | 26 | #pragma pack(push, 1) 27 | struct d2client_struct { 28 | DWORD dwInit; 29 | BYTE _1[0x209]; 30 | DWORD fpInit; 31 | }; 32 | 33 | struct RoomTile 34 | { 35 | Room2* pRoom2; //0x00 36 | RoomTile* pNext; //0x04 37 | DWORD _2[2]; //0x08 38 | DWORD* nNum; //0x10 39 | }; 40 | 41 | //1.13c - PresetUnit - McGod 42 | struct PresetUnit 43 | { 44 | DWORD _1; //0x00 45 | DWORD dwTxtFileNo; //0x04 46 | DWORD dwPosX; //0x08 47 | PresetUnit* pPresetNext; //0x0C 48 | DWORD _3; //0x10 49 | DWORD dwType; //0x14 50 | DWORD dwPosY; //0x18 51 | }; 52 | 53 | //1.13c - Level - McGod 54 | struct Level { 55 | DWORD _1[4]; //0x00 56 | Room2* pRoom2First; //0x10 57 | DWORD _2[2]; //0x14 58 | DWORD dwPosX; //0x1C 59 | DWORD dwPosY; //0x20 60 | DWORD dwSizeX; //0x24 61 | DWORD dwSizeY; //0x28 62 | DWORD _3[96]; //0x2C 63 | Level* pNextLevel; //0x1AC 64 | DWORD _4; //0x1B0 65 | ActMisc* pMisc; //0x1B4 66 | DWORD _5[6]; //0x1BC 67 | DWORD dwLevelNo; //0x1D0 68 | }; 69 | 70 | //1.13c - Room2 - McGod 71 | struct Room2 { 72 | DWORD _1[2]; //0x00 73 | Room2** pRoom2Near; //0x08 74 | DWORD _2[6]; //0x0C 75 | Room2* pRoom2Next; //0x24 76 | DWORD dwRoomFlags; //0x28 77 | DWORD dwRoomsNear; //0x2C 78 | Room1* pRoom1; //0x30 79 | DWORD dwPosX; //0x34 80 | DWORD dwPosY; //0x38 81 | DWORD dwSizeX; //0x3C 82 | DWORD dwSizeY; //0x40 83 | DWORD _3; //0x44 84 | DWORD dwPresetType; //0x48 85 | RoomTile* pRoomTiles; //0x4C 86 | DWORD _4[2]; //0x50 87 | Level* pLevel; //0x58 88 | PresetUnit* pPreset; //0x5C 89 | }; 90 | 91 | //1.13c - Room1 - McGod 92 | struct Room1 { 93 | Room1** pRoomsNear; //0x00 94 | DWORD _1[3]; //0x04 95 | Room2* pRoom2; //0x10 96 | DWORD _2[3]; //0x14 97 | CollMap* Coll; //0x20 98 | DWORD dwRoomsNear; //0x24 99 | DWORD _3[9]; //0x28 100 | DWORD dwPosX; //0x4C 101 | DWORD dwPosY; //0x50 102 | DWORD dwSizeX; //0x54 103 | DWORD dwSizeY; //0x58 104 | DWORD _4[6]; //0x5C 105 | UnitAny* pUnitFirst; //0x74 106 | DWORD _5; //0x78 107 | Room1* pRoomNext; //0x7C 108 | }; 109 | 110 | 111 | //1.13c - ActMisc - McGod 112 | struct ActMisc { 113 | DWORD _1[37]; //0x00 114 | DWORD dwStaffTombLevel; //0x94 115 | DWORD _2[245]; //0x98 116 | Act* pAct; //0x46C 117 | DWORD _3[3]; //0x470 118 | Level* pLevelFirst; //0x47C 119 | }; 120 | 121 | //1.13c - Act - McGod 122 | struct Act { 123 | DWORD _1[3]; //0x00 124 | DWORD dwMapSeed; //0x0C 125 | Room1* pRoom1; //0x10 126 | DWORD dwAct; //0x14 127 | DWORD _2[12]; //0x18 128 | ActMisc* pMisc; //0x48 129 | }; 130 | #pragma pack(pop) -------------------------------------------------------------------------------- /D2Map.Core/Wrapper/Structs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace D2Map.Core.Wrapper 5 | { 6 | [StructLayout(LayoutKind.Explicit)] 7 | public unsafe struct Act 8 | { 9 | [FieldOffset(0xC)] public uint MapSeed; 10 | [FieldOffset(0x14)] public uint ActId; 11 | [FieldOffset(0x48)] public ActMisc* pActMisc; 12 | } 13 | 14 | [StructLayout(LayoutKind.Explicit)] 15 | public unsafe struct Level 16 | { 17 | [FieldOffset(0x10)] public Room2* pRoom2First; 18 | [FieldOffset(0x1C)] public uint dwPosX; 19 | [FieldOffset(0x20)] public uint dwPosY; 20 | [FieldOffset(0x24)] public uint dwSizeX; 21 | [FieldOffset(0x28)] public uint dwSizeY; 22 | [FieldOffset(0x1AC)] public Level* pNextLevel; 23 | [FieldOffset(0x1B4)] public ActMisc* pMisc; 24 | [FieldOffset(0x1D0)] public uint dwLevelNo; 25 | } 26 | 27 | [StructLayout(LayoutKind.Explicit)] 28 | public unsafe struct ActMisc 29 | { 30 | [FieldOffset(0x94)] public uint RealTombArea; 31 | [FieldOffset(0x46C)] public Act* pAct; 32 | [FieldOffset(0x47C)] public Level* pLevelFirst; 33 | } 34 | 35 | [StructLayout(LayoutKind.Explicit)] 36 | public unsafe struct CollMap 37 | { 38 | [FieldOffset(0x00)] public uint dwPosGameX; 39 | [FieldOffset(0x04)] public uint dwPosGameY; 40 | [FieldOffset(0x08)] public uint dwSizeGameX; 41 | [FieldOffset(0x0C)] public uint dwSizeGameY; 42 | [FieldOffset(0x10)] public uint dwPosRoomX; 43 | [FieldOffset(0x14)] public uint dwPosRoomY; 44 | [FieldOffset(0x18)] public uint dwSizeRoomX; 45 | [FieldOffset(0x1C)] public uint dwSizeRoomY; 46 | [FieldOffset(0x20)] public ushort* pMapStart; 47 | [FieldOffset(0x22)] public ushort* pMapEnd; 48 | }; 49 | 50 | [StructLayout(LayoutKind.Explicit)] 51 | public unsafe struct Room1 52 | { 53 | [FieldOffset(0x00)] public Room1** pRoomsNear; 54 | [FieldOffset(0x10)] public Room2* pRoom2; 55 | [FieldOffset(0x20)] public CollMap* Coll; 56 | [FieldOffset(0x24)] public uint numRoomsNear; 57 | [FieldOffset(0x4C)] public uint dwPosX; 58 | [FieldOffset(0x50)] public uint dwPosY; 59 | [FieldOffset(0x54)] public uint dwSizeX; 60 | [FieldOffset(0x58)] public uint dwSizeY; 61 | [FieldOffset(0x74)] public IntPtr pUnitFirst; 62 | [FieldOffset(0x7C)] public Room1* pRoomNext; 63 | } 64 | 65 | [StructLayout(LayoutKind.Explicit)] 66 | public unsafe struct PresetUnit 67 | { 68 | [FieldOffset(0x04)] public uint dwTxtFileNo; 69 | [FieldOffset(0x08)] public uint dwPosX; 70 | [FieldOffset(0x0C)] public PresetUnit* pPresetNext; 71 | [FieldOffset(0x14)] public uint dwType; 72 | [FieldOffset(0x18)] public uint dwPosY; 73 | }; 74 | 75 | [StructLayout(LayoutKind.Explicit)] 76 | public unsafe struct RoomTile 77 | { 78 | [FieldOffset(0x00)] public Room2* pRoom2; 79 | [FieldOffset(0x04)] public RoomTile* pNext; 80 | [FieldOffset(0x10)] public uint* nNum; 81 | }; 82 | 83 | [StructLayout(LayoutKind.Explicit)] 84 | public unsafe struct Room2 85 | { 86 | [FieldOffset(0x08)] public Room2** pRoom2Near; 87 | [FieldOffset(0x24)] public Room2* pRoom2Next; 88 | [FieldOffset(0x30)] public Room1* pRoom1; 89 | [FieldOffset(0x2C)] public uint dwRoomsNear; 90 | [FieldOffset(0x34)] public uint dwPosX; 91 | [FieldOffset(0x38)] public uint dwPosY; 92 | [FieldOffset(0x3C)] public uint dwSizeX; 93 | [FieldOffset(0x40)] public uint dwSizeY; 94 | [FieldOffset(0x4C)] public RoomTile* pRoomTiles; 95 | [FieldOffset(0x58)] public Level* pLevel; 96 | [FieldOffset(0x5C)] public PresetUnit* pPreset; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /D2Map.Core/Models/Area.cs: -------------------------------------------------------------------------------- 1 | namespace D2Map.Core.Models 2 | { 3 | public enum Area : ushort 4 | { 5 | None = 0, 6 | RogueEncampment = 1, 7 | BloodMoor = 2, 8 | ColdPlains = 3, 9 | StonyFields = 4, 10 | DarkWood = 5, 11 | BlackMarsh = 6, 12 | TamoeHighland = 7, 13 | DenOfEvil = 8, 14 | CaveLevel1 = 9, 15 | UndergroundPassageLevel1 = 10, 16 | HoleLevel1 = 11, 17 | PitLevel1 = 12, 18 | CaveLevel2 = 13, 19 | UndergroundPassageLevel2 = 14, 20 | HoleLevel2 = 15, 21 | PitLevel2 = 16, 22 | BurialGrounds = 17, 23 | Crypt = 18, 24 | Mausoleum = 19, 25 | ForgottenTower = 20, 26 | TowerCellarLevel1 = 21, 27 | TowerCellarLevel2 = 22, 28 | TowerCellarLevel3 = 23, 29 | TowerCellarLevel4 = 24, 30 | TowerCellarLevel5 = 25, 31 | MonasteryGate = 26, 32 | OuterCloister = 27, 33 | Barracks = 28, 34 | JailLevel1 = 29, 35 | JailLevel2 = 30, 36 | JailLevel3 = 31, 37 | InnerCloister = 32, 38 | Cathedral = 33, 39 | CatacombsLevel1 = 34, 40 | CatacombsLevel2 = 35, 41 | CatacombsLevel3 = 36, 42 | CatacombsLevel4 = 37, 43 | Tristram = 38, 44 | CowLevel = 39, 45 | LutGholein = 40, 46 | RockyWaste = 41, 47 | DryHills = 42, 48 | FarOasis = 43, 49 | LostCity = 44, 50 | ValleyOfSnakes = 45, 51 | CanyonOfTheMagi = 46, 52 | SewersLevel1 = 47, 53 | SewersLevel2 = 48, 54 | SewersLevel3 = 49, 55 | HaremLevel1 = 50, 56 | HaremLevel2 = 51, 57 | PalaceCellarLevel1 = 52, 58 | PalaceCellarLevel2 = 53, 59 | PalaceCellarLevel3 = 54, 60 | StonyTombLevel1 = 55, 61 | HallsOfTheDeadLevel1 = 56, 62 | HallsOfTheDeadLevel2 = 57, 63 | ClawViperTempleLevel1 = 58, 64 | StonyTombLevel2 = 59, 65 | HallsOfTheDeadLevel3 = 60, 66 | ClawViperTempleLevel2 = 61, 67 | MaggotLairLevel1 = 62, 68 | MaggotLairLevel2 = 63, 69 | MaggotLairLevel3 = 64, 70 | AncientTunnels = 65, 71 | TalRashasTomb1 = 66, 72 | TalRashasTomb2 = 67, 73 | TalRashasTomb3 = 68, 74 | TalRashasTomb4 = 69, 75 | TalRashasTomb5 = 70, 76 | TalRashasTomb6 = 71, 77 | TalRashasTomb7 = 72, 78 | DurielsLair = 73, 79 | ArcaneSanctuary = 74, 80 | KurastDocks = 75, 81 | SpiderForest = 76, 82 | GreatMarsh = 77, 83 | FlayerJungle = 78, 84 | LowerKurast = 79, 85 | KurastBazaar = 80, 86 | UpperKurast = 81, 87 | KurastCauseWay = 82, 88 | Travincal = 83, 89 | SpiderCave = 84, 90 | SpiderCavern = 85, 91 | SwampyPitLevel1 = 86, 92 | SwampyPitLevel2 = 87, 93 | FlayerDungeonLevel1 = 88, 94 | FlayerDungeonLevel2 = 89, 95 | SwampyPitLevel3 = 90, 96 | FlayerDungeonLevel3 = 91, 97 | Sewers2Level1 = 92, 98 | Sewers2Level2 = 93, 99 | RuinedTemple = 94, 100 | DisusedFane = 95, 101 | ForgottenReliquary = 96, 102 | ForgottenTemple = 97, 103 | RuinedFane = 98, 104 | DisusedReliquary = 99, 105 | DuranceOfHateLevel1 = 100, 106 | DuranceOfHateLevel2 = 101, 107 | DuranceOfHateLevel3 = 102, 108 | ThePandemoniumFortress = 103, 109 | OuterSteppes = 104, 110 | PlainsOfDespair = 105, 111 | CityOfTheDamned = 106, 112 | RiverOfFlame = 107, 113 | ChaosSanctuary = 108, 114 | Harrogath = 109, 115 | BloodyFoothills = 110, 116 | FrigidHighlands = 111, 117 | ArreatPlateau = 112, 118 | CrystalizedCavernLevel1 = 113, 119 | CellarOfPity = 114, 120 | CrystalizedCavernLevel2 = 115, 121 | EchoChamber = 116, 122 | FrozenTundra = 117, 123 | CrystallinePassage = 118, 124 | GlacialTrail = 119, 125 | TheAncientsWay = 120, 126 | NihlathaksTemple = 121, 127 | hallsOfAnguish = 122, 128 | HallsOfPain = 123, 129 | HallsOfVaught = 124, 130 | Hell1 = 125, 131 | Hell2 = 126, 132 | Hell3 = 127, 133 | TheWorldStoneKeepLevel1 = 128, 134 | TheWorldStoneKeepLevel2 = 129, 135 | TheWorldStoneKeepLevel3 = 130, 136 | ThroneOfDestruction = 131, 137 | TheWorldStoneChamber = 132 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /D2Map.DllWrapper/exports.cpp: -------------------------------------------------------------------------------- 1 | #include "exports.h" 2 | #include "stdafx.h" 3 | #define _DEFINE_VARS 4 | #include "d2ptrs.h" 5 | 6 | d2client_struct D2Client; 7 | 8 | uint32_t GetDllOffset(const char* dll, int32_t offset) { 9 | auto hmod = GetModuleHandleA(dll); 10 | if (!hmod) 11 | hmod = LoadLibraryA(dll); 12 | if (!hmod) 13 | return NULL; 14 | if (offset < 0) 15 | return (uint32_t)GetProcAddress(hmod, (LPCSTR)(-offset)); 16 | return ((uint32_t)hmod) + offset; 17 | } 18 | 19 | uint32_t GetDllOffset(int32_t num) { 20 | static const char* dlls[] = { "D2Client.DLL", "D2Common.DLL", "D2Gfx.DLL", "D2Lang.DLL", 21 | "D2Win.DLL", "D2Net.DLL", "D2Game.DLL", "D2Launch.DLL", "Fog.DLL", "BNClient.DLL", 22 | "Storm.DLL", "D2Cmp.DLL" }; 23 | if ((num & 0xff) > 12) 24 | return NULL; 25 | return GetDllOffset(dlls[num & 0xff], num >> 8); 26 | } 27 | 28 | bool setup_game_dlls() { 29 | PVOID ptrsToLoad[] = { 30 | &D2CLIENT_InitGameMisc_I, 31 | &p_STORM_MPQHashTable, 32 | &D2CLIENT_LoadAct_1, 33 | &D2CLIENT_LoadAct_2, 34 | &D2COMMON_AddRoomData, 35 | &D2COMMON_RemoveRoomData, 36 | &D2COMMON_GetLevel, 37 | &D2COMMON_InitLevel, 38 | &D2COMMON_LoadAct, 39 | &D2COMMON_UnloadAct, 40 | &FOG_10021, 41 | &FOG_10101, 42 | &FOG_10089, 43 | &FOG_10218, 44 | &D2WIN_10086, 45 | &D2WIN_10005, 46 | &D2LANG_10008, 47 | &D2COMMON_InitDataTables, 48 | }; 49 | DWORD ptrSaved[sizeof(ptrsToLoad) / sizeof(PVOID)] = {}; 50 | for (auto i = 0u; i < sizeof(ptrsToLoad) / sizeof(PVOID); ++i) 51 | ptrSaved[i] = *(DWORD*)ptrsToLoad[i]; 52 | bool result = true; 53 | for (auto* ptr : ptrsToLoad) { 54 | auto* p = (DWORD*)ptr; 55 | auto offset = GetDllOffset(*p); 56 | if (!offset) { result = false; break; } 57 | *p = offset; 58 | } 59 | if (!result) 60 | for (auto i = 0u; i < sizeof(ptrsToLoad) / sizeof(PVOID); ++i) 61 | *(DWORD*)ptrsToLoad[i] = ptrSaved[i]; 62 | return result; 63 | } 64 | 65 | #if defined(_MSC_VER) 66 | void __declspec(naked) D2CLIENT_InitGameMisc(void) 67 | { 68 | __asm 69 | { 70 | PUSH ECX 71 | PUSH EBP 72 | PUSH ESI 73 | PUSH EDI 74 | JMP D2CLIENT_InitGameMisc_I 75 | RETN 76 | } 77 | } 78 | #else 79 | void __attribute__((naked)) D2CLIENT_InitGameMisc() { 80 | asm volatile ( 81 | "push %%ecx\n" 82 | "push %%ebp\n" 83 | "push %%esi\n" 84 | "push %%edi\n" 85 | "jmp *%0\n" 86 | "ret" 87 | : 88 | : "r"(D2CLIENT_InitGameMisc_I) 89 | ); 90 | } 91 | #endif 92 | 93 | uint32_t D2ClientInterface() { 94 | return D2Client.dwInit; 95 | } 96 | 97 | bool Initialize(const wchar_t* path) { 98 | wchar_t szPath[260] = { 0 }; 99 | GetCurrentDirectoryW(260, szPath); 100 | if (path[0] != 0 && path[lstrlenW(path) - 1] != '\\') { 101 | wchar_t gameDir[260]; 102 | lstrcpyW(gameDir, path); 103 | lstrcatW(gameDir, L"\\"); 104 | SetCurrentDirectoryW(gameDir); 105 | } 106 | else { 107 | SetCurrentDirectoryW(path); 108 | } 109 | 110 | memset(&D2Client, 0, sizeof(d2client_struct)); 111 | if (!setup_game_dlls()) 112 | return false; 113 | 114 | *p_STORM_MPQHashTable = 0; 115 | D2Client.dwInit = 1; 116 | D2Client.fpInit = (DWORD)D2ClientInterface; 117 | 118 | FOG_10021("D2"); 119 | FOG_10101(1, 0); 120 | FOG_10089(1); 121 | 122 | if (!FOG_10218()) 123 | return false; 124 | 125 | if (!D2WIN_10086() || !D2WIN_10005(0, 0, 0, &D2Client)) 126 | return false; 127 | 128 | D2LANG_10008(0, "ENG", 0); 129 | 130 | if (!D2COMMON_InitDataTables(0, 0, 0)) 131 | return false; 132 | 133 | D2CLIENT_InitGameMisc(); 134 | 135 | SetCurrentDirectoryW(szPath); 136 | return true; 137 | } 138 | 139 | Level* GetLevel(ActMisc* misc, uint32_t levelno) { 140 | for (Level* pLevel = misc->pLevelFirst; pLevel; pLevel = pLevel->pNextLevel) 141 | if (pLevel->dwLevelNo == levelno) 142 | return pLevel; 143 | return D2COMMON_GetLevel(misc, levelno); 144 | } 145 | 146 | void InitLevel(Level* pLevel) { 147 | return D2COMMON_InitLevel(pLevel); 148 | } 149 | 150 | void AddRoomData(Act* pAct, int32_t levelid, int32_t xpos, int32_t ypos, Room1* pRoom) { 151 | return D2COMMON_AddRoomData(pAct, levelid, xpos, ypos, pRoom); 152 | } 153 | 154 | void RemoveRoomData(Act* pAct, int32_t levelid, int32_t xpos, int32_t ypos, Room1* pRoom) { 155 | return D2COMMON_RemoveRoomData(pAct, levelid, xpos, ypos, pRoom); 156 | } 157 | 158 | Act* LoadAct(uint32_t actno, uint32_t seed, uint32_t difficulty, uint32_t TownLevelId) { 159 | return D2COMMON_LoadAct(actno, seed, TRUE, FALSE, difficulty, NULL, TownLevelId, D2CLIENT_LoadAct_1, D2CLIENT_LoadAct_2); 160 | } 161 | 162 | void UnloadAct(Act* pAct) { 163 | return D2COMMON_UnloadAct(pAct); 164 | } -------------------------------------------------------------------------------- /D2Map.DllWrapper/D2Map.DllWrapper.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | 18.0 15 | Win32Proj 16 | {016346a9-c02e-4af2-bf0f-6c4593b43352} 17 | D2Map.DllWrapper 18 | 10.0 19 | D2Map.DllWrapper 20 | 21 | 22 | 23 | DynamicLibrary 24 | true 25 | v145 26 | Unicode 27 | 28 | 29 | DynamicLibrary 30 | false 31 | v145 32 | false 33 | Unicode 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | true 49 | $(IncludePath) 50 | $(Configuration)\ 51 | 52 | 53 | false 54 | $(IncludePath) 55 | $(Configuration)\ 56 | 57 | 58 | false 59 | 60 | 61 | 62 | Level3 63 | true 64 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 65 | true 66 | MultiThreadedDebug 67 | 68 | 69 | Console 70 | true 71 | 72 | 73 | 74 | 75 | Level3 76 | true 77 | true 78 | true 79 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 80 | true 81 | Disabled 82 | MultiThreaded 83 | 84 | 85 | Console 86 | true 87 | true 88 | true 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /D2Map.Core/Helpers/MapHelpers.cs: -------------------------------------------------------------------------------- 1 | using D2Map.Core.Models; 2 | using D2Map.Core.Wrapper; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | namespace D2Map.Core.Helpers 7 | { 8 | public static class MapHelpers 9 | { 10 | static public uint[] ActLevels = { 1, 40, 75, 103, 109, 137 }; 11 | 12 | static private uint unit_type_npc = 1; 13 | static private uint unit_type_object = 2; 14 | static private uint unit_type_tile = 5; 15 | public static Models.Act GetAct(Area area) 16 | { 17 | for (uint i = 1; i < 5; ++i) 18 | { 19 | if ((int)area < ActLevels[i]) 20 | { 21 | return (Models.Act)(i - 1); 22 | } 23 | } 24 | return Models.Act.Act5; 25 | } 26 | 27 | public unsafe static CollisionMap BuildCollissionMap(Wrapper.Act* act, Area area) 28 | { 29 | var collisionMap = new CollisionMap(); 30 | if (act->pActMisc->RealTombArea != 0) 31 | { 32 | collisionMap.TombArea = (Area)act->pActMisc->RealTombArea; 33 | } 34 | 35 | Level* pLevel = MapDll.GetLevel(act->pActMisc, (uint)area); 36 | 37 | if (pLevel != null) 38 | { 39 | if (pLevel->pRoom2First == null) 40 | { 41 | MapDll.InitLevel(pLevel); 42 | } 43 | 44 | if (pLevel->pRoom2First != null) 45 | { 46 | collisionMap.LevelOrigin = new Point(pLevel->dwPosX * 5, pLevel->dwPosY * 5); 47 | int width = (int)pLevel->dwSizeX * 5; 48 | int height = (int)pLevel->dwSizeY * 5; 49 | collisionMap.Map = new List>(height); 50 | for (int i = 0; i < height; i++) 51 | { 52 | collisionMap.Map.Add(new List(Enumerable.Repeat(-1, width))); 53 | } 54 | 55 | for (Room2* pRoom2 = pLevel->pRoom2First; pRoom2 != null; pRoom2 = pRoom2->pRoom2Next) 56 | { 57 | bool bAdded = false; 58 | 59 | if (pRoom2->pRoom1 == null) 60 | { 61 | bAdded = true; 62 | MapDll.AddRoomData(act, pLevel->dwLevelNo, pRoom2->dwPosX, pRoom2->dwPosY, null); 63 | } 64 | 65 | // levels near 66 | for (uint i = 0; i < pRoom2->dwRoomsNear; i++) 67 | { 68 | if (pLevel->dwLevelNo != pRoom2->pRoom2Near[i]->pLevel->dwLevelNo) 69 | { 70 | var originX = pRoom2->pRoom2Near[i]->pLevel->dwPosX * 5; 71 | var originY = pRoom2->pRoom2Near[i]->pLevel->dwPosY * 5; 72 | var origin = new Point(originX, originY); 73 | var newLevelWidth = pRoom2->pRoom2Near[i]->pLevel->dwSizeX * 5; 74 | var newLevelHeight = pRoom2->pRoom2Near[i]->pLevel->dwSizeY * 5; 75 | 76 | var levelNumber = pRoom2->pRoom2Near[i]->pLevel->dwLevelNo; 77 | var adjacentLevel = new AdjacentLevel { LevelOrigin = origin, Width = (int)newLevelWidth, Height = (int)newLevelHeight }; 78 | collisionMap.AdjacentLevels.TryAdd(levelNumber.ToString(), adjacentLevel); 79 | } 80 | } 81 | 82 | // add collision data 83 | if (pRoom2->pRoom1 != null && pRoom2->pRoom1->Coll != null) 84 | { 85 | var x = pRoom2->pRoom1->Coll->dwPosGameX - collisionMap.LevelOrigin.X; 86 | var y = pRoom2->pRoom1->Coll->dwPosGameY - collisionMap.LevelOrigin.Y; 87 | var cx = pRoom2->pRoom1->Coll->dwSizeGameX; 88 | var cy = pRoom2->pRoom1->Coll->dwSizeGameY; 89 | var nLimitX = x + cx; 90 | var nLimitY = y + cy; 91 | 92 | var p = pRoom2->pRoom1->Coll->pMapStart; 93 | for (var j = y; j < nLimitY; j++) 94 | { 95 | for (var i = x; i < nLimitX; i++) 96 | { 97 | collisionMap.Map[(int)j][(int)i] = *p++; 98 | } 99 | } 100 | } 101 | 102 | // add unit data 103 | for (PresetUnit* pPresetUnit = pRoom2->pPreset; pPresetUnit != null; pPresetUnit = pPresetUnit->pPresetNext) 104 | { 105 | // npcs 106 | if (pPresetUnit->dwType == unit_type_npc) 107 | { 108 | var npcX = pRoom2->dwPosX * 5 + pPresetUnit->dwPosX; 109 | var npcY = pRoom2->dwPosY * 5 + pPresetUnit->dwPosY; 110 | var fileNumber = pPresetUnit->dwTxtFileNo.ToString(); 111 | if (!collisionMap.Npcs.TryAdd(fileNumber, new List { new Point(npcX, npcY) })) 112 | { 113 | collisionMap.Npcs[fileNumber].Add(new Point(npcX, npcY)); 114 | } 115 | } 116 | 117 | // objects 118 | if (pPresetUnit->dwType == unit_type_object) 119 | { 120 | var objectX = pRoom2->dwPosX * 5 + pPresetUnit->dwPosX; 121 | var objectY = pRoom2->dwPosY * 5 + pPresetUnit->dwPosY; 122 | var fileNumber = pPresetUnit->dwTxtFileNo.ToString(); 123 | if (!collisionMap.Objects.TryAdd(fileNumber, new List { new Point(objectX, objectY) })) 124 | { 125 | collisionMap.Objects[fileNumber].Add(new Point(objectX, objectY)); 126 | } 127 | } 128 | 129 | // level exits 130 | if (pPresetUnit->dwType == unit_type_tile) 131 | { 132 | for (RoomTile* pRoomTile = pRoom2->pRoomTiles; pRoomTile != null; pRoomTile = pRoomTile->pNext) 133 | { 134 | if (*pRoomTile->nNum == pPresetUnit->dwTxtFileNo) 135 | { 136 | var exitX = pRoom2->dwPosX * 5 + pPresetUnit->dwPosX; 137 | var exitY = pRoom2->dwPosY * 5 + pPresetUnit->dwPosY; 138 | 139 | var levelNumber = pRoomTile->pRoom2->pLevel->dwLevelNo.ToString(); 140 | collisionMap.AdjacentLevels[levelNumber].Exits.Add(new Point(exitX, exitY)); 141 | } 142 | } 143 | } 144 | } 145 | 146 | if (bAdded) 147 | { 148 | MapDll.RemoveRoomData(act, pLevel->dwLevelNo, pRoom2->dwPosX, pRoom2->dwPosY, null); 149 | } 150 | } 151 | } 152 | } 153 | 154 | return collisionMap; 155 | } 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd --------------------------------------------------------------------------------