From 81797667e93aab15838ed83a5faefba2a41350c9 Mon Sep 17 00:00:00 2001 From: high Date: Tue, 6 Sep 2011 01:23:49 -0400 Subject: [PATCH] Changed RestObject dictionary value to object so you can add things besides strings. --- TShockAPI/Rest/RestObject.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TShockAPI/Rest/RestObject.cs b/TShockAPI/Rest/RestObject.cs index fcc21e6a..eb0631d9 100644 --- a/TShockAPI/Rest/RestObject.cs +++ b/TShockAPI/Rest/RestObject.cs @@ -4,21 +4,21 @@ using System.Collections.Generic; namespace Rests { [Serializable] - public class RestObject : Dictionary + public class RestObject : Dictionary { public string Status { - get { return this["status"]; } + get { return this["status"] as string; } set { this["status"] = value; } } public string Error { - get { return this["error"]; } + get { return this["error"] as string; } set { this["error"] = value; } } public string Response { - get { return this["response"]; } + get { return this["response"] as string; } set { this["response"] = value; } } @@ -33,11 +33,11 @@ namespace Rests /// /// /// Returns null if key does not exist. - public new string this[string key] + public new object this[string key] { get { - string ret; + object ret; if (TryGetValue(key, out ret)) return ret; return null;