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
This commit is contained in:
parent
d9fd10fe23
commit
186263c20e
15 changed files with 274 additions and 145 deletions
|
|
@ -9,7 +9,7 @@ namespace BetterSecondbot.BetterAtHome
|
|||
{
|
||||
public class BetterAtHome
|
||||
{
|
||||
protected CliExitOnLogout controler = null;
|
||||
protected Cli controler = null;
|
||||
protected JsonConfig configfile;
|
||||
|
||||
protected bool LoginFailed = false;
|
||||
|
|
@ -21,7 +21,7 @@ namespace BetterSecondbot.BetterAtHome
|
|||
protected long LastTeleportEvent = 0;
|
||||
protected List<string> homeRegions = new List<string>();
|
||||
|
||||
public BetterAtHome(CliExitOnLogout setcontroler, JsonConfig configfile)
|
||||
public BetterAtHome(Cli setcontroler, JsonConfig configfile)
|
||||
{
|
||||
controler = setcontroler;
|
||||
this.configfile = configfile;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace BetterSecondBot.BetterRelayService
|
|||
public class BetterRelay
|
||||
{
|
||||
Discord_super superV = null;
|
||||
CliExitOnLogout controler = null;
|
||||
Cli controler = null;
|
||||
|
||||
List<relay_config> DiscordRelay = new List<relay_config>();
|
||||
List<relay_config> LocalchatRelay = new List<relay_config>();
|
||||
|
|
@ -24,7 +24,7 @@ namespace BetterSecondBot.BetterRelayService
|
|||
List<relay_config> AvatarIMRelay = new List<relay_config>();
|
||||
List<relay_config> GroupChatRelay = new List<relay_config>();
|
||||
|
||||
public BetterRelay(CliExitOnLogout setcontroler, Discord_super setdiscord, bool running_in_docker)
|
||||
public BetterRelay(Cli setcontroler, Discord_super setdiscord, bool running_in_docker)
|
||||
{
|
||||
controler = setcontroler;
|
||||
superV = setdiscord;
|
||||
|
|
|
|||
|
|
@ -6,15 +6,17 @@ using BetterSecondBot.bottypes;
|
|||
using System.Threading;
|
||||
using static BetterSecondBot.Program;
|
||||
using BetterSecondbot.BetterAtHome;
|
||||
using BetterSecondbot.DataStorage;
|
||||
|
||||
namespace BetterSecondBot
|
||||
{
|
||||
public class CliExitOnLogout
|
||||
public class Cli
|
||||
{
|
||||
public bool Exited { get { return exitBot; } }
|
||||
protected bool exitBot = false;
|
||||
public SecondBot Bot;
|
||||
protected BetterAtHome betterAtHomeService;
|
||||
protected Datastorage datastorage;
|
||||
|
||||
protected void keep_alive()
|
||||
{
|
||||
|
|
@ -30,35 +32,37 @@ namespace BetterSecondBot
|
|||
Bot.Log2File(LogFormater.Status(Bot.LastStatusMessage, false), ConsoleLogLogLevel.Status);
|
||||
}
|
||||
}
|
||||
Thread.Sleep(1000);
|
||||
Thread.Sleep(1500);
|
||||
}
|
||||
betterAtHomeService = null;
|
||||
}
|
||||
public CliExitOnLogout(JsonConfig Config, bool as_docker, bool use_self_keep_alive)
|
||||
|
||||
public void attachEventListenerObjects(JsonConfig Config, bool as_docker)
|
||||
{
|
||||
if (Config.Http_Enable == true)
|
||||
{
|
||||
new Thread(() =>
|
||||
{
|
||||
new HttpAsService(Bot, Config, as_docker);
|
||||
}).Start();
|
||||
}
|
||||
betterAtHomeService = new BetterAtHome(this, Config);
|
||||
datastorage = new Datastorage(this);
|
||||
}
|
||||
public Cli(JsonConfig Config, bool as_docker, bool use_self_keep_alive)
|
||||
{
|
||||
exitBot = false;
|
||||
LogFormater.Status("Mode: Cli [Basic]");
|
||||
if (helpers.botRequired(Config) == true)
|
||||
{
|
||||
Bot = new SecondBot();
|
||||
Bot.Setup(Config, AssemblyInfo.GetGitHash());
|
||||
betterAtHomeService = new BetterAtHome(this, Config);
|
||||
|
||||
if (as_docker == true)
|
||||
{
|
||||
Bot.AsDocker();
|
||||
}
|
||||
Bot.Start();
|
||||
if (Config.Http_Enable == true)
|
||||
{
|
||||
/*
|
||||
SecondBotHttpServer my_http_server = new SecondBotHttpServer();
|
||||
my_http_server.StartHttpServer(Bot, Config);
|
||||
*/
|
||||
new Thread(() =>
|
||||
{
|
||||
new HttpAsService(Bot, Config, as_docker);
|
||||
}).Start();
|
||||
}
|
||||
attachEventListenerObjects(Config, as_docker);
|
||||
if(use_self_keep_alive == true)
|
||||
{
|
||||
keep_alive();
|
||||
80
BetterSecondbot/DataStorage/Datastorage.cs
Normal file
80
BetterSecondbot/DataStorage/Datastorage.cs
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
using BetterSecondBot;
|
||||
using BetterSecondBotShared.Static;
|
||||
using OpenMetaverse;
|
||||
using BetterSecondBot.bottypes;
|
||||
|
||||
namespace BetterSecondbot.DataStorage
|
||||
{
|
||||
public class Datastorage
|
||||
{
|
||||
protected Cli controler = null;
|
||||
|
||||
public Datastorage(Cli setcontroler)
|
||||
{
|
||||
controler = setcontroler;
|
||||
attach_events();
|
||||
}
|
||||
|
||||
protected void attach_events()
|
||||
{
|
||||
controler.Bot.GetClient.Estate.EstateBansReply += EstateBansReply;
|
||||
controler.Bot.ChangeSimEvent += ChangedSim;
|
||||
controler.Bot.LoginProgess += LoginProcess;
|
||||
controler.Bot.StatusMessageEvent += StatusPing;
|
||||
}
|
||||
|
||||
protected void StatusPing(object o, StatusMessageEvent e)
|
||||
{
|
||||
if(simname != "")
|
||||
{
|
||||
if (controler.Bot.GetClient.Network.CurrentSim.IsEstateManager == true)
|
||||
{
|
||||
long dif = helpers.UnixTimeNow() - controler.Bot._lastUpdatedSimBlacklist.lastupdated;
|
||||
if(dif > 120)
|
||||
{
|
||||
controler.Bot.GetClient.Estate.RequestInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void LoginProcess(object o, LoginProgressEventArgs e)
|
||||
{
|
||||
simname = "";
|
||||
if (e.Status == LoginStatus.Success)
|
||||
{
|
||||
ChangedSim(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
protected string simname = "";
|
||||
protected void ChangedSim(object o, SimChangedEventArgs e)
|
||||
{
|
||||
simname = "";
|
||||
if (controler.Bot.GetClient.Network.CurrentSim != null)
|
||||
{
|
||||
simname = controler.Bot.GetClient.Network.CurrentSim.Name;
|
||||
}
|
||||
if(simname != "")
|
||||
{
|
||||
if(controler.Bot.GetClient.Network.CurrentSim.IsEstateManager == true)
|
||||
{
|
||||
controler.Bot.GetClient.Estate.RequestInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void EstateBansReply(object o, EstateBansReplyEventArgs e)
|
||||
{
|
||||
simBlacklistDataset working = new simBlacklistDataset();
|
||||
working.lastupdated = helpers.UnixTimeNow();
|
||||
foreach(UUID av in e.Banned)
|
||||
{
|
||||
working.banned.Add(av,controler.Bot.FindAvatarKey2Name(av));
|
||||
}
|
||||
working.regionname = controler.Bot.GetClient.Network.CurrentSim.Name;
|
||||
controler.Bot.UpdateSimBlacklist(working);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@ namespace BetterSecondBot.DiscordSupervisor
|
|||
}
|
||||
}
|
||||
}
|
||||
Thread.Sleep(1000);
|
||||
Thread.Sleep(1500);
|
||||
}
|
||||
}
|
||||
public Discord_super(JsonConfig configfile, bool as_docker)
|
||||
|
|
@ -82,7 +82,7 @@ namespace BetterSecondBot.DiscordSupervisor
|
|||
controler.Bot.KillMePlease();
|
||||
controler = null;
|
||||
}
|
||||
controler = new CliExitOnLogout(myconfig, running_as_docker, self_keep_alive);
|
||||
controler = new Cli(myconfig, running_as_docker, self_keep_alive);
|
||||
controler.Bot.setDiscordClient(DiscordClient);
|
||||
relayService = new BetterRelay(controler, this, running_as_docker);
|
||||
attach_events();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace BetterSecondBot.DiscordSupervisor
|
|||
{
|
||||
protected JsonConfig myconfig;
|
||||
protected bool exit_super = false;
|
||||
protected CliExitOnLogout controler;
|
||||
protected Cli controler;
|
||||
protected bool running_as_docker = false;
|
||||
|
||||
protected bool discord_group_relay;
|
||||
|
|
|
|||
32
BetterSecondbot/HttpService/Estate.cs
Normal file
32
BetterSecondbot/HttpService/Estate.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -189,8 +189,11 @@ namespace BetterSecondBot.HttpService
|
|||
.WithWebApi("/core", m => m
|
||||
.WithController(() => new HttpApiCore(Config, Bot, Tokens))
|
||||
)
|
||||
.WithWebApi("/parcelestate", m => m
|
||||
.WithController(() => new HttpApiParcelEstate(Bot,Tokens))
|
||||
.WithWebApi("/parcel", m => m
|
||||
.WithController(() => new HttpApiParcel(Bot,Tokens))
|
||||
)
|
||||
.WithWebApi("/estate", m => m
|
||||
.WithController(() => new HttpAPIEstate(Bot, Tokens))
|
||||
)
|
||||
.WithModule(new ActionModule("/", HttpVerbs.Any, ctx => ctx.SendDataAsync(new { Message = "Error" })));
|
||||
return server;
|
||||
|
|
|
|||
|
|
@ -12,18 +12,18 @@ using static OpenMetaverse.ParcelManager;
|
|||
|
||||
namespace BetterSecondBot.HttpService
|
||||
{
|
||||
class HttpApiParcelEstate: WebApiControllerWithTokens
|
||||
class HttpApiParcel : WebApiControllerWithTokens
|
||||
{
|
||||
public HttpApiParcelEstate(SecondBot mainbot, TokenStorage setuptokens) : base(mainbot, setuptokens) { }
|
||||
public HttpApiParcel(SecondBot mainbot, TokenStorage setuptokens) : base(mainbot, setuptokens) { }
|
||||
|
||||
[About("Fetchs the parcel ban list of the parcel the bot is currently on<br/>If the name returned is lookup the bot is currently requesting the avatar name")]
|
||||
[ReturnHints("array of UUID=Name")]
|
||||
[ReturnHints("Error not in a sim")]
|
||||
[ReturnHints("Parcel data not ready")]
|
||||
[Route(HttpVerbs.Get, "/parcelbanlist/{token}")]
|
||||
[Route(HttpVerbs.Get, "/banlist/{token}")]
|
||||
public object parcelbanlist(string token)
|
||||
{
|
||||
if (tokens.Allow(token, "parcelestate", "parcelbanlist", getClientIP()) == true)
|
||||
if (tokens.Allow(token, "parcel", "banlist", getClientIP()) == true)
|
||||
{
|
||||
if (bot.GetClient.Network.CurrentSim != null)
|
||||
{
|
||||
|
|
@ -174,7 +174,7 @@ namespace BetterSecondBot.WikiMake
|
|||
sb.Replace("[[SUBFOLDER]]", "");
|
||||
sb.Replace("[[RETURNROOT]]", "../");
|
||||
sb = DebugModeCreateWiki.MenuActive(sb, area);
|
||||
string target_file = "" + area + "" + workspace + "" + c.ToLowerInvariant() + ".html";
|
||||
string target_file = "" + area + "" + workspace + "" + c + ".html";
|
||||
io.writefile(target_file, sb.ToString());
|
||||
}
|
||||
}
|
||||
|
|
@ -392,9 +392,6 @@ namespace BetterSecondBot.WikiMake
|
|||
}
|
||||
sb.Append("</ul>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
sb = DebugModeCreateWiki.MenuActive(sb, area);
|
||||
sb.Append(html_footer);
|
||||
sb.Replace("[[COMMAND]]", c);
|
||||
|
|
@ -566,7 +563,8 @@ namespace BetterSecondBot.WikiMake
|
|||
createEndpoint("im", typeof(HttpApiIM));
|
||||
createEndpoint("groups", typeof(HttpApiGroup));
|
||||
createEndpoint("chat", typeof(HttpApiLocalchat));
|
||||
createEndpoint("parcelestate", typeof(HttpApiParcelEstate));
|
||||
createEndpoint("parcel", typeof(HttpApiParcel));
|
||||
createEndpoint("estate", typeof(HttpAPIEstate));
|
||||
}
|
||||
|
||||
public string getCommandMethod(string endpoint, string command)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ using System.Text;
|
|||
|
||||
namespace BetterSecondBot.bottypes
|
||||
{
|
||||
public abstract class AVstorageBot : AtHome
|
||||
public abstract class AVstorageBot : AttachableBot
|
||||
{
|
||||
protected UUID master_uuid = UUID.Zero;
|
||||
public UUID getMaster_uuid { get { return master_uuid; } }
|
||||
|
|
|
|||
66
Core/bottypes/AttachableBot.cs
Normal file
66
Core/bottypes/AttachableBot.cs
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
using System;
|
||||
using OpenMetaverse;
|
||||
using BetterSecondBotShared.Static;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BetterSecondBot.bottypes
|
||||
{
|
||||
public class NextHomeRegionArgs: EventArgs
|
||||
{
|
||||
}
|
||||
|
||||
public abstract class AttachableBot : MessageSwitcherBot
|
||||
{
|
||||
protected string BetterAtHomeAction = "";
|
||||
|
||||
protected simBlacklistDataset lastUpdatedSimBlacklist = new simBlacklistDataset();
|
||||
public simBlacklistDataset _lastUpdatedSimBlacklist { get { return lastUpdatedSimBlacklist; } }
|
||||
|
||||
public void UpdateSimBlacklist(simBlacklistDataset current)
|
||||
{
|
||||
lastUpdatedSimBlacklist = current;
|
||||
}
|
||||
|
||||
public void ResetAtHome()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void SetBetterAtHomeAction(string BetterAtHomeAction)
|
||||
{
|
||||
this.BetterAtHomeAction = BetterAtHomeAction;
|
||||
}
|
||||
|
||||
public override string GetStatus()
|
||||
{
|
||||
return base.GetStatus() + " <@BetterAtHome: " + BetterAtHomeAction + ">";
|
||||
}
|
||||
|
||||
public string TeleportWithSLurl(string sl_url)
|
||||
{
|
||||
string[] bits = helpers.ParseSLurl(sl_url);
|
||||
if (helpers.notempty(bits) == true)
|
||||
{
|
||||
if (bits.Length == 4)
|
||||
{
|
||||
float.TryParse(bits[1], out float posX);
|
||||
float.TryParse(bits[2], out float posY);
|
||||
float.TryParse(bits[3], out float posZ);
|
||||
string regionName = bits[0];
|
||||
Client.Self.Teleport(regionName, new Vector3(posX, posY, posZ));
|
||||
return "ok";
|
||||
}
|
||||
return "Invaild bits length for SLurl";
|
||||
}
|
||||
return "No bits decoded";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class simBlacklistDataset
|
||||
{
|
||||
public long lastupdated = 0;
|
||||
public Dictionary<UUID, string> banned = new Dictionary<UUID, string>();
|
||||
public string regionname = "";
|
||||
}
|
||||
}
|
||||
|
|
@ -119,17 +119,46 @@ namespace BetterSecondBot.bottypes
|
|||
|
||||
public class EventsBot : VoidEventBot
|
||||
{
|
||||
private EventHandler<SimChangedEventArgs> _ChangeSim;
|
||||
private EventHandler<AlertMessageEventArgs> _AlertMessage;
|
||||
private EventHandler<LoginProgressEventArgs> _LoginProgess;
|
||||
private EventHandler<NextHomeRegionArgs> _NextHomeRegion;
|
||||
private EventHandler<MessageEventArgs> _MessageEvent;
|
||||
private EventHandler<StatusMessageEvent> _StatusMessageEvent;
|
||||
private EventHandler<GroupEventArgs> _GroupsEvent;
|
||||
private EventHandler<ImSendArgs> _SendImEvent;
|
||||
|
||||
private readonly object _ChangeSimLock = new object();
|
||||
private readonly object _AlertMessageLock = new object();
|
||||
private readonly object _LoginProgressLock = new object();
|
||||
private readonly object _NextHomeRegionLock = new object();
|
||||
private readonly object _MessageEventLock = new object();
|
||||
private readonly object _StatusMessageEventlock = new object();
|
||||
private readonly object _GroupsEventLock = new object();
|
||||
private readonly object _SendImEventLock = new object();
|
||||
|
||||
|
||||
public event EventHandler<SimChangedEventArgs> ChangeSimEvent
|
||||
{
|
||||
add { lock (_ChangeSimLock) { _ChangeSim += value; } }
|
||||
remove { lock (_ChangeSimLock) { _ChangeSim -= value; } }
|
||||
}
|
||||
public event EventHandler<AlertMessageEventArgs> AlertMessage
|
||||
{
|
||||
add { lock (_AlertMessageLock) { _AlertMessage += value; } }
|
||||
remove { lock (_AlertMessageLock) { _AlertMessage -= value; } }
|
||||
}
|
||||
public event EventHandler<LoginProgressEventArgs> LoginProgess
|
||||
{
|
||||
add { lock (_LoginProgressLock) { _LoginProgess += value; } }
|
||||
remove { lock (_LoginProgressLock) { _LoginProgess -= value; } }
|
||||
}
|
||||
public event EventHandler<NextHomeRegionArgs> NextHomeRegion
|
||||
{
|
||||
add { lock (_NextHomeRegionLock) { _NextHomeRegion += value; } }
|
||||
remove { lock (_NextHomeRegionLock) { _NextHomeRegion -= value; } }
|
||||
}
|
||||
|
||||
public event EventHandler<MessageEventArgs> MessageEvent
|
||||
{
|
||||
add { lock (_MessageEventLock) { _MessageEvent += value; } }
|
||||
|
|
@ -187,6 +216,32 @@ namespace BetterSecondBot.bottypes
|
|||
}
|
||||
}
|
||||
|
||||
protected override void LoginHandler(object o, LoginProgressEventArgs e)
|
||||
{
|
||||
base.LoginHandler(o, e);
|
||||
EventHandler<LoginProgressEventArgs> handler = _LoginProgess;
|
||||
handler?.Invoke(this, e);
|
||||
}
|
||||
|
||||
protected void ChangeSim(object sender, SimChangedEventArgs e)
|
||||
{
|
||||
EventHandler<SimChangedEventArgs> handler = _ChangeSim;
|
||||
handler?.Invoke(this, e);
|
||||
}
|
||||
|
||||
protected void AlertEvent(object sender, AlertMessageEventArgs e)
|
||||
{
|
||||
EventHandler<AlertMessageEventArgs> handler = _AlertMessage;
|
||||
handler?.Invoke(this, e);
|
||||
}
|
||||
|
||||
public void GotoNextHomeRegion()
|
||||
{
|
||||
NextHomeRegionArgs e = new NextHomeRegionArgs();
|
||||
EventHandler<NextHomeRegionArgs> handler = _NextHomeRegion;
|
||||
handler?.Invoke(this, e);
|
||||
}
|
||||
|
||||
protected bool login_auto_logout;
|
||||
protected long delay_group_fetch;
|
||||
protected Dictionary<UUID, KeyValuePair<long, List<UUID>>> group_members_storage = new Dictionary<UUID, KeyValuePair<long, List<UUID>>>();
|
||||
|
|
|
|||
|
|
@ -1,109 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenMetaverse;
|
||||
using BetterSecondBotShared.Static;
|
||||
using BetterSecondBotShared.logs;
|
||||
|
||||
namespace BetterSecondBot.bottypes
|
||||
{
|
||||
public class NextHomeRegionArgs: EventArgs
|
||||
{
|
||||
}
|
||||
|
||||
public abstract class AtHome : MessageSwitcherBot
|
||||
{
|
||||
protected string BetterAtHomeAction = "";
|
||||
private EventHandler<SimChangedEventArgs> _ChangeSim;
|
||||
private EventHandler<AlertMessageEventArgs> _AlertMessage;
|
||||
private EventHandler<LoginProgressEventArgs> _LoginProgess;
|
||||
private EventHandler<NextHomeRegionArgs> _NextHomeRegion;
|
||||
|
||||
private readonly object _ChangeSimLock = new object();
|
||||
private readonly object _AlertMessageLock = new object();
|
||||
private readonly object _LoginProgressLock = new object();
|
||||
private readonly object _NextHomeRegionLock = new object();
|
||||
|
||||
|
||||
public event EventHandler<SimChangedEventArgs> ChangeSimEvent
|
||||
{
|
||||
add { lock (_ChangeSimLock) { _ChangeSim += value; } }
|
||||
remove { lock (_ChangeSimLock) { _ChangeSim -= value; } }
|
||||
}
|
||||
public event EventHandler<AlertMessageEventArgs> AlertMessage
|
||||
{
|
||||
add { lock (_AlertMessageLock) { _AlertMessage += value; } }
|
||||
remove { lock (_AlertMessageLock) { _AlertMessage -= value; } }
|
||||
}
|
||||
public event EventHandler<LoginProgressEventArgs> LoginProgess
|
||||
{
|
||||
add { lock (_LoginProgressLock) { _LoginProgess += value; } }
|
||||
remove { lock (_LoginProgressLock) { _LoginProgess -= value; } }
|
||||
}
|
||||
public event EventHandler<NextHomeRegionArgs> NextHomeRegion
|
||||
{
|
||||
add { lock (_NextHomeRegionLock) { _NextHomeRegion += value; } }
|
||||
remove { lock (_NextHomeRegionLock) { _NextHomeRegion -= value; } }
|
||||
}
|
||||
|
||||
protected override void LoginHandler(object o, LoginProgressEventArgs e)
|
||||
{
|
||||
base.LoginHandler(o, e);
|
||||
EventHandler<LoginProgressEventArgs> handler = _LoginProgess;
|
||||
handler?.Invoke(this, e);
|
||||
}
|
||||
|
||||
protected void ChangeSim(object sender,SimChangedEventArgs e)
|
||||
{
|
||||
EventHandler<SimChangedEventArgs> handler = _ChangeSim;
|
||||
handler?.Invoke(this, e);
|
||||
}
|
||||
|
||||
protected void AlertEvent(object sender,AlertMessageEventArgs e)
|
||||
{
|
||||
EventHandler<AlertMessageEventArgs> handler = _AlertMessage;
|
||||
handler?.Invoke(this, e);
|
||||
}
|
||||
|
||||
public void GotoNextHomeRegion()
|
||||
{
|
||||
NextHomeRegionArgs e = new NextHomeRegionArgs();
|
||||
EventHandler<NextHomeRegionArgs> handler = _NextHomeRegion;
|
||||
handler?.Invoke(this, e);
|
||||
}
|
||||
|
||||
public void ResetAtHome()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void SetBetterAtHomeAction(string BetterAtHomeAction)
|
||||
{
|
||||
this.BetterAtHomeAction = BetterAtHomeAction;
|
||||
}
|
||||
|
||||
public override string GetStatus()
|
||||
{
|
||||
return base.GetStatus() + " <@BetterAtHome: " + BetterAtHomeAction + ">";
|
||||
}
|
||||
|
||||
public string TeleportWithSLurl(string sl_url)
|
||||
{
|
||||
string[] bits = helpers.ParseSLurl(sl_url);
|
||||
if (helpers.notempty(bits) == true)
|
||||
{
|
||||
if (bits.Length == 4)
|
||||
{
|
||||
float.TryParse(bits[1], out float posX);
|
||||
float.TryParse(bits[2], out float posY);
|
||||
float.TryParse(bits[3], out float posZ);
|
||||
string regionName = bits[0];
|
||||
Client.Self.Teleport(regionName, new Vector3(posX, posY, posZ));
|
||||
return "ok";
|
||||
}
|
||||
return "Invaild bits length for SLurl";
|
||||
}
|
||||
return "No bits decoded";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
SecondBot -> DialogsBot -> ChatRelay -> RLVbot -> RLVbotHelper ->
|
||||
AwaitReplyEventBot -> CommandsBot -> AVstorageBot -> AtHome ->
|
||||
AwaitReplyEventBot -> CommandsBot -> AVstorageBot -> AttachableBot ->
|
||||
MessageSwitcherBot -> EventsBot -> VoidEventBot -> AnimationsBot ->
|
||||
VirtualsBot -> Log2FileBot -> ActionsAutoAcceptBot -> BasicBot
|
||||
Loading…
Reference in a new issue