├── Net.Bertware.Get ├── BertWare.pfx ├── Updater.exe ├── drive-download.ico ├── My Project │ ├── Settings.settings │ ├── Application.Designer.vb │ ├── Application.myapp │ └── AssemblyInfo.vb ├── Sysinfo.vb ├── ChangelogInfo.vb ├── UpdateInfo.vb ├── UpdateDialog.vb └── ProgramInfo.vb ├── bukkitgui2 ├── bukkitgui-icon.ico ├── bukkitgui-icon32.ico ├── Resources │ ├── Dll │ │ ├── Jayrock.Json.dll │ │ ├── YamlUtility.dll │ │ ├── MetroFramework.dll │ │ ├── Net.Bertware.Get.dll │ │ ├── Net.Bertware.Get.pdb │ │ ├── Interop.NATUPNPLib.dll │ │ ├── MetroFramework.Fonts.dll │ │ ├── MetroFramework.Fonts.pdb │ │ ├── MetroFramework.Design.dll │ │ ├── MetroFramework.Design.pdb │ │ ├── ICSharpCode.SharpZipLib.dll │ │ └── Net.Bertware.Get.xml │ ├── Img │ │ ├── bukkit_logo.png │ │ ├── jsonapi_logo.png │ │ ├── player_face.png │ │ ├── spigot_logo.png │ │ ├── vanilla_logo.png │ │ ├── bukkitgui-icon.ico │ │ ├── bukkitgui-logo.png │ │ ├── glowstone-logo.png │ │ ├── bukkitgui-white-icon.png │ │ └── mcpc_cauldron_logo.png │ ├── JsonApiConnector.exe │ ├── JsonApiConnector.pdb │ ├── Icon │ │ ├── icon_cancel-64.png │ │ ├── icon_chat-64.png │ │ ├── icon_clock-64.png │ │ ├── icon_group-64.png │ │ ├── icon_minus-64.png │ │ ├── icon_plus-64.png │ │ ├── icon_today-64.png │ │ ├── icon_console-64.png │ │ ├── icon_contacts-64.png │ │ ├── icon_services-64.png │ │ ├── icon_settings-64.png │ │ ├── icon_checkmark-64.png │ │ ├── icon_left_round-64.png │ │ ├── icon_right_round-64.png │ │ ├── icon_sinchronize-64.png │ │ ├── icon_up_circular-64.png │ │ ├── icon_command_line-64.png │ │ ├── icon_down_circular-64.png │ │ ├── icon_downloads_folder-64.png │ │ ├── icon_right_circular-64.png │ │ ├── icon_extensions_folder-64.png │ │ └── icon_downloading_updates-64.png │ └── Sound │ │ ├── sound_connect.wav │ │ ├── sound_severe.wav │ │ ├── sound_warning.wav │ │ └── sound_disconnect.wav ├── AddOn │ ├── Forwarder │ │ ├── PortMappingEntry.cs │ │ └── Forwarder.cs │ ├── IAddonTab.cs │ ├── Settings │ │ ├── Credits.cs │ │ ├── Credits.Designer.cs │ │ ├── Settings.cs │ │ ├── VariousSettings.cs │ │ └── SettingsTab.cs │ ├── Editor │ │ ├── EditorTab.cs │ │ ├── SettingsEditDialog.cs │ │ ├── Editor.cs │ │ ├── IpBanListControl.cs │ │ ├── BanListControl.cs │ │ ├── WhitelistControl.cs │ │ ├── OpListControl.cs │ │ └── ServerSettingsControl.cs │ ├── Plugins │ │ ├── PluginsTab.cs │ │ └── Plugins.cs │ ├── Updater │ │ ├── UpdaterSettings.cs │ │ └── Updater.cs │ ├── Console │ │ ├── EmulatorInput.cs │ │ ├── Console.cs │ │ └── ConsoleSettings.cs │ ├── Tasker │ │ ├── Action │ │ │ ├── IAction.cs │ │ │ ├── ServerRestartAction.cs │ │ │ ├── ServerStopAction.cs │ │ │ ├── KickAllAction.cs │ │ │ ├── ServerKillAction.cs │ │ │ ├── RunAction.cs │ │ │ ├── ConsoleCommandAction.cs │ │ │ ├── ServerStartAction.cs │ │ │ ├── ExitGuiAction.cs │ │ │ ├── ShellCommandAction.cs │ │ │ ├── ConsoleClearAction.cs │ │ │ └── BackupAction.cs │ │ ├── Trigger │ │ │ ├── ITrigger.cs │ │ │ ├── ServerStartedTrigger.cs │ │ │ ├── ServerStoppedTrigger.cs │ │ │ ├── PlayerLeftTrigger.cs │ │ │ ├── ServerStartingTrigger.cs │ │ │ ├── ServerStoppingTrigger.cs │ │ │ ├── PlayerJoinedTrigger.cs │ │ │ ├── UnexpectedServerStopTrigger.cs │ │ │ ├── TaskExecutedTrigger.cs │ │ │ ├── TaskButtonPressedTrigger.cs │ │ │ ├── ServerOutputTrigger.cs │ │ │ ├── PlayerCountTrigger.cs │ │ │ └── ServerOutputRegexTrigger.cs │ │ └── TaskerTab.cs │ ├── IAddon.cs │ ├── Issues │ │ └── Issues.cs │ ├── Notifications │ │ └── NotificationsSettings.cs │ ├── Playerlist │ │ └── PlayerList.cs │ └── Backup │ │ └── BackupTab.cs ├── Controls │ ├── SortableListView │ │ ├── ListViewNumericSort.cs │ │ ├── ListViewDateSort.cs │ │ └── ListViewStringSort.cs │ ├── ConsoleInput │ │ └── AutoCompletionMenu.cs │ ├── MarkupTextArea │ │ ├── MarkupTextArea.cs │ │ └── MarkupTextArea.Designer.cs │ ├── SettingsToggle.cs │ ├── SettingsCheckbox.cs │ └── ColorPicker │ │ ├── ColorPicker.Designer.cs │ │ └── ColorPicker.cs ├── app.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ └── AssemblyInfo.cs ├── Core │ ├── Util │ │ ├── Web │ │ │ ├── EnhancedWebClient.cs │ │ │ ├── FileDownloader.Designer.cs │ │ │ └── WebUtil.cs │ │ ├── DynamicDllLoader.cs │ │ ├── StringUtil.cs │ │ ├── FsUtil.cs │ │ └── Performance │ │ │ └── CpuCounter.cs │ ├── Logging │ │ └── LogEntry.cs │ └── Share.cs ├── MinecraftInterop │ ├── PlayerHandler │ │ └── MinecraftGameMode.cs │ └── OutputHandler │ │ ├── PlayerActions │ │ ├── PlayerActionBan.cs │ │ ├── PlayerActionIpBan.cs │ │ ├── PlayerActionKick.cs │ │ ├── PlayerActionLeave.cs │ │ ├── PlayerActionJoin.cs │ │ └── IPlayerAction.cs │ │ ├── EnumMessageType.cs │ │ └── OutputParseResult.cs ├── MinecraftServers │ ├── Tools │ │ ├── global │ │ │ └── JenkinsApi.cs │ │ ├── JsonApi2CredentialsSettingsControl.cs │ │ ├── JsonApiCredentialsSettingsControl.cs │ │ └── MinecraftServerVersion.cs │ ├── Servers │ │ ├── McpcServer.cs │ │ ├── VanillaServer.cs │ │ ├── JsonApi2Server.cs │ │ ├── JsonApiServer.cs │ │ ├── SpigotServer.cs │ │ └── GlowstoneServer.cs │ └── MinecraftServerLoader.cs ├── Launcher.cs ├── UI │ ├── SplashScreen.cs │ └── ServerStopDialog.cs └── Program.cs ├── JsonApiConnector ├── Jayrock.Json.dll ├── JsonApiStreamResult.cs ├── IJsonApi.cs ├── Properties │ └── AssemblyInfo.cs └── Program.cs ├── bukkitgui2.sln ├── README.md └── .gitattributes /Net.Bertware.Get/BertWare.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/Net.Bertware.Get/BertWare.pfx -------------------------------------------------------------------------------- /Net.Bertware.Get/Updater.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/Net.Bertware.Get/Updater.exe -------------------------------------------------------------------------------- /bukkitgui2/bukkitgui-icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/bukkitgui-icon.ico -------------------------------------------------------------------------------- /bukkitgui2/bukkitgui-icon32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/bukkitgui-icon32.ico -------------------------------------------------------------------------------- /JsonApiConnector/Jayrock.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/JsonApiConnector/Jayrock.Json.dll -------------------------------------------------------------------------------- /Net.Bertware.Get/drive-download.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/Net.Bertware.Get/drive-download.ico -------------------------------------------------------------------------------- /JsonApiConnector/JsonApiStreamResult.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/JsonApiConnector/JsonApiStreamResult.cs -------------------------------------------------------------------------------- /bukkitgui2/Resources/Dll/Jayrock.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Dll/Jayrock.Json.dll -------------------------------------------------------------------------------- /bukkitgui2/Resources/Dll/YamlUtility.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Dll/YamlUtility.dll -------------------------------------------------------------------------------- /bukkitgui2/Resources/Img/bukkit_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Img/bukkit_logo.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Img/jsonapi_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Img/jsonapi_logo.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Img/player_face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Img/player_face.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Img/spigot_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Img/spigot_logo.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Img/vanilla_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Img/vanilla_logo.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/JsonApiConnector.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/JsonApiConnector.exe -------------------------------------------------------------------------------- /bukkitgui2/Resources/JsonApiConnector.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/JsonApiConnector.pdb -------------------------------------------------------------------------------- /bukkitgui2/Resources/Dll/MetroFramework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Dll/MetroFramework.dll -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_cancel-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_cancel-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_chat-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_chat-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_clock-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_clock-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_group-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_group-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_minus-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_minus-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_plus-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_plus-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_today-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_today-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Img/bukkitgui-icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Img/bukkitgui-icon.ico -------------------------------------------------------------------------------- /bukkitgui2/Resources/Img/bukkitgui-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Img/bukkitgui-logo.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Img/glowstone-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Img/glowstone-logo.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Sound/sound_connect.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Sound/sound_connect.wav -------------------------------------------------------------------------------- /bukkitgui2/Resources/Sound/sound_severe.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Sound/sound_severe.wav -------------------------------------------------------------------------------- /bukkitgui2/Resources/Sound/sound_warning.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Sound/sound_warning.wav -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Forwarder/PortMappingEntry.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/AddOn/Forwarder/PortMappingEntry.cs -------------------------------------------------------------------------------- /bukkitgui2/Resources/Dll/Net.Bertware.Get.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Dll/Net.Bertware.Get.dll -------------------------------------------------------------------------------- /bukkitgui2/Resources/Dll/Net.Bertware.Get.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Dll/Net.Bertware.Get.pdb -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_console-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_console-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_contacts-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_contacts-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_services-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_services-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_settings-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_settings-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Dll/Interop.NATUPNPLib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Dll/Interop.NATUPNPLib.dll -------------------------------------------------------------------------------- /bukkitgui2/Resources/Dll/MetroFramework.Fonts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Dll/MetroFramework.Fonts.dll -------------------------------------------------------------------------------- /bukkitgui2/Resources/Dll/MetroFramework.Fonts.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Dll/MetroFramework.Fonts.pdb -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_checkmark-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_checkmark-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_left_round-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_left_round-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_right_round-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_right_round-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_sinchronize-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_sinchronize-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_up_circular-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_up_circular-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Img/bukkitgui-white-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Img/bukkitgui-white-icon.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Img/mcpc_cauldron_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Img/mcpc_cauldron_logo.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Sound/sound_disconnect.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Sound/sound_disconnect.wav -------------------------------------------------------------------------------- /bukkitgui2/Resources/Dll/MetroFramework.Design.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Dll/MetroFramework.Design.dll -------------------------------------------------------------------------------- /bukkitgui2/Resources/Dll/MetroFramework.Design.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Dll/MetroFramework.Design.pdb -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_command_line-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_command_line-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_down_circular-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_down_circular-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Dll/ICSharpCode.SharpZipLib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Dll/ICSharpCode.SharpZipLib.dll -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_downloads_folder-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_downloads_folder-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_right_circular-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_right_circular-64.png -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_extensions_folder-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_extensions_folder-64.png -------------------------------------------------------------------------------- /bukkitgui2/Controls/SortableListView/ListViewNumericSort.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Controls/SortableListView/ListViewNumericSort.cs -------------------------------------------------------------------------------- /bukkitgui2/Resources/Icon/icon_downloading_updates-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bertware/bukkitgui2/HEAD/bukkitgui2/Resources/Icon/icon_downloading_updates-64.png -------------------------------------------------------------------------------- /bukkitgui2/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /bukkitgui2/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Net.Bertware.Get/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /bukkitgui2/Core/Util/Web/EnhancedWebClient.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | 4 | namespace Net.Bertware.Bukkitgui2.Core.Util.Web 5 | { 6 | public class EnhancedWebClient : WebClient 7 | { 8 | protected override WebRequest GetWebRequest(Uri uri) 9 | { 10 | WebRequest w = base.GetWebRequest(uri); 11 | if (w != null) 12 | { 13 | w.Timeout = 10*60*1000; 14 | return w; 15 | } 16 | return null; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /bukkitgui2/Core/Util/DynamicDllLoader.cs: -------------------------------------------------------------------------------- 1 | // DynamicDllLoader.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | namespace Net.Bertware.Bukkitgui2.Core.Util 11 | { 12 | internal class DynamicDllLoader 13 | { 14 | } 15 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/IAddonTab.cs: -------------------------------------------------------------------------------- 1 | // IAddonTab.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/30 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | namespace Net.Bertware.Bukkitgui2.AddOn 11 | { 12 | public interface IAddonTab 13 | { 14 | IAddon ParentAddon { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /bukkitgui2/Controls/ConsoleInput/AutoCompletionMenu.cs: -------------------------------------------------------------------------------- 1 | // AutoCompletionMenu.cs in bukkitgui2/bukkitgui2 2 | // Created 2016/05/15 3 | // Last edited at 2016/05/15 21:46 4 | // ©Bertware, visit http://bertware.net 5 | 6 | using System.Runtime.CompilerServices; 7 | using System.Windows.Forms; 8 | 9 | namespace Net.Bertware.Bukkitgui2.AddOn.Console 10 | { 11 | internal class AutoCompletionMenu : ContextMenu 12 | { 13 | 14 | // Todo: space, right arrow and tab should have the same behaviour as enter 15 | } 16 | } -------------------------------------------------------------------------------- /Net.Bertware.Get/My Project/Application.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.296 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | -------------------------------------------------------------------------------- /Net.Bertware.Get/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | false 5 | 0 6 | true 7 | 0 8 | 1 9 | true 10 | 11 | -------------------------------------------------------------------------------- /bukkitgui2/MinecraftInterop/PlayerHandler/MinecraftGameMode.cs: -------------------------------------------------------------------------------- 1 | // MinecraftGameMode.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/24 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | namespace Net.Bertware.Bukkitgui2.MinecraftInterop.PlayerHandler 11 | { 12 | public enum MinecraftGameMode 13 | { 14 | Survival = 0, 15 | Creative = 1, 16 | Adventure = 2 17 | } 18 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Settings/Credits.cs: -------------------------------------------------------------------------------- 1 | // Credits.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/25 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using MetroFramework.Controls; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Settings 13 | { 14 | public partial class Credits : MetroUserControl 15 | { 16 | public Credits() 17 | { 18 | InitializeComponent(); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Editor/EditorTab.cs: -------------------------------------------------------------------------------- 1 | // EditorTab.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | namespace Net.Bertware.Bukkitgui2.AddOn.Editor 11 | { 12 | public partial class EditorTab : IAddonTab 13 | { 14 | public EditorTab() 15 | { 16 | InitializeComponent(); 17 | } 18 | 19 | public IAddon ParentAddon { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /bukkitgui2/MinecraftServers/Tools/global/JenkinsApi.cs: -------------------------------------------------------------------------------- 1 | // JenkinsApi.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/02/21 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | namespace Net.Bertware.Bukkitgui2.MinecraftServers.Tools.Global 11 | { 12 | /// 13 | /// Allows to get latest build numbers and download links from jenkins repositories 14 | /// 15 | internal class JenkinsApi 16 | { 17 | } 18 | } -------------------------------------------------------------------------------- /bukkitgui2/Controls/MarkupTextArea/MarkupTextArea.cs: -------------------------------------------------------------------------------- 1 | // MarkupTextArea.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Windows.Forms; 11 | 12 | namespace Net.Bertware.Bukkitgui2.Controls.MarkupTextArea 13 | { 14 | public partial class MarkupTextArea : UserControl 15 | { 16 | public MarkupTextArea() 17 | { 18 | InitializeComponent(); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Plugins/PluginsTab.cs: -------------------------------------------------------------------------------- 1 | // PluginsTab.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using MetroFramework.Controls; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Plugins 13 | { 14 | public partial class PluginsTab : MetroUserControl, IAddonTab 15 | { 16 | public PluginsTab() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | public IAddon ParentAddon { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /JsonApiConnector/IJsonApi.cs: -------------------------------------------------------------------------------- 1 | // IJsonApi.cs in bukkitgui2/JsonApiConnector 2 | // Created 2014/09/05 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | 12 | namespace JsonApiConnector 13 | { 14 | internal interface IJsonApi 15 | { 16 | void Connect(); 17 | 18 | void Disconnect(); 19 | 20 | void ReadConsoleStream(); 21 | 22 | void SendConsoleCommand(string command); 23 | 24 | string CreateKey(string method); 25 | 26 | Boolean IsListening(); 27 | } 28 | } -------------------------------------------------------------------------------- /bukkitgui2/Launcher.cs: -------------------------------------------------------------------------------- 1 | // Launcher.cs in bukkitgui2/bukkitgui2 2 | // Created 2015/01/10 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Windows.Forms; 11 | using Net.Bertware.Bukkitgui2.UI; 12 | 13 | namespace Net.Bertware.Bukkitgui2 14 | { 15 | public static class Launcher 16 | { 17 | // run the mainform, we need to proxy it through this class since we need to load embedded dll's first 18 | public static void Run() 19 | { 20 | Application.Run(new MainForm()); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /bukkitgui2/MinecraftInterop/OutputHandler/PlayerActions/PlayerActionBan.cs: -------------------------------------------------------------------------------- 1 | // PlayerActionBan.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/02/02 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | 12 | namespace Net.Bertware.Bukkitgui2.MinecraftInterop.OutputHandler.PlayerActions 13 | { 14 | public class PlayerActionBan : IPlayerAction 15 | { 16 | public PlayerActionBan() 17 | { 18 | Time = DateTime.Now; 19 | } 20 | 21 | public string PlayerName { get; set; } 22 | public string Details { get; set; } 23 | public DateTime Time { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /bukkitgui2/MinecraftInterop/OutputHandler/PlayerActions/PlayerActionIpBan.cs: -------------------------------------------------------------------------------- 1 | // PlayerActionIpBan.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/02/02 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | 12 | namespace Net.Bertware.Bukkitgui2.MinecraftInterop.OutputHandler.PlayerActions 13 | { 14 | public class PlayerActionIpBan : IPlayerAction 15 | { 16 | public PlayerActionIpBan() 17 | { 18 | Time = DateTime.Now; 19 | } 20 | 21 | public string PlayerName { get; set; } 22 | public string Details { get; set; } 23 | public DateTime Time { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /bukkitgui2/MinecraftInterop/OutputHandler/PlayerActions/PlayerActionKick.cs: -------------------------------------------------------------------------------- 1 | // PlayerActionKick.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/02/02 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | 12 | namespace Net.Bertware.Bukkitgui2.MinecraftInterop.OutputHandler.PlayerActions 13 | { 14 | public class PlayerActionKick : IPlayerAction 15 | { 16 | public PlayerActionKick() 17 | { 18 | Time = DateTime.Now; 19 | } 20 | 21 | public string PlayerName { get; set; } 22 | public string Details { get; set; } 23 | public DateTime Time { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /bukkitgui2/MinecraftInterop/OutputHandler/PlayerActions/PlayerActionLeave.cs: -------------------------------------------------------------------------------- 1 | // PlayerActionLeave.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/02/02 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | 12 | namespace Net.Bertware.Bukkitgui2.MinecraftInterop.OutputHandler.PlayerActions 13 | { 14 | public class PlayerActionLeave : IPlayerAction 15 | { 16 | public PlayerActionLeave() 17 | { 18 | Time = DateTime.Now; 19 | } 20 | 21 | public string PlayerName { get; set; } 22 | public string Details { get; set; } 23 | public DateTime Time { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /bukkitgui2/MinecraftInterop/OutputHandler/PlayerActions/PlayerActionJoin.cs: -------------------------------------------------------------------------------- 1 | // PlayerActionJoin.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/02/02 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | 12 | namespace Net.Bertware.Bukkitgui2.MinecraftInterop.OutputHandler.PlayerActions 13 | { 14 | public class PlayerActionJoin : IPlayerAction 15 | { 16 | public PlayerActionJoin() 17 | { 18 | Time = DateTime.Now; 19 | } 20 | 21 | public string PlayerName { get; set; } 22 | public string Details { get; set; } 23 | public string Ip { get; set; } 24 | public DateTime Time { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /bukkitgui2/MinecraftServers/Servers/McpcServer.cs: -------------------------------------------------------------------------------- 1 | // McpcServer.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/02/02 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.Properties; 11 | 12 | namespace Net.Bertware.Bukkitgui2.MinecraftServers.Servers 13 | { 14 | internal class McpcServer : MinecraftServerBase 15 | { 16 | public McpcServer() 17 | { 18 | Name = "MCPC+ (Cauldron)"; 19 | Site = "http://www.mcportcentral.co.za/"; 20 | Logo = Resources.mcpc_cauldron_logo; 21 | 22 | CanDownloadRecommendedVersion = false; 23 | 24 | //default value for boolean is false, so all other features are disabled by default 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /bukkitgui2/MinecraftInterop/OutputHandler/PlayerActions/IPlayerAction.cs: -------------------------------------------------------------------------------- 1 | // IPlayerAction.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/02/02 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | 12 | namespace Net.Bertware.Bukkitgui2.MinecraftInterop.OutputHandler.PlayerActions 13 | { 14 | public interface IPlayerAction 15 | { 16 | /// 17 | /// The name of the player who was subject to the action 18 | /// 19 | string PlayerName { get; set; } 20 | 21 | /// 22 | /// Details on the action 23 | /// 24 | string Details { get; set; } 25 | 26 | /// 27 | /// Time the action was registered 28 | /// 29 | DateTime Time { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /bukkitgui2/UI/SplashScreen.cs: -------------------------------------------------------------------------------- 1 | // SplashScreen.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/18 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Windows.Forms; 11 | using MetroFramework.Forms; 12 | 13 | namespace Net.Bertware.Bukkitgui2.UI 14 | { 15 | public partial class SplashScreen : MetroForm 16 | { 17 | public static SplashScreen Reference; 18 | 19 | public SplashScreen() 20 | { 21 | Reference = this; 22 | InitializeComponent(); 23 | } 24 | 25 | public void SafeFormClose() 26 | { 27 | if (InvokeRequired) 28 | { 29 | Invoke((MethodInvoker) SafeFormClose); 30 | } 31 | else 32 | { 33 | Close(); 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Net.Bertware.Get/Sysinfo.vb: -------------------------------------------------------------------------------- 1 | Public Class Sysinfo 2 | Public Version = "" 3 | Public Status = "" 4 | Public UpdateToolVersion = "" 5 | Public UpdateToolLocation = "" 6 | Public UpdateToolSha256 = "" 7 | 8 | Public Sub New() 9 | LoadXML(api.GetAPIResponse(APIAction.sysinfo)) 10 | End Sub 11 | 12 | Public Sub LoadXML(xml As String) 13 | Try 14 | Dim xmldoc As New Xml.XmlDocument() 15 | xmldoc.LoadXml(xml) 16 | Version = xmldoc.DocumentElement.Item("version").InnerText 17 | Status = xmldoc.DocumentElement.Item("status").InnerText 18 | UpdateToolLocation = xmldoc.DocumentElement.Item("updater").Item("location").InnerText 19 | UpdateToolVersion = xmldoc.DocumentElement.GetElementsByTagName("updater")(0).Attributes("version").Value 20 | UpdateToolSha256 = xmldoc.DocumentElement.Item("updater").Item("sha256").InnerText 21 | Catch ex As Exception 22 | Trace.WriteLine("Failed to load XML for sysinfo!") 23 | End Try 24 | End Sub 25 | End Class 26 | -------------------------------------------------------------------------------- /bukkitgui2/MinecraftServers/Tools/JsonApi2CredentialsSettingsControl.cs: -------------------------------------------------------------------------------- 1 | // JsonApi2CredentialsSettingsControl.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/05 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Windows.Forms; 12 | 13 | namespace Net.Bertware.Bukkitgui2.MinecraftServers.Tools 14 | { 15 | public partial class JsonApi2CredentialsSettingsControl : UserControl 16 | { 17 | public JsonApi2CredentialsSettingsControl() 18 | { 19 | InitializeComponent(); 20 | } 21 | 22 | public string Username 23 | { 24 | get { return TxtRemoteUsername.Text; } 25 | } 26 | 27 | public string Password 28 | { 29 | get { return MTxtRemotePassword.Text; } 30 | } 31 | 32 | public string Host 33 | { 34 | get { return TxtRemoteHost.Text; } 35 | } 36 | 37 | public int Port 38 | { 39 | get { return Convert.ToInt16(NumRemotePort.Value); } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /bukkitgui2/Controls/MarkupTextArea/MarkupTextArea.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Net.Bertware.Bukkitgui2.Controls.MarkupTextArea 2 | { 3 | partial class MarkupTextArea 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | components = new System.ComponentModel.Container(); 32 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 33 | } 34 | 35 | #endregion 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /bukkitgui2/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18444 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Net.Bertware.Bukkitgui2.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /bukkitgui2/MinecraftServers/Tools/JsonApiCredentialsSettingsControl.cs: -------------------------------------------------------------------------------- 1 | // JsonApiCredentialsSettingsControl.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/07/13 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Windows.Forms; 12 | 13 | namespace Net.Bertware.Bukkitgui2.MinecraftServers.Tools 14 | { 15 | public partial class JsonApiCredentialsSettingsControl : UserControl 16 | { 17 | public JsonApiCredentialsSettingsControl() 18 | { 19 | InitializeComponent(); 20 | } 21 | 22 | public string Username 23 | { 24 | get { return TxtRemoteUsername.Text; } 25 | } 26 | 27 | public string Password 28 | { 29 | get { return MTxtRemotePassword.Text; } 30 | } 31 | 32 | public string Salt 33 | { 34 | get { return MTxtRemoteSalt.Text; } 35 | } 36 | 37 | public string Host 38 | { 39 | get { return TxtRemoteHost.Text; } 40 | } 41 | 42 | public int Port 43 | { 44 | get { return Convert.ToInt16(NumRemotePort.Value); } 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /bukkitgui2/Core/Logging/LogEntry.cs: -------------------------------------------------------------------------------- 1 | // LogEntry.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/31 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | namespace Net.Bertware.Bukkitgui2.Core.Logging 11 | { 12 | internal class LogEntry 13 | { 14 | private readonly string _timestamp; 15 | private readonly LogLevel _level; 16 | private readonly string _origin; 17 | private readonly string _message; 18 | private readonly string _details; 19 | 20 | public LogEntry(LogLevel level, string origin, string message, string details, string timestamp) 21 | { 22 | _level = level; 23 | _origin = origin; 24 | _message = message; 25 | _details = details; 26 | _timestamp = timestamp; 27 | } 28 | 29 | public override string ToString() 30 | { 31 | return _timestamp + "\t[" + _level + "]\t[" + _origin + "]\t" + _message + 32 | ((string.IsNullOrEmpty(_details)) ? "" : " (" + _details + ");"); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /bukkitgui2/Core/Util/StringUtil.cs: -------------------------------------------------------------------------------- 1 | // StringUtil.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/06 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Collections.Generic; 12 | 13 | namespace Net.Bertware.Bukkitgui2.Core.Util 14 | { 15 | internal class StringUtil 16 | { 17 | public static string ListToCsv(IEnumerable list, char separator = ',') 18 | { 19 | if (list == null) return ""; 20 | string result = ""; 21 | foreach (Object obj in list) 22 | { 23 | result += obj + separator.ToString() + ' '; 24 | } 25 | result = result.Substring(0, result.Length - 2); //remove the last ", " 26 | return result; 27 | } 28 | 29 | public static string ListToCsv(List list, char separator = ',') 30 | { 31 | if (list == null || list.Count < 1) return ""; 32 | string result = ""; 33 | foreach (Object obj in list) 34 | { 35 | result += obj + separator.ToString() + ' '; 36 | } 37 | result = result.Substring(0, result.Length - 2); //remove the last ", " 38 | return result; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Updater/UpdaterSettings.cs: -------------------------------------------------------------------------------- 1 | // UpdaterSettings.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/08 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using MetroFramework.Controls; 12 | using Net.Bertware.Bukkitgui2.Core; 13 | using Net.Bertware.Get; 14 | 15 | namespace Net.Bertware.Bukkitgui2.AddOn.Updater 16 | { 17 | public partial class UpdaterSettings : MetroUserControl 18 | { 19 | public UpdaterSettings() 20 | { 21 | InitializeComponent(); 22 | } 23 | 24 | private void UpdaterSettings_Load(object sender, EventArgs e) 25 | { 26 | lblInfoAppName.Text = "Name: " + Share.AssemblyName; 27 | lblInfoAppVersion.Text = "Version: " + Share.AssemblyVersion; 28 | lblInfoAppCopyright.Text = "Copyright: " + Share.AssemblyCopyRight; 29 | lblInfoAppAuthors.Text = "Authors: " + Share.AssemblyCompany; 30 | lblInfoAppLatest.Text = "Latest version: " + api.LatestVersion.Version; 31 | } 32 | 33 | private void BtnInfoAppUpdater_Click(object sender, EventArgs e) 34 | { 35 | api.ShowUpdater(api.LatestVersion); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Net.Bertware.Get/My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | 2 | 3 | ' General Information about an assembly is controlled through the following 4 | ' set of attributes. Change these attribute values to modify the information 5 | ' associated with an assembly. 6 | 7 | ' Review the values of the assembly attributes 8 | Imports System.Reflection 9 | Imports System.Runtime.InteropServices 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 'The following GUID is for the ID of the typelib if this project is exposed to COM 21 | 22 | 23 | ' Version information for an assembly consists of the following four values: 24 | ' 25 | ' Major Version 26 | ' Minor Version 27 | ' Build Number 28 | ' Revision 29 | ' 30 | ' You can specify all the values or you can default the Build and Revision Numbers 31 | ' by using the '*' as shown below: 32 | ' 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Console/EmulatorInput.cs: -------------------------------------------------------------------------------- 1 | // EmulatorInput.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/04 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Windows.Forms; 12 | using MetroFramework.Forms; 13 | using Net.Bertware.Bukkitgui2.MinecraftInterop.OutputHandler; 14 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ProcessHandler; 15 | using MetroMessageBox = MetroFramework.MetroMessageBox; 16 | 17 | namespace Net.Bertware.Bukkitgui2.AddOn.Console 18 | { 19 | public partial class EmulatorInput : MetroForm 20 | { 21 | public EmulatorInput() 22 | { 23 | InitializeComponent(); 24 | } 25 | 26 | private void btnEmulate_Click(object sender, EventArgs e) 27 | { 28 | if (!ProcessHandler.IsRunning) 29 | { 30 | MetroMessageBox.Show(this, "The server has to be running in order to emulate output!", 31 | "Server not running", 32 | MessageBoxButtons.OK, MessageBoxIcon.Warning); 33 | return; 34 | } 35 | foreach (string line in txtLog.Text.Split(Environment.NewLine.ToCharArray()[0])) 36 | { 37 | MinecraftOutputHandler.HandleOutput(ProcessHandler.Server, line); 38 | } 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /bukkitgui2/Controls/SettingsToggle.cs: -------------------------------------------------------------------------------- 1 | // SettingsToggle.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/23 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using MetroFramework.Controls; 12 | using Net.Bertware.Bukkitgui2.Core.Configuration; 13 | 14 | namespace Net.Bertware.Bukkitgui2.Controls 15 | { 16 | internal class SettingsToggle : MetroToggle 17 | { 18 | private string _ident, _key; 19 | private Boolean _defaultvalue; 20 | 21 | /// 22 | /// Link this checkbox to a settings value to automaticly load and save settings 23 | /// 24 | /// 25 | /// 26 | /// 27 | public void Link(string ident, string key, Boolean defaultvalue) 28 | { 29 | _ident = ident; 30 | _key = key; 31 | _defaultvalue = defaultvalue; 32 | Checked = Config.ReadBool(_ident, _key, _defaultvalue); 33 | CheckedChanged += OnCheckedChange; 34 | } 35 | 36 | public void Unlink() 37 | { 38 | CheckedChanged -= OnCheckedChange; 39 | } 40 | 41 | private void OnCheckedChange(object sender, EventArgs e) 42 | { 43 | Config.WriteBool(_ident, _key, Checked); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /bukkitgui2/Controls/SettingsCheckbox.cs: -------------------------------------------------------------------------------- 1 | // SettingsCheckbox.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/07/13 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using MetroFramework.Controls; 12 | using Net.Bertware.Bukkitgui2.Core.Configuration; 13 | 14 | namespace Net.Bertware.Bukkitgui2.Controls 15 | { 16 | internal class SettingsCheckbox : MetroCheckBox 17 | { 18 | private string _ident, _key; 19 | private Boolean _defaultvalue; 20 | 21 | /// 22 | /// Link this checkbox to a settings value to automaticly load and save settings 23 | /// 24 | /// 25 | /// 26 | /// 27 | public void Link(string ident, string key, Boolean defaultvalue) 28 | { 29 | _ident = ident; 30 | _key = key; 31 | _defaultvalue = defaultvalue; 32 | Checked = Config.ReadBool(_ident, _key, _defaultvalue); 33 | CheckedChanged += OnCheckedChange; 34 | } 35 | 36 | public void Unlink() 37 | { 38 | CheckedChanged -= OnCheckedChange; 39 | } 40 | 41 | private void OnCheckedChange(object sender, EventArgs e) 42 | { 43 | Config.WriteBool(_ident, _key, Checked); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /bukkitgui2/Controls/SortableListView/ListViewDateSort.cs: -------------------------------------------------------------------------------- 1 | // ListViewDateSort.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/01 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Collections; 12 | using System.Windows.Forms; 13 | 14 | namespace Net.Bertware.Bukkitgui2.Controls.SortableListView 15 | { 16 | public class ListViewDateSort : IComparer 17 | { 18 | private readonly int _sortColumn; 19 | 20 | private readonly SortOrder _sortOrder; 21 | 22 | public ListViewDateSort(int sortColumn, SortOrder sortOrder) 23 | { 24 | _sortColumn = sortColumn; 25 | _sortOrder = sortOrder; 26 | } 27 | 28 | public int Compare(object x, object y) 29 | { 30 | int result; 31 | ListViewItem itemX = (ListViewItem) x; 32 | ListViewItem itemY = (ListViewItem) y; 33 | if (_sortColumn == 0) 34 | { 35 | result = DateTime.Compare(DateTime.Parse(itemX.Text), DateTime.Parse(itemY.Text)); 36 | } 37 | else 38 | { 39 | result = DateTime.Compare(DateTime.Parse(itemX.SubItems[_sortColumn].Text), 40 | DateTime.Parse(itemY.SubItems[_sortColumn].Text)); 41 | } 42 | if (_sortOrder == SortOrder.Descending) 43 | { 44 | result = -result; 45 | } 46 | return result; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /bukkitgui2/Controls/ColorPicker/ColorPicker.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Net.Bertware.Bukkitgui2.Controls.ColorPicker 2 | { 3 | partial class ColorPicker 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.SuspendLayout(); 32 | // 33 | // ColorPicker 34 | // 35 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 36 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 37 | this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 38 | this.Name = "ColorPicker"; 39 | this.Size = new System.Drawing.Size(58, 18); 40 | this.Click += new System.EventHandler(this.ColorPicker_Click); 41 | this.ResumeLayout(false); 42 | 43 | } 44 | 45 | #endregion 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /bukkitgui2/MinecraftServers/MinecraftServerLoader.cs: -------------------------------------------------------------------------------- 1 | // MinecraftServerLoader.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Collections.Generic; 11 | using Net.Bertware.Bukkitgui2.Core.Logging; 12 | using Net.Bertware.Bukkitgui2.Core.Util; 13 | 14 | namespace Net.Bertware.Bukkitgui2.MinecraftServers 15 | { 16 | internal static class MinecraftServerLoader 17 | { 18 | /// 19 | /// Get a list of all available server types 20 | /// 21 | /// 22 | internal static Dictionary GetAvailableServers() 23 | { 24 | Dictionary servers = new Dictionary(); 25 | 26 | foreach ( 27 | IMinecraftServer server in 28 | DynamicModuleLoader.GetClassesOfType( 29 | "Net.Bertware.Bukkitgui2.MinecraftServers.Servers")) 30 | { 31 | if (!servers.ContainsKey(server.Name)) 32 | { 33 | servers.Add(server.Name, server); 34 | } 35 | else 36 | { 37 | Logger.Log( 38 | LogLevel.Severe, 39 | "MinecraftServerLoader", 40 | "Can't add server to dictionary, duplicate name!", 41 | server.Name); 42 | } 43 | } 44 | return servers; 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Editor/SettingsEditDialog.cs: -------------------------------------------------------------------------------- 1 | // SettingsEditDialog.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/27 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Windows.Forms; 12 | using MetroFramework.Forms; 13 | 14 | namespace Net.Bertware.Bukkitgui2.AddOn.Editor 15 | { 16 | public partial class SettingsEditDialog : MetroForm 17 | { 18 | public SettingsEditDialog() 19 | { 20 | InitializeComponent(); 21 | txtSetting.ReadOnly = false; 22 | Text = "Add Setting"; 23 | } 24 | 25 | public SettingsEditDialog(string setting, string value) 26 | { 27 | InitializeComponent(); 28 | txtSetting.ReadOnly = true; // make setting name readonly 29 | txtSetting.Text = setting; 30 | txtValue.Text = value; 31 | txtValue.Focus(); // focus value textbox 32 | } 33 | 34 | public string Setting 35 | { 36 | get { return txtSetting.Text; } 37 | } 38 | 39 | public string Value 40 | { 41 | get { return txtValue.Text; } 42 | } 43 | 44 | private void btnSave_Click(object sender, EventArgs e) 45 | { 46 | DialogResult = DialogResult.OK; 47 | Close(); 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /bukkitgui2/Controls/ColorPicker/ColorPicker.cs: -------------------------------------------------------------------------------- 1 | // ColorPicker.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/06/26 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Drawing; 12 | using System.Windows.Forms; 13 | 14 | namespace Net.Bertware.Bukkitgui2.Controls.ColorPicker 15 | { 16 | public partial class ColorPicker : UserControl 17 | { 18 | public ColorPicker() 19 | { 20 | InitializeComponent(); 21 | } 22 | 23 | public delegate void ColorChangedEventHandler(Color color); 24 | 25 | /// 26 | /// Raised when the color is changed 27 | /// 28 | public event ColorChangedEventHandler ColorChanged; 29 | 30 | private void RaiseColorChangedEvent() 31 | { 32 | ColorChangedEventHandler handler = ColorChanged; 33 | if (handler != null) handler.Invoke(Color); 34 | } 35 | 36 | private Color _color; 37 | 38 | /// 39 | /// The selected color 40 | /// 41 | public Color Color 42 | { 43 | get { return _color; } 44 | set 45 | { 46 | _color = value; 47 | BackColor = value; 48 | } 49 | } 50 | 51 | private void ColorPicker_Click(object sender, EventArgs e) 52 | { 53 | PickColor(); 54 | } 55 | 56 | private void PickColor() 57 | { 58 | ColorDialog cd = new ColorDialog {Color = Color}; 59 | cd.ShowDialog(); 60 | Color = cd.Color; 61 | RaiseColorChangedEvent(); 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Action/IAction.cs: -------------------------------------------------------------------------------- 1 | // IAction.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/10 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Action 11 | { 12 | public interface IAction 13 | { 14 | event TaskerEventArgs TaskerActionExecuteStarted; 15 | event TaskerEventArgs TaskerActionExecuteFinished; 16 | 17 | /// 18 | /// Name of the action 19 | /// 20 | string Name { get; } 21 | 22 | /// 23 | /// Description of the action 24 | /// 25 | string Description { get; } 26 | 27 | /// 28 | /// Description of the action parameters 29 | /// 30 | string ParameterDescription { get; } 31 | 32 | /// 33 | /// Load an action by name and parameter 34 | /// 35 | /// 36 | void Load(string parameters); 37 | 38 | /// 39 | /// Validate parameter input 40 | /// 41 | /// The input to validate 42 | /// Returns True if valid 43 | bool ValidateInput(string inputText); 44 | 45 | /// 46 | /// The saved parameters for an instance of this action 47 | /// 48 | string Parameters { get; set; } 49 | 50 | 51 | /// 52 | /// Enable this action 53 | /// 54 | void Execute(); 55 | } 56 | } -------------------------------------------------------------------------------- /bukkitgui2/UI/ServerStopDialog.cs: -------------------------------------------------------------------------------- 1 | // ServerStopDialog.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/06/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Windows.Forms; 12 | using MetroFramework.Forms; 13 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ProcessHandler; 14 | 15 | namespace Net.Bertware.Bukkitgui2.UI 16 | { 17 | public partial class ServerStopDialog : MetroForm 18 | { 19 | public ServerStopDialog() 20 | { 21 | InitializeComponent(); 22 | } 23 | 24 | 25 | private void btnCancel_Click(object sender, EventArgs e) 26 | { 27 | DialogResult = DialogResult.Cancel; 28 | Close(); 29 | } 30 | 31 | private void ServerStopDialog_Load(object sender, EventArgs e) 32 | { 33 | if (ProcessHandler.CurrentState == ServerState.Stopped) 34 | { 35 | DialogResult = DialogResult.OK; 36 | Close(); 37 | } 38 | 39 | if (ProcessHandler.Server.IsLocal) 40 | { 41 | ProcessHandler.StopServer(); 42 | } 43 | else 44 | { 45 | ProcessHandler.StopServerProcess(); 46 | } 47 | 48 | ProcessHandler.ServerStopped += Return; 49 | } 50 | 51 | private void Return() 52 | { 53 | if (InvokeRequired) 54 | { 55 | Invoke(new MethodInvoker(Return)); 56 | } 57 | else 58 | { 59 | DialogResult = DialogResult.OK; 60 | Close(); 61 | } 62 | } 63 | 64 | private void btnKill_Click(object sender, EventArgs e) 65 | { 66 | ProcessHandler.KillServer(); 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /bukkitgui2/Core/Util/Web/FileDownloader.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Net.Bertware.Bukkitgui2.Core.Util.Web 2 | { 3 | partial class FileDownloader 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.SuspendLayout(); 32 | // 33 | // FileDownloader 34 | // 35 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 36 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 37 | this.ClientSize = new System.Drawing.Size(414, 133); 38 | this.MaximizeBox = false; 39 | this.MinimizeBox = false; 40 | this.Name = "FileDownloader"; 41 | this.Resizable = false; 42 | this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; 43 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 44 | this.Text = Locale.Tr("Downloads..."); 45 | this.Load += new System.EventHandler(this.FileDownloader_Load); 46 | this.ResumeLayout(false); 47 | 48 | } 49 | 50 | #endregion 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /bukkitgui2/Controls/SortableListView/ListViewStringSort.cs: -------------------------------------------------------------------------------- 1 | // ListViewStringSort.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/01 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Collections; 12 | using System.Diagnostics; 13 | using System.Windows.Forms; 14 | 15 | namespace Net.Bertware.Bukkitgui2.Controls.SortableListView 16 | { 17 | public class ListViewStringSort : IComparer 18 | { 19 | private readonly int _sortColumn; 20 | private readonly SortOrder _sortOrder; 21 | 22 | public ListViewStringSort(int sortColumn, SortOrder sortOrder) 23 | { 24 | _sortColumn = sortColumn; 25 | _sortOrder = sortOrder; 26 | } 27 | 28 | public int Compare(object x, object y) 29 | { 30 | try 31 | { 32 | int result; 33 | ListViewItem itemX = (ListViewItem) x; 34 | ListViewItem itemY = (ListViewItem) y; 35 | 36 | if (_sortColumn == 0) 37 | { 38 | result = String.Compare(itemX.Text.ToLower(), itemY.Text.ToLower(), StringComparison.Ordinal); 39 | } 40 | else 41 | { 42 | result = String.Compare(itemX.SubItems[_sortColumn].Text.ToLower(), 43 | itemY.SubItems[_sortColumn].Text.ToLower(), 44 | StringComparison.Ordinal); 45 | } 46 | if (_sortOrder == SortOrder.Descending) 47 | { 48 | result = -result; 49 | } 50 | return result; 51 | } 52 | catch (Exception ex) 53 | { 54 | Trace.WriteLine("Exception while sorting listview!" + ex.Message); 55 | return 1; 56 | } 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/IAddon.cs: -------------------------------------------------------------------------------- 1 | // IAddon.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/30 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using MetroFramework.Controls; 12 | 13 | namespace Net.Bertware.Bukkitgui2.AddOn 14 | { 15 | public interface IAddon 16 | { 17 | /// 18 | /// The addon name, ideally this name is the same as used in the tabpage 19 | /// 20 | string Name { get; } 21 | 22 | /// 23 | /// The addon priority. Default: 0 24 | /// 25 | int Priority { get; } 26 | 27 | /// 28 | /// True if this addon has a tabpage 29 | /// 30 | Boolean HasTab { get; } 31 | 32 | /// 33 | /// True if this addon has a config field 34 | /// 35 | Boolean HasConfig { get; } 36 | 37 | /// 38 | /// Initialize all functions and the tabcontrol 39 | /// 40 | void Initialize(); 41 | 42 | /// 43 | /// Dispose all resources 44 | /// 45 | void Dispose(); 46 | 47 | /// 48 | /// The tab control for this addon, if any 49 | /// 50 | /// Returns the tabpage 51 | MetroUserControl TabPage { get; } 52 | 53 | /// 54 | /// The config control for this addon, if any 55 | /// 56 | /// Returns the tabpage 57 | MetroUserControl ConfigPage { get; } 58 | } 59 | 60 | public enum RequiredAddon 61 | { 62 | Console, 63 | Starter, 64 | Settings 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /bukkitgui2/MinecraftInterop/OutputHandler/EnumMessageType.cs: -------------------------------------------------------------------------------- 1 | // EnumMessageType.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/02/02 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | namespace Net.Bertware.Bukkitgui2.MinecraftInterop.OutputHandler 11 | { 12 | /// 13 | /// The type of output from a minecraft server 14 | /// 15 | public enum MessageType 16 | { 17 | /// 18 | /// Informative 19 | /// 20 | Info = 10, 21 | 22 | /// 23 | /// Warning 24 | /// 25 | Warning = 11, 26 | 27 | /// 28 | /// Severe/Error 29 | /// 30 | Severe = 12, 31 | 32 | /// 33 | /// Player joined 34 | /// 35 | PlayerJoin = 20, 36 | 37 | /// 38 | /// Player left or disconnected 39 | /// 40 | PlayerLeave = 21, 41 | 42 | /// 43 | /// Player kicked 44 | /// 45 | PlayerKick = 22, 46 | 47 | /// 48 | /// Player banned 49 | /// 50 | PlayerBan = 23, 51 | 52 | /// 53 | /// Ip banned 54 | /// 55 | PlayerIpBan = 24, 56 | 57 | /// 58 | /// Java stacktrace 59 | /// 60 | JavaStackTrace = 30, 61 | 62 | /// 63 | /// Java VM messages 64 | /// 65 | JavaStatus = 31, 66 | 67 | /// 68 | /// Output from /list command 69 | /// 70 | PlayerList = 40, 71 | 72 | /// 73 | /// Uknown text 74 | /// 75 | Unknown = 0 76 | } 77 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Trigger/ITrigger.cs: -------------------------------------------------------------------------------- 1 | // ITrigger.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/10 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Trigger 11 | { 12 | public interface ITrigger 13 | { 14 | event TaskerEventArgs TaskerTriggerFired; 15 | 16 | /// 17 | /// Name of the trigger 18 | /// 19 | string Name { get; } 20 | 21 | /// 22 | /// Description of the trigger 23 | /// 24 | string Description { get; } 25 | 26 | /// 27 | /// Description of the trigger parameters 28 | /// 29 | string ParameterDescription { get; } 30 | 31 | /// 32 | /// Validate parameter input 33 | /// 34 | /// The input to validate 35 | /// Returns True if valid 36 | bool ValidateInput(string inputText); 37 | 38 | /// 39 | /// Load a trigger by name and parameter 40 | /// 41 | /// 42 | void Load(string parameters); 43 | 44 | /// 45 | /// The saved parameters for an instance of this trigger 46 | /// 47 | string Parameters { get; set; } 48 | 49 | /// 50 | /// If this trigger instance is enabled 51 | /// 52 | bool Enabled { get; } 53 | 54 | /// 55 | /// Enable this trigger 56 | /// 57 | void Enable(); 58 | 59 | /// 60 | /// Disable this trigger 61 | /// 62 | void Disable(); 63 | } 64 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Action/ServerRestartAction.cs: -------------------------------------------------------------------------------- 1 | // ServerRestartAction.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/13 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Action 11 | { 12 | internal class ServerRestartAction : IAction 13 | { 14 | public ServerRestartAction() 15 | { 16 | Name = "Restart server"; 17 | Description = "Restart the server gracefully"; 18 | ParameterDescription = 19 | "No parameters are required"; 20 | } 21 | 22 | public event TaskerEventArgs TaskerActionExecuteStarted; 23 | 24 | protected virtual void OnTaskerActionExecuteStarted() 25 | { 26 | TaskerEventArgs handler = TaskerActionExecuteStarted; 27 | if (handler != null) handler(); 28 | } 29 | 30 | public event TaskerEventArgs TaskerActionExecuteFinished; 31 | 32 | protected virtual void OnTaskerActionExecuteFinished() 33 | { 34 | TaskerEventArgs handler = TaskerActionExecuteFinished; 35 | if (handler != null) handler(); 36 | } 37 | 38 | public string Name { get; protected set; } 39 | 40 | public string Description { get; protected set; } 41 | 42 | public string ParameterDescription { get; protected set; } 43 | 44 | public void Load(string parameters) 45 | { 46 | Parameters = parameters; 47 | } 48 | 49 | public bool ValidateInput(string inputText) 50 | { 51 | return true; 52 | } 53 | 54 | public string Parameters { get; set; } 55 | 56 | public void Execute() 57 | { 58 | OnTaskerActionExecuteStarted(); 59 | Starter.Starter.RestartServer(); 60 | OnTaskerActionExecuteFinished(); 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Issues/Issues.cs: -------------------------------------------------------------------------------- 1 | // Issues.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/31 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using MetroFramework.Controls; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Issues 13 | { 14 | internal class Issues : IAddon 15 | { 16 | public Issues() 17 | { 18 | Name = "Issues"; 19 | Priority = 0; 20 | HasTab = true; 21 | TabPage = new IssuesTab(); 22 | HasConfig = false; 23 | ConfigPage = null; 24 | } 25 | 26 | /// 27 | /// The addon name, ideally this name is the same as used in the tabpage 28 | /// 29 | public string Name { get; private set; } 30 | 31 | /// 32 | /// The addon priority. Default: 0 33 | /// 34 | public int Priority { get; private set; } 35 | 36 | /// 37 | /// True if this addon has a tab page 38 | /// 39 | public bool HasTab { get; private set; } 40 | 41 | /// 42 | /// True if this addon has a config field 43 | /// 44 | public bool HasConfig { get; private set; } 45 | 46 | /// 47 | /// Initialize all functions and the tabcontrol 48 | /// 49 | public void Initialize() 50 | { 51 | // nothing to do 52 | } 53 | 54 | public void Dispose() 55 | { 56 | // nothing to do 57 | } 58 | 59 | /// 60 | /// The tab control for this addon 61 | /// 62 | /// Returns the tabpage 63 | public MetroUserControl TabPage { get; private set; } 64 | 65 | public MetroUserControl ConfigPage { get; private set; } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Editor/Editor.cs: -------------------------------------------------------------------------------- 1 | // Editor.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using MetroFramework.Controls; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Editor 13 | { 14 | internal class Editor : IAddon 15 | { 16 | /// 17 | /// The addon name, ideally this name is the same as used in the tabpage 18 | /// 19 | public string Name 20 | { 21 | get { return "Editor"; } 22 | } 23 | 24 | /// 25 | /// The addon priority. Default: 0 26 | /// 27 | public int Priority 28 | { 29 | get { return 0; } 30 | } 31 | 32 | /// 33 | /// True if this addon has a tab page 34 | /// 35 | public bool HasTab 36 | { 37 | get { return true; } 38 | } 39 | 40 | /// 41 | /// True if this addon has a config field 42 | /// 43 | public bool HasConfig 44 | { 45 | get { return false; } 46 | } 47 | 48 | /// 49 | /// Initialize all functions and the tabcontrol 50 | /// 51 | public void Initialize() 52 | { 53 | TabPage = new EditorTab {Text = Name, ParentAddon = this}; 54 | ConfigPage = null; 55 | } 56 | 57 | public void Dispose() 58 | { 59 | // nothing to do 60 | } 61 | 62 | /// 63 | /// The tab control for this addon 64 | /// 65 | /// Returns the tabpage 66 | public MetroUserControl TabPage { get; private set; } 67 | 68 | public MetroUserControl ConfigPage { get; private set; } 69 | 70 | public bool CanDisable 71 | { 72 | get { return true; } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Editor/IpBanListControl.cs: -------------------------------------------------------------------------------- 1 | // IpBanListControl.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/29 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Windows.Forms; 12 | using MetroFramework.Forms; 13 | using Net.Bertware.Bukkitgui2.MinecraftInterop.PlayerHandler; 14 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ServerConfig; 15 | 16 | namespace Net.Bertware.Bukkitgui2.AddOn.Editor 17 | { 18 | public partial class IpBanListControl : IAddonTab 19 | { 20 | public IpBanListControl() 21 | { 22 | InitializeComponent(); 23 | } 24 | 25 | public IAddon ParentAddon { get; set; } 26 | 27 | private void WhitelistControl_Load(object sender, EventArgs e) 28 | { 29 | RefreshList(); 30 | } 31 | 32 | private void RefreshList() 33 | { 34 | slvList.Items.Clear(); 35 | foreach (ServerListItem item in ServerList.BannedIps.List.Values) 36 | { 37 | string[] content = {item.Ip, item.Created, item.Source, item.Expires}; 38 | ListViewItem lvi = new ListViewItem(content) {Tag = item.Ip}; 39 | slvList.Items.Add(lvi); 40 | } 41 | } 42 | 43 | private void btnAdd_Click(object sender, EventArgs e) 44 | { 45 | string ip = MetroPrompt.ShowPrompt("Ban ip", "Enter the ip you'd like to ban"); 46 | if (string.IsNullOrEmpty(ip)) return; 47 | 48 | PlayerActions.BanIp(ip); 49 | 50 | RefreshList(); 51 | } 52 | 53 | private void btnRemove_Click(object sender, EventArgs e) 54 | { 55 | if (slvList.SelectedItems.Count < 1) return; 56 | string ip = slvList.SelectedItems[0].Tag.ToString(); 57 | if (!string.IsNullOrEmpty(ip)) PlayerActions.PardonIp(ip); 58 | 59 | RefreshList(); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Action/ServerStopAction.cs: -------------------------------------------------------------------------------- 1 | // ServerStopAction.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/13 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ProcessHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Action 13 | { 14 | internal class ServerStopAction : IAction 15 | { 16 | public ServerStopAction() 17 | { 18 | Name = "Stop Server"; 19 | Description = "Stop the server gracefully"; 20 | ParameterDescription = 21 | "No parameters are required"; 22 | } 23 | 24 | public event TaskerEventArgs TaskerActionExecuteStarted; 25 | 26 | protected virtual void OnTaskerActionExecuteStarted() 27 | { 28 | TaskerEventArgs handler = TaskerActionExecuteStarted; 29 | if (handler != null) handler(); 30 | } 31 | 32 | public event TaskerEventArgs TaskerActionExecuteFinished; 33 | 34 | protected virtual void OnTaskerActionExecuteFinished() 35 | { 36 | TaskerEventArgs handler = TaskerActionExecuteFinished; 37 | if (handler != null) handler(); 38 | } 39 | 40 | public string Name { get; protected set; } 41 | 42 | public string Description { get; protected set; } 43 | 44 | public string ParameterDescription { get; protected set; } 45 | 46 | public void Load(string parameters) 47 | { 48 | Parameters = parameters; 49 | } 50 | 51 | public bool ValidateInput(string inputText) 52 | { 53 | return true; 54 | } 55 | 56 | public string Parameters { get; set; } 57 | 58 | public void Execute() 59 | { 60 | OnTaskerActionExecuteStarted(); 61 | if (ProcessHandler.IsRunning) ProcessHandler.StopServer(); 62 | OnTaskerActionExecuteFinished(); 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Console/Console.cs: -------------------------------------------------------------------------------- 1 | // Console.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using MetroFramework.Controls; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Console 13 | { 14 | internal class Console : IAddon 15 | { 16 | /// 17 | /// The addon name, ideally this name is the same as used in the tabpage 18 | /// 19 | public string Name 20 | { 21 | get { return "Console"; } 22 | } 23 | 24 | /// 25 | /// The addon priority. Default: 0 26 | /// 27 | public int Priority 28 | { 29 | get { return 0; } 30 | } 31 | 32 | /// 33 | /// True if this addon has a tab page 34 | /// 35 | public bool HasTab 36 | { 37 | get { return true; } 38 | } 39 | 40 | /// 41 | /// True if this addon has a config field 42 | /// 43 | public bool HasConfig 44 | { 45 | get { return true; } 46 | } 47 | 48 | /// 49 | /// Initialize all functions and the tabcontrol 50 | /// 51 | public void Initialize() 52 | { 53 | TabPage = new ConsoleTab {Text = Name, ParentAddon = this}; 54 | ConfigPage = new ConsoleSettings(); 55 | } 56 | 57 | public void Dispose() 58 | { 59 | // nothing to do 60 | } 61 | 62 | /// 63 | /// The tab control for this addon 64 | /// 65 | /// Returns the tabpage 66 | public MetroUserControl TabPage { get; private set; } 67 | 68 | public MetroUserControl ConfigPage { get; private set; } 69 | 70 | public bool CanDisable 71 | { 72 | get { return false; } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /bukkitgui2/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // AssemblyInfo.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Reflection; 11 | using System.Runtime.InteropServices; 12 | 13 | // General Information about an assembly is controlled through the following 14 | // set of attributes. Change these attribute values to modify the information 15 | // associated with an assembly. 16 | 17 | [assembly: AssemblyTitle("Bukkitgui2")] 18 | [assembly: AssemblyDescription("Minecraft server hosting made easy")] 19 | [assembly: AssemblyConfiguration("")] 20 | [assembly: AssemblyCompany("Bertware.net")] 21 | [assembly: AssemblyProduct("Bukkitgui2")] 22 | [assembly: AssemblyCopyright("Copyright ©2011 - 2016")] 23 | [assembly: AssemblyTrademark("")] 24 | [assembly: AssemblyCulture("")] 25 | 26 | // Setting ComVisible to false makes the types in this assembly not visible 27 | // to COM components. If you need to access a type in this assembly from 28 | // COM, set the ComVisible attribute to true on that type. 29 | 30 | [assembly: ComVisible(false)] 31 | 32 | // The following GUID is for the ID of the typelib if this project is exposed to COM 33 | 34 | [assembly: Guid("4d22161c-4978-46dd-95ad-3d4268ce5b15")] 35 | 36 | // Version information for an assembly consists of the following four values: 37 | // 38 | // Major Version 39 | // Minor Version 40 | // Build Number 41 | // Revision 42 | // 43 | // You can specify all the values or you can default the Build and Revision Numbers 44 | // by using the '*' as shown below: 45 | // [assembly: AssemblyVersion("1.0.*")] 46 | 47 | [assembly: AssemblyVersion("2.0.0.335")] 48 | [assembly: AssemblyFileVersion("2.0.0.335")] -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Notifications/NotificationsSettings.cs: -------------------------------------------------------------------------------- 1 | // NotificationsSettings.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/06/21 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using MetroFramework.Controls; 12 | 13 | namespace Net.Bertware.Bukkitgui2.AddOn.Notifications 14 | { 15 | public partial class NotificationSettings : MetroUserControl 16 | { 17 | public NotificationSettings() 18 | { 19 | InitializeComponent(); 20 | chkEnable.Link(Notifications.CfgIdent, "enabled", false); 21 | chkAlways.Link(Notifications.CfgIdent, "always", false); 22 | chkOnStatusChange.Link(Notifications.CfgIdent, "status", false); 23 | chkOnStatusChange.Link(Notifications.CfgIdent, "status", false); 24 | chkOnPlayerJoin.Link(Notifications.CfgIdent, "join", false); 25 | chkOnPlayerLeave.Link(Notifications.CfgIdent, "leave", false); 26 | chkOnPlayerKick.Link(Notifications.CfgIdent, "kick", false); 27 | chkOnPlayerBan.Link(Notifications.CfgIdent, "ban", false); 28 | 29 | chkSoundOnError.Link(Notifications.CfgIdent, "sound_error", false); 30 | chkSoundOnWarning.Link(Notifications.CfgIdent, "sound_warn", false); 31 | chkSoundOnJoin.Link(Notifications.CfgIdent, "sound_join", false); 32 | chkSoundOnLeave.Link(Notifications.CfgIdent, "sound_leave", false); 33 | } 34 | 35 | private void chkEnable_CheckedChanged(object sender, EventArgs e) 36 | { 37 | gbBalloons.Enabled = chkEnable.Checked; 38 | //gbSound.Enabled = chkEnable.Checked; 39 | } 40 | 41 | private void btnReload_Click(object sender, EventArgs e) 42 | { 43 | IAddon notifications = AddonManager.GetAddon("Notifications"); 44 | notifications.Dispose(); 45 | notifications.Initialize(); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Editor/BanListControl.cs: -------------------------------------------------------------------------------- 1 | // BanListControl.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/29 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Windows.Forms; 12 | using MetroFramework.Forms; 13 | using Net.Bertware.Bukkitgui2.MinecraftInterop.PlayerHandler; 14 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ServerConfig; 15 | 16 | namespace Net.Bertware.Bukkitgui2.AddOn.Editor 17 | { 18 | public partial class BanListControl : IAddonTab 19 | { 20 | public BanListControl() 21 | { 22 | InitializeComponent(); 23 | } 24 | 25 | public IAddon ParentAddon { get; set; } 26 | 27 | private void WhitelistControl_Load(object sender, EventArgs e) 28 | { 29 | RefreshList(); 30 | } 31 | 32 | private void RefreshList() 33 | { 34 | slvList.Items.Clear(); 35 | foreach (ServerListItem item in ServerList.BannedPlayers.List.Values) 36 | { 37 | string[] content = {item.Name, item.Uuid, item.Created, item.Source, item.Expires}; 38 | ListViewItem lvi = new ListViewItem(content) {Tag = item.Name}; 39 | slvList.Items.Add(lvi); 40 | } 41 | } 42 | 43 | private void btnAdd_Click(object sender, EventArgs e) 44 | { 45 | string name = MetroPrompt.ShowPrompt("Ban player", "Enter the name of the player you'd like to ban"); 46 | if (string.IsNullOrEmpty(name)) return; 47 | 48 | PlayerActions.BanPlayer(name); 49 | 50 | RefreshList(); 51 | } 52 | 53 | private void btnRemove_Click(object sender, EventArgs e) 54 | { 55 | if (slvList.SelectedItems.Count < 1) return; 56 | string name = slvList.SelectedItems[0].Tag.ToString(); 57 | if (!string.IsNullOrEmpty(name)) PlayerActions.PardonPlayer(name); 58 | 59 | RefreshList(); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Console/ConsoleSettings.cs: -------------------------------------------------------------------------------- 1 | // ConsoleSettings.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/05/24 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Drawing; 11 | using MetroFramework.Controls; 12 | using Net.Bertware.Bukkitgui2.Core.Configuration; 13 | 14 | namespace Net.Bertware.Bukkitgui2.AddOn.Console 15 | { 16 | public partial class ConsoleSettings : MetroUserControl 17 | { 18 | public ConsoleSettings() 19 | { 20 | InitializeComponent(); 21 | 22 | CpInfo.Color = Color.FromArgb(Config.ReadInt("console", "color_info", Color.Blue.ToArgb())); 23 | cpPlayer.Color = Color.FromArgb(Config.ReadInt("console", "color_playeraction", Color.DarkGreen.ToArgb())); 24 | cpSevere.Color = Color.FromArgb(Config.ReadInt("console", "color_severe", Color.DarkRed.ToArgb())); 25 | cpWarn.Color = Color.FromArgb(Config.ReadInt("console", "color_warning", Color.DarkOrange.ToArgb())); 26 | chkDate.Link("console", "date", false); 27 | chkTime.Link("console", "time", true); 28 | chkAutostart.Link("console", "autostart", false); 29 | chkAutoscroll.Link("console", "autoscroll", true); 30 | } 31 | 32 | private void CpInfo_ColorChanged(Color color) 33 | { 34 | Config.WriteInt("console", "color_info", CpInfo.Color.ToArgb()); 35 | } 36 | 37 | private void cpWarn_ColorChanged(Color color) 38 | { 39 | Config.WriteInt("console", "color_warning", cpWarn.Color.ToArgb()); 40 | } 41 | 42 | private void cpSevere_ColorChanged(Color color) 43 | { 44 | Config.WriteInt("console", "color_severe", cpSevere.Color.ToArgb()); 45 | } 46 | 47 | private void cpPlayer_ColorChanged(Color color) 48 | { 49 | Config.WriteInt("console", "color_playeraction", cpPlayer.Color.ToArgb()); 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Editor/WhitelistControl.cs: -------------------------------------------------------------------------------- 1 | // WhitelistControl.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/27 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Windows.Forms; 12 | using MetroFramework.Forms; 13 | using Net.Bertware.Bukkitgui2.MinecraftInterop.PlayerHandler; 14 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ServerConfig; 15 | 16 | namespace Net.Bertware.Bukkitgui2.AddOn.Editor 17 | { 18 | public partial class WhitelistControl : IAddonTab 19 | { 20 | public WhitelistControl() 21 | { 22 | InitializeComponent(); 23 | } 24 | 25 | public IAddon ParentAddon { get; set; } 26 | 27 | private void WhitelistControl_Load(object sender, EventArgs e) 28 | { 29 | RefreshList(); 30 | } 31 | 32 | private void RefreshList() 33 | { 34 | slvList.Items.Clear(); 35 | foreach (ServerListItem item in ServerList.WhiteList.List.Values) 36 | { 37 | string[] content = {item.Name, item.Uuid}; 38 | ListViewItem lvi = new ListViewItem(content) {Tag = item.Name}; 39 | slvList.Items.Add(lvi); 40 | } 41 | } 42 | 43 | private void btnAdd_Click(object sender, EventArgs e) 44 | { 45 | string name = MetroPrompt.ShowPrompt("Whitelist player", 46 | "Enter the name of the player you'd like to whitelist"); 47 | if (string.IsNullOrEmpty(name)) return; 48 | 49 | PlayerActions.SetPlayerWhitelist(name, true); 50 | 51 | RefreshList(); 52 | } 53 | 54 | private void btnRemove_Click(object sender, EventArgs e) 55 | { 56 | if (slvList.SelectedItems.Count < 1) return; 57 | string name = slvList.SelectedItems[0].Tag.ToString(); 58 | if (!string.IsNullOrEmpty(name)) PlayerActions.SetPlayerWhitelist(name, false); 59 | RefreshList(); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /JsonApiConnector/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // AssemblyInfo.cs in bukkitgui2/JsonApiConnector 2 | // Created 2014/02/05 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Reflection; 11 | using System.Runtime.InteropServices; 12 | 13 | // General Information about an assembly is controlled through the following 14 | // set of attributes. Change these attribute values to modify the information 15 | // associated with an assembly. 16 | 17 | [assembly: AssemblyTitle("JsonApiConnector")] 18 | [assembly: AssemblyDescription("Emulates a local server by connecting to a remote JsonApi server")] 19 | [assembly: AssemblyConfiguration("")] 20 | [assembly: AssemblyCompany("")] 21 | [assembly: AssemblyProduct("JsonApiConnector")] 22 | [assembly: AssemblyCopyright("Copyright © 2014")] 23 | [assembly: AssemblyTrademark("")] 24 | [assembly: AssemblyCulture("")] 25 | 26 | // Setting ComVisible to false makes the types in this assembly not visible 27 | // to COM components. If you need to access a type in this assembly from 28 | // COM, set the ComVisible attribute to true on that type. 29 | 30 | [assembly: ComVisible(false)] 31 | 32 | // The following GUID is for the ID of the typelib if this project is exposed to COM 33 | 34 | [assembly: Guid("c267ada1-17e9-4d6f-bf1f-214938849bb8")] 35 | 36 | // Version information for an assembly consists of the following four values: 37 | // 38 | // Major Version 39 | // Minor Version 40 | // Build Number 41 | // Revision 42 | // 43 | // You can specify all the values or you can default the Build and Revision Numbers 44 | // by using the '*' as shown below: 45 | // [assembly: AssemblyVersion("1.0.*")] 46 | 47 | [assembly: AssemblyVersion("1.0.0.0")] 48 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Forwarder/Forwarder.cs: -------------------------------------------------------------------------------- 1 | // Forwarder.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using MetroFramework.Controls; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Forwarder 13 | { 14 | internal class Forwarder : IAddon 15 | { 16 | public Forwarder() 17 | { 18 | Name = "Forwarder (experimental)"; 19 | Priority = 0; 20 | HasTab = true; 21 | HasConfig = false; 22 | ConfigPage = null; 23 | } 24 | 25 | /// 26 | /// The addon name, ideally this name is the same as used in the tabpage 27 | /// 28 | public string Name { get; private set; } 29 | 30 | /// 31 | /// The addon priority. Default: 0 32 | /// 33 | public int Priority { get; private set; } 34 | 35 | /// 36 | /// True if this addon has a tab page 37 | /// 38 | public bool HasTab { get; private set; } 39 | 40 | /// 41 | /// True if this addon has a config field 42 | /// 43 | public bool HasConfig { get; private set; } 44 | 45 | 46 | /// 47 | /// Initialize all functions and the tabcontrol 48 | /// 49 | public void Initialize() 50 | { 51 | TabPage = new ForwarderTab {Text = Name, ParentAddon = this}; 52 | } 53 | 54 | public void Dispose() 55 | { 56 | // nothing to do 57 | } 58 | 59 | /// 60 | /// The tab control for this addon 61 | /// 62 | /// Returns the tabpage 63 | public MetroUserControl TabPage { get; private set; } 64 | 65 | public MetroUserControl ConfigPage { get; private set; } 66 | 67 | public bool CanDisable 68 | { 69 | get { return true; } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Action/KickAllAction.cs: -------------------------------------------------------------------------------- 1 | // KickAllAction.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/07 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.PlayerHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Action 13 | { 14 | internal class KickAllAction : IAction 15 | { 16 | public KickAllAction() 17 | { 18 | Name = "Kick All"; 19 | Description = "Kick all online players."; 20 | ParameterDescription = 21 | "Reason for the kick, shown to kicked players"; 22 | } 23 | 24 | public event TaskerEventArgs TaskerActionExecuteStarted; 25 | 26 | protected virtual void OnTaskerActionExecuteStarted() 27 | { 28 | TaskerEventArgs handler = TaskerActionExecuteStarted; 29 | if (handler != null) handler(); 30 | } 31 | 32 | public event TaskerEventArgs TaskerActionExecuteFinished; 33 | 34 | protected virtual void OnTaskerActionExecuteFinished() 35 | { 36 | TaskerEventArgs handler = TaskerActionExecuteFinished; 37 | if (handler != null) handler(); 38 | } 39 | 40 | public string Name { get; protected set; } 41 | 42 | public string Description { get; protected set; } 43 | 44 | public string ParameterDescription { get; protected set; } 45 | 46 | public void Load(string parameters) 47 | { 48 | Parameters = parameters; 49 | } 50 | 51 | public bool ValidateInput(string inputText) 52 | { 53 | return true; 54 | } 55 | 56 | public string Parameters { get; set; } 57 | 58 | public void Execute() 59 | { 60 | OnTaskerActionExecuteStarted(); 61 | 62 | foreach (Player player in PlayerHandler.GetOnlinePlayers()) 63 | { 64 | player.Kick(Parameters); 65 | } 66 | 67 | OnTaskerActionExecuteFinished(); 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Trigger/ServerStartedTrigger.cs: -------------------------------------------------------------------------------- 1 | // ServerStartedTrigger.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/14 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ProcessHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Trigger 13 | { 14 | internal class ServerStartedTrigger : ITrigger 15 | { 16 | public ServerStartedTrigger() 17 | { 18 | Name = "Server Started"; 19 | Description = "Execute a task when the server started"; 20 | ParameterDescription = "No parameters are required"; 21 | } 22 | 23 | public event TaskerEventArgs TaskerTriggerFired; 24 | 25 | protected virtual void OnTaskerTriggerFired() 26 | { 27 | TaskerEventArgs handler = TaskerTriggerFired; 28 | if (handler != null) handler(); 29 | } 30 | 31 | 32 | public string Name { get; protected set; } 33 | 34 | public string Description { get; protected set; } 35 | 36 | public string ParameterDescription { get; protected set; } 37 | 38 | public bool ValidateInput(string inputText) 39 | { 40 | // no parameters required, always valid 41 | return true; 42 | } 43 | 44 | public void Load(string parameters) 45 | { 46 | if (Enabled) 47 | { 48 | Disable(); 49 | Load(parameters); 50 | Enable(); 51 | } 52 | else 53 | { 54 | Parameters = parameters; 55 | } 56 | } 57 | 58 | public string Parameters { get; set; } 59 | 60 | public bool Enabled { get; protected set; } 61 | 62 | public void Enable() 63 | { 64 | ProcessHandler.ServerStarted += OnTaskerTriggerFired; 65 | Enabled = true; 66 | } 67 | 68 | public void Disable() 69 | { 70 | ProcessHandler.ServerStarted -= OnTaskerTriggerFired; 71 | Enabled = false; 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Action/ServerKillAction.cs: -------------------------------------------------------------------------------- 1 | // ServerKillAction.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/13 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ProcessHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Action 13 | { 14 | internal class ServerKillAction : IAction 15 | { 16 | public ServerKillAction() 17 | { 18 | Name = "Kill Server"; 19 | Description = 20 | "Kill the current server instance. Warning! May corrupt data, use at own risk. Only to be used in case of a crashed server."; 21 | ParameterDescription = 22 | "No parameters are required"; 23 | } 24 | 25 | public event TaskerEventArgs TaskerActionExecuteStarted; 26 | 27 | protected virtual void OnTaskerActionExecuteStarted() 28 | { 29 | TaskerEventArgs handler = TaskerActionExecuteStarted; 30 | if (handler != null) handler(); 31 | } 32 | 33 | public event TaskerEventArgs TaskerActionExecuteFinished; 34 | 35 | protected virtual void OnTaskerActionExecuteFinished() 36 | { 37 | TaskerEventArgs handler = TaskerActionExecuteFinished; 38 | if (handler != null) handler(); 39 | } 40 | 41 | public string Name { get; protected set; } 42 | 43 | public string Description { get; protected set; } 44 | 45 | public string ParameterDescription { get; protected set; } 46 | 47 | public void Load(string parameters) 48 | { 49 | Parameters = parameters; 50 | } 51 | 52 | public bool ValidateInput(string inputText) 53 | { 54 | return true; 55 | } 56 | 57 | public string Parameters { get; set; } 58 | 59 | public void Execute() 60 | { 61 | OnTaskerActionExecuteStarted(); 62 | ProcessHandler.KillServer(); 63 | OnTaskerActionExecuteFinished(); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Trigger/ServerStoppedTrigger.cs: -------------------------------------------------------------------------------- 1 | // ServerStoppedTrigger.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/14 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ProcessHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Trigger 13 | { 14 | internal class ServerStoppedTrigger : ITrigger 15 | { 16 | public ServerStoppedTrigger() 17 | { 18 | Name = "Server stopped"; 19 | Description = "Execute a task when the server has stopped"; 20 | ParameterDescription = "No parameters are required"; 21 | } 22 | 23 | public event TaskerEventArgs TaskerTriggerFired; 24 | 25 | protected virtual void OnTaskerTriggerFired() 26 | { 27 | TaskerEventArgs handler = TaskerTriggerFired; 28 | if (handler != null) handler(); 29 | } 30 | 31 | 32 | public string Name { get; protected set; } 33 | 34 | public string Description { get; protected set; } 35 | 36 | public string ParameterDescription { get; protected set; } 37 | 38 | public bool ValidateInput(string inputText) 39 | { 40 | // no parameters required, always valid 41 | return true; 42 | } 43 | 44 | public void Load(string parameters) 45 | { 46 | if (Enabled) 47 | { 48 | Disable(); 49 | Load(parameters); 50 | Enable(); 51 | } 52 | else 53 | { 54 | Parameters = parameters; 55 | } 56 | } 57 | 58 | public string Parameters { get; set; } 59 | 60 | public bool Enabled { get; protected set; } 61 | 62 | public void Enable() 63 | { 64 | ProcessHandler.ServerStopped += OnTaskerTriggerFired; 65 | Enabled = true; 66 | } 67 | 68 | public void Disable() 69 | { 70 | ProcessHandler.ServerStopped -= OnTaskerTriggerFired; 71 | Enabled = false; 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Trigger/PlayerLeftTrigger.cs: -------------------------------------------------------------------------------- 1 | // PlayerLeftTrigger.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/07 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.PlayerHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Trigger 13 | { 14 | internal class PlayerLeftTrigger : ITrigger 15 | { 16 | public PlayerLeftTrigger() 17 | { 18 | Name = "Player leave"; 19 | Description = "Execute a task when a player leaves"; 20 | ParameterDescription = "No parameters are required"; 21 | } 22 | 23 | public event TaskerEventArgs TaskerTriggerFired; 24 | 25 | protected virtual void OnTaskerTriggerFired() 26 | { 27 | TaskerEventArgs handler = TaskerTriggerFired; 28 | if (handler != null) handler(); 29 | } 30 | 31 | 32 | public string Name { get; protected set; } 33 | 34 | public string Description { get; protected set; } 35 | 36 | public string ParameterDescription { get; protected set; } 37 | 38 | public bool ValidateInput(string inputText) 39 | { 40 | // no parameters required, always valid 41 | return true; 42 | } 43 | 44 | public void Load(string parameters) 45 | { 46 | if (Enabled) 47 | { 48 | Disable(); 49 | Load(parameters); 50 | Enable(); 51 | } 52 | else 53 | { 54 | Parameters = parameters; 55 | } 56 | } 57 | 58 | public string Parameters { get; set; } 59 | 60 | public bool Enabled { get; protected set; } 61 | 62 | public void Enable() 63 | { 64 | PlayerHandler.PlayerListDeletion += (p => OnTaskerTriggerFired()); 65 | Enabled = true; 66 | } 67 | 68 | public void Disable() 69 | { 70 | PlayerHandler.PlayerListDeletion -= (p => OnTaskerTriggerFired()); 71 | Enabled = false; 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Trigger/ServerStartingTrigger.cs: -------------------------------------------------------------------------------- 1 | // ServerStartingTrigger.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/14 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ProcessHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Trigger 13 | { 14 | internal class ServerStartingTrigger : ITrigger 15 | { 16 | public ServerStartingTrigger() 17 | { 18 | Name = "Server starting"; 19 | Description = "Execute a task when the server is starting"; 20 | ParameterDescription = "No parameters are required"; 21 | } 22 | 23 | public event TaskerEventArgs TaskerTriggerFired; 24 | 25 | protected virtual void OnTaskerTriggerFired() 26 | { 27 | TaskerEventArgs handler = TaskerTriggerFired; 28 | if (handler != null) handler(); 29 | } 30 | 31 | 32 | public string Name { get; protected set; } 33 | 34 | public string Description { get; protected set; } 35 | 36 | public string ParameterDescription { get; protected set; } 37 | 38 | public bool ValidateInput(string inputText) 39 | { 40 | // no parameters required, always valid 41 | return true; 42 | } 43 | 44 | public void Load(string parameters) 45 | { 46 | if (Enabled) 47 | { 48 | Disable(); 49 | Load(parameters); 50 | Enable(); 51 | } 52 | else 53 | { 54 | Parameters = parameters; 55 | } 56 | } 57 | 58 | public string Parameters { get; set; } 59 | 60 | public bool Enabled { get; protected set; } 61 | 62 | public void Enable() 63 | { 64 | ProcessHandler.ServerStarting += OnTaskerTriggerFired; 65 | Enabled = true; 66 | } 67 | 68 | public void Disable() 69 | { 70 | ProcessHandler.ServerStarting -= OnTaskerTriggerFired; 71 | Enabled = false; 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Trigger/ServerStoppingTrigger.cs: -------------------------------------------------------------------------------- 1 | // ServerStoppingTrigger.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/14 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ProcessHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Trigger 13 | { 14 | internal class ServerStoppingTrigger : ITrigger 15 | { 16 | public ServerStoppingTrigger() 17 | { 18 | Name = "Server stopping"; 19 | Description = "Execute a task when the server is stopping"; 20 | ParameterDescription = "No parameters are required"; 21 | } 22 | 23 | public event TaskerEventArgs TaskerTriggerFired; 24 | 25 | protected virtual void OnTaskerTriggerFired() 26 | { 27 | TaskerEventArgs handler = TaskerTriggerFired; 28 | if (handler != null) handler(); 29 | } 30 | 31 | 32 | public string Name { get; protected set; } 33 | 34 | public string Description { get; protected set; } 35 | 36 | public string ParameterDescription { get; protected set; } 37 | 38 | public bool ValidateInput(string inputText) 39 | { 40 | // no parameters required, always valid 41 | return true; 42 | } 43 | 44 | public void Load(string parameters) 45 | { 46 | if (Enabled) 47 | { 48 | Disable(); 49 | Load(parameters); 50 | Enable(); 51 | } 52 | else 53 | { 54 | Parameters = parameters; 55 | } 56 | } 57 | 58 | public string Parameters { get; set; } 59 | 60 | public bool Enabled { get; protected set; } 61 | 62 | public void Enable() 63 | { 64 | ProcessHandler.ServerStopping += OnTaskerTriggerFired; 65 | Enabled = true; 66 | } 67 | 68 | public void Disable() 69 | { 70 | ProcessHandler.ServerStopping -= OnTaskerTriggerFired; 71 | Enabled = false; 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Trigger/PlayerJoinedTrigger.cs: -------------------------------------------------------------------------------- 1 | // PlayerJoinedTrigger.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/07 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.PlayerHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Trigger 13 | { 14 | internal class PlayerJoinedTrigger : ITrigger 15 | { 16 | public PlayerJoinedTrigger() 17 | { 18 | Name = "Player join"; 19 | Description = "Execute a task when a player joins"; 20 | ParameterDescription = "No parameters are required"; 21 | } 22 | 23 | public event TaskerEventArgs TaskerTriggerFired; 24 | 25 | protected virtual void OnTaskerTriggerFired() 26 | { 27 | TaskerEventArgs handler = TaskerTriggerFired; 28 | if (handler != null) handler(); 29 | } 30 | 31 | 32 | public string Name { get; protected set; } 33 | 34 | public string Description { get; protected set; } 35 | 36 | public string ParameterDescription { get; protected set; } 37 | 38 | public bool ValidateInput(string inputText) 39 | { 40 | // no parameters required, always valid 41 | return true; 42 | } 43 | 44 | public void Load(string parameters) 45 | { 46 | if (Enabled) 47 | { 48 | Disable(); 49 | Load(parameters); 50 | Enable(); 51 | } 52 | else 53 | { 54 | Parameters = parameters; 55 | } 56 | } 57 | 58 | public string Parameters { get; set; } 59 | 60 | public bool Enabled { get; protected set; } 61 | 62 | public void Enable() 63 | { 64 | PlayerHandler.PlayerListAddition += (p => OnTaskerTriggerFired()); 65 | Enabled = true; 66 | } 67 | 68 | public void Disable() 69 | { 70 | PlayerHandler.PlayerListAddition -= (p => OnTaskerTriggerFired()); 71 | Enabled = false; 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Action/RunAction.cs: -------------------------------------------------------------------------------- 1 | // ShellCommandAction.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/10 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Diagnostics; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Action 13 | { 14 | internal class RunAction : IAction 15 | { 16 | public RunAction() 17 | { 18 | Name = "Run"; 19 | Description = "Run an executable file"; 20 | ParameterDescription = 21 | "The file to execute"; 22 | } 23 | 24 | public event TaskerEventArgs TaskerActionExecuteStarted; 25 | 26 | protected virtual void OnTaskerActionExecuteStarted() 27 | { 28 | TaskerEventArgs handler = TaskerActionExecuteStarted; 29 | if (handler != null) handler(); 30 | } 31 | 32 | public event TaskerEventArgs TaskerActionExecuteFinished; 33 | 34 | protected virtual void OnTaskerActionExecuteFinished() 35 | { 36 | TaskerEventArgs handler = TaskerActionExecuteFinished; 37 | if (handler != null) handler(); 38 | } 39 | 40 | public string Name { get; protected set; } 41 | 42 | public string Description { get; protected set; } 43 | 44 | public string ParameterDescription { get; protected set; } 45 | 46 | public void Load(string parameters) 47 | { 48 | Parameters = parameters; 49 | } 50 | 51 | public bool ValidateInput(string inputText) 52 | { 53 | return true; 54 | } 55 | 56 | public string Parameters { get; set; } 57 | 58 | public void Execute() 59 | { 60 | OnTaskerActionExecuteStarted(); 61 | Process process = new Process 62 | { 63 | StartInfo = new ProcessStartInfo 64 | { 65 | WindowStyle = ProcessWindowStyle.Normal, 66 | FileName = Parameters, 67 | } 68 | }; 69 | process.Start(); 70 | OnTaskerActionExecuteFinished(); 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Action/ConsoleCommandAction.cs: -------------------------------------------------------------------------------- 1 | // ConsoleCommandAction.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/10 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ProcessHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Action 13 | { 14 | internal class ConsoleCommandAction : IAction 15 | { 16 | public ConsoleCommandAction() 17 | { 18 | Name = "ConsoleCommand"; 19 | Description = "Send a command to the console, if the server is running"; 20 | ParameterDescription = 21 | "The command to send"; 22 | } 23 | 24 | public event TaskerEventArgs TaskerActionExecuteStarted; 25 | 26 | protected virtual void OnTaskerActionExecuteStarted() 27 | { 28 | TaskerEventArgs handler = TaskerActionExecuteStarted; 29 | if (handler != null) handler(); 30 | } 31 | 32 | public event TaskerEventArgs TaskerActionExecuteFinished; 33 | 34 | protected virtual void OnTaskerActionExecuteFinished() 35 | { 36 | TaskerEventArgs handler = TaskerActionExecuteFinished; 37 | if (handler != null) handler(); 38 | } 39 | 40 | public string Name { get; protected set; } 41 | 42 | public string Description { get; protected set; } 43 | 44 | public string ParameterDescription { get; protected set; } 45 | 46 | public void Load(string parameters) 47 | { 48 | Parameters = parameters; 49 | } 50 | 51 | public bool ValidateInput(string inputText) 52 | { 53 | // accept all input, it's a command, so we can't check if it exists 54 | return true; 55 | } 56 | 57 | public string Parameters { get; set; } 58 | 59 | public void Execute() 60 | { 61 | OnTaskerActionExecuteStarted(); 62 | ProcessHandler.SendInput(Parameters); 63 | OnTaskerActionExecuteFinished(); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Action/ServerStartAction.cs: -------------------------------------------------------------------------------- 1 | // ServerStartAction.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/13 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ProcessHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Action 13 | { 14 | internal class ServerStartAction : IAction 15 | { 16 | public ServerStartAction() 17 | { 18 | Name = "Start Server"; 19 | Description = "Start the server, if no other instance is running"; 20 | ParameterDescription = 21 | "No parameters are required"; 22 | } 23 | 24 | public event TaskerEventArgs TaskerActionExecuteStarted; 25 | 26 | protected virtual void OnTaskerActionExecuteStarted() 27 | { 28 | TaskerEventArgs handler = TaskerActionExecuteStarted; 29 | if (handler != null) handler(); 30 | } 31 | 32 | public event TaskerEventArgs TaskerActionExecuteFinished; 33 | 34 | protected virtual void OnTaskerActionExecuteFinished() 35 | { 36 | TaskerEventArgs handler = TaskerActionExecuteFinished; 37 | if (handler != null) handler(); 38 | } 39 | 40 | public string Name { get; protected set; } 41 | 42 | public string Description { get; protected set; } 43 | 44 | public string ParameterDescription { get; protected set; } 45 | 46 | public void Load(string parameters) 47 | { 48 | Parameters = parameters; 49 | } 50 | 51 | public bool ValidateInput(string inputText) 52 | { 53 | return true; 54 | } 55 | 56 | public string Parameters { get; set; } 57 | 58 | public void Execute() 59 | { 60 | OnTaskerActionExecuteStarted(); 61 | // if no instance is currently running, start a new one 62 | if (!ProcessHandler.IsRunning) Starter.Starter.StartServer(); 63 | OnTaskerActionExecuteFinished(); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /bukkitgui2/MinecraftInterop/OutputHandler/OutputParseResult.cs: -------------------------------------------------------------------------------- 1 | // OutputParseResult.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/02/02 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using Net.Bertware.Bukkitgui2.MinecraftInterop.OutputHandler.PlayerActions; 12 | 13 | namespace Net.Bertware.Bukkitgui2.MinecraftInterop.OutputHandler 14 | { 15 | public class OutputParseResult 16 | { 17 | /// 18 | /// The time the message was received 19 | /// 20 | public DateTime Time { get; private set; } 21 | 22 | /// 23 | /// The text in the message 24 | /// 25 | public string Text { get; private set; } 26 | 27 | /// 28 | /// The text in the message, without the timestamp and prefixes 29 | /// 30 | public string Message { get; private set; } 31 | 32 | /// 33 | /// The type of message 34 | /// 35 | public MessageType Type { get; private set; } 36 | 37 | /// 38 | /// If the message type was a player action, the action object 39 | /// 40 | public IPlayerAction Action { get; private set; } 41 | 42 | /// 43 | /// Create a new instance 44 | /// 45 | /// the output text 46 | /// the output message, text without timestamp or tags 47 | /// the message type 48 | /// if any player action was described, the player action object 49 | public OutputParseResult(string text, string message, MessageType type, IPlayerAction action = null) 50 | { 51 | Time = DateTime.Now; 52 | Text = text; 53 | Message = message; 54 | Type = type; 55 | Action = action; 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Settings/Credits.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Net.Bertware.Bukkitgui2.AddOn.Settings 2 | { 3 | partial class Credits 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Credits)); 32 | this.lblCredits = new MetroFramework.Controls.MetroLabel(); 33 | this.SuspendLayout(); 34 | // 35 | // lblCredits 36 | // 37 | this.lblCredits.AutoSize = true; 38 | this.lblCredits.Location = new System.Drawing.Point(3, 0); 39 | this.lblCredits.Name = "lblCredits"; 40 | this.lblCredits.Size = new System.Drawing.Size(466, 247); 41 | this.lblCredits.TabIndex = 0; 42 | this.lblCredits.Text = resources.GetString("lblCredits.Text"); 43 | // 44 | // Credits 45 | // 46 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 47 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 48 | this.Controls.Add(this.lblCredits); 49 | this.Name = "Credits"; 50 | this.Size = new System.Drawing.Size(560, 490); 51 | this.ResumeLayout(false); 52 | this.PerformLayout(); 53 | 54 | } 55 | 56 | #endregion 57 | 58 | private MetroFramework.Controls.MetroLabel lblCredits; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Trigger/UnexpectedServerStopTrigger.cs: -------------------------------------------------------------------------------- 1 | // UnexpectedServerStopTrigger.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/14 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ProcessHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Trigger 13 | { 14 | internal class UnexpectedServerStopTrigger : ITrigger 15 | { 16 | public UnexpectedServerStopTrigger() 17 | { 18 | Name = "Server unexpectedly exited"; 19 | Description = "Execute a task when the server has exited unexpectedly"; 20 | ParameterDescription = "No parameters are required"; 21 | } 22 | 23 | public event TaskerEventArgs TaskerTriggerFired; 24 | 25 | protected virtual void OnTaskerTriggerFired() 26 | { 27 | TaskerEventArgs handler = TaskerTriggerFired; 28 | if (handler != null) handler(); 29 | } 30 | 31 | 32 | public string Name { get; protected set; } 33 | 34 | public string Description { get; protected set; } 35 | 36 | public string ParameterDescription { get; protected set; } 37 | 38 | public bool ValidateInput(string inputText) 39 | { 40 | // no parameters required, always valid 41 | return true; 42 | } 43 | 44 | public void Load(string parameters) 45 | { 46 | if (Enabled) 47 | { 48 | Disable(); 49 | Load(parameters); 50 | Enable(); 51 | } 52 | else 53 | { 54 | Parameters = parameters; 55 | } 56 | } 57 | 58 | public string Parameters { get; set; } 59 | 60 | public bool Enabled { get; protected set; } 61 | 62 | public void Enable() 63 | { 64 | ProcessHandler.UnexpectedServerStop += OnTaskerTriggerFired; 65 | Enabled = true; 66 | } 67 | 68 | public void Disable() 69 | { 70 | ProcessHandler.UnexpectedServerStop -= OnTaskerTriggerFired; 71 | Enabled = false; 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Plugins/Plugins.cs: -------------------------------------------------------------------------------- 1 | // Plugins.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using MetroFramework.Controls; 11 | using Net.Bertware.Bukkitgui2.AddOn.Plugins.InstalledPlugins; 12 | 13 | namespace Net.Bertware.Bukkitgui2.AddOn.Plugins 14 | { 15 | internal class Plugins : IAddon 16 | { 17 | /// 18 | /// The addon name, ideally this name is the same as used in the tabpage 19 | /// 20 | public string Name 21 | { 22 | get { return "Plugins"; } 23 | } 24 | 25 | /// 26 | /// The addon priority. Default: 0 27 | /// 28 | public int Priority 29 | { 30 | get { return 0; } 31 | } 32 | 33 | /// 34 | /// True if this addon has a tab page 35 | /// 36 | public bool HasTab 37 | { 38 | get { return true; } 39 | } 40 | 41 | /// 42 | /// True if this addon has a config field 43 | /// 44 | public bool HasConfig 45 | { 46 | get { return false; } 47 | } 48 | 49 | /// 50 | /// Initialize all functions and the tabcontrol 51 | /// 52 | public void Initialize() 53 | { 54 | TabPage = new PluginsTab {Text = Name, ParentAddon = this}; 55 | ConfigPage = null; 56 | 57 | // TODO: This code locks up the UI for a while 58 | InstalledPluginManager.Initialize(); 59 | } 60 | 61 | public void Dispose() 62 | { 63 | // nothing to do 64 | } 65 | 66 | /// 67 | /// The tab control for this addon 68 | /// 69 | /// Returns the tabpage 70 | public MetroUserControl TabPage { get; private set; } 71 | 72 | public MetroUserControl ConfigPage { get; private set; } 73 | 74 | public bool CanDisable 75 | { 76 | get { return true; } 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Action/ExitGuiAction.cs: -------------------------------------------------------------------------------- 1 | // ExitGuiAction.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/07 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Windows.Forms; 11 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ProcessHandler; 12 | 13 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Action 14 | { 15 | internal class ExitGuiAction : IAction 16 | { 17 | public ExitGuiAction() 18 | { 19 | Name = "Exit GUI"; 20 | Description = "Exit the Gui. Will only work if the server has stopped"; 21 | ParameterDescription = 22 | "No parameters are required"; 23 | } 24 | 25 | public event TaskerEventArgs TaskerActionExecuteStarted; 26 | 27 | protected virtual void OnTaskerActionExecuteStarted() 28 | { 29 | TaskerEventArgs handler = TaskerActionExecuteStarted; 30 | if (handler != null) handler(); 31 | } 32 | 33 | public event TaskerEventArgs TaskerActionExecuteFinished; 34 | 35 | protected virtual void OnTaskerActionExecuteFinished() 36 | { 37 | TaskerEventArgs handler = TaskerActionExecuteFinished; 38 | if (handler != null) handler(); 39 | } 40 | 41 | public string Name { get; protected set; } 42 | 43 | public string Description { get; protected set; } 44 | 45 | public string ParameterDescription { get; protected set; } 46 | 47 | public void Load(string parameters) 48 | { 49 | Parameters = parameters; 50 | } 51 | 52 | public bool ValidateInput(string inputText) 53 | { 54 | // any parameters are good, since we don't use them 55 | return true; 56 | } 57 | 58 | public string Parameters { get; set; } 59 | 60 | public void Execute() 61 | { 62 | OnTaskerActionExecuteStarted(); 63 | 64 | // exit, only if running 65 | if (ProcessHandler.IsRunning) return; 66 | Application.Exit(); 67 | 68 | OnTaskerActionExecuteFinished(); 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /bukkitgui2.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bukkitgui2", "bukkitgui2\bukkitgui2.csproj", "{0AEF421A-A71F-4642-9C9B-621F58FD7735}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JsonApiConnector", "JsonApiConnector\JsonApiConnector.csproj", "{975CEB77-4212-4532-B834-E19A9B824856}" 9 | EndProject 10 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Net.Bertware.Get", "Net.Bertware.Get\Net.Bertware.Get.vbproj", "{BC306ED3-B53C-4E13-987D-AD2E111950CD}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {0AEF421A-A71F-4642-9C9B-621F58FD7735}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {0AEF421A-A71F-4642-9C9B-621F58FD7735}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {0AEF421A-A71F-4642-9C9B-621F58FD7735}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {0AEF421A-A71F-4642-9C9B-621F58FD7735}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {975CEB77-4212-4532-B834-E19A9B824856}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {975CEB77-4212-4532-B834-E19A9B824856}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {975CEB77-4212-4532-B834-E19A9B824856}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {975CEB77-4212-4532-B834-E19A9B824856}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {BC306ED3-B53C-4E13-987D-AD2E111950CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {BC306ED3-B53C-4E13-987D-AD2E111950CD}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {BC306ED3-B53C-4E13-987D-AD2E111950CD}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {BC306ED3-B53C-4E13-987D-AD2E111950CD}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /bukkitgui2/MinecraftServers/Servers/VanillaServer.cs: -------------------------------------------------------------------------------- 1 | // VanillaServer.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.Core.Util.Web; 11 | using Net.Bertware.Bukkitgui2.MinecraftServers.Tools.Vanilla; 12 | using Net.Bertware.Bukkitgui2.Properties; 13 | 14 | namespace Net.Bertware.Bukkitgui2.MinecraftServers.Servers 15 | { 16 | /// 17 | /// Default vanilla server. All parsing code is already in the server base 18 | /// 19 | internal class VanillaServer : MinecraftServerBase 20 | { 21 | public VanillaServer() 22 | { 23 | Name = "Vanilla"; 24 | Site = "http://minecraft.net"; 25 | Logo = Resources.vanilla_logo; 26 | 27 | CanDownloadRecommendedVersion = true; 28 | CanDownloadDevVersion = true; 29 | CanFetchDevVersion = true; 30 | CanFetchRecommendedVersion = true; 31 | //default value for boolean is false, so all other features are disabled by default 32 | } 33 | 34 | public override string FetchDevVersion 35 | { 36 | get { return VanillaDownloadProvider.GetLatestVersion(); } 37 | } 38 | 39 | public override string FetchRecommendedVersion 40 | { 41 | get { return VanillaDownloadProvider.GetLatestRecommendedVersion(); } 42 | } 43 | 44 | 45 | public override bool DownloadRecommendedVersion(string targetfile) 46 | { 47 | WebUtil.DownloadFile(VanillaDownloadProvider.GetLatestRecommendedVersionUrl(), targetfile, true, true); 48 | 49 | return true; 50 | } 51 | 52 | public override bool DownloadDevVersion(string targetfile) 53 | { 54 | WebUtil.DownloadFile(VanillaDownloadProvider.GetLatestUrl(), targetfile, true, true); 55 | 56 | return true; 57 | } 58 | 59 | public override string GetLaunchFlags(string defaultFlags = "") 60 | { 61 | return " nogui " + defaultFlags; 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Action/ShellCommandAction.cs: -------------------------------------------------------------------------------- 1 | // ShellCommandAction.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/10 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Diagnostics; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Action 13 | { 14 | internal class ShellCommandAction : IAction 15 | { 16 | public ShellCommandAction() 17 | { 18 | Name = "ShellCommand"; 19 | Description = "Send a command to the windows shell (cmd)"; 20 | ParameterDescription = 21 | "The command to send"; 22 | } 23 | 24 | public event TaskerEventArgs TaskerActionExecuteStarted; 25 | 26 | protected virtual void OnTaskerActionExecuteStarted() 27 | { 28 | TaskerEventArgs handler = TaskerActionExecuteStarted; 29 | if (handler != null) handler(); 30 | } 31 | 32 | public event TaskerEventArgs TaskerActionExecuteFinished; 33 | 34 | protected virtual void OnTaskerActionExecuteFinished() 35 | { 36 | TaskerEventArgs handler = TaskerActionExecuteFinished; 37 | if (handler != null) handler(); 38 | } 39 | 40 | public string Name { get; protected set; } 41 | 42 | public string Description { get; protected set; } 43 | 44 | public string ParameterDescription { get; protected set; } 45 | 46 | public void Load(string parameters) 47 | { 48 | Parameters = parameters; 49 | } 50 | 51 | public bool ValidateInput(string inputText) 52 | { 53 | return true; 54 | } 55 | 56 | public string Parameters { get; set; } 57 | 58 | public void Execute() 59 | { 60 | OnTaskerActionExecuteStarted(); 61 | Process process = new Process 62 | { 63 | StartInfo = new ProcessStartInfo 64 | { 65 | WindowStyle = ProcessWindowStyle.Hidden, 66 | FileName = "cmd.exe", 67 | Arguments = Parameters 68 | } 69 | }; 70 | process.Start(); 71 | OnTaskerActionExecuteFinished(); 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /bukkitgui2/Resources/Dll/Net.Bertware.Get.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Net.Bertware.Get 7 | 8 | 9 | 10 | 11 | 12 | User agent: 13 | Bertware x.y/application_name application_version [DEBUG]/hash/mail 14 | Hash is set to 0 for debug, and is used to detect fake distributions (evt. banning them from the server) 15 | 16 | 17 | 18 | 19 | 20 | Check which from 2 versions is newer. returns -1 if old version is newer, 0 if equal, 1 if new version is newer 21 | 22 | the old version, x.x, x.x.x or x.x.x.x format 23 | the new version, x.x, x.x.x or x.x.x.x format 24 | -1 if old version is newer, 0 if equal, 1 if new version is newer 25 | This function can handle version numbers with parts up to 65535 26 | 27 | 28 | 29 | Returns the cached ResourceManager instance used by this class. 30 | 31 | 32 | 33 | 34 | Overrides the current thread's CurrentUICulture property for all 35 | resource lookups using this strongly typed resource class. 36 | 37 | 38 | 39 | 40 | Looks up a localized resource of type System.Byte[]. 41 | 42 | 43 | 44 | 45 | A strongly-typed resource class, for looking up localized strings, etc. 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Trigger/TaskExecutedTrigger.cs: -------------------------------------------------------------------------------- 1 | // TaskExecutedTrigger.cs in bukkitgui2/bukkitgui2 2 | // Created 2015/01/31 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Trigger 13 | { 14 | internal class TaskExecutedTrigger : ITrigger 15 | { 16 | public TaskExecutedTrigger() 17 | { 18 | Name = "Task executed"; 19 | Description = "Execute a task after another task has been exuted"; 20 | ParameterDescription = "The name of the task, after which this task should run"; 21 | } 22 | 23 | public event TaskerEventArgs TaskerTriggerFired; 24 | 25 | 26 | public string Name { get; protected set; } 27 | 28 | public string Description { get; protected set; } 29 | 30 | public string ParameterDescription { get; protected set; } 31 | 32 | public bool ValidateInput(string inputText) 33 | { 34 | // no parameters required, always valid 35 | return true; 36 | } 37 | 38 | public void Load(string parameters) 39 | { 40 | if (Enabled) 41 | { 42 | Disable(); 43 | Load(parameters); 44 | Enable(); 45 | } 46 | else 47 | { 48 | Parameters = parameters; 49 | } 50 | } 51 | 52 | public string Parameters { get; set; } 53 | 54 | public bool Enabled { get; protected set; } 55 | 56 | public void Enable() 57 | { 58 | Tasker.Reference.TaskExecuted += OnTaskerTriggerFired; 59 | Enabled = true; 60 | } 61 | 62 | public void Disable() 63 | { 64 | Tasker.Reference.TaskExecuted -= OnTaskerTriggerFired; 65 | Enabled = false; 66 | } 67 | 68 | protected virtual void OnTaskerTriggerFired(object sender, EventArgs e) 69 | { 70 | if (!Enabled || !(sender is Task) || !Equals(Parameters.ToLower(), ((Task) sender).Name.ToLower())) return; 71 | 72 | TaskerEventArgs handler = TaskerTriggerFired; 73 | if (handler != null) handler(); 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /bukkitgui2/MinecraftServers/Servers/JsonApi2Server.cs: -------------------------------------------------------------------------------- 1 | // JsonApi2Server.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/05 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.IO; 12 | using System.Windows.Forms; 13 | using Net.Bertware.Bukkitgui2.AddOn.Starter; 14 | using Net.Bertware.Bukkitgui2.Core.FileLocation; 15 | using Net.Bertware.Bukkitgui2.MinecraftServers.Tools; 16 | using Net.Bertware.Bukkitgui2.Properties; 17 | 18 | namespace Net.Bertware.Bukkitgui2.MinecraftServers.Servers 19 | { 20 | internal class JsonApi2Server : MinecraftServerBase 21 | { 22 | public JsonApi2Server() 23 | { 24 | Name = "JsonApi API v2"; 25 | Logo = Resources.jsonapi_logo; 26 | Site = "http://mcjsonapi.com/"; 27 | HasCustomAssembly = true; 28 | CustomAssembly = ""; // will be set in preparelaunch 29 | SupportsPlugins = false; //disable plugin manager on this one 30 | HasCustomSettingsControl = true; 31 | CustomSettingsControl = new JsonApi2CredentialsSettingsControl(); 32 | IsLocal = false; 33 | } 34 | 35 | public override void PrepareLaunch() 36 | { 37 | // Extract the assembly 38 | CustomAssembly = Fl.SafeLocation(RequestFile.Temp) + "connector.exe"; 39 | using (FileStream fs = File.Create(CustomAssembly)) 40 | { 41 | fs.Write(Resources.JsonApiConnector, 0, Resources.JsonApiConnector.Length); 42 | } 43 | } 44 | 45 | public override string GetLaunchParameters(string defaultParameters = "") 46 | { 47 | Control control = Starter.GetCustomSettingsControl(); 48 | if (!(control is JsonApi2CredentialsSettingsControl)) throw new Exception("Couldn't retrieve parameters"); 49 | 50 | JsonApi2CredentialsSettingsControl cred = (JsonApi2CredentialsSettingsControl) control; 51 | 52 | return "-u=" + cred.Username + " -p=" + cred.Password + " -host=" + cred.Host + 53 | " -port=" + cred.Port + " -filter"; 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Action/ConsoleClearAction.cs: -------------------------------------------------------------------------------- 1 | // ConsoleClearAction.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/24 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Windows.Forms; 11 | using Net.Bertware.Bukkitgui2.AddOn.Console; 12 | 13 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Action 14 | { 15 | internal class ConsoleClearAction : IAction 16 | { 17 | public ConsoleClearAction() 18 | { 19 | Name = "Clear console"; 20 | Description = "Clear the console in the main tab"; 21 | ParameterDescription = 22 | "No parameters are required"; 23 | } 24 | 25 | public event TaskerEventArgs TaskerActionExecuteStarted; 26 | 27 | protected virtual void OnTaskerActionExecuteStarted() 28 | { 29 | TaskerEventArgs handler = TaskerActionExecuteStarted; 30 | if (handler != null) handler(); 31 | } 32 | 33 | public event TaskerEventArgs TaskerActionExecuteFinished; 34 | 35 | protected virtual void OnTaskerActionExecuteFinished() 36 | { 37 | TaskerEventArgs handler = TaskerActionExecuteFinished; 38 | if (handler != null) handler(); 39 | } 40 | 41 | public string Name { get; protected set; } 42 | 43 | public string Description { get; protected set; } 44 | 45 | public string ParameterDescription { get; protected set; } 46 | 47 | public void Load(string parameters) 48 | { 49 | Parameters = parameters; 50 | } 51 | 52 | public bool ValidateInput(string inputText) 53 | { 54 | return true; 55 | } 56 | 57 | public string Parameters { get; set; } 58 | 59 | public void Execute() 60 | { 61 | OnTaskerActionExecuteStarted(); 62 | 63 | if (ConsoleTab.Reference.InvokeRequired) 64 | { 65 | ConsoleTab.Reference.Invoke((MethodInvoker) ConsoleTab.Reference.MCCOut.Clear); 66 | } 67 | else 68 | { 69 | ConsoleTab.Reference.MCCOut.Clear(); 70 | } 71 | 72 | OnTaskerActionExecuteFinished(); 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /bukkitgui2/MinecraftServers/Servers/JsonApiServer.cs: -------------------------------------------------------------------------------- 1 | // JsonApiServer.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/02/02 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.IO; 12 | using System.Windows.Forms; 13 | using Net.Bertware.Bukkitgui2.AddOn.Starter; 14 | using Net.Bertware.Bukkitgui2.Core.FileLocation; 15 | using Net.Bertware.Bukkitgui2.MinecraftServers.Tools; 16 | using Net.Bertware.Bukkitgui2.Properties; 17 | 18 | namespace Net.Bertware.Bukkitgui2.MinecraftServers.Servers 19 | { 20 | internal class JsonApiServer : MinecraftServerBase 21 | { 22 | public JsonApiServer() 23 | { 24 | Name = "JsonApi"; 25 | Logo = Resources.jsonapi_logo; 26 | Site = "http://mcjsonapi.com/"; 27 | HasCustomAssembly = true; 28 | CustomAssembly = ""; // will be set in preparelaunch 29 | SupportsPlugins = false; //disable plugin manager on this one 30 | HasCustomSettingsControl = true; 31 | CustomSettingsControl = new JsonApiCredentialsSettingsControl(); 32 | IsLocal = false; 33 | } 34 | 35 | public override void PrepareLaunch() 36 | { 37 | // Extract the assembly 38 | CustomAssembly = Fl.SafeLocation(RequestFile.Temp) + "connector.exe"; 39 | using (FileStream fs = File.Create(CustomAssembly)) 40 | { 41 | fs.Write(Resources.JsonApiConnector, 0, Resources.JsonApiConnector.Length); 42 | } 43 | } 44 | 45 | public override string GetLaunchParameters(string defaultParameters = "") 46 | { 47 | Control control = Starter.GetCustomSettingsControl(); 48 | if (!(control is JsonApiCredentialsSettingsControl)) throw new Exception("Couldn't retrieve parameters"); 49 | 50 | JsonApiCredentialsSettingsControl cred = (JsonApiCredentialsSettingsControl) control; 51 | 52 | return "-u=" + cred.Username + " -p=" + cred.Password + " -s=" + cred.Salt + " -host=" + cred.Host + 53 | " -port=" + cred.Port + " -api=1 -filter"; 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Action/BackupAction.cs: -------------------------------------------------------------------------------- 1 | // BackupAction.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/13 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using Net.Bertware.Bukkitgui2.AddOn.Backup; 12 | 13 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Action 14 | { 15 | internal class BackupAction : IAction 16 | { 17 | public BackupAction() 18 | { 19 | Name = "Backup"; 20 | Description = "Create a backup"; 21 | ParameterDescription = 22 | "The name of the backup." + Environment.NewLine + "(Backup has to be set-up in backup manager first)"; 23 | } 24 | 25 | public event TaskerEventArgs TaskerActionExecuteStarted; 26 | 27 | protected virtual void OnTaskerActionExecuteStarted() 28 | { 29 | TaskerEventArgs handler = TaskerActionExecuteStarted; 30 | if (handler != null) handler(); 31 | } 32 | 33 | public event TaskerEventArgs TaskerActionExecuteFinished; 34 | 35 | protected virtual void OnTaskerActionExecuteFinished() 36 | { 37 | TaskerEventArgs handler = TaskerActionExecuteFinished; 38 | if (handler != null) handler(); 39 | } 40 | 41 | public string Name { get; protected set; } 42 | 43 | public string Description { get; protected set; } 44 | 45 | public string ParameterDescription { get; protected set; } 46 | 47 | public void Load(string parameters) 48 | { 49 | Parameters = parameters; 50 | } 51 | 52 | public bool ValidateInput(string inputText) 53 | { 54 | if (string.IsNullOrEmpty(inputText)) return false; 55 | return (Backup.Backup.Reference.GetBackupByName(inputText) != null); 56 | } 57 | 58 | public string Parameters { get; set; } 59 | 60 | public void Execute() 61 | { 62 | OnTaskerActionExecuteStarted(); 63 | 64 | BackupDefenition bd = Backup.Backup.Reference.GetBackupByName(Parameters); 65 | if (bd == null) return; 66 | bd.Execute(); 67 | 68 | OnTaskerActionExecuteFinished(); 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Editor/OpListControl.cs: -------------------------------------------------------------------------------- 1 | // OpListControl.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/29 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Windows.Forms; 12 | using MetroFramework.Forms; 13 | using Net.Bertware.Bukkitgui2.MinecraftInterop.PlayerHandler; 14 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ServerConfig; 15 | 16 | namespace Net.Bertware.Bukkitgui2.AddOn.Editor 17 | { 18 | public partial class OpListControl : IAddonTab 19 | { 20 | public OpListControl() 21 | { 22 | InitializeComponent(); 23 | } 24 | 25 | public IAddon ParentAddon { get; set; } 26 | 27 | private void WhitelistControl_Load(object sender, EventArgs e) 28 | { 29 | RefreshList(); 30 | } 31 | 32 | private void RefreshList() 33 | { 34 | slvList.Items.Clear(); 35 | foreach (ServerListItem item in ServerList.Ops.List.Values) 36 | { 37 | string[] content = {item.Name, item.Uuid, item.OpLevel.ToString()}; 38 | ListViewItem lvi = new ListViewItem(content) {Tag = item.Name}; 39 | slvList.Items.Add(lvi); 40 | } 41 | } 42 | 43 | private void btnAdd_Click(object sender, EventArgs e) 44 | { 45 | string name = MetroPrompt.ShowPrompt("Op player", "Enter the name of the player you'd like to op"); 46 | if (string.IsNullOrEmpty(name)) return; 47 | 48 | PlayerActions.SetPlayerOp(name, true); 49 | 50 | RefreshList(); 51 | } 52 | 53 | private void btnRemove_Click(object sender, EventArgs e) 54 | { 55 | if (slvList.SelectedItems.Count < 1) return; 56 | string name = slvList.SelectedItems[0].Tag.ToString(); 57 | if (!string.IsNullOrEmpty(name)) PlayerActions.SetPlayerOp(name, false); 58 | RefreshList(); 59 | } 60 | 61 | private void bntRefresh_Click(object sender, EventArgs e) 62 | { 63 | RefreshList(); 64 | } 65 | 66 | private void OpListControl_VisibleChanged(object sender, EventArgs e) 67 | { 68 | if (Visible) RefreshList(); 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Trigger/TaskButtonPressedTrigger.cs: -------------------------------------------------------------------------------- 1 | // TaskButtonPressedTrigger.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/18 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using Net.Bertware.Bukkitgui2.AddOn.Console; 12 | 13 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Trigger 14 | { 15 | internal class TaskButtonPressedTrigger : ITrigger 16 | { 17 | public TaskButtonPressedTrigger() 18 | { 19 | Name = "Task button pressed"; 20 | Description = "Execute a task when the task button on the main tab is clicked"; 21 | ParameterDescription = "No parameters are required"; 22 | } 23 | 24 | public event TaskerEventArgs TaskerTriggerFired; 25 | 26 | // signature is compatible with EventHandler to simplify hooking the source event to this method. 27 | private void OnTaskerTriggerFired(object sender, EventArgs e) 28 | { 29 | TaskerEventArgs handler = TaskerTriggerFired; 30 | if (handler != null) handler(); 31 | } 32 | 33 | 34 | public string Name { get; protected set; } 35 | 36 | public string Description { get; protected set; } 37 | 38 | public string ParameterDescription { get; protected set; } 39 | 40 | public bool ValidateInput(string inputText) 41 | { 42 | // no parameters required, always valid 43 | return true; 44 | } 45 | 46 | public void Load(string parameters) 47 | { 48 | if (Enabled) 49 | { 50 | Disable(); 51 | Load(parameters); 52 | Enable(); 53 | } 54 | else 55 | { 56 | Parameters = parameters; 57 | } 58 | } 59 | 60 | public string Parameters { get; set; } 61 | 62 | public bool Enabled { get; protected set; } 63 | 64 | public void Enable() 65 | { 66 | ConsoleTab.Reference.quickButtons.TaskButtonPressed += OnTaskerTriggerFired; 67 | Enabled = true; 68 | } 69 | 70 | public void Disable() 71 | { 72 | ConsoleTab.Reference.quickButtons.TaskButtonPressed -= OnTaskerTriggerFired; 73 | Enabled = false; 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Trigger/ServerOutputTrigger.cs: -------------------------------------------------------------------------------- 1 | // ServerOutputTrigger.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/07 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.OutputHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Trigger 13 | { 14 | internal class ServerOutputTrigger : ITrigger 15 | { 16 | public ServerOutputTrigger() 17 | { 18 | Name = "Server output"; 19 | Description = "Execute a task when the server output contains the parameter text"; 20 | ParameterDescription = "the text which the server output should contain. Case insensitive."; 21 | } 22 | 23 | public event TaskerEventArgs TaskerTriggerFired; 24 | 25 | protected virtual void OnTaskerTriggerFired() 26 | { 27 | TaskerEventArgs handler = TaskerTriggerFired; 28 | if (handler != null) handler(); 29 | } 30 | 31 | 32 | public string Name { get; protected set; } 33 | 34 | public string Description { get; protected set; } 35 | 36 | public string ParameterDescription { get; protected set; } 37 | 38 | public bool ValidateInput(string inputText) 39 | { 40 | // any text 41 | return true; 42 | } 43 | 44 | public void Load(string parameters) 45 | { 46 | if (Enabled) 47 | { 48 | Disable(); 49 | Load(parameters); 50 | Enable(); 51 | } 52 | else 53 | { 54 | Parameters = parameters; 55 | } 56 | } 57 | 58 | public string Parameters { get; set; } 59 | 60 | public bool Enabled { get; protected set; } 61 | 62 | public void Enable() 63 | { 64 | MinecraftOutputHandler.OutputParsed += OnOutputReceived; 65 | Enabled = true; 66 | } 67 | 68 | public void Disable() 69 | { 70 | MinecraftOutputHandler.OutputParsed -= OnOutputReceived; 71 | Enabled = false; 72 | } 73 | 74 | private void OnOutputReceived(string s, OutputParseResult result) 75 | { 76 | if (result.Message.ToLower().Contains(result.Message.ToLower())) OnTaskerTriggerFired(); 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Trigger/PlayerCountTrigger.cs: -------------------------------------------------------------------------------- 1 | // PlayerCountTrigger.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/07 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using Net.Bertware.Bukkitgui2.MinecraftInterop.PlayerHandler; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Trigger 13 | { 14 | internal class PlayerCountTrigger : ITrigger 15 | { 16 | public PlayerCountTrigger() 17 | { 18 | Name = "Player count"; 19 | Description = 20 | "Execute a task when a given amount of players is online (evaluated after every join or leave)"; 21 | ParameterDescription = "The amount of players on which this trigger should run (0 to 9999)"; 22 | } 23 | 24 | public event TaskerEventArgs TaskerTriggerFired; 25 | 26 | protected virtual void OnTaskerTriggerFired() 27 | { 28 | TaskerEventArgs handler = TaskerTriggerFired; 29 | if (handler != null) handler(); 30 | } 31 | 32 | 33 | public string Name { get; protected set; } 34 | 35 | public string Description { get; protected set; } 36 | 37 | public string ParameterDescription { get; protected set; } 38 | 39 | public bool ValidateInput(string inputText) 40 | { 41 | // int 42 | int i; 43 | return int.TryParse(inputText, out i); 44 | } 45 | 46 | public void Load(string parameters) 47 | { 48 | if (Enabled) 49 | { 50 | Disable(); 51 | Load(parameters); 52 | Enable(); 53 | } 54 | else 55 | { 56 | Parameters = parameters; 57 | } 58 | } 59 | 60 | public string Parameters { get; set; } 61 | 62 | public bool Enabled { get; protected set; } 63 | 64 | public void Enable() 65 | { 66 | PlayerHandler.PlayerListChanged += OnPlayerListChanged; 67 | Enabled = true; 68 | } 69 | 70 | public void Disable() 71 | { 72 | PlayerHandler.PlayerListChanged -= OnPlayerListChanged; 73 | Enabled = false; 74 | } 75 | 76 | private void OnPlayerListChanged() 77 | { 78 | if (PlayerHandler.GetOnlinePlayerCount() == int.Parse(Parameters)) OnTaskerTriggerFired(); 79 | } 80 | } 81 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Playerlist/PlayerList.cs: -------------------------------------------------------------------------------- 1 | // PlayerList.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using MetroFramework.Controls; 11 | using Net.Bertware.Bukkitgui2.MinecraftInterop.PlayerHandler; 12 | 13 | namespace Net.Bertware.Bukkitgui2.AddOn.PlayerList 14 | { 15 | internal class PlayerList : IAddon 16 | { 17 | /// 18 | /// Reference to the latest created playerlist instance 19 | /// 20 | public static PlayerList Reference; 21 | 22 | public PlayerList() 23 | { 24 | Reference = this; 25 | } 26 | 27 | /// 28 | /// The addon name, ideally this name is the same as used in the tabpage 29 | /// 30 | public string Name 31 | { 32 | get { return "Players"; } 33 | } 34 | 35 | /// 36 | /// The addon priority. Default: 0 37 | /// 38 | public int Priority 39 | { 40 | get { return 0; } 41 | } 42 | 43 | /// 44 | /// True if this addon has a tab page 45 | /// 46 | public bool HasTab 47 | { 48 | get { return true; } 49 | } 50 | 51 | /// 52 | /// True if this addon has a config field 53 | /// 54 | public bool HasConfig 55 | { 56 | get { return false; } 57 | } 58 | 59 | /// 60 | /// Initialize all functions and the tabcontrol 61 | /// 62 | public void Initialize() 63 | { 64 | PlayerHandler.Initialize(); 65 | TabPage = new PlayerListTab {Text = Name, ParentAddon = this}; 66 | ConfigPage = null; 67 | } 68 | 69 | public void Dispose() 70 | { 71 | // nothing to do 72 | } 73 | 74 | /// 75 | /// The tab control for this addon 76 | /// 77 | /// Returns the tabpage 78 | public MetroUserControl TabPage { get; private set; } 79 | 80 | public MetroUserControl ConfigPage { get; private set; } 81 | 82 | public bool CanDisable 83 | { 84 | get { return true; } 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /bukkitgui2/MinecraftServers/Servers/SpigotServer.cs: -------------------------------------------------------------------------------- 1 | // SpigotServer.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/02/02 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Diagnostics; 11 | using System.IO; 12 | using System.Windows.Forms; 13 | using MetroFramework; 14 | using Net.Bertware.Bukkitgui2.Core.Util.Web; 15 | using Net.Bertware.Bukkitgui2.Properties; 16 | 17 | namespace Net.Bertware.Bukkitgui2.MinecraftServers.Servers 18 | { 19 | internal class SpigotServer : MinecraftServerBase 20 | { 21 | 22 | private const string BuildtoolsUrl = "https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar"; 23 | 24 | public SpigotServer() 25 | { 26 | Name = "Spigot"; 27 | Site = "http://www.spigotmc.org/"; 28 | Logo = Resources.spigot_logo; 29 | 30 | CanDownloadRecommendedVersion = false; 31 | CanDownloadBetaVersion = false; 32 | CanDownloadDevVersion = true; 33 | //default value for boolean is false, so all other features are disabled by default 34 | } 35 | 36 | 37 | public override bool DownloadDevVersion(string targetfile) 38 | { 39 | WebUtil.DownloadFile(BuildtoolsUrl,"spigot_buildtools.jar",true,true); 40 | 41 | const string gitx86 = "C:\\Program Files (x86)\\Git\\bin\\sh.exe"; 42 | const string gitx64 = "C:\\Program Files\\Git\\bin\\sh.exe"; 43 | string git = null; 44 | 45 | if (File.Exists(gitx86)) 46 | { 47 | git = gitx86; 48 | } 49 | if (File.Exists(gitx64)) 50 | { 51 | git = gitx64; 52 | } 53 | if (git == null) 54 | { 55 | if ( 56 | MetroMessageBox.Show(Application.OpenForms[0], 57 | "You need to install git in order to download spigot. Do you want to open the download page now? Once git is installed you can try again to download spigot.", 58 | "Git shell not found", MessageBoxButtons.YesNo) == DialogResult.Yes) 59 | { 60 | Process.Start("http://git-scm.com/download/win"); 61 | } 62 | return false; 63 | } 64 | 65 | // TODO: run buildtools 66 | 67 | return true; 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /Net.Bertware.Get/ChangelogInfo.vb: -------------------------------------------------------------------------------- 1 | Public Class ChangelogInfo 2 | Public Changes As List(Of Change) 3 | 4 | Public Sub Load(program As String, startversion As String, stopversion As String) 5 | Dim p As New Dictionary(Of String, String) 6 | p.Add("program", program) 7 | p.Add("start", startversion) 8 | p.Add("stop", stopversion) 9 | Dim response = api.GetAPIResponse(APIAction.changelog, p) 10 | If response IsNot Nothing AndAlso response <> "" Then LoadXML(response) 11 | End Sub 12 | 13 | Public Sub LoadThis(startversion As String, stopversion As String) 14 | Load(Reflection.Assembly.GetEntryAssembly.GetName.Name, startversion, stopversion) 15 | End Sub 16 | 17 | Private Sub LoadXML(xml As String) 18 | Try 19 | Dim xmldoc As New Xml.XmlDocument 20 | xmldoc.LoadXml(xml) 21 | Changes = New List(Of Change) 22 | For Each element As Xml.XmlElement In xmldoc.DocumentElement.GetElementsByTagName("change") 23 | Try 24 | Changes.Add(New Change([Enum].Parse(GetType(Change.changeType), element.Attributes("type").Value), element.Attributes("version").Value, element.InnerText)) 25 | Catch slex As Exception 26 | Trace.WriteLine("Failed to load change! : " + slex.Message) 27 | End Try 28 | 29 | Next 30 | Catch ex As Exception 31 | Trace.WriteLine("Failed to load XML for changelog! : " + ex.Message) 32 | End Try 33 | End Sub 34 | End Class 35 | 36 | Public Class Change 37 | Public Id 38 | Public Version 39 | Public Type As changeType 40 | Public Description As String 41 | 42 | Public Enum changeType 43 | fix 44 | addition 45 | End Enum 46 | 47 | Public Sub New() 48 | 49 | End Sub 50 | 51 | Public Sub New(Type As changeType, version As String, description As String) 52 | Me.Type = Type 53 | Me.Version = version 54 | Me.Description = description 55 | End Sub 56 | 57 | Public Overrides Function ToString() As String 58 | If Description.Length > 50 Then Return Type.ToString + ": " + Description.Substring(0, 47) + "..." Else Return Type.ToString + ": " + Description 59 | End Function 60 | 61 | End Class -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Editor/ServerSettingsControl.cs: -------------------------------------------------------------------------------- 1 | // ServerSettingsControl.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/27 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Windows.Forms; 13 | using MetroFramework.Controls; 14 | using Net.Bertware.Bukkitgui2.MinecraftInterop.ServerConfig; 15 | 16 | namespace Net.Bertware.Bukkitgui2.AddOn.Editor 17 | { 18 | public partial class ServerSettingsControl : MetroUserControl 19 | { 20 | public ServerSettingsControl() 21 | { 22 | InitializeComponent(); 23 | } 24 | 25 | private void ServerSettingsControl_Load(object sender, EventArgs e) 26 | { 27 | UpdateListView(); 28 | } 29 | 30 | private void UpdateListView() 31 | { 32 | Dictionary settings = ServerProperties.ServerSettings; 33 | slvServerSettings.Items.Clear(); 34 | 35 | foreach (KeyValuePair setting in settings) 36 | { 37 | string[] content = {setting.Key, setting.Value}; 38 | ListViewItem lvi = new ListViewItem(content) {Tag = setting.Key}; 39 | slvServerSettings.Items.Add(lvi); 40 | } 41 | } 42 | 43 | private void btnEdit_Click(object sender, EventArgs e) 44 | { 45 | if (slvServerSettings.SelectedItems.Count < 1) return; 46 | 47 | string key = slvServerSettings.SelectedItems[0].Tag.ToString(); 48 | string value = ServerProperties.GetServerSetting(key); 49 | 50 | SettingsEditDialog dialog = new SettingsEditDialog(key, value); 51 | if (dialog.ShowDialog() != DialogResult.OK) return; 52 | ServerProperties.SetServerSetting(dialog.Setting, dialog.Value); 53 | UpdateListView(); 54 | } 55 | 56 | 57 | private void slvServerSettings_DoubleClick(object sender, EventArgs e) 58 | { 59 | btnEdit_Click(sender, e); 60 | } 61 | 62 | private void btnAdd_Click(object sender, EventArgs e) 63 | { 64 | SettingsEditDialog dialog = new SettingsEditDialog(); 65 | if (dialog.ShowDialog() != DialogResult.OK) return; 66 | ServerProperties.SetServerSetting(dialog.Setting, dialog.Value); 67 | UpdateListView(); 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /bukkitgui2/Core/Util/Web/WebUtil.cs: -------------------------------------------------------------------------------- 1 | // WebUtil.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/02/02 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.IO; 12 | using System.Net; 13 | using System.Text; 14 | using Net.Bertware.Bukkitgui2.Core.Logging; 15 | 16 | namespace Net.Bertware.Bukkitgui2.Core.Util.Web 17 | { 18 | internal static class WebUtil 19 | { 20 | public const string Mail = "contact@bertware.net"; 21 | 22 | public static readonly string UserAgent = "Bertware 1.3/" + Share.AssemblyName + " " + Share.AssemblyVersion + 23 | "/" + 24 | Mail; 25 | 26 | public static string RetrieveString(string url) 27 | { 28 | Uri uri = new Uri(url); 29 | try 30 | { 31 | HttpWebRequest webc = (HttpWebRequest) WebRequest.Create(uri); 32 | webc.Timeout = 1000*9; 33 | webc.UserAgent = UserAgent; 34 | Logger.Log(LogLevel.Info, "WebUtil", "Retrieving data from " + url); 35 | 36 | StreamReader readStream = new StreamReader(webc.GetResponse().GetResponseStream(), Encoding.UTF8); 37 | Logger.Log(LogLevel.Info, "WebUtil", "Retrieved data from " + url); 38 | return readStream.ReadToEnd(); 39 | } 40 | catch (WebException webException) 41 | { 42 | Logger.Log(LogLevel.Warning, "WebUtil", "Couldn't retrieve data from " + url, webException.Message); 43 | return ""; 44 | } 45 | } 46 | 47 | public static string GetGeoLocation(string ip) 48 | { 49 | return RetrieveString("http://geoip.bertware.net/?key=qXCsPUpvCvaQnWRv&ip=" + ip); 50 | } 51 | 52 | public static void DownloadFile(string url, string targetlocation, Boolean showUi, Boolean sync = false) 53 | { 54 | FileDownloader fileDownloadDialog = new FileDownloader(); 55 | fileDownloadDialog.AddFile(url, targetlocation); 56 | if (!showUi) 57 | { 58 | fileDownloadDialog.StartDownload(); 59 | return; 60 | } 61 | if (!sync) 62 | { 63 | fileDownloadDialog.Show(); 64 | } 65 | else 66 | { 67 | fileDownloadDialog.ShowDialog(); 68 | } 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Settings/Settings.cs: -------------------------------------------------------------------------------- 1 | // Settings.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using MetroFramework.Controls; 11 | 12 | namespace Net.Bertware.Bukkitgui2.AddOn.Settings 13 | { 14 | internal class Settings : IAddon 15 | { 16 | public Settings() 17 | { 18 | TabPage = null; 19 | ConfigPage = null; 20 | } 21 | 22 | /// 23 | /// True if this addon has a tab page 24 | /// 25 | public bool HasTab 26 | { 27 | get { return true; } 28 | } 29 | 30 | /// 31 | /// True if this addon has a config field 32 | /// 33 | public bool HasConfig 34 | { 35 | get { return false; } 36 | } 37 | 38 | public void Dispose() 39 | { 40 | // nothing to do 41 | } 42 | 43 | /// 44 | /// The tab control for this addon 45 | /// 46 | /// Returns the tabpage 47 | public MetroUserControl TabPage { get; private set; } 48 | 49 | public MetroUserControl ConfigPage { get; private set; } 50 | 51 | /// 52 | /// The addon name, ideally this name is the same as used in the tabpage 53 | /// 54 | public string Name 55 | { 56 | get { return "Settings"; } 57 | } 58 | 59 | /// 60 | /// The addon priority. Default: 0 61 | /// 62 | public int Priority 63 | { 64 | get { return -10; } 65 | } 66 | 67 | /// 68 | /// Initialize all functions and the tabcontrol 69 | /// 70 | public void Initialize() 71 | { 72 | if (TabPage == null) TabPage = new SettingsTab {Text = Name, ParentAddon = this}; 73 | ((SettingsTab) TabPage).Initialize(); 74 | } 75 | 76 | /// 77 | /// Remove the settings control for a given addon 78 | /// 79 | /// 80 | /// Reloading addons is highly discouraged! Only use if no other way is possible 81 | public void RemoveAddonSettings(IAddon addon) 82 | { 83 | } 84 | 85 | /// 86 | /// Add the settings control for a given addon 87 | /// 88 | /// 89 | /// Reloading addons is highly discouraged! Only use if no other way is possible 90 | public void AddAddonSettings(IAddon addon) 91 | { 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Net.Bertware.Get/UpdateInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System.Xml 2 | 3 | Public Class UpdateInfo 4 | Public Id As UInt16 5 | Public Pid As UInt16 6 | Public Version As String 7 | Public Channel As releasechannel 8 | Public Forced As Boolean = 0 9 | Public URL_1 As String 10 | Public URL_2 As String 11 | 12 | Public ReleaseDate As String 13 | Public Size As Int32 14 | Public FileName As String 15 | Public Sha256 As String = "" 16 | Public VTPermaLink As String = "" 17 | 18 | 19 | Public Sub LoadXML(xml As String) 20 | Try 21 | Dim xmldoc As New XmlDocument 22 | Id = xmldoc.GetElementsByTagName("update")(0).Attributes("id").Value 23 | Pid = xmldoc.Item("pid").InnerText 24 | Version = xmldoc.GetElementsByTagName("update")(0).Attributes("version").Value 25 | Channel = [Enum].Parse(GetType(releasechannel), xmldoc.Item("channel").InnerText) 26 | Forced = (xmldoc.Item("forced")(0).Value = "1") 27 | URL_1 = xmldoc.Item("url_1").InnerText 28 | URL_2 = xmldoc.Item("url_2").InnerText 29 | 30 | ReleaseDate = xmldoc.Item("releasedate").InnerText 31 | Size = xmldoc.Item("size").InnerText 32 | FileName = xmldoc.Item("filename").InnerText 33 | Sha256 = xmldoc.Item("sha256").InnerText 34 | VTPermaLink = xmldoc.Item("vtlink").InnerText 35 | Catch ex As Exception 36 | Trace.WriteLine("Failed to load XML for updateinfo!(text) : " + ex.Message) 37 | End Try 38 | End Sub 39 | 40 | Public Sub LoadXML(xmlelement As XmlElement) 41 | Try 42 | 43 | Id = xmlelement.Attributes("id").InnerText 44 | Pid = xmlelement.Item("pid").InnerText 45 | Version = xmlelement.Attributes("version").InnerText 46 | Channel = [Enum].Parse(GetType(releasechannel), xmlelement.Item("channel").InnerText) 47 | Forced = (xmlelement.Item("forced").InnerText = "1") 48 | URL_1 = xmlelement.Item("url_1").InnerText 49 | URL_2 = xmlelement.Item("url_2").InnerText 50 | 51 | ReleaseDate = xmlelement.Item("releasedate").InnerText 52 | Size = xmlelement.Item("size").InnerText 53 | FileName = xmlelement.Item("filename").InnerText 54 | Sha256 = xmlelement.Item("sha256").InnerText 55 | VTPermaLink = xmlelement.Item("vtlink").InnerText 56 | Catch ex As Exception 57 | Trace.WriteLine("Failed to load XML for updateinfo!(element) : " + ex.Message) 58 | End Try 59 | End Sub 60 | End Class 61 | -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Settings/VariousSettings.cs: -------------------------------------------------------------------------------- 1 | // VariousSettings.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/07 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.IO; 12 | using System.Reflection; 13 | using System.Windows.Forms; 14 | using MetroFramework; 15 | using MetroFramework.Controls; 16 | using Net.Bertware.Bukkitgui2.Core.FileLocation; 17 | using Net.Bertware.Bukkitgui2.Core.Logging; 18 | 19 | namespace Net.Bertware.Bukkitgui2.AddOn.Settings 20 | { 21 | public partial class VariousSettings : MetroUserControl 22 | { 23 | public VariousSettings() 24 | { 25 | InitializeComponent(); 26 | chkSaveInServerDir.Checked = Fl.GetLocal(); 27 | } 28 | 29 | private static void CreateAppShortcutToDesktop(string linkName, string args) 30 | { 31 | string deskDir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); 32 | 33 | using (StreamWriter writer = new StreamWriter(deskDir + "\\" + linkName + ".url")) 34 | { 35 | string app = Assembly.GetExecutingAssembly().Location; 36 | writer.WriteLine("[InternetShortcut]"); 37 | writer.WriteLine("URL=file:///" + app + " " + args); 38 | writer.WriteLine("IconIndex=0"); 39 | string icon = app.Replace('\\', '/'); 40 | writer.WriteLine("IconFile=" + icon); 41 | writer.Flush(); 42 | } 43 | } 44 | 45 | private void btnCustomFolder_Click(object sender, EventArgs e) 46 | { 47 | try 48 | { 49 | FolderBrowserDialog dialog = new FolderBrowserDialog 50 | { 51 | ShowNewFolderButton = true 52 | }; 53 | dialog.ShowDialog(); 54 | CreateAppShortcutToDesktop("BukkitGui custom dir", " -wd=\"" + dialog.SelectedPath + "\""); 55 | MetroMessageBox.Show(Application.OpenForms[0], "A special shortcut has been created on your desktop.", 56 | "Shortcut created", MessageBoxButtons.OK, MessageBoxIcon.Information); 57 | } 58 | catch (Exception exception) 59 | { 60 | MetroMessageBox.Show(Application.OpenForms[0], "Failed to create shortcut! Try running as administrator.", 61 | "Failed to create shortcut", MessageBoxButtons.OK, MessageBoxIcon.Warning); 62 | Logger.Log(LogLevel.Warning, "VariousSettings", "Failed to create custom folder shortcut", exception.Message); 63 | } 64 | } 65 | 66 | private void chkSaveInServerDir_CheckedChanged(object sender, EventArgs e) 67 | { 68 | Fl.SetLocal(chkSaveInServerDir.Checked); 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /Net.Bertware.Get/UpdateDialog.vb: -------------------------------------------------------------------------------- 1 | Imports System.Windows.Forms 2 | 3 | Public Class UpdateDialog 4 | Private ReadOnly _update As UpdateInfo 5 | Private ReadOnly _changelog As ChangelogInfo 6 | 7 | Public onlyGetUrl As Boolean = False 8 | 9 | Public Sub New(update As UpdateInfo, changelog As ChangelogInfo) 10 | InitializeComponent() 11 | _update = update 12 | _changelog = changelog 13 | End Sub 14 | 15 | Private Sub UpdateDialog_Load(sender As Object, e As EventArgs) Handles MyBase.Load 16 | Try 17 | If _update Is Nothing Then _ 18 | MessageBox.Show("Invalid update information! Check your internet connection.", 19 | "Invalid update information", MessageBoxButtons.OK, MessageBoxIcon.Error) : Me.Close() : _ 20 | Exit Sub 21 | lblCurrentVersion.Text += " " + CurrentVersion 22 | LblNewVersion.Text += " " + _update.Version 23 | lblReleaseDate.Text += " " + _update.ReleaseDate 24 | If _update.Size < 1048576 Then 25 | LblSize.Text += " " + Math.Round(_update.Size/1024, 1).ToString + "Kb" 26 | Else 27 | LblSize.Text += " " + Math.Round(_update.Size/1048576, 1).ToString + "Mb" 28 | End If 29 | If _changelog IsNot Nothing AndAlso _changelog.Changes IsNot Nothing Then 30 | For Each entry In _changelog.Changes 31 | LboxChangelog.Items.Add(entry.ToString) 32 | Next 33 | End If 34 | Catch ex As Exception 35 | Trace.WriteLine("Failed to load updatedialog! : " + ex.Message) 36 | End Try 37 | Me.Focus() 38 | Me.BringToFront() 39 | Me.TopLevel = True 40 | Me.TopMost = True 41 | End Sub 42 | 43 | Private Sub LLblGetBertware_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) _ 44 | Handles LLblGetBertware.LinkClicked 45 | Process.Start("http://get.bertware.net") 46 | End Sub 47 | 48 | Private Sub BtnInstall_Click(sender As Object, e As EventArgs) Handles BtnInstall.Click 49 | If _update Is Nothing Then Exit Sub 50 | If onlyGetUrl Then 51 | Me.DialogResult = DialogResult.OK 52 | Me.Close() 53 | Exit Sub 54 | End If 55 | 56 | Updater.Update(_update) 57 | Me.DialogResult = DialogResult.OK 58 | Me.Close() 59 | End Sub 60 | 61 | Private Sub BtnIgnore_Click(sender As Object, e As EventArgs) Handles BtnIgnore.Click 62 | Me.DialogResult = DialogResult.Ignore 63 | Me.Close() 64 | End Sub 65 | End Class -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Updater/Updater.cs: -------------------------------------------------------------------------------- 1 | // Updater.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/08/08 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Threading; 12 | using MetroFramework.Controls; 13 | using Net.Bertware.Get; 14 | 15 | namespace Net.Bertware.Bukkitgui2.AddOn.Updater 16 | { 17 | /// 18 | /// Addon to show updater settings and info 19 | /// 20 | internal class Updater : IAddon 21 | { 22 | public Updater() 23 | { 24 | TabPage = null; 25 | } 26 | 27 | /// 28 | /// The addon name, ideally this name is the same as used in the tabpage 29 | /// 30 | public string Name 31 | { 32 | get { return "Updater"; } 33 | } 34 | 35 | /// 36 | /// The addon priority. Default: 0 37 | /// 38 | public int Priority 39 | { 40 | get { return 0; } 41 | } 42 | 43 | /// 44 | /// True if this addon has a tab page 45 | /// 46 | public bool HasTab 47 | { 48 | get { return false; } 49 | } 50 | 51 | /// 52 | /// True if this addon has a config field 53 | /// 54 | public bool HasConfig 55 | { 56 | get { return true; } 57 | } 58 | 59 | /// 60 | /// Initialize all functions and the tabcontrol 61 | /// 62 | public void Initialize() 63 | { 64 | ConfigPage = new UpdaterSettings(); 65 | CheckForUpdates(); 66 | } 67 | 68 | public void Dispose() 69 | { 70 | // nothing to do 71 | } 72 | 73 | /// 74 | /// The tab control for this addon 75 | /// 76 | /// Returns the tabpage 77 | public MetroUserControl TabPage { get; private set; } 78 | 79 | public MetroUserControl ConfigPage { get; private set; } 80 | 81 | public bool CanDisable 82 | { 83 | get { return true; } 84 | } 85 | 86 | public static void CheckForUpdates() 87 | { 88 | Thread t = new Thread(() => RunUpdateCheck()) {Name = "RunUpdateCheck"}; 89 | t.SetApartmentState(ApartmentState.STA); 90 | 91 | t.Start(); 92 | } 93 | 94 | private static void RunUpdateCheck() 95 | { 96 | try{ 97 | api.RunUpdateCheck(false,true); 98 | } 99 | catch (Exception) 100 | { 101 | // ignored 102 | } 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /bukkitgui2/Program.cs: -------------------------------------------------------------------------------- 1 | // Program.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.IO; 12 | using System.Reflection; 13 | using System.Windows.Forms; 14 | 15 | namespace Net.Bertware.Bukkitgui2 16 | { 17 | internal static class Program 18 | { 19 | /// 20 | /// The main entry point for the application. 21 | /// 22 | [STAThread] 23 | private static void Main() 24 | { 25 | // Load embedded DLLs 26 | AppDomain.CurrentDomain.AssemblyResolve += LoadDll; 27 | 28 | // Load app 29 | Application.EnableVisualStyles(); 30 | Application.SetCompatibleTextRenderingDefault(false); 31 | 32 | try 33 | { 34 | Launcher.Run(); 35 | } 36 | catch (Exception exception) 37 | { 38 | MessageBox.Show("The application encountered an unexpected error!" + Environment.NewLine + 39 | "Please contact the developer with following information:" + Environment.NewLine + 40 | "Exception: " + exception.Message + Environment.NewLine + 41 | "Details:" + exception.StackTrace, 42 | "Unexpected error", MessageBoxButtons.OK, MessageBoxIcon.Error); 43 | } 44 | } 45 | 46 | public static Assembly LoadDll(object sender, ResolveEventArgs args) 47 | { 48 | //Load embedded DLLs 49 | 50 | String resourceName = "Net.Bertware.Bukkitgui2.Resources.Dll." + new AssemblyName(args.Name).Name + ".dll"; 51 | 52 | using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)) 53 | { 54 | if (stream == null || stream.Length < 1) 55 | { 56 | return null; 57 | } 58 | Byte[] assemblyData = new Byte[stream.Length]; 59 | stream.Read(assemblyData, 0, assemblyData.Length); 60 | 61 | return Assembly.Load(assemblyData); 62 | } 63 | } 64 | 65 | internal static void ExtractDll(string name) 66 | { 67 | String resourceName = "Net.Bertware.Bukkitgui2.Resources.Dll." + name + ".dll"; 68 | 69 | using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)) 70 | { 71 | if (stream == null || stream.Length < 1) 72 | { 73 | return; 74 | } 75 | Byte[] assemblyData = new Byte[stream.Length]; 76 | stream.Read(assemblyData, 0, assemblyData.Length); 77 | 78 | using (FileStream fs = File.Create(name + ".dll")) 79 | { 80 | fs.Write(assemblyData, 0, assemblyData.Length); 81 | } 82 | } 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This project has been abandoned. Pull requests will be reviewed and accepted, but no active development is happening anymore. 2 | 3 | --------- 4 | 5 | ## bukkitgui 2 6 | The original bukkit GUI project - shortened BukkitGUI - was intended to provide minecraft server owners with a easy to use, powerful GUI. 7 | BukkitGui2 continues with the same mindset, but with higher performance and better code. 8 | 9 | ### Features 10 | * Coloured output, colours definable in settings 11 | * Detailed player list with context menu, quickly apply an action to a player 12 | * Advanced options to launch bukkit, update bukkit, auto update check for bukkit 13 | * Automate your server with the task manager 14 | * Highly precise memory and CPU measurement 15 | * Low on resources, performance can be adjusted in settings 16 | * Error logging, searching for the cause of errors, and if possible, solving of errors 17 | * Tray icon (with support to minimize to tray) and balloon tips 18 | * Sound when something happen can be activated 19 | * Rarely/Never breaks on Minecraft/bukkit update 20 | * Backups (multiple backup definitions possible) 21 | * Install, update, manage plugins from within the GUI 22 | * port forwarding 23 | 24 | ### Use 25 | Please see the project page at dev.bukkit.org for information, including video tutorials, on how to set-up and use this software. 26 | https://dev.bukkit.org/projects/bukkitgui?gameCategorySlug=bukkit-plugins&projectID=32715 27 | 28 | #### Remote Server Support 29 | The GUI can also show output and send commands to remote servers. The recommended way to use a remote server is by using JSONAPI. In order for this to work, the JSONAPI plugin should be installed on your server. 30 | 31 | If you want to start RemoteToolkit using the GUI, do the following: -Set the server type to bukkit -Select the remote toolkit jar file -Enter the following custom switch: "user:pass" without the "" 32 | 33 | #### Downloads 34 | Recommended builds can be downloaded from Bukkitdev. If enabled, the GUI will check for updates and download those from bukkitdev after you agreed with the download. 35 | 36 | ### To-Do 37 | * Portforwarding (work in progress) 38 | 39 | ### Known Issues 40 | 41 | Sometimes tasks run twice 42 | 43 | ### compatibility 44 | #### operating systems 45 | Windows XP and higher. If it doesn't work, make shure if you have .net framework 4. 46 | Linux and Mac aren't supported. 47 | 48 | #### minecraft servers 49 | The following minecraft servers are supported: 50 | 51 | * Bukkit build 800 and higher (lower isn't tested) 52 | * RemoteToolKit 53 | * Vanilla 54 | * Tekkit 55 | * MCPC (set server type to vanilla,generic java, or to bukkit with disabled "retrieve current version on server start") 56 | * CraftBukkit 57 | * Spigot 58 | * Spout 59 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /Net.Bertware.Get/ProgramInfo.vb: -------------------------------------------------------------------------------- 1 | Public Class ProgramInfo 2 | 3 | Public Id As UInt16 = 0 4 | Public Name As String = "" 5 | Public Added_Date As String = "" 6 | Public Allow_View_Site As Boolean = 1 7 | Public Allow_Download_Site As Boolean = 1 8 | Public Allow_Download_Updater As Boolean = 1 9 | Public Icon As String = "" 10 | 11 | Public Description As String = "" 12 | Public Platform As String = "" 13 | Public Price As Single = 0 14 | 15 | Public updates As New List(Of UpdateInfo) 16 | 17 | Public Sub New() 18 | 19 | End Sub 20 | 21 | Public Sub New(name As String) 22 | Load(name) 23 | End Sub 24 | 25 | Public Sub LoadThis() 26 | Load(Reflection.Assembly.GetEntryAssembly.GetName.Name) 27 | End Sub 28 | 29 | Public Sub Load(name As String) 30 | Dim p As New Dictionary(Of String, String) 31 | p.Add("program", name) 32 | Dim response = api.GetAPIResponse(APIAction.program_all, p) 33 | If response IsNot Nothing AndAlso response <> "" Then LoadXML(response) 34 | End Sub 35 | 36 | Public Sub LoadXML(xml As String) 37 | Try 38 | Dim xmldoc As New Xml.XmlDocument() 39 | xmldoc.LoadXml(xml) 40 | 41 | Name = xmldoc.GetElementsByTagName("program")(0).Attributes("name").Value 42 | Id = CInt(xmldoc.GetElementsByTagName("pid")(0).Value) 43 | Platform = xmldoc.GetElementsByTagName("platform")(0).Value 44 | Price = CSng(xmldoc.GetElementsByTagName("price")(0).Value) 45 | Description = xmldoc.GetElementsByTagName("description")(0).Value 46 | Icon = xmldoc.GetElementsByTagName("icon")(0).Value 47 | Added_Date = xmldoc.GetElementsByTagName("added_date")(0).Value 48 | Allow_Download_Site = (xmldoc.GetElementsByTagName("allow_download_site")(0).Value = "1") 49 | Allow_Download_Updater = (xmldoc.GetElementsByTagName("allow_download_updater")(0).Value = "1") 50 | Allow_View_Site = (xmldoc.GetElementsByTagName("allow_view_site")(0).Value = "1") 51 | 52 | updates = New List(Of UpdateInfo) 53 | For Each update As Xml.XmlElement In xmldoc.GetElementsByTagName("update") 54 | Try 55 | Dim ui As New UpdateInfo 56 | ui.LoadXML(update) 57 | updates.Add(ui) 58 | Catch slex As Exception 59 | Trace.WriteLine("Failed to load update for programinfo! : " + slex.Message) 60 | End Try 61 | Next 62 | Catch ex As Exception 63 | Trace.WriteLine("Failed to load XML for programinfo! : " + ex.Message) 64 | End Try 65 | End Sub 66 | 67 | 68 | End Class 69 | -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/TaskerTab.cs: -------------------------------------------------------------------------------- 1 | // TaskerTab.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Windows.Forms; 13 | using MetroFramework.Controls; 14 | using Net.Bertware.Bukkitgui2.AddOn.Tasker.TaskerUI; 15 | 16 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker 17 | { 18 | public partial class TaskerTab : MetroUserControl, IAddonTab 19 | { 20 | public TaskerTab() 21 | { 22 | InitializeComponent(); 23 | LoadUi(); 24 | Tasker.Reference.TaskListAltered += OnTaskListAltered; 25 | } 26 | 27 | private void OnTaskListAltered(object sender, EventArgs e) 28 | { 29 | LoadUi(); 30 | } 31 | 32 | public IAddon ParentAddon { get; set; } 33 | 34 | /// 35 | /// Load all tasks to the UI 36 | /// 37 | private void LoadUi() 38 | { 39 | slvTasks.Items.Clear(); 40 | foreach (KeyValuePair pair in Tasker.Tasks) 41 | { 42 | string[] content = 43 | { 44 | pair.Key, 45 | pair.Value.Trigger.Name, 46 | pair.Value.Trigger.Parameters, 47 | pair.Value.Actions[0].Name, 48 | pair.Value.Actions[0].Parameters, 49 | pair.Value.Enabled.ToString() 50 | }; 51 | ListViewItem lvi = new ListViewItem(content) {Tag = pair.Value}; 52 | slvTasks.Items.Add(lvi); 53 | } 54 | } 55 | 56 | private void btnNew_Click(object sender, EventArgs e) 57 | { 58 | TaskEditor editor = new TaskEditor(); 59 | editor.ShowDialog(); 60 | } 61 | 62 | private void slvTasks_SelectedIndexChanged(object sender, EventArgs e) 63 | { 64 | bool taskSelected = (slvTasks.SelectedItems.Count > 0); 65 | btnEdit.Enabled = taskSelected; 66 | btnDelete.Enabled = taskSelected; 67 | btnTest.Enabled = taskSelected; 68 | } 69 | 70 | private void btnEdit_Click(object sender, EventArgs e) 71 | { 72 | if (slvTasks.SelectedItems.Count < 1) return; 73 | Task t = (Task) slvTasks.SelectedItems[0].Tag; 74 | TaskEditor editor = new TaskEditor(t); 75 | editor.ShowDialog(); 76 | } 77 | 78 | private void btnDelete_Click(object sender, EventArgs e) 79 | { 80 | Task t = (Task) slvTasks.SelectedItems[0].Tag; 81 | Tasker.Reference.DeleteTask(t); 82 | slvTasks_SelectedIndexChanged(null, null); // force selected in dex check 83 | } 84 | 85 | private void btnTest_Click(object sender, EventArgs e) 86 | { 87 | if (slvTasks.SelectedItems.Count < 1) return; 88 | Task t = (Task) slvTasks.SelectedItems[0].Tag; 89 | t.ExecuteActions(); 90 | } 91 | } 92 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Settings/SettingsTab.cs: -------------------------------------------------------------------------------- 1 | // SettingsTab.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Collections.Generic; 11 | using System.Windows.Forms; 12 | using MetroFramework.Controls; 13 | using Net.Bertware.Bukkitgui2.Core.Configuration; 14 | 15 | namespace Net.Bertware.Bukkitgui2.AddOn.Settings 16 | { 17 | public partial class SettingsTab : MetroUserControl, IAddonTab 18 | { 19 | public bool IsInitialized { get; private set; } 20 | 21 | public IAddon ParentAddon { get; set; } 22 | 23 | /// 24 | /// Dictionary of addon names and their settings controls 25 | /// 26 | private Dictionary _settings; 27 | 28 | public SettingsTab() 29 | { 30 | InitializeComponent(); 31 | if (AddonManager.AddonsLoaded) 32 | { 33 | Initialize(); 34 | } 35 | } 36 | 37 | public void Initialize() 38 | { 39 | if (IsInitialized) 40 | { 41 | return; 42 | } 43 | _settings = new Dictionary(); 44 | TreeNode node; 45 | 46 | foreach (KeyValuePair settingsEntry in AddonManager.SettingsDictionary) 47 | { 48 | _settings.Add(settingsEntry.Key.Name, settingsEntry.Value); 49 | node = new TreeNode(settingsEntry.Key.Name) {Name = settingsEntry.Key.Name}; 50 | TVSettings.Nodes.Add(node); 51 | } 52 | _settings.Add("Credits", new Credits()); 53 | node = new TreeNode("Credits") {Name = "Credits"}; 54 | TVSettings.Nodes.Add(node); 55 | 56 | _settings.Add("Various", new VariousSettings()); 57 | node = new TreeNode("Various") {Name = "Various"}; 58 | TVSettings.Nodes.Add(node); 59 | IsInitialized = true; 60 | } 61 | 62 | /// 63 | /// Handle the selection of a different node in the treeview 64 | /// 65 | /// 66 | /// 67 | private void TvSettingsAfterSelect(object sender, TreeViewEventArgs e) 68 | { 69 | Config.SaveFile(); //autosave the file while editing different settings groups 70 | LoadControl(e.Node.Name); 71 | } 72 | 73 | /// 74 | /// Load a new settings control 75 | /// 76 | /// 77 | private void LoadControl(string name) 78 | { 79 | if (!_settings.ContainsKey(name)) 80 | { 81 | return; 82 | } 83 | 84 | gbSettings.Controls.Clear(); 85 | UserControl control = _settings[name]; 86 | 87 | // safety check 88 | if (control == null) return; 89 | 90 | gbSettings.Controls.Add(control); 91 | gbSettings.Controls[0].Dock = DockStyle.Fill; 92 | } 93 | } 94 | } -------------------------------------------------------------------------------- /bukkitgui2/MinecraftServers/Tools/MinecraftServerVersion.cs: -------------------------------------------------------------------------------- 1 | // MinecraftServerVersion.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/06/23 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Text.RegularExpressions; 12 | 13 | namespace Net.Bertware.Bukkitgui2.MinecraftServers.Tools 14 | { 15 | public class MinecraftServerVersion 16 | { 17 | public int Build { get; private set; } 18 | public string MinecraftVersion { get; private set; } 19 | public string ServerVersion { get; private set; } 20 | 21 | public MinecraftServerVersion(string versionString) 22 | { 23 | Build = ParseVersionString(versionString); 24 | MinecraftVersion = ParseVersionStringMinecraftVersion(versionString); 25 | ServerVersion = ParseVersionStringServerVersion(versionString); 26 | } 27 | 28 | /// 29 | /// parse a version string (jenkins etc) 30 | /// 31 | /// 32 | /// 33 | /// 34 | private static int ParseVersionString(string text) 35 | { 36 | // -b120, #1200, b548jnks, ... 37 | const string pattern = "((#|b|b-)\\d{3,5}(jnks)?)"; 38 | Match match = Regex.Match(text, pattern); 39 | char[] chars = 40 | { 41 | '#', 42 | 'b', 43 | 'j', 44 | 'n', 45 | 'k', 46 | 's', 47 | '-' 48 | }; 49 | 50 | if (string.IsNullOrEmpty(match.Value)) 51 | return 0; 52 | return Convert.ToInt32(match.Value.Trim(chars)); 53 | } 54 | 55 | /// 56 | /// parse a bukkit version (console output) 57 | /// 58 | /// 59 | /// 60 | /// 61 | private static string ParseVersionStringServerVersion(string text) 62 | { 63 | const string pattern = "(\\d.\\d.\\d|\\d.\\d)(\\-R\\d|)"; 64 | Match match = Regex.Match(text, pattern); 65 | if (string.IsNullOrEmpty(match.Value)) 66 | return "unknown"; 67 | return match.Value; 68 | } 69 | 70 | /// 71 | /// parse an MC version. Can be in the same version string as the bukkit version 72 | /// 73 | /// 74 | /// 75 | /// 76 | private static string ParseVersionStringMinecraftVersion(string text) 77 | { 78 | const string pattern = "(MC|Minecraft Version): ((\\d.){1,2}\\d)"; 79 | Match match = Regex.Match(text, pattern, RegexOptions.IgnoreCase); 80 | if (string.IsNullOrEmpty(match.Value)) 81 | return "unknown"; 82 | 83 | return match.Value; 84 | } 85 | 86 | public override string ToString() 87 | { 88 | return ServerVersion + " (" + MinecraftVersion + ")"; 89 | } 90 | } 91 | } -------------------------------------------------------------------------------- /bukkitgui2/Core/Util/FsUtil.cs: -------------------------------------------------------------------------------- 1 | // FsUtil.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/31 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.IO; 11 | 12 | namespace Net.Bertware.Bukkitgui2.Core.Util 13 | { 14 | internal static class FsUtil 15 | { 16 | /// 17 | /// Create a directory, only if it doesn't exist. 18 | /// 19 | /// 20 | public static void CreateDirectoryIfNotExists(string directory) 21 | { 22 | if (Directory.Exists(directory)) return; 23 | 24 | Directory.CreateDirectory(directory); 25 | } 26 | 27 | public static string ReadFileInUse(string path) 28 | { 29 | string result = ""; 30 | using (FileStream stream = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) 31 | { 32 | using (StreamReader reader = new StreamReader(stream)) 33 | { 34 | while (!reader.EndOfStream) 35 | { 36 | result += reader.ReadToEnd(); 37 | } 38 | } 39 | } 40 | return result; 41 | } 42 | 43 | /// 44 | /// Copy a folder, also works between different drives 45 | /// 46 | /// source dir 47 | /// destination dir 48 | /// delete the source? (move) 49 | public static void CopyFolder(string sourceFolder, string destFolder, bool deleteSource = false) 50 | { 51 | if (!Directory.Exists(destFolder)) 52 | Directory.CreateDirectory(destFolder); 53 | string[] files = Directory.GetFiles(sourceFolder); 54 | foreach (string file in files) 55 | { 56 | string name = Path.GetFileName(file); 57 | if (name != null) 58 | { 59 | string dest = Path.Combine(destFolder, name); 60 | File.Copy(file, dest, true); 61 | } 62 | } 63 | string[] folders = Directory.GetDirectories(sourceFolder); 64 | foreach (string folder in folders) 65 | { 66 | string name = Path.GetFileName(folder); 67 | if (name != null) 68 | { 69 | string dest = Path.Combine(destFolder, name); 70 | CopyFolder(folder, dest); 71 | } 72 | } 73 | if (deleteSource) Directory.Delete(sourceFolder, true); 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /bukkitgui2/Core/Share.cs: -------------------------------------------------------------------------------- 1 | // Share.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/18 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.IO; 12 | using System.Reflection; 13 | using Net.Bertware.Bukkitgui2.Core.Configuration; 14 | using Net.Bertware.Bukkitgui2.Core.FileLocation; 15 | using Net.Bertware.Bukkitgui2.Core.Filesystem; 16 | using Net.Bertware.Bukkitgui2.Core.Filesystem.Local; 17 | using Net.Bertware.Bukkitgui2.Core.Logging; 18 | 19 | namespace Net.Bertware.Bukkitgui2.Core 20 | { 21 | internal static class Share 22 | { 23 | public static IFilesystem ServerFileSystem; 24 | public static IntPtr MainFormHandle; 25 | 26 | 27 | /// 28 | /// Assembly name 29 | /// 30 | public static readonly string AssemblyName = Assembly.GetExecutingAssembly().GetName().Name; 31 | 32 | /// 33 | /// Assembly copyright 34 | /// 35 | public static readonly string AssemblyCopyRight = 36 | ((AssemblyCopyrightAttribute) 37 | Assembly.GetExecutingAssembly().GetCustomAttributes(typeof (AssemblyCopyrightAttribute), false)[0]) 38 | .Copyright; 39 | 40 | /// 41 | /// Assembly copyright 42 | /// 43 | public static readonly string AssemblyCompany = 44 | ((AssemblyCompanyAttribute) 45 | Assembly.GetExecutingAssembly().GetCustomAttributes(typeof (AssemblyCompanyAttribute), false)[0]) 46 | .Company; 47 | 48 | /// 49 | /// Assembly version 50 | /// 51 | public static readonly Version AssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version; 52 | 53 | /// 54 | /// Assembly fullname 55 | /// 56 | public static readonly string AssemblyFullName = Assembly.GetExecutingAssembly().GetName().FullName; 57 | 58 | /// 59 | /// Directory containing the assembly. 60 | /// 61 | public static readonly string AssemblyLocation = new FileInfo(AssemblyFullName).DirectoryName + "\\"; 62 | 63 | 64 | public static bool Is64Bit 65 | { 66 | get 67 | { 68 | return (8 == IntPtr.Size 69 | || (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432")))); 70 | } 71 | } 72 | 73 | public static void Initialize() 74 | { 75 | Fl.Initialize(); 76 | Logger.Initialize(); 77 | Config.Initialize(); 78 | Locale.Initialize(); 79 | 80 | 81 | //The filesystem to use (Only for server actions! e.g. logging and config are handled through the normal filesystem 82 | //This can be changed later on 83 | //e.g. when FTP connection settings are read from config or user presses connect button 84 | ServerFileSystem = new LocalFileSystem(); 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /bukkitgui2/MinecraftServers/Servers/GlowstoneServer.cs: -------------------------------------------------------------------------------- 1 | // GlowstoneServer.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/08 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System.Diagnostics; 11 | using System.IO; 12 | using System.Text.RegularExpressions; 13 | using System.Threading; 14 | using Net.Bertware.Bukkitgui2.AddOn.Starter; 15 | using Net.Bertware.Bukkitgui2.Core.Logging; 16 | using Net.Bertware.Bukkitgui2.Core.Util.Web; 17 | using Net.Bertware.Bukkitgui2.MinecraftServers.Tools; 18 | using Net.Bertware.Bukkitgui2.Properties; 19 | 20 | namespace Net.Bertware.Bukkitgui2.MinecraftServers.Servers 21 | { 22 | public class GlowstoneServer : MinecraftServerBase 23 | { 24 | // TODO: Fix issue with jline (glowstone doesn't support -nojline) 25 | 26 | public GlowstoneServer() 27 | { 28 | Name = "Glowstone"; 29 | Site = "http://www.glowstone.net/"; 30 | Logo = Resources.glowstone_logo; 31 | 32 | CanDownloadRecommendedVersion = true; 33 | 34 | CanGetCurrentVersion = true; 35 | 36 | SupportsPlugins = true; 37 | } 38 | 39 | public override string GetLaunchFlags(string defaultFlags = "") 40 | { 41 | return defaultFlags + "--jline 0"; 42 | } 43 | 44 | public override string RemoveTimeStamp(string text) 45 | { 46 | //2014-01-01 00:00:00,000 47 | text = Regex.Replace(text, "^\\d{2}:\\d{2}:\\d{2}(,\\d{3}|)\\s*", ""); 48 | text = text.Trim(); 49 | return text; 50 | } 51 | 52 | public override bool DownloadRecommendedVersion(string targetfile) 53 | { 54 | const string source = 55 | "http://ci.chrisgward.com/job/Glowstone/lastStableBuild/artifact/build/libs/glowstone.jar"; 56 | WebUtil.DownloadFile(source, targetfile, true, true); 57 | return true; 58 | } 59 | 60 | public override MinecraftServerVersion GetCurrentVersionObject(string file) 61 | { 62 | string versionString; 63 | string java = Starter.GetSelectedJavaPath(); 64 | Process p = new Process 65 | { 66 | StartInfo = new ProcessStartInfo(java) 67 | { 68 | RedirectStandardOutput = true, 69 | Arguments = " -Xmx32M -jar \"" + file + "\" -v", 70 | CreateNoWindow = true, 71 | UseShellExecute = false 72 | } 73 | }; 74 | 75 | Logger.Log(LogLevel.Info, "GlowstoneServer", "Starting process for version check", 76 | "\"" + p.StartInfo.FileName + "\"" + p.StartInfo.Arguments); 77 | 78 | p.Start(); 79 | 80 | using (StreamReader sr = new StreamReader(p.StandardOutput.BaseStream)) 81 | { 82 | for (int i = 0; i < 8; i++) 83 | { 84 | int peek = sr.Peek(); 85 | if (peek > 0) continue; 86 | Thread.Sleep(250); 87 | } 88 | 89 | versionString = sr.ReadToEnd(); 90 | } 91 | 92 | return new MinecraftServerVersion(versionString); 93 | } 94 | } 95 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Tasker/Trigger/ServerOutputRegexTrigger.cs: -------------------------------------------------------------------------------- 1 | // ServerOutputRegexTrigger.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/09/07 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Text.RegularExpressions; 12 | using System.Windows.Forms; 13 | using MetroFramework; 14 | using Net.Bertware.Bukkitgui2.Core.Logging; 15 | using Net.Bertware.Bukkitgui2.MinecraftInterop.OutputHandler; 16 | 17 | namespace Net.Bertware.Bukkitgui2.AddOn.Tasker.Trigger 18 | { 19 | internal class ServerOutputRegexTrigger : ITrigger 20 | { 21 | public ServerOutputRegexTrigger() 22 | { 23 | Name = "Server output (Regular expression - regex)"; 24 | Description = "Execute a task when (part of) the server output matches the parameter regex"; 25 | ParameterDescription = "The regex, which (part of) the server output should match"; 26 | } 27 | 28 | public event TaskerEventArgs TaskerTriggerFired; 29 | 30 | protected virtual void OnTaskerTriggerFired() 31 | { 32 | TaskerEventArgs handler = TaskerTriggerFired; 33 | if (handler != null) handler(); 34 | } 35 | 36 | 37 | public string Name { get; protected set; } 38 | 39 | public string Description { get; protected set; } 40 | 41 | public string ParameterDescription { get; protected set; } 42 | 43 | public bool ValidateInput(string inputText) 44 | { 45 | // any regex 46 | return true; 47 | } 48 | 49 | public void Load(string parameters) 50 | { 51 | if (Enabled) 52 | { 53 | Disable(); 54 | Load(parameters); 55 | Enable(); 56 | } 57 | else 58 | { 59 | Parameters = parameters; 60 | } 61 | } 62 | 63 | public string Parameters { get; set; } 64 | 65 | public bool Enabled { get; protected set; } 66 | 67 | public void Enable() 68 | { 69 | MinecraftOutputHandler.OutputParsed += OnOutputReceived; 70 | Enabled = true; 71 | } 72 | 73 | public void Disable() 74 | { 75 | MinecraftOutputHandler.OutputParsed -= OnOutputReceived; 76 | Enabled = false; 77 | } 78 | 79 | private void OnOutputReceived(string s, OutputParseResult result) 80 | { 81 | try 82 | { 83 | if (Regex.IsMatch(result.Message, Parameters)) OnTaskerTriggerFired(); 84 | } 85 | catch (Exception exception) 86 | { 87 | Disable(); // prevent spam of this error on server start 88 | MetroMessageBox.Show(Application.OpenForms[0], 89 | "Failed to execute regex trigger!" + Environment.NewLine + "Following regex caused issues: " + 90 | Parameters + 91 | Environment.NewLine + "The trigger will now be disabled. Edit the task to enable it again.", 92 | "Regex trigger failed", 93 | MessageBoxButtons.OK, MessageBoxIcon.Error); 94 | Logger.Log(LogLevel.Warning, "Regex trigger failed, check regex!", exception.Message); 95 | } 96 | } 97 | } 98 | } -------------------------------------------------------------------------------- /bukkitgui2/Core/Util/Performance/CpuCounter.cs: -------------------------------------------------------------------------------- 1 | // CpuCounter.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/07/13 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Diagnostics; 12 | using System.Timers; 13 | using Net.Bertware.Bukkitgui2.Core.Logging; 14 | 15 | namespace Net.Bertware.Bukkitgui2.Core.Util.Performance 16 | { 17 | /// 18 | /// Provide information over total, used, available memory 19 | /// 20 | public class CpuCounter 21 | { 22 | private const int Interval = 333; 23 | private readonly int _pid; 24 | private Int32 _value; 25 | 26 | private static readonly int Cores = 27 | Convert.ToInt16(Wmi.GetprocessorInfo(Wmi.ProcessorProp.NumberOfLogicalProcessors)); 28 | 29 | private Timer _updateTimer; 30 | 31 | private PerformanceCounter _counter; 32 | 33 | public CpuCounter() 34 | { 35 | Initialize(); 36 | } 37 | 38 | public CpuCounter(int pid) 39 | { 40 | _pid = pid; 41 | Initialize(); 42 | } 43 | 44 | private void Initialize() 45 | { 46 | try 47 | { 48 | if (_pid == 0) 49 | { 50 | _counter = new PerformanceCounter("Processor", "% Processor Time", "_Total"); 51 | } 52 | else 53 | { 54 | _counter = new PerformanceCounter("Process", "% Processor Time", 55 | Process.GetProcessById(_pid).ProcessName); 56 | } 57 | 58 | 59 | _updateTimer = new Timer(Interval) {AutoReset = true}; 60 | _updateTimer.Elapsed += OnTimerElapsed; 61 | _updateTimer.Start(); 62 | } 63 | catch (Exception exception) 64 | { 65 | Logger.Log(LogLevel.Severe, "CpuCounter", "Failed to initialize CpuCounter", exception.Message); 66 | } 67 | } 68 | 69 | private void OnTimerElapsed(object sender, ElapsedEventArgs e) 70 | { 71 | UpdateStats(); 72 | } 73 | 74 | public void UpdateStats() 75 | { 76 | try 77 | { 78 | if (_pid != 0 && Process.GetProcessById(_pid).HasExited) 79 | { 80 | _value = 0; 81 | Disable(); 82 | return; 83 | } 84 | _value = Convert.ToInt16(_counter.NextValue()); 85 | if (_pid != 0) _value = _value/Cores; 86 | } 87 | catch (Exception exception) 88 | { 89 | _value = 0; 90 | Logger.Log(LogLevel.Warning, "CpuCounter", "Failed to update CpuCounter values", exception.Message); 91 | } 92 | } 93 | 94 | public int CpuUsage 95 | { 96 | get 97 | { 98 | if (_value > 100) return 100; 99 | return _value; 100 | } 101 | } 102 | 103 | 104 | public void Enable() 105 | { 106 | if (_updateTimer != null) _updateTimer.Enabled = true; 107 | } 108 | 109 | public void Disable() 110 | { 111 | _value = 0; 112 | if (_updateTimer != null) _updateTimer.Enabled = false; 113 | } 114 | } 115 | } -------------------------------------------------------------------------------- /bukkitgui2/AddOn/Backup/BackupTab.cs: -------------------------------------------------------------------------------- 1 | // BackupTab.cs in bukkitgui2/bukkitgui2 2 | // Created 2014/01/17 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.Windows.Forms; 12 | using MetroFramework.Controls; 13 | using Net.Bertware.Bukkitgui2.Core.Logging; 14 | using Net.Bertware.Bukkitgui2.Core.Util; 15 | 16 | namespace Net.Bertware.Bukkitgui2.AddOn.Backup 17 | { 18 | public partial class BackupTab : MetroUserControl, IAddonTab 19 | { 20 | public BackupTab() 21 | { 22 | InitializeComponent(); 23 | Backup.Reference.BackupsLoaded += UpdateUi; 24 | } 25 | 26 | public IAddon ParentAddon { get; set; } 27 | 28 | public void UpdateUi() 29 | { 30 | if (!Backup.Reference.Loaded) return; 31 | 32 | try 33 | { 34 | if (InvokeRequired) 35 | { 36 | Invoke((MethodInvoker) UpdateUi); 37 | } 38 | else 39 | { 40 | SlvBackups.Items.Clear(); 41 | foreach (BackupDefenition backup in Backup.Reference.Backups.Values) 42 | { 43 | ListViewItem lvi = new ListViewItem( 44 | new[] 45 | { 46 | backup.Name, 47 | StringUtil.ListToCsv(backup.Folders), 48 | backup.TargetDirectory, 49 | backup.Compression.ToString() 50 | }) {Tag = backup}; 51 | SlvBackups.Items.Add(lvi); 52 | } 53 | } 54 | } 55 | catch (Exception ex) 56 | { 57 | Logger.Log(LogLevel.Severe, "mainform", "Severe exception in Backupmanager_UpdateUI! " + ex.Message, 58 | "mainform"); 59 | } 60 | } 61 | 62 | private void BtnBackupAdd_Click(Object sender, EventArgs e) 63 | { 64 | BackupDialog bd = new BackupDialog(); 65 | if (bd.ShowDialog() == DialogResult.OK) 66 | Backup.Reference.AddBackupToXml(bd.Defenition); 67 | UpdateUi(); 68 | } 69 | 70 | private void BtnBackupEdit_Click(Object sender, EventArgs e) 71 | { 72 | if (SlvBackups.SelectedItems.Count < 1 || SlvBackups.SelectedItems[0] == null) 73 | return; 74 | BackupDefenition backup = Backup.Reference.GetBackupByName(SlvBackups.SelectedItems[0].SubItems[0].Text); 75 | BackupDialog bd = new BackupDialog(backup); 76 | if (bd.ShowDialog() == DialogResult.OK) 77 | Backup.Reference.SaveBackup(backup, bd.Defenition); 78 | UpdateUi(); 79 | } 80 | 81 | private void BtnBackupRemove_Click(Object sender, EventArgs e) 82 | { 83 | if (SlvBackups.SelectedItems.Count < 1 || SlvBackups.SelectedItems[0] == null) 84 | return; 85 | BackupDefenition backup = Backup.Reference.GetBackupByName(SlvBackups.SelectedItems[0].SubItems[0].Text); 86 | Backup.Reference.DeleteBackup(backup); 87 | UpdateUi(); 88 | } 89 | 90 | private void BtnBackupExecute_Click(Object sender, EventArgs e) 91 | { 92 | if (SlvBackups.SelectedItems.Count < 1 || SlvBackups.SelectedItems[0] == null) 93 | return; 94 | BackupDefenition backup = Backup.Reference.GetBackupByName(SlvBackups.SelectedItems[0].SubItems[0].Text); 95 | backup.Execute(); 96 | } 97 | } 98 | } -------------------------------------------------------------------------------- /JsonApiConnector/Program.cs: -------------------------------------------------------------------------------- 1 | // Program.cs in bukkitgui2/JsonApiConnector 2 | // Created 2014/02/05 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 5 | // If a copy of the MPL was not distributed with this file, 6 | // you can obtain one at http://mozilla.org/MPL/2.0/. 7 | // 8 | // ©Bertware, visit http://bertware.net 9 | 10 | using System; 11 | using System.IO; 12 | using System.Reflection; 13 | using System.Threading; 14 | 15 | namespace Net.Bertware.JsonApiConnector 16 | { 17 | /// 18 | /// Emulate a local server (standardin,standardout) by connecting to a remote Jsonapi server 19 | /// 20 | internal class Program 21 | { 22 | private static JsonApiConnector _connector; 23 | public static Boolean ThreadsRunning = true; 24 | 25 | private static void Main(string[] args) 26 | { 27 | // Load embedded DLLs 28 | AppDomain.CurrentDomain.AssemblyResolve += LoadDll; 29 | 30 | _connector = new JsonApiConnector(args); 31 | _connector.OutputReceived += TextReceived; 32 | 33 | Thread t; 34 | if (_connector.ShowConsole) 35 | { 36 | t = new Thread(ScanInput) {Name = "thd_ScanInput", IsBackground = true}; 37 | t.Start(); 38 | } 39 | else 40 | { 41 | t = new Thread(ScanStdIn) {Name = "thd_ScanStdIn", IsBackground = true}; 42 | t.Start(); 43 | } 44 | _connector.Connect(); 45 | while (_connector.Api.IsListening()) 46 | { 47 | Thread.Sleep(10); 48 | } 49 | } 50 | 51 | private static void TextReceived(string text) 52 | { 53 | Console.Out.WriteLine(text); 54 | //Console.WriteLine(text); 55 | } 56 | 57 | private static void ScanInput() 58 | { 59 | while (ThreadsRunning) 60 | { 61 | string input = Console.In.ReadLine(); 62 | _connector.Api.SendConsoleCommand(input); 63 | } 64 | } 65 | 66 | private static void ScanStdIn() 67 | { 68 | while (ThreadsRunning) 69 | { 70 | string input = Console.In.ReadLine(); 71 | _connector.Api.SendConsoleCommand(input); 72 | } 73 | } 74 | 75 | public static Assembly LoadDll(object sender, ResolveEventArgs args) 76 | { 77 | //Load embedded DLLs 78 | 79 | String resourceName = "Net.Bertware.JsonApiConnector." + new AssemblyName(args.Name).Name + ".dll"; 80 | using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)) 81 | { 82 | if (stream == null || stream.Length < 1) 83 | { 84 | return null; 85 | } 86 | Byte[] assemblyData = new Byte[stream.Length]; 87 | stream.Read(assemblyData, 0, assemblyData.Length); 88 | return Assembly.Load(assemblyData); 89 | } 90 | } 91 | } 92 | } --------------------------------------------------------------------------------