SecondBot/BetterSecondbot/HttpService/Estate.cs
Madpeterz 186263c20e New stuff,Fixs and API changes
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
2021-02-15 06:12:43 +00:00

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");
}
}
}