Fixed wiki make I hope HTTP api "ParcelEstate" split into Parcel, Estate ready for more later Datastorage event class for stuff (currently only Estate bans) Class renamed from CliExitOnLogout to Cli. Events moved from athome to Events, and the old Athome renamed attachable
32 lines
863 B
C#
32 lines
863 B
C#
using BetterSecondBotShared.Json;
|
|
using BetterSecondBot.bottypes;
|
|
using EmbedIO;
|
|
using EmbedIO.Routing;
|
|
using System;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace BetterSecondBot.HttpService
|
|
{
|
|
|
|
|
|
|
|
public class HttpAPIEstate : WebApiControllerWithTokens
|
|
{
|
|
public HttpAPIEstate(SecondBot mainbot, TokenStorage setuptokens) : base(mainbot, setuptokens)
|
|
{
|
|
|
|
}
|
|
|
|
[About("Requests the estate banlist")]
|
|
[ReturnHints("")]
|
|
[Route(HttpVerbs.Get, "/banlist/{token}")]
|
|
public Object Banlist(string token)
|
|
{
|
|
if (tokens.Allow(token, "estate", "banlist", getClientIP()) == true)
|
|
{
|
|
return BasicReply(JsonConvert.SerializeObject(bot._lastUpdatedSimBlacklist));
|
|
}
|
|
return BasicReply("Token not accepted");
|
|
}
|
|
}
|
|
}
|