correct a bug with command logs not being in the correct order

This commit is contained in:
Madpeter 2023-12-07 13:43:06 +00:00
parent 34cacefdc7
commit bf53e8249c

View file

@ -8,6 +8,7 @@ using System.Text;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Net.Http; using System.Net.Http;
using OpenMetaverse.ImportExport.Collada14;
namespace SecondBotEvents.Services namespace SecondBotEvents.Services
{ {
@ -197,6 +198,7 @@ namespace SecondBotEvents.Services
return new KeyValuePair<bool, string>(false, "Not accepted via signing"); return new KeyValuePair<bool, string>(false, "Not accepted via signing");
} }
KeyValuePair<bool, string> reply = RunCommand(C, viaCustomCommand); KeyValuePair<bool, string> reply = RunCommand(C, viaCustomCommand);
CommandNotice(C.command, source, String.Join("@@@", C.args), reply.Key);
return reply; return reply;
} }
@ -385,7 +387,7 @@ namespace SecondBotEvents.Services
public void CommandNotice(string command,string source, string args,bool accepted) public void CommandNotice(string command,string source, string args,bool accepted)
{ {
BotCommandNotice e = new BotCommandNotice(command, source, args, accepted); BotCommandNotice e = new BotCommandNotice(command, args, source, accepted);
EventHandler<BotCommandNotice> handler = BotclientCommandEventNotices; EventHandler<BotCommandNotice> handler = BotclientCommandEventNotices;
handler?.Invoke(this, e); handler?.Invoke(this, e);
if(master.BotClient.basicCfg.GetLogCommands() == true) if(master.BotClient.basicCfg.GetLogCommands() == true)
@ -431,11 +433,9 @@ namespace SecondBotEvents.Services
if (requireSigning == false) if (requireSigning == false)
{ {
accepted = true; // just accept the command accepted = true; // just accept the command
master.CommandNotice(command, source, String.Join("@@@", args), accepted);
return; return;
} }
Vaildate(requireTimewindow, windowSize, secret); Vaildate(requireTimewindow, windowSize, secret);
master.CommandNotice(command, source, String.Join("@@@", args), accepted);
} }
protected void Vaildate(bool requireTimewindow, int windowSize, string secret) protected void Vaildate(bool requireTimewindow, int windowSize, string secret)