From bfc9ad98fb422dd838ad38d2cc438b0d00decc88 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sun, 1 Jan 2012 15:55:48 -0700 Subject: [PATCH] Fixed the REST kick endpoint expecting a player parameter as opposed to a verb --- TShockAPI/Log.cs | 1 + TShockAPI/Rest/RestManager.cs | 2 +- TShockAPI/TShock.cs | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Log.cs b/TShockAPI/Log.cs index 4f743334..4bbd05ac 100644 --- a/TShockAPI/Log.cs +++ b/TShockAPI/Log.cs @@ -22,6 +22,7 @@ using System.IO; namespace TShockAPI { + [Flags] public enum LogLevel { None = 0, diff --git a/TShockAPI/Rest/RestManager.cs b/TShockAPI/Rest/RestManager.cs index 0e30d4bc..d9c21c1f 100644 --- a/TShockAPI/Rest/RestManager.cs +++ b/TShockAPI/Rest/RestManager.cs @@ -398,7 +398,7 @@ namespace TShockAPI private object PlayerKick(RestVerbs verbs, IParameterCollection parameters) { var returnBlock = new Dictionary(); - var playerParam = parameters["player"]; + var playerParam = verbs["player"]; var found = TShock.Utils.FindPlayer(playerParam); var reason = verbs["reason"]; if (found.Count == 0) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index c9d1497e..39af00a7 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -21,6 +21,7 @@ using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Globalization; using System.IO; using System.Net; using System.Reflection; @@ -121,7 +122,7 @@ namespace TShockAPI "TShock was improperly shut down. Please avoid this in the future, world corruption may result from this."); File.Delete(Path.Combine(SavePath, "tshock.pid")); } - File.WriteAllText(Path.Combine(SavePath, "tshock.pid"), Process.GetCurrentProcess().Id.ToString()); + File.WriteAllText(Path.Combine(SavePath, "tshock.pid"), Process.GetCurrentProcess().Id.ToString(CultureInfo.InvariantCulture)); ConfigFile.ConfigRead += OnConfigRead; FileTools.SetupConfig();