function name changes plus cleanup
This commit is contained in:
parent
1f96060e72
commit
4d03589345
11 changed files with 60 additions and 62 deletions
|
|
@ -16,7 +16,7 @@ namespace BetterSecondBotShared.bottypes
|
||||||
LastStatusMessage = "No status";
|
LastStatusMessage = "No status";
|
||||||
}
|
}
|
||||||
protected List<string> SubMasters = new List<string>();
|
protected List<string> SubMasters = new List<string>();
|
||||||
public bool is_avatar_master(string name)
|
public bool Is_avatar_master(string name)
|
||||||
{
|
{
|
||||||
if (name == myconfig.Security_MasterUsername)
|
if (name == myconfig.Security_MasterUsername)
|
||||||
{
|
{
|
||||||
|
|
@ -202,7 +202,7 @@ namespace BetterSecondBotShared.bottypes
|
||||||
{
|
{
|
||||||
name = "" + name + " " + stage1[1].FirstCharToUpper() + "";
|
name = "" + name + " " + stage1[1].FirstCharToUpper() + "";
|
||||||
}
|
}
|
||||||
if(is_avatar_master(name) == true)
|
if(Is_avatar_master(name) == true)
|
||||||
{
|
{
|
||||||
GroupInvitationEventArgs G = new GroupInvitationEventArgs(e.Simulator, e.IM.FromAgentID, e.IM.FromAgentName, e.IM.Message);
|
GroupInvitationEventArgs G = new GroupInvitationEventArgs(e.Simulator, e.IM.FromAgentID, e.IM.FromAgentName, e.IM.Message);
|
||||||
Client.Self.GroupInviteRespond(G.AgentID, e.IM.IMSessionID, true);
|
Client.Self.GroupInviteRespond(G.AgentID, e.IM.IMSessionID, true);
|
||||||
|
|
@ -211,7 +211,7 @@ namespace BetterSecondBotShared.bottypes
|
||||||
}
|
}
|
||||||
protected virtual void FriendshipOffer(UUID IMSessionID, string FromAgentName, UUID FromAgentID)
|
protected virtual void FriendshipOffer(UUID IMSessionID, string FromAgentName, UUID FromAgentID)
|
||||||
{
|
{
|
||||||
if (is_avatar_master(FromAgentName) == true)
|
if (Is_avatar_master(FromAgentName) == true)
|
||||||
{
|
{
|
||||||
Client.Friends.AcceptFriendship(FromAgentID, IMSessionID);
|
Client.Friends.AcceptFriendship(FromAgentID, IMSessionID);
|
||||||
}
|
}
|
||||||
|
|
@ -219,14 +219,14 @@ namespace BetterSecondBotShared.bottypes
|
||||||
|
|
||||||
protected virtual void RequestLure(UUID IMSessionID, string FromAgentName, UUID FromAgentID)
|
protected virtual void RequestLure(UUID IMSessionID, string FromAgentName, UUID FromAgentID)
|
||||||
{
|
{
|
||||||
if (is_avatar_master(FromAgentName) == true)
|
if (Is_avatar_master(FromAgentName) == true)
|
||||||
{
|
{
|
||||||
Client.Self.SendTeleportLure(FromAgentID);
|
Client.Self.SendTeleportLure(FromAgentID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<UUID> accept_next_teleport_from = new List<UUID>();
|
protected List<UUID> accept_next_teleport_from = new List<UUID>();
|
||||||
public void add_uuid_to_teleport_list(UUID avatar)
|
public void Add_uuid_to_teleport_list(UUID avatar)
|
||||||
{
|
{
|
||||||
if (accept_next_teleport_from.Contains(avatar) == false)
|
if (accept_next_teleport_from.Contains(avatar) == false)
|
||||||
{
|
{
|
||||||
|
|
@ -237,7 +237,7 @@ namespace BetterSecondBotShared.bottypes
|
||||||
protected virtual void RequestTeleport(UUID IMSessionID, string FromAgentName, UUID FromAgentID)
|
protected virtual void RequestTeleport(UUID IMSessionID, string FromAgentName, UUID FromAgentID)
|
||||||
{
|
{
|
||||||
bool allow = false;
|
bool allow = false;
|
||||||
if (is_avatar_master(FromAgentName) == true)
|
if (Is_avatar_master(FromAgentName) == true)
|
||||||
{
|
{
|
||||||
allow = true;
|
allow = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -359,7 +359,7 @@ namespace BetterSecondBotShared.Json
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected JsonConfig process_prop(JsonConfig reply,string arg,string arg_value_default)
|
protected JsonConfig Process_prop(JsonConfig reply,string arg,string arg_value_default)
|
||||||
{
|
{
|
||||||
string arg_type = GetCommandArgTypes(arg).First();
|
string arg_type = GetCommandArgTypes(arg).First();
|
||||||
if (arg_type != "")
|
if (arg_type != "")
|
||||||
|
|
@ -378,7 +378,7 @@ namespace BetterSecondBotShared.Json
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JsonConfig http_config_check(JsonConfig jsonConfig)
|
public static JsonConfig Http_config_check(JsonConfig jsonConfig)
|
||||||
{
|
{
|
||||||
if (helpers.notempty(jsonConfig.Security_WebUIKey) == true)
|
if (helpers.notempty(jsonConfig.Security_WebUIKey) == true)
|
||||||
{
|
{
|
||||||
|
|
@ -437,7 +437,7 @@ namespace BetterSecondBotShared.Json
|
||||||
arg_value_default = arg_value_default.Replace("]", "");
|
arg_value_default = arg_value_default.Replace("]", "");
|
||||||
arg_value_default = arg_value_default.Replace("\"", "");
|
arg_value_default = arg_value_default.Replace("\"", "");
|
||||||
}
|
}
|
||||||
reply = process_prop(reply, arg, arg_value_default);
|
reply = Process_prop(reply, arg, arg_value_default);
|
||||||
}
|
}
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace BetterSecondBotShared.logs
|
||||||
}
|
}
|
||||||
public static string Debug(string message, bool send_to_console)
|
public static string Debug(string message, bool send_to_console)
|
||||||
{
|
{
|
||||||
return Add(message, ConsoleLogLogLevel.Debug, true);
|
return Add(message, ConsoleLogLogLevel.Debug, send_to_console);
|
||||||
}
|
}
|
||||||
public static string Warn(string message)
|
public static string Warn(string message)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace BetterSecondBot
|
||||||
Thread.Sleep(3000);
|
Thread.Sleep(3000);
|
||||||
LogFormater.Status("-> Getting config from Docker");
|
LogFormater.Status("-> Getting config from Docker");
|
||||||
JsonConfig Config = MakeJsonConfig.FromENV();
|
JsonConfig Config = MakeJsonConfig.FromENV();
|
||||||
Config = MakeJsonConfig.http_config_check(Config);
|
Config = MakeJsonConfig.Http_config_check(Config);
|
||||||
new CliExitOnLogout(Config);
|
new CliExitOnLogout(Config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ namespace BetterSecondBot
|
||||||
}
|
}
|
||||||
if(ok_to_try_start == true)
|
if(ok_to_try_start == true)
|
||||||
{
|
{
|
||||||
Config = MakeJsonConfig.http_config_check(Config);
|
Config = MakeJsonConfig.Http_config_check(Config);
|
||||||
new CliExitOnLogout(Config);
|
new CliExitOnLogout(Config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ using System.Web;
|
||||||
|
|
||||||
namespace BetterSecondBot.HttpServer
|
namespace BetterSecondBot.HttpServer
|
||||||
{
|
{
|
||||||
public class json_http_reply
|
public class Json_http_reply
|
||||||
{
|
{
|
||||||
public bool status;
|
public bool status;
|
||||||
public string message;
|
public string message;
|
||||||
|
|
@ -100,7 +100,7 @@ namespace BetterSecondBot.HttpServer
|
||||||
|
|
||||||
protected async Task HandleIncomingConnections()
|
protected async Task HandleIncomingConnections()
|
||||||
{
|
{
|
||||||
webui myUI = new webui(Config,Bot);
|
Webui myUI = new Webui(Config,Bot);
|
||||||
while (Bot.KillMe == false)
|
while (Bot.KillMe == false)
|
||||||
{
|
{
|
||||||
HttpListenerContext ctx = await listener.GetContextAsync().ConfigureAwait(true);
|
HttpListenerContext ctx = await listener.GetContextAsync().ConfigureAwait(true);
|
||||||
|
|
@ -114,22 +114,20 @@ namespace BetterSecondBot.HttpServer
|
||||||
test = test.Replace(Config.Http_PublicUrl, "");
|
test = test.Replace(Config.Http_PublicUrl, "");
|
||||||
|
|
||||||
//rproxy weirdness
|
//rproxy weirdness
|
||||||
string use_http_url = Config.Http_PublicUrl.Replace("http://", "");
|
test = test.Replace(Config.Http_PublicUrl, "");
|
||||||
use_http_url = Config.Http_PublicUrl.Replace("https://", "");
|
Config.Http_PublicUrl = Config.Http_PublicUrl.Replace("http://", "");
|
||||||
|
Config.Http_PublicUrl = Config.Http_PublicUrl.Replace("https://", "");
|
||||||
|
test = test.Replace(Config.Http_PublicUrl, "");
|
||||||
test = test.Replace(":" + Config.Http_Port.ToString(), "");
|
test = test.Replace(":" + Config.Http_Port.ToString(), "");
|
||||||
test = test.Replace(use_http_url, "");
|
|
||||||
test = test.Replace("https://", "");
|
|
||||||
test = test.Replace("http://", "");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
json_http_reply reply = new json_http_reply();
|
Json_http_reply reply = new Json_http_reply();
|
||||||
List<string> http_args = test.Split('/', StringSplitOptions.RemoveEmptyEntries).ToList();
|
List<string> http_args = test.Split('/', StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||||
byte[] data;
|
byte[] data;
|
||||||
resp.StatusCode = 200;
|
resp.StatusCode = 200;
|
||||||
resp.ContentType = "text/html";
|
resp.ContentType = "text/html";
|
||||||
if (req.HttpMethod == "GET")
|
if (req.HttpMethod == "GET")
|
||||||
{
|
{
|
||||||
KeyValuePair<string, byte[]> replydata = myUI.Get_Process(req, resp, http_args);
|
KeyValuePair<string, byte[]> replydata = myUI.Get_Process(resp, http_args);
|
||||||
if (replydata.Value != null)
|
if (replydata.Value != null)
|
||||||
{
|
{
|
||||||
resp.ContentType = replydata.Key;
|
resp.ContentType = replydata.Key;
|
||||||
|
|
@ -166,7 +164,7 @@ namespace BetterSecondBot.HttpServer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resp.StatusCode = 200;
|
resp.StatusCode = 200;
|
||||||
if (myUI.Post_process(reply, req, resp, http_args, post_args) == true)
|
if (myUI.Post_process(reply, resp, http_args, post_args) == true)
|
||||||
{
|
{
|
||||||
bool accept_request = false;
|
bool accept_request = false;
|
||||||
string why_request_failed = "Bad signing request";
|
string why_request_failed = "Bad signing request";
|
||||||
|
|
|
||||||
|
|
@ -15,27 +15,26 @@ using System.Threading;
|
||||||
|
|
||||||
namespace BetterSecondBot.HttpWebUi
|
namespace BetterSecondBot.HttpWebUi
|
||||||
{
|
{
|
||||||
public class webui
|
public class Webui
|
||||||
{
|
{
|
||||||
JsonConfig siteconfig;
|
private JsonConfig siteconfig;
|
||||||
SecondBot bot;
|
private SecondBot bot;
|
||||||
Dictionary<string, long> vaildlogincookies = new Dictionary<string, long>();
|
private Dictionary<string, long> vaildlogincookies = new Dictionary<string, long>();
|
||||||
public webui(JsonConfig setconfig, SecondBot setbot)
|
public Webui(JsonConfig setconfig, SecondBot setbot)
|
||||||
{
|
{
|
||||||
bot = setbot;
|
bot = setbot;
|
||||||
siteconfig = setconfig;
|
siteconfig = setconfig;
|
||||||
}
|
}
|
||||||
protected KeyValuePair<bool, bool> logincookievaild(HttpListenerRequest reqs, HttpListenerResponse resp)
|
protected KeyValuePair<bool, bool> Logincookievaild(HttpListenerResponse resp)
|
||||||
{
|
{
|
||||||
return logincookievaild(reqs, resp, false);
|
return Logincookievaild(resp, false);
|
||||||
}
|
}
|
||||||
protected KeyValuePair<bool, bool> logincookievaild(HttpListenerRequest reqs, HttpListenerResponse resp, bool force_logout)
|
protected KeyValuePair<bool, bool> Logincookievaild(HttpListenerResponse resp, bool force_logout)
|
||||||
{
|
{
|
||||||
foreach (Cookie C in resp.Cookies)
|
foreach (Cookie C in resp.Cookies)
|
||||||
{
|
{
|
||||||
if (C.Name == "logincookie")
|
if (C.Name == "logincookie")
|
||||||
{
|
{
|
||||||
Cookie old = C;
|
|
||||||
if (force_logout == true)
|
if (force_logout == true)
|
||||||
{
|
{
|
||||||
if (vaildlogincookies.ContainsKey(C.Value) == true)
|
if (vaildlogincookies.ContainsKey(C.Value) == true)
|
||||||
|
|
@ -61,7 +60,7 @@ namespace BetterSecondBot.HttpWebUi
|
||||||
}
|
}
|
||||||
return new KeyValuePair<bool, bool>(false, false);
|
return new KeyValuePair<bool, bool>(false, false);
|
||||||
}
|
}
|
||||||
public bool Post_process(json_http_reply reply, HttpListenerRequest reqs, HttpListenerResponse resp, List<string> args, Dictionary<string, string> post_args)
|
public bool Post_process(Json_http_reply reply, HttpListenerResponse resp, List<string> args, Dictionary<string, string> post_args)
|
||||||
{
|
{
|
||||||
bool processed = false;
|
bool processed = false;
|
||||||
if (args != null)
|
if (args != null)
|
||||||
|
|
@ -82,7 +81,7 @@ namespace BetterSecondBot.HttpWebUi
|
||||||
{
|
{
|
||||||
area = args[2];
|
area = args[2];
|
||||||
}
|
}
|
||||||
KeyValuePair<bool, bool> logincheck = logincookievaild(reqs, resp);
|
KeyValuePair<bool, bool> logincheck = Logincookievaild(resp);
|
||||||
|
|
||||||
if (logincheck.Key == false)
|
if (logincheck.Key == false)
|
||||||
{
|
{
|
||||||
|
|
@ -99,9 +98,11 @@ namespace BetterSecondBot.HttpWebUi
|
||||||
newcookiecode = helpers.GetSHA1(siteconfig.Security_WebUIKey + helpers.UnixTimeNow().ToString() + new Random().Next(12345).ToString());
|
newcookiecode = helpers.GetSHA1(siteconfig.Security_WebUIKey + helpers.UnixTimeNow().ToString() + new Random().Next(12345).ToString());
|
||||||
}
|
}
|
||||||
vaildlogincookies.Add(newcookiecode, helpers.UnixTimeNow() + (5 * 60)); // auto logout after 5 mins
|
vaildlogincookies.Add(newcookiecode, helpers.UnixTimeNow() + (5 * 60)); // auto logout after 5 mins
|
||||||
Cookie logincookie = new Cookie("logincookie", newcookiecode);
|
Cookie logincookie = new Cookie("logincookie", newcookiecode)
|
||||||
logincookie.Expires = DateTime.Now.AddDays(1);
|
{
|
||||||
logincookie.Path = "/";
|
Expires = DateTime.Now.AddDays(1),
|
||||||
|
Path = "/"
|
||||||
|
};
|
||||||
resp.Cookies.Add(logincookie);
|
resp.Cookies.Add(logincookie);
|
||||||
Console.WriteLine("Cookie created: " + logincookie.Value + " <=> " + newcookiecode + "");
|
Console.WriteLine("Cookie created: " + logincookie.Value + " <=> " + newcookiecode + "");
|
||||||
reply.message = "ok";
|
reply.message = "ok";
|
||||||
|
|
@ -133,7 +134,7 @@ namespace BetterSecondBot.HttpWebUi
|
||||||
// logged in
|
// logged in
|
||||||
if (mod == "logout")
|
if (mod == "logout")
|
||||||
{
|
{
|
||||||
logincookievaild(reqs, resp, true);
|
Logincookievaild(resp, true);
|
||||||
reply.message = "logged-out";
|
reply.message = "logged-out";
|
||||||
reply.redirect = "/";
|
reply.redirect = "/";
|
||||||
reply.status = false;
|
reply.status = false;
|
||||||
|
|
@ -356,7 +357,7 @@ namespace BetterSecondBot.HttpWebUi
|
||||||
// login expired
|
// login expired
|
||||||
reply.message = "login-expired";
|
reply.message = "login-expired";
|
||||||
reply.redirect = "/";
|
reply.redirect = "/";
|
||||||
logincookievaild(reqs, resp, true);
|
Logincookievaild(resp, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -364,7 +365,7 @@ namespace BetterSecondBot.HttpWebUi
|
||||||
}
|
}
|
||||||
return !processed;
|
return !processed;
|
||||||
}
|
}
|
||||||
public string html_logged_in(string mod, string area)
|
public string Html_logged_in(string mod, string area)
|
||||||
{
|
{
|
||||||
string layout = helpers.ReadResourceFile(Assembly.GetExecutingAssembly(), "sidemenu.layout");
|
string layout = helpers.ReadResourceFile(Assembly.GetExecutingAssembly(), "sidemenu.layout");
|
||||||
Dictionary<string, string> swaps = new Dictionary<string, string>();
|
Dictionary<string, string> swaps = new Dictionary<string, string>();
|
||||||
|
|
@ -387,7 +388,6 @@ namespace BetterSecondBot.HttpWebUi
|
||||||
loop++;
|
loop++;
|
||||||
}
|
}
|
||||||
swaps.Add("html_menu", menu);
|
swaps.Add("html_menu", menu);
|
||||||
menu = "";
|
|
||||||
if (mod == "none")
|
if (mod == "none")
|
||||||
{
|
{
|
||||||
pagecontent = "<p>Please select a menu item on the left</p>";
|
pagecontent = "<p>Please select a menu item on the left</p>";
|
||||||
|
|
@ -428,7 +428,7 @@ namespace BetterSecondBot.HttpWebUi
|
||||||
}
|
}
|
||||||
return layout;
|
return layout;
|
||||||
}
|
}
|
||||||
public string html_logged_out()
|
public string Html_logged_out()
|
||||||
{
|
{
|
||||||
string layout = helpers.ReadResourceFile(Assembly.GetExecutingAssembly(), "full.layout");
|
string layout = helpers.ReadResourceFile(Assembly.GetExecutingAssembly(), "full.layout");
|
||||||
layout = layout.Replace("[[page_content]]", helpers.ReadResourceFile(Assembly.GetExecutingAssembly(), "login.block"));
|
layout = layout.Replace("[[page_content]]", helpers.ReadResourceFile(Assembly.GetExecutingAssembly(), "login.block"));
|
||||||
|
|
@ -438,7 +438,7 @@ namespace BetterSecondBot.HttpWebUi
|
||||||
layout = layout.Replace("[[html_title]]", siteconfig.Basic_BotUserName);
|
layout = layout.Replace("[[html_title]]", siteconfig.Basic_BotUserName);
|
||||||
return layout;
|
return layout;
|
||||||
}
|
}
|
||||||
public KeyValuePair<string, byte[]> Get_Process(HttpListenerRequest reqs, HttpListenerResponse resp, List<string> args)
|
public KeyValuePair<string, byte[]> Get_Process(HttpListenerResponse resp, List<string> args)
|
||||||
{
|
{
|
||||||
|
|
||||||
// get content
|
// get content
|
||||||
|
|
@ -467,18 +467,18 @@ namespace BetterSecondBot.HttpWebUi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// get display
|
// get display
|
||||||
KeyValuePair<bool, bool> logincheck = logincookievaild(reqs, resp);
|
KeyValuePair<bool, bool> logincheck = Logincookievaild(resp);
|
||||||
if (logincheck.Key == true)
|
if (logincheck.Key == true)
|
||||||
{
|
{
|
||||||
if (logincheck.Value == false)
|
if (logincheck.Value == false)
|
||||||
{
|
{
|
||||||
logincookievaild(reqs, resp, true);
|
Logincookievaild(resp, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string reply_with = "";
|
string reply_with;
|
||||||
if (logincheck.Value == false)
|
if (logincheck.Value == false)
|
||||||
{
|
{
|
||||||
reply_with = html_logged_out();
|
reply_with = Html_logged_out();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -495,13 +495,13 @@ namespace BetterSecondBot.HttpWebUi
|
||||||
|
|
||||||
if (mod == "logout")
|
if (mod == "logout")
|
||||||
{
|
{
|
||||||
logincookievaild(reqs, resp, true);
|
Logincookievaild(resp, true);
|
||||||
reply_with = html_logged_out();
|
reply_with = Html_logged_out();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// logged in
|
// logged in
|
||||||
reply_with = html_logged_in(mod, area);
|
reply_with = Html_logged_in(mod, area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reply_with = reply_with.Replace("[[url_base]]", siteconfig.Http_PublicUrl);
|
reply_with = reply_with.Replace("[[url_base]]", siteconfig.Http_PublicUrl);
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,9 @@ namespace BSB.Commands.Group
|
||||||
{
|
{
|
||||||
if (UUID.TryParse(args[0], out UUID target_group) == true)
|
if (UUID.TryParse(args[0], out UUID target_group) == true)
|
||||||
{
|
{
|
||||||
if (UUID.TryParse(args[1], out UUID target_avatar) == true)
|
if (UUID.TryParse(args[1], out UUID _) == true)
|
||||||
{
|
{
|
||||||
if (UUID.TryParse(args[2], out UUID target_role) == true)
|
if (UUID.TryParse(args[2], out UUID _) == true)
|
||||||
{
|
{
|
||||||
if (bot.MyGroups.ContainsKey(target_group) == true)
|
if (bot.MyGroups.ContainsKey(target_group) == true)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace BSB.Commands.Movement
|
||||||
{
|
{
|
||||||
if(UUID.TryParse(args[0],out UUID avatar) == true)
|
if(UUID.TryParse(args[0],out UUID avatar) == true)
|
||||||
{
|
{
|
||||||
bot.add_uuid_to_teleport_list(avatar);
|
bot.Add_uuid_to_teleport_list(avatar);
|
||||||
bot.GetClient.Self.SendTeleportLureRequest(avatar, "I would like to teleport to you");
|
bot.GetClient.Self.SendTeleportLureRequest(avatar, "I would like to teleport to you");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,10 +45,8 @@ namespace BSB.bottypes
|
||||||
|
|
||||||
Rotate(logFilePath);
|
Rotate(logFilePath);
|
||||||
|
|
||||||
using (var sw = File.AppendText(logFilePath))
|
using var sw = File.AppendText(logFilePath);
|
||||||
{
|
sw.WriteLine(message);
|
||||||
sw.WriteLine(message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Rotate(string filePath)
|
private void Rotate(string filePath)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ namespace BSB.bottypes
|
||||||
{
|
{
|
||||||
public abstract class MessageSwitcherBot : EventsBot
|
public abstract class MessageSwitcherBot : EventsBot
|
||||||
{
|
{
|
||||||
string[] hard_blocked_agents = new string[] { "secondlife", "second life"};
|
readonly string[] hard_blocked_agents = new string[] { "secondlife", "second life"};
|
||||||
protected override void ChatInputHandler(object sender, ChatEventArgs e)
|
protected override void ChatInputHandler(object sender, ChatEventArgs e)
|
||||||
{
|
{
|
||||||
bool fromme = false;
|
bool fromme = false;
|
||||||
|
|
@ -90,8 +90,10 @@ namespace BSB.bottypes
|
||||||
if (bits.Count > 2)
|
if (bits.Count > 2)
|
||||||
{
|
{
|
||||||
arg_signed_with = "|||";
|
arg_signed_with = "|||";
|
||||||
List<string> newbits = new List<string>();
|
List<string> newbits = new List<string>
|
||||||
newbits.Add(bits[0]);
|
{
|
||||||
|
bits[0]
|
||||||
|
};
|
||||||
StringBuilder B = new StringBuilder();
|
StringBuilder B = new StringBuilder();
|
||||||
int loop = 1;
|
int loop = 1;
|
||||||
string addon = "";
|
string addon = "";
|
||||||
|
|
@ -111,7 +113,7 @@ namespace BSB.bottypes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (is_avatar_master(sender_name) == true)
|
if (Is_avatar_master(sender_name) == true)
|
||||||
{
|
{
|
||||||
CoreCommandLib(sender_uuid, true, bits.ElementAt(0), bits.ElementAt(1), "", arg_signed_with);
|
CoreCommandLib(sender_uuid, true, bits.ElementAt(0), bits.ElementAt(1), "", arg_signed_with);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue