diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 37a7e664..d26ac5f6 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -20,16 +20,13 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; -using System.Net; using System.Text; using System.Threading; using TShockAPI.PluginUpdater; using Terraria; using TShockAPI.DB; -using System.Reflection; namespace TShockAPI { diff --git a/TShockAPI/DB/BanManager.cs b/TShockAPI/DB/BanManager.cs index 92d6b058..ddcd4d8e 100644 --- a/TShockAPI/DB/BanManager.cs +++ b/TShockAPI/DB/BanManager.cs @@ -19,7 +19,6 @@ along with this program. If not, see . using System; using System.Collections.Generic; using System.Data; -using System.IO; using MySql.Data.MySqlClient; namespace TShockAPI.DB diff --git a/TShockAPI/DB/GroupManager.cs b/TShockAPI/DB/GroupManager.cs index e65870d0..ab9fe61d 100644 --- a/TShockAPI/DB/GroupManager.cs +++ b/TShockAPI/DB/GroupManager.cs @@ -21,7 +21,6 @@ using System.Collections; using System.Collections.Generic; using System.Data; using System.Diagnostics; -using System.IO; using System.Linq; using MySql.Data.MySqlClient; diff --git a/TShockAPI/DB/ItemManager.cs b/TShockAPI/DB/ItemManager.cs index 26d2ae5a..b95bd886 100644 --- a/TShockAPI/DB/ItemManager.cs +++ b/TShockAPI/DB/ItemManager.cs @@ -19,7 +19,6 @@ along with this program. If not, see . using System; using System.Collections.Generic; using System.Data; -using System.IO; using System.Linq; using MySql.Data.MySqlClient; diff --git a/TShockAPI/DB/RegionManager.cs b/TShockAPI/DB/RegionManager.cs index f6cb9e03..f9cce5c8 100644 --- a/TShockAPI/DB/RegionManager.cs +++ b/TShockAPI/DB/RegionManager.cs @@ -19,10 +19,7 @@ along with this program. If not, see . using System; using System.Collections.Generic; using System.Data; -using System.Diagnostics.CodeAnalysis; -using System.IO; using System.Linq; -using System.Xml; using MySql.Data.MySqlClient; using Terraria; diff --git a/TShockAPI/DB/UserManager.cs b/TShockAPI/DB/UserManager.cs index 9b08c1e8..fdb3cdf5 100644 --- a/TShockAPI/DB/UserManager.cs +++ b/TShockAPI/DB/UserManager.cs @@ -18,7 +18,6 @@ along with this program. If not, see . using System; using System.Data; -using System.IO; using System.Collections.Generic; using System.Linq; using MySql.Data.MySqlClient; diff --git a/TShockAPI/HandlerList.cs b/TShockAPI/HandlerList.cs index 2ea21453..128e6c5e 100644 --- a/TShockAPI/HandlerList.cs +++ b/TShockAPI/HandlerList.cs @@ -20,7 +20,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; -using System.Text; namespace TShockAPI { diff --git a/TShockAPI/Hooks/GeneralHooks.cs b/TShockAPI/Hooks/GeneralHooks.cs index e2631e11..f84efabd 100644 --- a/TShockAPI/Hooks/GeneralHooks.cs +++ b/TShockAPI/Hooks/GeneralHooks.cs @@ -15,10 +15,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace TShockAPI.Hooks { diff --git a/TShockAPI/Hooks/PlayerHooks.cs b/TShockAPI/Hooks/PlayerHooks.cs index 6d593473..047fca50 100644 --- a/TShockAPI/Hooks/PlayerHooks.cs +++ b/TShockAPI/Hooks/PlayerHooks.cs @@ -15,11 +15,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -using System; + using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; namespace TShockAPI.Hooks { diff --git a/TShockAPI/PaginationTools.cs b/TShockAPI/PaginationTools.cs index 2fadce7c..e64d3e2a 100644 --- a/TShockAPI/PaginationTools.cs +++ b/TShockAPI/PaginationTools.cs @@ -19,7 +19,6 @@ along with this program. If not, see . using System; using System.Collections; using System.Collections.Generic; -using System.Linq; using System.Text; namespace TShockAPI diff --git a/TShockAPI/PluginUpdater/PluginUpdaterThread.cs b/TShockAPI/PluginUpdater/PluginUpdaterThread.cs index 4e4c8134..b77a1370 100644 --- a/TShockAPI/PluginUpdater/PluginUpdaterThread.cs +++ b/TShockAPI/PluginUpdater/PluginUpdaterThread.cs @@ -16,10 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; using System.Threading; using Terraria; diff --git a/TShockAPI/PluginUpdater/PluginVersionCheck.cs b/TShockAPI/PluginUpdater/PluginVersionCheck.cs index 3deddee7..61858af8 100644 --- a/TShockAPI/PluginUpdater/PluginVersionCheck.cs +++ b/TShockAPI/PluginUpdater/PluginVersionCheck.cs @@ -18,9 +18,7 @@ along with this program. If not, see . using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Net; -using System.Text; using JsonLoader; using Newtonsoft.Json; diff --git a/TShockAPI/PluginUpdater/VersionInfo.cs b/TShockAPI/PluginUpdater/VersionInfo.cs index a4966090..4dd061b3 100644 --- a/TShockAPI/PluginUpdater/VersionInfo.cs +++ b/TShockAPI/PluginUpdater/VersionInfo.cs @@ -17,8 +17,6 @@ along with this program. If not, see . */ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; namespace JsonLoader { diff --git a/TShockAPI/Resources.Designer.cs b/TShockAPI/Resources.Designer.cs index fd3fcd96..d22d260b 100644 --- a/TShockAPI/Resources.Designer.cs +++ b/TShockAPI/Resources.Designer.cs @@ -27,9 +27,6 @@ along with this program. If not, see . //------------------------------------------------------------------------------ namespace TShockAPI { - using System; - - /// /// A strongly-typed resource class, for looking up localized strings, etc. /// diff --git a/TShockAPI/Rest/RestManager.cs b/TShockAPI/Rest/RestManager.cs index 44b33594..50c442cb 100644 --- a/TShockAPI/Rest/RestManager.cs +++ b/TShockAPI/Rest/RestManager.cs @@ -300,8 +300,8 @@ namespace TShockAPI return RestMissingParam("user"); var group = parameters["group"]; - if (string.IsNullOrWhiteSpace(group)) - return RestMissingParam("group"); + if (string.IsNullOrWhiteSpace(group)) + group = TShock.Config.DefaultRegistrationGroupName; var password = parameters["password"]; if (string.IsNullOrWhiteSpace(password)) diff --git a/TShockAPI/Rest/RestPermissions.cs b/TShockAPI/Rest/RestPermissions.cs index 484291bd..c602370f 100644 --- a/TShockAPI/Rest/RestPermissions.cs +++ b/TShockAPI/Rest/RestPermissions.cs @@ -16,9 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -using System; using System.ComponentModel; -using System.Linq; namespace Rests { diff --git a/TShockAPI/Rest/SecureRest.cs b/TShockAPI/Rest/SecureRest.cs index 2edf3013..d53915aa 100644 --- a/TShockAPI/Rest/SecureRest.cs +++ b/TShockAPI/Rest/SecureRest.cs @@ -20,7 +20,6 @@ using System; using System.Collections.Generic; using System.Linq; using System.Net; -using System.Text; using HttpServer; using TShockAPI; using TShockAPI.DB; @@ -55,7 +54,7 @@ namespace Rests } // TODO: Get rid of this when the old REST permission model is removed. - if (!TShock.Config.RestUseNewPermissionModel) + if (TShock.Config.RestApiEnabled && !TShock.Config.RestUseNewPermissionModel) { string warningMessage = string.Concat( "You're using the old REST permission model which is highly vulnerable in matter of security. ", @@ -67,7 +66,7 @@ namespace Rests Console.WriteLine(warningMessage); Console.ForegroundColor = ConsoleColor.Gray; } - else + else if (TShock.Config.RestApiEnabled) { string warningMessage = string.Concat( "You're using the new more secure REST permission model which can lead to compatibility problems ", diff --git a/TShockAPI/SaveManager.cs b/TShockAPI/SaveManager.cs index 9accad28..7e0b0b57 100644 --- a/TShockAPI/SaveManager.cs +++ b/TShockAPI/SaveManager.cs @@ -19,7 +19,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Threading; -using System.Diagnostics; using Terraria; namespace TShockAPI diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index f45262f4..0b3f411f 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -26,7 +26,6 @@ using System.Globalization; using System.IO; using System.Net; using System.Reflection; -using System.Threading; using Hooks; using MaxMind; using Mono.Data.Sqlite; diff --git a/TShockAPI/TShockAPI.csproj b/TShockAPI/TShockAPI.csproj index ab4c32bf..bba42947 100644 --- a/TShockAPI/TShockAPI.csproj +++ b/TShockAPI/TShockAPI.csproj @@ -61,22 +61,14 @@ ..\SqlBins\MySql.Data.dll True - - False - ..\SqlBins\MySql.Web.dll - True - .\Newtonsoft.Json.dll - - - - - - + + False + .exe ..\TerrariaServerBins\TerrariaServer.exe @@ -187,7 +179,8 @@ - "$(ProjectDir)postbuild.bat" + + diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index 98766036..5a7483a4 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -24,7 +24,6 @@ using System.Net; using System.Net.Sockets; using System.Security.Cryptography; using System.Text; -using TShockAPI.DB; using Terraria; namespace TShockAPI diff --git a/TerrariaServerBins/TerrariaServer.exe b/TerrariaServerBins/TerrariaServer.exe index 65df1f35..c9081b0e 100644 Binary files a/TerrariaServerBins/TerrariaServer.exe and b/TerrariaServerBins/TerrariaServer.exe differ