diff --git a/PistonClient/App.config b/Piston.Launcher/App.config similarity index 100% rename from PistonClient/App.config rename to Piston.Launcher/App.config diff --git a/PistonClient/App.xaml b/Piston.Launcher/App.xaml similarity index 72% rename from PistonClient/App.xaml rename to Piston.Launcher/App.xaml index ffc6794..9c68c35 100644 --- a/PistonClient/App.xaml +++ b/Piston.Launcher/App.xaml @@ -1,7 +1,7 @@ - diff --git a/PistonClient/App.xaml.cs b/Piston.Launcher/App.xaml.cs similarity index 92% rename from PistonClient/App.xaml.cs rename to Piston.Launcher/App.xaml.cs index efb1a1a..c8e73b6 100644 --- a/PistonClient/App.xaml.cs +++ b/Piston.Launcher/App.xaml.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Threading.Tasks; using System.Windows; -namespace PistonClient +namespace Piston.Launcher { /// /// Interaction logic for App.xaml diff --git a/Piston.Launcher/Config.cs b/Piston.Launcher/Config.cs new file mode 100644 index 0000000..9efc697 --- /dev/null +++ b/Piston.Launcher/Config.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Serialization; + +namespace Piston.Launcher +{ + public class Config + { + public int Version { get; set; } + public string RemoteFilePath { get; set; } + public string SpaceDirectory { get; set; } + + private Config() + { + Version = 0; + RemoteFilePath = "ftp://athena.jimmacle.com/"; + SpaceDirectory = @"C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64"; + } + + public static string GetConfigPath() + { + var appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); + var pistonFolder = Path.Combine(appdata, "Piston"); + if (!Directory.Exists(pistonFolder)) + Directory.CreateDirectory(pistonFolder); + return Path.Combine(appdata, "Piston\\config.xml"); + } + + public static Config Load() + { + if (!File.Exists(GetConfigPath())) + return new Config(); + + XmlSerializer ser = new XmlSerializer(typeof(Config)); + using (var f = File.OpenRead(GetConfigPath())) + { + using (var sr = new StreamReader(f)) + { + return (Config)ser.Deserialize(sr); + } + } + } + + public void Save() + { + XmlSerializer ser = new XmlSerializer(typeof(Config)); + using (var sw = new StreamWriter(GetConfigPath())) + { + ser.Serialize(sw, this); + } + } + } +} diff --git a/Piston.Launcher/MainWindow.xaml b/Piston.Launcher/MainWindow.xaml new file mode 100644 index 0000000..7d42326 --- /dev/null +++ b/Piston.Launcher/MainWindow.xaml @@ -0,0 +1,15 @@ + + + + diff --git a/Piston.Launcher/SpaceDirPrompt.xaml.cs b/Piston.Launcher/SpaceDirPrompt.xaml.cs new file mode 100644 index 0000000..6d1ccf9 --- /dev/null +++ b/Piston.Launcher/SpaceDirPrompt.xaml.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace Piston.Launcher +{ + /// + /// Interaction logic for SpaceDirPrompt.xaml + /// + public partial class SpaceDirPrompt : Window + { + public string SelectedDir { get; private set; } + public bool Success { get; private set; } + public SpaceDirPrompt() + { + InitializeComponent(); + } + + private void OkButton_Click(object sender, RoutedEventArgs e) + { + if (!Directory.Exists(PathBox.Text)) + { + MessageBox.Show(this, "That's not a valid directory."); + return; + } + + if (!Directory.GetFiles(PathBox.Text).Any(i => i.Contains("SpaceEngineers.exe"))) + { + MessageBox.Show(this, "SE was not found in the given directory."); + return; + } + + Success = true; + SelectedDir = PathBox.Text; + Close(); + } + } +} diff --git a/Piston.sln b/Piston.sln index e629baa..a14ebaa 100644 --- a/Piston.sln +++ b/Piston.sln @@ -11,6 +11,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Piston.Client", "PistonClie EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Piston.Server", "PistonServer\Piston.Server.csproj", "{CA50886B-7B22-4CD8-93A0-C06F38D4F77D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestPlugin", "TestPlugin\TestPlugin.csproj", "{BF0D9941-B488-4880-B378-A9BF942D140D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Piston.Launcher", "Piston.Launcher\Piston.Launcher.csproj", "{19292801-5B9C-4EE0-961F-0FA37B3A6C3D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -51,6 +55,22 @@ Global {CA50886B-7B22-4CD8-93A0-C06F38D4F77D}.Release|Any CPU.Build.0 = Release|Any CPU {CA50886B-7B22-4CD8-93A0-C06F38D4F77D}.Release|x64.ActiveCfg = Release|x64 {CA50886B-7B22-4CD8-93A0-C06F38D4F77D}.Release|x64.Build.0 = Release|x64 + {BF0D9941-B488-4880-B378-A9BF942D140D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BF0D9941-B488-4880-B378-A9BF942D140D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BF0D9941-B488-4880-B378-A9BF942D140D}.Debug|x64.ActiveCfg = Debug|x64 + {BF0D9941-B488-4880-B378-A9BF942D140D}.Debug|x64.Build.0 = Debug|x64 + {BF0D9941-B488-4880-B378-A9BF942D140D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BF0D9941-B488-4880-B378-A9BF942D140D}.Release|Any CPU.Build.0 = Release|Any CPU + {BF0D9941-B488-4880-B378-A9BF942D140D}.Release|x64.ActiveCfg = Release|x64 + {BF0D9941-B488-4880-B378-A9BF942D140D}.Release|x64.Build.0 = Release|x64 + {19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Debug|x64.ActiveCfg = Debug|x64 + {19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Debug|x64.Build.0 = Debug|x64 + {19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Release|Any CPU.Build.0 = Release|Any CPU + {19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Release|x64.ActiveCfg = Release|Any CPU + {19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/PistonServer/ConnectionState.cs b/Piston/ConnectionState.cs similarity index 92% rename from PistonServer/ConnectionState.cs rename to Piston/ConnectionState.cs index e242906..695b1ad 100644 --- a/PistonServer/ConnectionState.cs +++ b/Piston/ConnectionState.cs @@ -1,6 +1,6 @@ using System; -namespace Piston.Server +namespace Piston { /// /// Identifies a player's current connection state. diff --git a/Piston/Piston.csproj b/Piston/Piston.csproj index 72d318d..4cee744 100644 --- a/Piston/Piston.csproj +++ b/Piston/Piston.csproj @@ -49,24 +49,37 @@ MinimumRecommendedRules.ruleset - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Common.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Game.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Graphics.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SpaceEngineers.Game.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SpaceEngineers.ObjectBuilders.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SpaceEngineers.ObjectBuilders.XmlSerializers.dll + + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\DedicatedServer64\SpaceEngineersDedicated.exe + + + False + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SteamSDK.dll + @@ -75,51 +88,70 @@ - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Audio.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Game.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Game.XmlSerializers.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Input.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Library.dll C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Math.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Native.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.OpenVRWrapper.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Render.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Render11.dll - + + False C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Scripting.dll + + + + + - + + + + diff --git a/PistonServer/PlayerInfo.cs b/Piston/PlayerInfo.cs similarity index 97% rename from PistonServer/PlayerInfo.cs rename to Piston/PlayerInfo.cs index 6db3e52..1341a3e 100644 --- a/PistonServer/PlayerInfo.cs +++ b/Piston/PlayerInfo.cs @@ -1,6 +1,6 @@ using Sandbox.Engine.Multiplayer; -namespace Piston.Server +namespace Piston { /// /// Stores player information in an observable format. diff --git a/Piston/PlayerInfoCache.cs b/Piston/PlayerInfoCache.cs new file mode 100644 index 0000000..8234335 --- /dev/null +++ b/Piston/PlayerInfoCache.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Piston +{ + public static class PlayerInfoCache + { + private static readonly Dictionary _cache = new Dictionary(); + + public static PlayerInfo GetOrCreate(ulong steamId) + { + PlayerInfo info; + if (_cache.TryGetValue(steamId, out info)) + return info; + + info = new PlayerInfo(steamId) {State = ConnectionState.Unknown}; + _cache.Add(steamId, info); + return info; + } + + public static void Add(PlayerInfo info) + { + if (_cache.ContainsKey(info.SteamId)) + return; + + _cache.Add(info.SteamId, info); + } + + public static void Reset() + { + _cache.Clear(); + } + } +} diff --git a/Piston/PluginManager.cs b/Piston/PluginManager.cs index a477700..6c9b72d 100644 --- a/Piston/PluginManager.cs +++ b/Piston/PluginManager.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; +using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using Piston.API; +using PistonAPI; using Sandbox; using VRage.Plugins; using VRage.Collections; @@ -30,17 +32,42 @@ namespace Piston GetPluginList(); } + /// + /// Get a reference to the internal VRage plugin list. + /// private void GetPluginList() { _plugins = typeof(MyPlugins).GetField("m_plugins", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null) as List; } + /// + /// Get a plugin's name from its or its type name. + /// + public string GetPluginName(Type pluginType) + { + var attr = pluginType.GetCustomAttribute(); + return attr?.Name ?? pluginType.Name; + } + + /// + /// Load all plugins in the folder. + /// + public void LoadAllPlugins() + { + var pluginFolders = GetPluginFolders(); + foreach (var folder in pluginFolders) + { + LoadPluginFolder(folder); + } + } + /// /// Load a plugin into the game. /// /// public void LoadPlugin(IPlugin plugin) { + Logger.Write($"Loading plugin: {GetPluginName(plugin.GetType())}"); plugin.Init(MySandboxGame.Static); _plugins.Add(plugin); } @@ -68,21 +95,25 @@ namespace Piston { var relativeDir = Path.Combine(PluginDir, folderName); if (!Directory.Exists(relativeDir)) - throw new FileNotFoundException($"Plugin {folderName} does not exist in the Plugins folder."); + { + Logger.Write($"Plugin {folderName} does not exist in the Plugins folder."); + return; + } var fileNames = Directory.GetFiles(relativeDir, "*.dll"); foreach (var fileName in fileNames) { var fullPath = Path.Combine(Directory.GetCurrentDirectory(), fileName); + UnblockDll(fullPath); var asm = Assembly.LoadFrom(fullPath); foreach (var type in asm.GetTypes()) { if (type.GetInterfaces().Contains(typeof(IPlugin))) { - var inst = Activator.CreateInstance(type); - LoadPlugin((IPlugin)inst); + var inst = (IPlugin)Activator.CreateInstance(type); + MySandboxGame.Static.Invoke(() => LoadPlugin(inst)); } } } @@ -91,7 +122,6 @@ namespace Piston /// /// Unload a plugin from the game. /// - /// public void UnloadPlugin(IPlugin plugin) { _plugins.Remove(plugin); @@ -125,5 +155,14 @@ namespace Piston p?.Reload(); } } + + [DllImport("kernel32", CharSet = CharSet.Unicode, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool DeleteFile(string name); + + public bool UnblockDll(string fileName) + { + return DeleteFile(fileName + ":Zone.Identifier"); + } } } diff --git a/Piston/SteamHelper.cs b/Piston/SteamHelper.cs new file mode 100644 index 0000000..dafcb93 --- /dev/null +++ b/Piston/SteamHelper.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Sandbox; +using Sandbox.Engine.Networking; +using Sandbox.Engine.Platform; +using SteamSDK; +using VRage.Game; + +namespace Piston +{ + public static class SteamHelper + { + private static Thread _callbackThread; + + public static void Init() + { + _callbackThread = new Thread(() => + { + while (true) + { + SteamAPI.Instance.RunCallbacks(); + Thread.Sleep(100); + } + }) {Name = "SteamAPICallbacks"}; + _callbackThread.Start(); + } + + public static MySteamWorkshop.SubscribedItem GetItemInfo(ulong itemId) + { + MySteamWorkshop.SubscribedItem item = null; + + using (var mre = new ManualResetEvent(false)) + { + SteamAPI.Instance.RemoteStorage.GetPublishedFileDetails(itemId, 0, (ioFail, result) => + { + if (!ioFail && result.Result == Result.OK) + { + item = new MySteamWorkshop.SubscribedItem + { + Title = result.Title, + Description = result.Description, + PublishedFileId = result.PublishedFileId, + SteamIDOwner = result.SteamIDOwner, + Tags = result.Tags.Split(' '), + TimeUpdated = result.TimeUpdated, + UGCHandle = result.FileHandle + }; + } + else + { + Logger.Write($"Failed to get item info for {itemId}"); + } + + mre.Set(); + }); + + mre.WaitOne(); + mre.Reset(); + + return item; + } + } + + public static SteamUGCDetails GetItemDetails(ulong itemId) + { + SteamUGCDetails details = default(SteamUGCDetails); + using (var mre = new ManualResetEvent(false)) + { + SteamAPI.Instance.UGC.RequestUGCDetails(itemId, 0, (b, result) => + { + if (!b && result.Details.Result == Result.OK) + details = result.Details; + else + Logger.Write($"Failed to get item details for {itemId}"); + + mre.Set(); + }); + + mre.WaitOne(); + mre.Reset(); + } + + return details; + } + + public static MyObjectBuilder_Checkpoint.ModItem GetModItem(ulong modId) + { + var details = GetItemDetails(modId); + return new MyObjectBuilder_Checkpoint.ModItem(null, modId, details.Title); + } + + public static MyObjectBuilder_Checkpoint.ModItem GetModItem(SteamUGCDetails details) + { + return new MyObjectBuilder_Checkpoint.ModItem(null, details.PublishedFileId, details.Title); + } + } +} diff --git a/Piston/SteamService.cs b/Piston/SteamService.cs new file mode 100644 index 0000000..266afd5 --- /dev/null +++ b/Piston/SteamService.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Sandbox; + +namespace Piston +{ + /// + /// SNAGGED FROM PHOENIX84'S SE WORKSHOP TOOL + /// Keen's steam service calls RestartIfNecessary, which triggers steam to think the game was launched + /// outside of Steam, which causes this process to exit, and the game to launch instead with an arguments warning. + /// We have to override the default behavior, then forcibly set the correct options. + /// + public class SteamService : MySteamService + { + public SteamService(bool isDedicated, uint appId) + : base(true, appId) + { + // TODO: Add protection for this mess... somewhere + SteamSDK.SteamServerAPI.Instance.Dispose(); + var steam = typeof(Sandbox.MySteamService); + steam.GetField("SteamServerAPI").SetValue(this, null); + + steam.GetProperty("AppId").GetSetMethod(true).Invoke(this, new object[] { appId }); + if (isDedicated) + { + steam.GetField("SteamServerAPI").SetValue(this, SteamSDK.SteamServerAPI.Instance); + } + else + { + var SteamAPI = SteamSDK.SteamAPI.Instance; + steam.GetField("SteamAPI").SetValue(this, SteamSDK.SteamAPI.Instance); + steam.GetProperty("IsActive").GetSetMethod(true).Invoke(this, new object[] { SteamSDK.SteamAPI.Instance != null }); + + if (SteamAPI != null) + { + steam.GetProperty("UserId").GetSetMethod(true).Invoke(this, new object[] { SteamAPI.GetSteamUserId() }); + steam.GetProperty("UserName").GetSetMethod(true).Invoke(this, new object[] { SteamAPI.GetSteamName() }); + steam.GetProperty("OwnsGame").GetSetMethod(true).Invoke(this, new object[] { SteamAPI.HasGame() }); + steam.GetProperty("UserUniverse").GetSetMethod(true).Invoke(this, new object[] { SteamAPI.GetSteamUserUniverse() }); + steam.GetProperty("BranchName").GetSetMethod(true).Invoke(this, new object[] { SteamAPI.GetBranchName() }); + SteamAPI.LoadStats(); + } + } + } + } +} diff --git a/Piston/StringExtensions.cs b/Piston/StringExtensions.cs new file mode 100644 index 0000000..3a4a879 --- /dev/null +++ b/Piston/StringExtensions.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Piston +{ + public static class StringExtensions + { + public static string Truncate(this string s, int maxLength) + { + return s.Length <= maxLength ? s : s.Substring(0, maxLength); + } + + public static IEnumerable ReadLines(this string s, int max, bool skipEmpty = false, char delim = '\n') + { + var lines = s.Split(delim); + + for (var i = 0; i < lines.Length && i < max; i++) + { + var l = lines[i]; + if (skipEmpty && string.IsNullOrWhiteSpace(l)) + continue; + + yield return l; + } + } + + public static string Wrap(this string s, int lineLength) + { + if (s.Length <= lineLength) + return s; + + var result = new StringBuilder(); + for (var i = 0; i < s.Length;) + { + var next = i + lineLength; + if (s.Length - 1 < next) + { + result.AppendLine(s.Substring(i)); + break; + } + + result.AppendLine(s.Substring(i, next)); + i = next; + } + + return result.ToString(); + } + } +} diff --git a/Piston/ViewModels/ModViewModel.cs b/Piston/ViewModels/ModViewModel.cs new file mode 100644 index 0000000..31f1000 --- /dev/null +++ b/Piston/ViewModels/ModViewModel.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VRage.Game; + +namespace Piston +{ + public class ModViewModel + { + public MyObjectBuilder_Checkpoint.ModItem ModItem { get; } + public string Name => ModItem.Name; + public string FriendlyName => ModItem.FriendlyName; + public ulong PublishedFileId => ModItem.PublishedFileId; + public string Description { get; } + + public ModViewModel(MyObjectBuilder_Checkpoint.ModItem item, string description = "") + { + ModItem = item; + Description = description; + } + + public static implicit operator MyObjectBuilder_Checkpoint.ModItem(ModViewModel item) + { + return item.ModItem; + } + } +} diff --git a/Piston/ViewModels/PluginViewModel.cs b/Piston/ViewModels/PluginViewModel.cs new file mode 100644 index 0000000..2b8356a --- /dev/null +++ b/Piston/ViewModels/PluginViewModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Piston.ViewModels +{ + public class PluginViewModel : ViewModel + { + + } +} diff --git a/Piston/ViewModel.cs b/Piston/ViewModels/ViewModel.cs similarity index 81% rename from Piston/ViewModel.cs rename to Piston/ViewModels/ViewModel.cs index 9cc7186..665840c 100644 --- a/Piston/ViewModel.cs +++ b/Piston/ViewModels/ViewModel.cs @@ -8,6 +8,9 @@ using System.Threading.Tasks; namespace Piston { + /// + /// Provides a method to notify an observer of changes to an object's properties. + /// public class ViewModel : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; diff --git a/PistonAPI/IPistonPlugin.cs b/PistonAPI/IPistonPlugin.cs index 751531b..2d41e24 100644 --- a/PistonAPI/IPistonPlugin.cs +++ b/PistonAPI/IPistonPlugin.cs @@ -10,7 +10,6 @@ namespace Piston.API { public interface IPistonPlugin : IPlugin { - string Name { get; } void Reload(); } } diff --git a/PistonAPI/Piston.API.csproj b/PistonAPI/Piston.API.csproj index f43e935..d465695 100644 --- a/PistonAPI/Piston.API.csproj +++ b/PistonAPI/Piston.API.csproj @@ -68,6 +68,7 @@ + diff --git a/PistonAPI/PluginAttribute.cs b/PistonAPI/PluginAttribute.cs new file mode 100644 index 0000000..e172736 --- /dev/null +++ b/PistonAPI/PluginAttribute.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PistonAPI +{ + public class PluginAttribute : Attribute + { + public string Name { get; } + public bool Reloadable { get; } + + public PluginAttribute(string name, bool reloadable = false) + { + Name = name; + Reloadable = reloadable; + } + } +} diff --git a/PistonClient/MainWindow.xaml b/PistonClient/MainWindow.xaml deleted file mode 100644 index 0af9433..0000000 --- a/PistonClient/MainWindow.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/PistonClient/MainWindow.xaml.cs b/PistonClient/MainWindow.xaml.cs deleted file mode 100644 index 3229824..0000000 --- a/PistonClient/MainWindow.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace PistonClient -{ - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : Window - { - public MainWindow() - { - InitializeComponent(); - } - } -} diff --git a/PistonClient/Piston.Client.csproj b/PistonClient/Piston.Client.csproj index 912e140..b7f2ee5 100644 --- a/PistonClient/Piston.Client.csproj +++ b/PistonClient/Piston.Client.csproj @@ -7,7 +7,7 @@ {E36DF745-260B-4956-A2E8-09F08B2E7161} WinExe Properties - PistonClient + Piston.Client PistonClient v4.6.1 512 @@ -56,6 +56,16 @@ true + + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Game.dll + + + False + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Graphics.dll + + + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SpaceEngineers.Game.dll + @@ -67,29 +77,31 @@ 4.0 + + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.dll + + + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Game.dll + + + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Library.dll + + + False + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Math.dll + + + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Render.dll + + + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Render11.dll + - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - MainWindow.xaml - Code - - - + Code @@ -114,7 +126,10 @@ - + + {7E01635C-3B67-472E-BCD6-C5539564F214} + Piston + + \ No newline at end of file