Added /world/read
This commit is contained in:
parent
dc6ef8e059
commit
04b9fef4d1
1 changed files with 15 additions and 0 deletions
|
|
@ -25,6 +25,8 @@ namespace TShockAPI {
|
|||
Rest.Register(new RestCommand("/users/update/{user}", UserUpdate) {RequiesToken = true});
|
||||
|
||||
Rest.Register(new RestCommand("/lists/players", UserList) {RequiesToken = true});
|
||||
|
||||
Rest.Register(new RestCommand("/world/read", WorldRead) { RequiesToken = true });
|
||||
//RegisterExamples();
|
||||
}
|
||||
|
||||
|
|
@ -155,6 +157,19 @@ namespace TShockAPI {
|
|||
return returnBlock;
|
||||
}
|
||||
|
||||
object WorldRead(RestVerbs verbs, IParameterCollection parameters)
|
||||
{
|
||||
var returnBlock = new Dictionary<string, string>();
|
||||
returnBlock.Add("status", "200");
|
||||
returnBlock.Add("name", Main.worldName);
|
||||
returnBlock.Add("size", Main.maxTilesX + "*" + Main.maxTilesY);
|
||||
returnBlock.Add("time", Main.time.ToString());
|
||||
returnBlock.Add("daytime", Main.dayTime.ToString());
|
||||
returnBlock.Add("bloodmoon", Main.bloodMoon.ToString());
|
||||
returnBlock.Add("invasionsize", Main.invasionSize.ToString());
|
||||
return returnBlock;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region RestExampleMethods
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue