├── .gitignore ├── LICENSE ├── README.md └── Source ├── MDK-Debug.sln └── MDK-Debug ├── BindingException.cs ├── FileDialog.cs ├── MDK-Debug.csproj ├── Plugin.cs ├── ProgrammableBlockExtensions.cs ├── ProgrammableBlockProxy.cs ├── Resources.cs ├── SpaceEngineersPath.props ├── SpaceEngineersReferences.props └── publish.bat /.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 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | /Source/MDK-Debug/Properties/launchSettings.json 352 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Malware 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MDK-Debug 2 | ***NON-FUNCTIONAL*** 3 | Since Keen now has removed direct plugin support, this project is dead. It would have to be rewritten to be a PluginLoader plugin - but since I personally don't use this plugin any longer, I have no incentive to maintain it. Sorry. 4 | 5 | Utility plugin for Space Engineers, allowing direct debugging of Programmable Block scripts via Space Engineers. Designed for MDK projects. 6 | 7 | **This plugin owes its existence to Inflex, who created the first version of it. By his permission I have rewritten and adapted it for use with MDK projects, but his basic methodology survives.** 8 | 9 | ## Remarks 10 | This plugin is currently a prototype. It should _work_ but it's technically not in a "releasable" state yet and I haven't really decided how much I should truly integrate it with MDK. Most likely the assembly selection method will remain 11 | for people who don't want to use MDK, and we'll see if I integrate it more completely with MDK. 12 | 13 | 14 | ## Usage 15 | * Installation: 16 | Create a shortcut on your desktop, or start menu or whereever you want it. 17 | Set it up to point to your Steam.exe file (you'll probably find it in `"C:\Program Files (x86)\Steam"`). 18 | Configure its arguments so they look like this: `Steam.exe -applaunch 244850 -plugin "path\to\MDK-Debug.dll" 19 | * Debugging: 20 | * Start the debugging shortcut 21 | * It is **highly recommended** that you set your Space Engineers up to run in a borderless window or windowed mode, not fullscreen. Otherwise you'll likely get Space Engineers on top, unresponsive, with Visual Studio on a breakpoint behind it, being difficult to get at. 22 | * Open the MDK project you wish to debug 23 | * Compile it 24 | * Make sure SE has completely started, then - in Visual Studio - press the `Debug` menu, `Attach to Process`, and select Space Engineers in the process list. 25 | * In Space Engineers, Create or load a world where you have a programmable block you wish to test in 26 | * Open the programmable block in question, select "MDK-SE: Bind DLL" 27 | * Select the `.exe` file generated for your MDK project. You'll find it in the `bin` folder of your MDK project 28 | * The program will be immediately loaded and started, so you might want to have placed breakpoints already. 29 | 30 | 31 | -------------------------------------------------------------------------------- /Source/MDK-Debug.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.8.34330.188 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MDK-Debug", "MDK-Debug\MDK-Debug.csproj", "{DED59CDE-040A-4E5B-8309-51D6437D5B6B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {DED59CDE-040A-4E5B-8309-51D6437D5B6B}.Debug|x64.ActiveCfg = Debug|x64 17 | {DED59CDE-040A-4E5B-8309-51D6437D5B6B}.Debug|x64.Build.0 = Debug|x64 18 | {DED59CDE-040A-4E5B-8309-51D6437D5B6B}.Debug|x86.ActiveCfg = Debug|Any CPU 19 | {DED59CDE-040A-4E5B-8309-51D6437D5B6B}.Debug|x86.Build.0 = Debug|Any CPU 20 | {DED59CDE-040A-4E5B-8309-51D6437D5B6B}.Release|x64.ActiveCfg = Release|x64 21 | {DED59CDE-040A-4E5B-8309-51D6437D5B6B}.Release|x64.Build.0 = Release|x64 22 | {DED59CDE-040A-4E5B-8309-51D6437D5B6B}.Release|x86.ActiveCfg = Release|Any CPU 23 | {DED59CDE-040A-4E5B-8309-51D6437D5B6B}.Release|x86.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {C87DAE87-D0E1-42D8-AE6D-7B4397062195} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /Source/MDK-Debug/BindingException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace MDK.Debug 5 | { 6 | [Serializable] 7 | public class BindingException : Exception 8 | { 9 | public BindingException() { } 10 | public BindingException(string message) : base(message) { } 11 | public BindingException(string message, Exception inner) : base(message, inner) { } 12 | 13 | protected BindingException( 14 | SerializationInfo info, 15 | StreamingContext context) : base(info, context) { } 16 | } 17 | } -------------------------------------------------------------------------------- /Source/MDK-Debug/FileDialog.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using System.Windows.Forms; 4 | using VRage.Utils; 5 | 6 | namespace MDK.Debug 7 | { 8 | public static class FileDialog 9 | { 10 | public static async Task RequestFileName(string title, string filter, string fileName) 11 | { 12 | MyLog.Default.WriteLine($"Synchronization Context, before thread: {SynchronizationContext.Current != null}"); 13 | MyLog.Default.Flush(); 14 | //var tcs = new TaskCompletionSource(); 15 | //var thread = new Thread(() => 16 | //{ 17 | var dialog = new OpenFileDialog 18 | { 19 | Title = title, 20 | Filter = filter, 21 | FileName = fileName, 22 | CheckFileExists = true, 23 | CheckPathExists = true, 24 | ShowReadOnly = false, 25 | AutoUpgradeEnabled = true 26 | }; 27 | 28 | //MyLog.Default.WriteLine($"Synchronization Context, before dialog: {SynchronizationContext.Current != null}"); 29 | //MyLog.Default.Flush(); 30 | //var response = dialog.ShowDialog(Plugin.Current) == DialogResult.OK ? dialog.FileName : null; 31 | return dialog.ShowDialog(Plugin.Current) == DialogResult.OK ? dialog.FileName : null; 32 | //MyLog.Default.WriteLine($"Synchronization Context, after dialog: {SynchronizationContext.Current != null}"); 33 | //MyLog.Default.Flush(); 34 | //tcs.SetResult(response); 35 | //}); 36 | //thread.SetApartmentState(ApartmentState.STA); 37 | //thread.Start(); 38 | //MyLog.Default.WriteLine($"Before await {Thread.CurrentThread.ManagedThreadId}"); 39 | //MyLog.Default.Flush(); 40 | //var result = await tcs.Task.ConfigureAwait(false); 41 | //MyLog.Default.WriteLine($"After await {Thread.CurrentThread.ManagedThreadId}"); 42 | //MyLog.Default.Flush(); 43 | //await Plugin.SwitchToMainThread().ConfigureAwait(false); 44 | //MyLog.Default.WriteLine($"After thread switch {Thread.CurrentThread.ManagedThreadId}"); 45 | //MyLog.Default.Flush(); 46 | //return result; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /Source/MDK-Debug/MDK-Debug.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net461 5 | MDK.Debug 6 | AnyCPU;x64 7 | 8 | 9 | 10 | D:\Repos\SpaceEngineers\MDK-Debug\Bin\ 11 | 12 | 13 | 14 | bin\Debug 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Source/MDK-Debug/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using System.Windows.Forms; 5 | using Sandbox.ModAPI; 6 | using SpaceEngineers.Game; 7 | using VRage.Plugins; 8 | 9 | namespace MDK.Debug 10 | { 11 | public class Plugin : IPlugin, IWin32Window 12 | { 13 | public const string Ident = "MDK-Debug"; 14 | 15 | static int _mainThreadId; 16 | 17 | public static bool IsMainThread() 18 | { 19 | return Thread.CurrentThread.ManagedThreadId == _mainThreadId; 20 | } 21 | 22 | public static Task SwitchToMainThread() 23 | { 24 | if (IsMainThread() || MyAPIGateway.Utilities == null) 25 | return Task.CompletedTask; 26 | var tcs = new TaskCompletionSource(); 27 | MyAPIGateway.Utilities.InvokeOnGameThread(() => tcs.SetResult(null), Plugin.Ident); 28 | return tcs.Task; 29 | } 30 | 31 | public static Plugin Current { get; private set; } 32 | 33 | readonly ProgrammableBlockExtensions _programmableBlockExtensions; 34 | 35 | public Plugin() 36 | { 37 | Current = this; 38 | _programmableBlockExtensions = new ProgrammableBlockExtensions(); 39 | _mainThreadId = Thread.CurrentThread.ManagedThreadId; 40 | } 41 | 42 | public SpaceEngineersGame Game { get; private set; } 43 | 44 | public void Init(object gameInstance) 45 | { 46 | Game = (SpaceEngineersGame)gameInstance; 47 | } 48 | 49 | public void Update() 50 | { 51 | if (!_programmableBlockExtensions.IsInstalled) 52 | _programmableBlockExtensions.Install(); 53 | } 54 | 55 | public void Dispose() 56 | { 57 | Current = null; 58 | } 59 | 60 | public IntPtr Handle => ((Form)Game.GameRenderComponent?.RenderThread?.RenderWindow)?.Handle ?? IntPtr.Zero; 61 | } 62 | } -------------------------------------------------------------------------------- /Source/MDK-Debug/ProgrammableBlockExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Threading; 7 | using Sandbox.Engine.Utils; 8 | using Sandbox.Game.Entities.Blocks; 9 | using Sandbox.Game.Gui; 10 | using Sandbox.Game.World; 11 | using Sandbox.ModAPI; 12 | using Sandbox.ModAPI.Ingame; 13 | using VRage.Game.Entity; 14 | using VRage.Utils; 15 | 16 | namespace MDK.Debug 17 | { 18 | public class ProgrammableBlockExtensions 19 | { 20 | readonly Dictionary _proxyCache = new Dictionary(); 21 | 22 | public bool IsInstalled { get; private set; } 23 | 24 | public bool IsFaulted { get; private set; } 25 | 26 | public bool HasLoadedProgram { get; private set; } 27 | 28 | public void Install() 29 | { 30 | if (IsInstalled || IsFaulted) 31 | return; 32 | 33 | // Custom terminal control needs to be initialized after game controls otherwise game fails it initialize it's own 34 | if (!MyTerminalControlFactory.AreControlsCreated()) 35 | return; 36 | 37 | if (MyTerminalControlFactory.GetControls(typeof(MyProgrammableBlock)).Any(x => x.Id == "MDK-Debug-BindScriptDLL")) 38 | return; 39 | 40 | IsInstalled = true; 41 | 42 | var editIndex = FindEditButtonIndex(); 43 | if (editIndex < 0) 44 | { 45 | MyLog.Default.WriteLine($"{Plugin.Ident}: {Resources.ProgrammableBlockExtensions_Install_NoEditButton}"); 46 | MyAPIGateway.Utilities.ShowMessage(Plugin.Ident, Resources.ProgrammableBlockExtensions_Install_NoEditButton); 47 | IsInstalled = true; 48 | IsFaulted = true; 49 | return; 50 | } 51 | 52 | var button = new MyTerminalControlButton("MDK-Debug-UnbindScriptDll", MyStringId.GetOrCompute($"{Plugin.Ident}: {Resources.ProgrammableBlockExtensions_Install_UnbindDLLButtonText}"), MyStringId.NullOrEmpty, OnUnbindScriptDll) 53 | { 54 | Visible = IsUnbindButtonVisible, 55 | Enabled = IsUnbindButtonEnabled 56 | }; 57 | MyTerminalControlFactory.AddControl(editIndex, button); 58 | 59 | button = new MyTerminalControlButton("MDK-Debug-BindScriptDLL", MyStringId.GetOrCompute($"{Plugin.Ident}: {Resources.ProgrammableBlockExtensions_Install_BindDLLButtonText}"), MyStringId.NullOrEmpty, OnBindScriptDll) 60 | { 61 | Visible = IsBindButtonVisible, 62 | Enabled = IsBindButtonEnabled, 63 | }; 64 | MyTerminalControlFactory.AddControl(editIndex, button); 65 | 66 | button = new MyTerminalControlButton("MDK-Debug-AttachDebugger", MyStringId.GetOrCompute($"{Plugin.Ident}: {Resources.ProgrammableBlockExtensions_Install_AttachDebugger}"), MyStringId.NullOrEmpty, OnAttachDebugger) 67 | { 68 | Visible = IsAttachDebuggerButtonVisible, 69 | Enabled = IsAttachDebuggerButtonEnabled 70 | }; 71 | MyTerminalControlFactory.AddControl(editIndex, button); 72 | 73 | MySession.OnUnloading += Unload; 74 | 75 | MyLog.Default.WriteLine($"{Plugin.Ident}: {Resources.ProgrammableBlockExtensions_Install_Ready}"); 76 | MyAPIGateway.Utilities.ShowMessage(Plugin.Ident, Resources.ProgrammableBlockExtensions_Install_Ready); 77 | } 78 | 79 | int FindEditButtonIndex() 80 | { 81 | var controls = MyTerminalControlFactory.GetControls(typeof(MyProgrammableBlock)); 82 | for (var i = 0; i < controls.Count; i++) 83 | { 84 | if (controls.ItemAt(i).Id == "Edit") 85 | return i; 86 | } 87 | 88 | return -1; 89 | } 90 | 91 | bool IsWorkable() => MyFakes.ENABLE_PROGRAMMABLE_BLOCK && MySession.Static.EnableIngameScripts && !IsFaulted; 92 | 93 | bool IsAttachDebuggerButtonEnabled(MyProgrammableBlock programmableBlock) 94 | { 95 | return IsWorkable() && !Debugger.IsAttached; 96 | } 97 | 98 | bool IsAttachDebuggerButtonVisible(MyProgrammableBlock programmableBlock) 99 | { 100 | return IsWorkable(); 101 | } 102 | 103 | void OnAttachDebugger(MyProgrammableBlock programmableBlock) 104 | { 105 | if (!Debugger.IsAttached) 106 | Debugger.Launch(); 107 | } 108 | 109 | bool IsUnbindButtonVisible(MyProgrammableBlock programmableBlock) 110 | { 111 | return IsWorkable(); 112 | } 113 | 114 | bool IsUnbindButtonEnabled(MyProgrammableBlock programmableBlock) 115 | { 116 | return IsWorkable() && _proxyCache.TryGetValue(programmableBlock, out var proxy) && proxy.HasLoadedProgram; 117 | } 118 | 119 | bool IsBindButtonVisible(MyProgrammableBlock programmableBlock) 120 | { 121 | return IsWorkable(); 122 | } 123 | 124 | bool IsBindButtonEnabled(MyProgrammableBlock programmableBlock) 125 | { 126 | return IsWorkable(); 127 | } 128 | 129 | async void OnBindScriptDll(MyProgrammableBlock programmableBlock) 130 | { 131 | if (IsFaulted) 132 | return; 133 | 134 | if (!_proxyCache.TryGetValue(programmableBlock, out var proxy)) 135 | { 136 | try 137 | { 138 | proxy = ProgrammableBlockProxy.Wrap(programmableBlock); 139 | _proxyCache[programmableBlock] = proxy; 140 | proxy.ProgrammableBlock.OnClose += OnProgrammableBlockClosed; 141 | } 142 | catch (BindingException e) 143 | { 144 | MyLog.Default.Error($"{Plugin.Ident}: {Resources.ProgrammableBlockExtensions_OnBindScriptDll_BindingFailed}: {e}"); 145 | MyLog.Default.Flush(); 146 | MyAPIGateway.Utilities.ShowMissionScreen( 147 | $"{Plugin.Ident}: {Resources.ProgrammableBlockExtensions_OnBindScriptDll_BindingFailed}", 148 | currentObjective: Resources.ProgrammableBlockExtensions_OnBindScriptDll_EnableDebugging, 149 | screenDescription: Resources.ProgrammableBlockExtensions_OnBindScriptDll_BindingError); 150 | IsFaulted = true; 151 | return; 152 | } 153 | } 154 | 155 | proxy.UnloadProgram(); 156 | 157 | var fileName = await FileDialog.RequestFileName( 158 | Resources.ProgrammableBlockExtensions_OnBindScriptDll_BindScriptDLL, 159 | Resources.ProgrammableBlockExtensions_OnBindScriptDll_Filters, 160 | proxy.FileName).ConfigureAwait(false); 161 | 162 | MyLog.Default.WriteLine($"After RequestFileName {Thread.CurrentThread.ManagedThreadId} {Debugger.IsAttached}"); 163 | MyLog.Default.Flush(); 164 | 165 | if (fileName != null) 166 | { 167 | MyLog.Default.WriteLine($"Found {fileName} {Thread.CurrentThread.ManagedThreadId}"); 168 | MyLog.Default.Flush(); 169 | LoadScriptAssembly(fileName, proxy); 170 | MyLog.Default.WriteLine($"Loaded {fileName} {Thread.CurrentThread.ManagedThreadId}"); 171 | MyLog.Default.Flush(); 172 | } 173 | 174 | proxy.ProgrammableBlock?.RaisePropertiesChanged(); 175 | } 176 | 177 | void LoadScriptAssembly(string fileName, ProgrammableBlockProxy proxy) 178 | { 179 | var assembly = LoadAssembly(fileName); 180 | if (assembly == null) 181 | { 182 | MyAPIGateway.Utilities.ShowMissionScreen( 183 | $"{Plugin.Ident}: {Resources.ProgrammableBlockExtensions_OnBindScriptDll_BindingFailed}", 184 | currentObjective: Resources.ProgrammableBlockExtensions_OnBindScriptDll_BindScriptDLL, 185 | screenDescription: Resources.ProgrammableBlockExtensions_LoadScriptAssembly_InvalidAssembly); 186 | return; 187 | } 188 | 189 | var programTypes = assembly.DefinedTypes.Where(type => !type.IsAbstract && typeof(MyGridProgram).IsAssignableFrom(type)).ToList(); 190 | if (programTypes.Count == 0) 191 | { 192 | MyAPIGateway.Utilities.ShowMissionScreen( 193 | $"{Plugin.Ident}: {Resources.ProgrammableBlockExtensions_OnBindScriptDll_BindingFailed}", 194 | currentObjective: Resources.ProgrammableBlockExtensions_OnBindScriptDll_BindScriptDLL, 195 | screenDescription: Resources.ProgrammableBlockExtensions_LoadScriptAssembly_InvalidAssembly); 196 | return; 197 | } 198 | 199 | if (programTypes.Count > 1) 200 | { 201 | MyAPIGateway.Utilities.ShowMissionScreen( 202 | $"{Plugin.Ident}: {Resources.ProgrammableBlockExtensions_OnBindScriptDll_BindingFailed}", 203 | currentObjective: Resources.ProgrammableBlockExtensions_OnBindScriptDll_BindScriptDLL, 204 | screenDescription: Resources.ProgrammableBlockExtensions_LoadScriptAssembly_TooManyGridPrograms); 205 | return; 206 | } 207 | 208 | if (proxy.LoadProgram(programTypes[0])) 209 | { 210 | HasLoadedProgram = true; 211 | 212 | } 213 | } 214 | 215 | Assembly LoadAssembly(string fileName) 216 | { 217 | try 218 | { 219 | var rawAssembly = File.ReadAllBytes(fileName); 220 | return Assembly.Load(rawAssembly); 221 | } 222 | catch 223 | { 224 | return null; 225 | } 226 | } 227 | 228 | void OnProgrammableBlockClosed(MyEntity entity) 229 | { 230 | var programmableBlock = (MyProgrammableBlock)entity; 231 | if (!_proxyCache.TryGetValue(programmableBlock, out var proxy)) 232 | return; 233 | _proxyCache.Remove(programmableBlock); 234 | proxy.Dispose(); 235 | } 236 | 237 | void OnUnbindScriptDll(MyProgrammableBlock programmableBlock) 238 | { 239 | if (IsFaulted) 240 | return; 241 | 242 | if (_proxyCache.TryGetValue(programmableBlock, out var proxy)) 243 | proxy.UnloadProgram(); 244 | } 245 | 246 | void Unload() 247 | { 248 | MyLog.Default.WriteLine($"{Plugin.Ident}: {Resources.ProgrammableBlockExtensions_Unload_Unloading}"); 249 | foreach (var proxy in _proxyCache.Values) 250 | proxy.Dispose(); 251 | _proxyCache.Clear(); 252 | IsInstalled = false; 253 | } 254 | } 255 | } -------------------------------------------------------------------------------- /Source/MDK-Debug/ProgrammableBlockProxy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Reflection; 4 | using System.Runtime.Serialization; 5 | using Sandbox; 6 | using Sandbox.Game.Entities.Blocks; 7 | using Sandbox.Game.Localization; 8 | using Sandbox.ModAPI; 9 | using Sandbox.ModAPI.Ingame; 10 | using VRage; 11 | 12 | namespace MDK.Debug 13 | { 14 | public class ProgrammableBlockProxy 15 | { 16 | static Reflections _reflections; 17 | 18 | public static ProgrammableBlockProxy Wrap(MyProgrammableBlock programmableBlock) 19 | { 20 | if (_reflections == null) 21 | _reflections = new Reflections(typeof(MyProgrammableBlock)); 22 | return new ProgrammableBlockProxy(programmableBlock); 23 | } 24 | 25 | //IMyGridProgram _instance; 26 | IMyIntergridCommunicationSystem _igcContextCache; 27 | 28 | ProgrammableBlockProxy(MyProgrammableBlock programmableBlock) 29 | { 30 | ProgrammableBlock = programmableBlock ?? throw new ArgumentNullException(nameof(programmableBlock)); 31 | } 32 | 33 | public MyProgrammableBlock ProgrammableBlock { get; private set; } 34 | 35 | protected string StorageData 36 | { 37 | get => (string)_reflections.StorageDataField.GetValue(ProgrammableBlock); 38 | set => _reflections.StorageDataField.SetValue(ProgrammableBlock, value); 39 | } 40 | 41 | protected IMyGridProgram Program 42 | { 43 | get => (IMyGridProgram)_reflections.InstanceField.GetValue(ProgrammableBlock); 44 | set => _reflections.InstanceField.SetValue(ProgrammableBlock, value); 45 | } 46 | 47 | protected IMyGridProgramRuntimeInfo Runtime => (IMyGridProgramRuntimeInfo)_reflections.RuntimeField.GetValue(ProgrammableBlock); 48 | 49 | protected Assembly Assembly 50 | { 51 | get => (Assembly)_reflections.AssemblyField.GetValue(ProgrammableBlock); 52 | set => _reflections.AssemblyField.SetValue(ProgrammableBlock, value); 53 | } 54 | 55 | protected string TerminationReason 56 | { 57 | get => (string)_reflections.TerminationReasonField.GetValue(ProgrammableBlock); 58 | set => _reflections.TerminationReasonField.SetValue(ProgrammableBlock, value); 59 | } 60 | 61 | public string FileName { get; set; } 62 | 63 | protected void ResetRuntime() 64 | { 65 | var runtime = Runtime; 66 | _reflections.GetResetMethod(runtime).Invoke(runtime, null); 67 | } 68 | 69 | protected void UpdateStorage() 70 | { 71 | _reflections.UpdateStorageMethod.Invoke(ProgrammableBlock, null); 72 | } 73 | 74 | protected void Echo(string text) 75 | { 76 | System.Diagnostics.Debug.WriteLine(text); 77 | _reflections.EchoTextToDetailInfoMethod.Invoke(ProgrammableBlock, new object[] {text}); 78 | } 79 | 80 | protected void SetDetailedInfo(string details) 81 | { 82 | _reflections.SetDetailedInfoMethod.Invoke(ProgrammableBlock, new object[] {details}); 83 | } 84 | 85 | protected void EvictIgcContext() 86 | { 87 | var component = _reflections.IgcStaticProperty.GetValue(null); 88 | _reflections.IgcEvictContextMethod.Invoke(component, new object[] {ProgrammableBlock}); 89 | } 90 | 91 | protected void CreateIgcContext() 92 | { 93 | var component = _reflections.IgcStaticProperty.GetValue(null); 94 | _igcContextCache = (IMyIntergridCommunicationSystem)_reflections.IgcGetOrMakeContextForMethod.Invoke(component, new object[] {ProgrammableBlock}); 95 | } 96 | 97 | protected void OnProgramTermination(MyProgrammableBlock.ScriptTerminationReason reason) 98 | { 99 | _reflections.OnProgramTerminationMethod.Invoke(ProgrammableBlock, new object[] {reason}); 100 | } 101 | 102 | public bool HasLoadedProgram { get; private set; } 103 | 104 | public void UnloadProgram() 105 | { 106 | HasLoadedProgram = false; 107 | ProgrammableBlock.RaisePropertiesChanged(); 108 | ProgrammableBlock.SendRecompile(); 109 | } 110 | 111 | public void Dispose() 112 | { 113 | ProgrammableBlock = null; 114 | _igcContextCache = null; 115 | } 116 | 117 | public bool LoadProgram(TypeInfo type) 118 | { 119 | if (type == null) 120 | return true; 121 | 122 | UpdateStorage(); 123 | OnProgramTermination(MyProgrammableBlock.ScriptTerminationReason.None); 124 | 125 | Program = FormatterServices.GetUninitializedObject(type) as IMyGridProgram; 126 | var constructor = type.GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, Type.EmptyTypes, null); 127 | if (Program == null || constructor == null) 128 | { 129 | Echo(MyTexts.GetString(MySpaceTexts.ProgrammableBlock_Exception_NoValidConstructor)); 130 | return false; 131 | } 132 | 133 | Assembly = type.Assembly; 134 | ResetRuntime(); 135 | Program.Runtime = Runtime; 136 | Program.Storage = StorageData; 137 | Program.Me = ProgrammableBlock; 138 | Program.Echo = Echo; 139 | 140 | EvictIgcContext(); 141 | CreateIgcContext(); 142 | Program.IGC_ContextGetter = () => _igcContextCache; 143 | 144 | ProgrammableBlock.RunSandboxedProgramAction(p => 145 | { 146 | constructor.Invoke(p, null); 147 | 148 | if (!Program.HasMainMethod) 149 | { 150 | Echo(MyTexts.GetString(MySpaceTexts.ProgrammableBlock_Exception_NoMain)); 151 | OnProgramTermination(MyProgrammableBlock.ScriptTerminationReason.NoEntryPoint); 152 | } 153 | }, out var response); 154 | SetDetailedInfo(response); 155 | HasLoadedProgram = true; 156 | ProgrammableBlock.RaisePropertiesChanged(); 157 | return true; 158 | } 159 | 160 | class Reflections 161 | { 162 | const string StorageDataFieldName = "m_storageData"; 163 | const string InstanceFieldName = "m_instance"; 164 | const string AssemblyFieldName = "m_assembly"; 165 | const string TerminationReasonFieldName = "m_terminationReason"; 166 | const string RuntimeFieldName = "m_runtime"; 167 | const string UpdateStorageMethodName = "UpdateStorage"; 168 | const string EchoTextToDetailInfoMethodName = "EchoTextToDetailInfo"; 169 | const string SetDetailedInfoMethodName = "SetDetailedInfo"; 170 | const string ResetMethodName = "Reset"; 171 | const string OnProgramTerminationMethodName = "OnProgramTermination"; 172 | const string IgcSystemSessionComponentTypeName = "Sandbox.Game.SessionComponents.MyIGCSystemSessionComponent"; 173 | const string StaticPropertName = "Static"; 174 | const string EvictContextForMethodName = "EvictContextFor"; 175 | const string GetOrMakeContextForMethodName = "GetOrMakeContextFor"; 176 | 177 | static FieldInfo GetFieldInfo(Type type, string fieldName, Type fieldType) 178 | { 179 | var field = type.GetField(fieldName, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); 180 | if (fieldType != null && field?.FieldType != fieldType) 181 | field = null; 182 | if (field == null) 183 | throw new BindingException(string.Format(Resources.Reflections_GetFieldInfo_MissingField, type.FullName, fieldName)); 184 | return field; 185 | } 186 | 187 | static PropertyInfo GetPropertyInfo(Type type, string propertyName, Type propertyType) 188 | { 189 | var property = type.GetProperty(propertyName, BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public); 190 | if (propertyType != null && property?.PropertyType != propertyType) 191 | property = null; 192 | if (property == null) 193 | throw new BindingException(string.Format(Resources.Reflections_GetPropertyInfo_MissingProperty, type.FullName, propertyName)); 194 | return property; 195 | } 196 | 197 | static MethodInfo GetMethodInfo(Type type, string methodName, Type returnType, Type[] argumentTypes) 198 | { 199 | var method = type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, null, argumentTypes, null); 200 | if (returnType != null && method?.ReturnType != returnType) 201 | method = null; 202 | if (method != null) return method; 203 | 204 | var arguments = string.Join(", ", argumentTypes.Select(a => a.Name)); 205 | throw new BindingException(string.Format(Resources.Reflections_GetMethodInfo_MissingMethod, type.FullName, methodName, arguments)); 206 | } 207 | 208 | MethodInfo _resetMethod; 209 | 210 | public Reflections(Type type) 211 | { 212 | StorageDataField = GetFieldInfo(type, StorageDataFieldName, typeof(string)); 213 | InstanceField = GetFieldInfo(type, InstanceFieldName, typeof(IMyGridProgram)); 214 | AssemblyField = GetFieldInfo(type, AssemblyFieldName, typeof(Assembly)); 215 | TerminationReasonField = GetFieldInfo(type, TerminationReasonFieldName, typeof(MyProgrammableBlock.ScriptTerminationReason)); 216 | RuntimeField = GetFieldInfo(type, RuntimeFieldName, null); 217 | UpdateStorageMethod = GetMethodInfo(type, UpdateStorageMethodName, typeof(void), Type.EmptyTypes); 218 | EchoTextToDetailInfoMethod = GetMethodInfo(type, EchoTextToDetailInfoMethodName, typeof(void), new[] {typeof(string)}); 219 | SetDetailedInfoMethod = GetMethodInfo(type, SetDetailedInfoMethodName, typeof(void), new[] {typeof(string)}); 220 | OnProgramTerminationMethod = GetMethodInfo(type, OnProgramTerminationMethodName, typeof(void), new[] {typeof(MyProgrammableBlock.ScriptTerminationReason)}); 221 | 222 | var gameAssembly = typeof(MySandboxGame).Assembly; 223 | var componentType = gameAssembly.GetType(IgcSystemSessionComponentTypeName); 224 | if (componentType == null) 225 | throw new BindingException(string.Format(Resources.Reflections_Reflections_MissingType, IgcSystemSessionComponentTypeName)); 226 | 227 | IgcStaticProperty = GetPropertyInfo(componentType, StaticPropertName, componentType); 228 | IgcEvictContextMethod = GetMethodInfo(componentType, EvictContextForMethodName, typeof(void), new[] {typeof(MyProgrammableBlock)}); 229 | IgcGetOrMakeContextForMethod = GetMethodInfo(componentType, GetOrMakeContextForMethodName, null, new[] {typeof(MyProgrammableBlock)}); 230 | } 231 | 232 | public FieldInfo StorageDataField { get; } 233 | public FieldInfo InstanceField { get; } 234 | public FieldInfo AssemblyField { get; } 235 | public FieldInfo TerminationReasonField { get; } 236 | public MethodInfo UpdateStorageMethod { get; } 237 | public MethodInfo EchoTextToDetailInfoMethod { get; } 238 | public MethodInfo SetDetailedInfoMethod { get; } 239 | public FieldInfo RuntimeField { get; } 240 | public PropertyInfo IgcStaticProperty { get; } 241 | public MethodInfo IgcEvictContextMethod { get; } 242 | public MethodInfo IgcGetOrMakeContextForMethod { get; } 243 | public MethodInfo OnProgramTerminationMethod { get; } 244 | 245 | public MethodInfo GetResetMethod(object runtime) 246 | { 247 | if (_resetMethod != null) 248 | return _resetMethod; 249 | var runtimeType = runtime.GetType(); 250 | _resetMethod = GetMethodInfo(runtimeType, ResetMethodName, typeof(void), Type.EmptyTypes); 251 | return _resetMethod; 252 | } 253 | } 254 | } 255 | } -------------------------------------------------------------------------------- /Source/MDK-Debug/Resources.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace MDK.Debug 8 | { 9 | internal class Resources 10 | { 11 | public const string ProgrammableBlockExtensions_Install_UnbindDLLButtonText = "Unbind DLL"; 12 | public const string ProgrammableBlockExtensions_Install_BindDLLButtonText = "Bind DLL"; 13 | public const string ProgrammableBlockExtensions_OnBindScriptDll_BindingFailed = "Binding Failed"; 14 | public const string ProgrammableBlockExtensions_OnBindScriptDll_EnableDebugging = "Enable Programmable Block Debugging"; 15 | public const string ProgrammableBlockExtensions_OnBindScriptDll_BindScriptDLL = "Bind Script DLL"; 16 | public const string ProgrammableBlockExtensions_OnBindScriptDll_Filters = "Script Assembly (*.dll,*.exe)|*.dll;*.exe"; 17 | public const string ProgrammableBlockExtensions_OnBindScriptDll_BindingError = "The plugin was unable to bind a programmable block. This is most likely caused by changes to the game."; 18 | public const string ProgrammableBlockExtensions_LoadScriptAssembly_InvalidAssembly = "The loaded assembly could not be recognized as a programmable block script container."; 19 | public const string ProgrammableBlockExtensions_LoadScriptAssembly_TooManyGridPrograms = "The loaded assembly contains too many grid programs. Only one was expected."; 20 | public const string Reflections_Reflections_MissingType = "The type {0} does not exist"; 21 | public const string Reflections_GetMethodInfo_MissingMethod = "The type {0} does not have the required method {1}({2})"; 22 | public const string Reflections_GetPropertyInfo_MissingProperty = "The type {0} does not have the required property {1}"; 23 | public const string Reflections_GetFieldInfo_MissingField = "The type {0} does not have the required field {1}"; 24 | public const string ProgrammableBlockExtensions_Install_NoEditButton = "Installation denied because the edit button could not be found"; 25 | public const string ProgrammableBlockExtensions_Install_Ready = "The debug plugin is installed and ready."; 26 | public const string ProgrammableBlockExtensions_Unload_Unloading = "Clearing out extensions"; 27 | public const string ProgrammableBlockExtensions_Install_AttachDebugger = "Attach Debugger"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/MDK-Debug/SpaceEngineersPath.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | D:\Steam\SteamApps\common\SpaceEngineers\Bin64 4 | D:\Data\sesaves\Mods 5 | 6 | -------------------------------------------------------------------------------- /Source/MDK-Debug/SpaceEngineersReferences.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(SpaceEngineersPath)\System.Collections.Immutable.dll 5 | false 6 | 7 | 8 | $(SpaceEngineersPath)\Sandbox.Common.dll 9 | False 10 | 11 | 12 | $(SpaceEngineersPath)\Sandbox.Game.dll 13 | False 14 | 15 | 16 | $(SpaceEngineersPath)\Sandbox.Graphics.dll 17 | False 18 | 19 | 20 | $(SpaceEngineersPath)\SpaceEngineers.Game.dll 21 | False 22 | 23 | 24 | $(SpaceEngineersPath)\SpaceEngineers.ObjectBuilders.dll 25 | False 26 | 27 | 28 | $(SpaceEngineersPath)\VRage.dll 29 | False 30 | 31 | 32 | $(SpaceEngineersPath)\VRage.Audio.dll 33 | False 34 | 35 | 36 | $(SpaceEngineersPath)\VRage.Game.dll 37 | False 38 | 39 | 40 | $(SpaceEngineersPath)\VRage.Input.dll 41 | False 42 | 43 | 44 | $(SpaceEngineersPath)\VRage.Library.dll 45 | False 46 | 47 | 48 | $(SpaceEngineersPath)\VRage.Math.dll 49 | False 50 | 51 | 52 | $(SpaceEngineersPath)\VRage.Render.dll 53 | False 54 | 55 | 56 | $(SpaceEngineersPath)\VRage.Render11.dll 57 | False 58 | 59 | 60 | $(SpaceEngineersPath)\VRage.Scripting.dll 61 | False 62 | 63 | 64 | -------------------------------------------------------------------------------- /Source/MDK-Debug/publish.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | if not '%1' == 'Release' goto exit 3 | XCopy /Y /I %2 %3 4 | 5 | :exit --------------------------------------------------------------------------------