public void ExecuteCommand(string command) { if (!string.IsNullOrEmpty(command)) { DecalProxy.DispatchChatToBoxWithPluginIntercept(command); } }
/// <summary> /// This will first attempt to send the messages to all plugins. If no plugins set e.Eat to true on the message, it will then simply call InvokeChatParser. /// </summary> /// <param name="chatcommand"></param> public static void SendChatCommand(string chatcommand) { try { DecalProxy.DispatchChatToBoxWithPluginIntercept(chatcommand); } catch (Exception ex) { LogError(ex); } }
void processCommand(string command) { if (command.ToLower().StartsWith("/mt")) { PluginCore.Current.ProcessMTCommand(command); } else { DecalProxy.DispatchChatToBoxWithPluginIntercept(command); } }
void Current_RenderFrame(object sender, EventArgs e) { try { if (DateTime.Now.Subtract(TimeSpan.FromMilliseconds(_loginCmds.WaitMillisencds)) < loginCompleteTime) { return; } if (_loginCmds.Commands.Count == 0 && sendingLastEnter == false) { CoreManager.Current.RenderFrame -= new EventHandler <EventArgs>(Current_RenderFrame); return; } bool useMagToolsStyle = true; if (useMagToolsStyle) { string cmd = _loginCmds.Commands.Dequeue(); log.WriteInfo("Dequeued a login message to send to DecalProxy: {0}", cmd); DecalProxy.DispatchChatToBoxWithPluginIntercept(cmd); } else { if (sendingLastEnter) { PostMessageTools.SendEnter(); sendingLastEnter = false; } else { PostMessageTools.SendEnter(); string cmd = _loginCmds.Commands.Dequeue(); // The game is losing the first character of our commands // So deliberately send a space at the start if (!cmd.StartsWith(" ")) { cmd = " " + cmd; } log.WriteInfo("Dequeued a login message to send char-by-char to chat: '{0}'", cmd); PostMessageTools.SendCharString(cmd); sendingLastEnter = true; } } } catch (Exception ex) { Debug.LogException(ex); } }
void Current_RenderFrame(object sender, EventArgs e) { try { var pendingCommand = pendingCommands.Dequeue(); if (pendingCommand.Command.ToLower().StartsWith("/mt")) { PluginCore.Current.ProcessMTCommand(pendingCommand.Command); } else { DecalProxy.DispatchChatToBoxWithPluginIntercept(pendingCommand.Command); } } catch (Exception ex) { Debug.LogException(ex); } finally { if (pendingCommands.Count == 0) { CoreManager.Current.RenderFrame -= new EventHandler <EventArgs>(Current_RenderFrame); } } }