diff --git a/BSBshared/Staic/ConsoleLog.cs b/BSBshared/Staic/ConsoleLog.cs index ceecf67..58c2521 100644 --- a/BSBshared/Staic/ConsoleLog.cs +++ b/BSBshared/Staic/ConsoleLog.cs @@ -38,10 +38,16 @@ namespace BetterSecondBotShared.logs var date = DateTime.Now; StringBuilder n = new StringBuilder(); n.Append("["); - if(date.Hour < 10) n.Append("0"); + if (date.Hour < 10) + { + n.Append("0"); + } n.Append(date.Hour.ToString()); n.Append(":"); - if (date.Minute < 10) n.Append("0"); + if (date.Minute < 10) + { + n.Append("0"); + } n.Append(date.Minute.ToString()); n.Append("] "); switch (Level) diff --git a/BSBshared/Staic/Helpers.cs b/BSBshared/Staic/Helpers.cs index 5492d79..c071ccf 100644 --- a/BSBshared/Staic/Helpers.cs +++ b/BSBshared/Staic/Helpers.cs @@ -150,13 +150,13 @@ namespace BetterSecondBotShared.Static { if (V != null) { - if (V.Length > 0) return true; - else return false; - } - else - { - return false; + if (V.Length > 0) + { + return true; + } } + return false; + } public static bool notempty(string[] V) { @@ -164,10 +164,7 @@ namespace BetterSecondBotShared.Static { return true; } - else - { - return false; - } + return false; } } } diff --git a/CLI/HttpServer/control/Interface/cmd_lib.cs b/CLI/HttpServer/control/Interface/cmd_lib.cs index 4f7f113..c5caf7b 100644 --- a/CLI/HttpServer/control/Interface/cmd_lib.cs +++ b/CLI/HttpServer/control/Interface/cmd_lib.cs @@ -7,8 +7,8 @@ namespace BetterSecondBot.HttpServer.Control.Interface { public class CoreCMD : HTTP_commands_post { - public override string[] ArgTypes { get { return new string[] { "Text","Text" }; } } - public override string[] ArgHints { get { return new string[] { "Command","Args (~#~ split)" }; } } + public override string[] ArgTypes { get { return new [] { "Text","Text" }; } } + public override string[] ArgHints { get { return new [] { "Command","Args (~#~ split)" }; } } public override string Helpfile { get { return "Calls the Commands interface via HTTP (returns OK if not rejected)"; } } public override int MinArgs { get { return 2; } } diff --git a/CLI/HttpServer/http_server.cs b/CLI/HttpServer/http_server.cs index ad7819e..74dec7b 100644 --- a/CLI/HttpServer/http_server.cs +++ b/CLI/HttpServer/http_server.cs @@ -136,7 +136,10 @@ namespace BetterSecondBot.HttpServer foreach(string B in pairs) { string[] bits = B.Split('=', StringSplitOptions.RemoveEmptyEntries); - if(bits.Length == 2) post_args.Add(bits[0].Trim(), bits[1].Trim()); + if (bits.Length == 2) + { + post_args.Add(bits[0].Trim(), bits[1].Trim()); + } } if (post_args.ContainsKey("command") == true) { diff --git a/Core/Commands/Dialogs/DialogResponce.cs b/Core/Commands/Dialogs/DialogResponce.cs index 57ff23d..012e9e8 100644 --- a/Core/Commands/Dialogs/DialogResponce.cs +++ b/Core/Commands/Dialogs/DialogResponce.cs @@ -19,7 +19,10 @@ namespace BSB.Commands.Dialogs { return bot.DialogReply(dialogid, args[1]); } - else return Failed("Invaild dialog id"); + else + { + return Failed("Invaild dialog id"); + } } return false; } diff --git a/Core/Commands/Movement/teleport.cs b/Core/Commands/Movement/teleport.cs index 6cc14b6..b425b58 100644 --- a/Core/Commands/Movement/teleport.cs +++ b/Core/Commands/Movement/teleport.cs @@ -48,7 +48,10 @@ namespace BSB.Commands.Movement float.TryParse(tp_args[offset + 1], out posY); float.TryParse(tp_args[offset + 2], out posZ); } - else if (tp_args.Length == 2) ok = false; + else if (tp_args.Length == 2) + { + ok = false; + } if (ok == true) { bot.SetTeleported(); diff --git a/Core/Commands/Notecard/notecardSend.cs b/Core/Commands/Notecard/notecardSend.cs index e62cdb1..53c2315 100644 --- a/Core/Commands/Notecard/notecardSend.cs +++ b/Core/Commands/Notecard/notecardSend.cs @@ -27,7 +27,10 @@ namespace BSB.Commands.Notecard { bot.ClearNotecardStorage(args[1]); string notecard_name = "New notecard for " + args[0] + " " + helpers.UnixTimeNow().ToString() + ""; - if (args.Length == 3) notecard_name = args[2] + " " + helpers.UnixTimeNow().ToString() + ""; + if (args.Length == 3) + { + notecard_name = args[2] + " " + helpers.UnixTimeNow().ToString() + ""; + } return bot.SendNotecard(notecard_name, content, target); } else diff --git a/Core/Commands/Parcel/GetParcelFlags.cs b/Core/Commands/Parcel/GetParcelFlags.cs index 7150d0c..c9ef2e3 100644 --- a/Core/Commands/Parcel/GetParcelFlags.cs +++ b/Core/Commands/Parcel/GetParcelFlags.cs @@ -68,7 +68,10 @@ namespace BSB.Commands.CMD_Parcel reply.Append(cfg); reply.Append("="); reply.Append(p.Flags.HasFlag(flags[cfg]).ToString()); - if (addon != ",") addon = ","; + if (addon != ",") + { + addon = ","; + } } } return bot.GetCommandsInterface.SmartCommandReply(target, reply.ToString(), CommandName); diff --git a/Core/RLV/Blacklist/getblacklist.cs b/Core/RLV/Blacklist/getblacklist.cs index faaba78..5dfb64a 100644 --- a/Core/RLV/Blacklist/getblacklist.cs +++ b/Core/RLV/Blacklist/getblacklist.cs @@ -53,8 +53,14 @@ namespace BSB.RLV.Blacklist } } } - if (sendim == "") sendim = "#"; - if (recvim == "") recvim = "#"; + if (sendim == "") + { + sendim = "#"; + } + if (recvim == "") + { + recvim = "#"; + } bot.GetClient.Self.Chat("" + sendim + "," + recvim + "", channel, OpenMetaverse.ChatType.Normal); return true; } diff --git a/Core/RLV/RLV_commandlib.cs b/Core/RLV/RLV_commandlib.cs index 8de9e34..cf0541f 100644 --- a/Core/RLV/RLV_commandlib.cs +++ b/Core/RLV/RLV_commandlib.cs @@ -82,6 +82,7 @@ namespace BSB.RLV { return Failed("Function not overridden"); } + public bool Failed(string why_failed) { ConsoleLog.Warn("[RLVapi/Failed] " + CommandName + ": " + why_failed); @@ -115,7 +116,10 @@ namespace BSB.RLV { if (args.Length > 0) { - if (args[0] == "force") return true; + if (args[0] == "force") + { + return true; + } return Failed("Magic word force is missing"); } return Failed("[RLV/WARN] RLV_1arg_force invaild number of args"); diff --git a/Core/bottypes/CommandsBot.cs b/Core/bottypes/CommandsBot.cs index a271ace..3337932 100644 --- a/Core/bottypes/CommandsBot.cs +++ b/Core/bottypes/CommandsBot.cs @@ -11,6 +11,10 @@ namespace BSB.bottypes { public abstract class CommandsBot : AVstorageBot { + protected CommandsBot() + { + CommandsInterface = new Commands.CoreCommandsInterface(this); + } List CommandHistory = new List(); protected int commandid = 1; public virtual string CommandHistoryAdd(string command, string arg, bool status,string infomessage) @@ -51,7 +55,12 @@ namespace BSB.bottypes } return message; } - public string[] GetLastCommands(int amount=10) + + public string[] GetLastCommands() + { + return GetLastCommands(10); + } + public string[] GetLastCommands(int amount) { List commands = new List(); int loop = 0; @@ -69,10 +78,7 @@ namespace BSB.bottypes public Commands.CoreCommandsInterface GetCommandsInterface { get { return CommandsInterface; } } protected Commands.CoreCommandsInterface CommandsInterface; - public CommandsBot() - { - CommandsInterface = new Commands.CoreCommandsInterface(this); - } + protected Dictionary notecards_content = new Dictionary(); protected Dictionary group_invite_lockout_timer = new Dictionary(); protected long last_cleanup_commands; diff --git a/Core/bottypes/EventsBot.cs b/Core/bottypes/EventsBot.cs index 31dbff3..96c906d 100644 --- a/Core/bottypes/EventsBot.cs +++ b/Core/bottypes/EventsBot.cs @@ -67,8 +67,7 @@ namespace BSB.bottypes protected List accept_animation_request_from_users = new List(); protected bool login_auto_logout = false; protected long delay_group_fetch = 0; - - Dictionary>> group_members_storage = new Dictionary>>(); + protected Dictionary>> group_members_storage = new Dictionary>>(); protected virtual void GroupMembersReplyHandler(object sender, GroupMembersReplyEventArgs e) { } @@ -136,7 +135,7 @@ namespace BSB.bottypes protected override void BotStartHandler() { - Client.Network.LoginProgress += new EventHandler(LoginHandler); + Client.Network.LoginProgress += LoginHandler; } public override string GetStatus() diff --git a/Core/bottypes/athome.cs b/Core/bottypes/athome.cs index 1894336..be7a3ae 100644 --- a/Core/bottypes/athome.cs +++ b/Core/bottypes/athome.cs @@ -191,19 +191,23 @@ namespace BSB.bottypes } } - protected bool inbox(float expected, float current, float drift) + protected static bool inbox(float expected, float current, float drift) { return inbox(expected, current, drift, true); } - protected bool inbox(float expected,float current, float drift, bool current_value) + protected static bool inbox(float expected,float current, float drift, bool current_value) { - if (current > (expected + drift)) return false; - else if (current < (expected - drift)) return false; - else return current_value; + if (current > (expected + drift)) + { + return false; + } + else if (current < (expected - drift)) + { + return false; + } + return current_value; } - - public bool IsSimHome(string simname) { simname = simname.ToLowerInvariant();