private static void OnMessageDispatched(MessageDispatcher dispatcher, Message message)
        {
            var bot = (Bot)dispatcher.CurrentProcessor;
            var file = string.Format("{0}/log {1} {2}.log", Plugin.CurrentPlugin.GetPluginDirectory(), bot, Process.GetCurrentProcess().StartTime.ToString("dd MMM HH-mm-ss"));

            // this is thread safe
            File.AppendAllText(file, m_dumper.Dump(message) + "\r\n");
        }
Exemple #2
0
 public Bot(MessageDispatcher messageDispatcher)
     : base(DefaultBotTick)
 {
     if (messageDispatcher == null) throw new ArgumentNullException("messageDispatcher");
     Dispatcher = messageDispatcher;
     ConnectionType = ClientConnectionType.Disconnected;
     ClientInformations = new ClientInformations();
     Display = DisplayState.None;
 }
Exemple #3
0
 public Bot(MessageDispatcher messageDispatcher)
     : base(DefaultBotTick)
 {
     if (messageDispatcher == null) throw new ArgumentNullException("messageDispatcher");
     Dispatcher = messageDispatcher;
     ConnectionType = ClientConnectionType.Disconnected;
     ClientInformations = new ClientInformations();
     ChatManager = new Managers.ChatManager(this);
 }
Exemple #4
0
        public Bot(MessageDispatcher messageDispatcher)
            : base(30)
        {
            if (messageDispatcher == null) throw new ArgumentNullException("messageDispatcher");
            Dispatcher = messageDispatcher;
            ConnectionType = ClientConnectionType.Disconnected;
            ClientInformations = new ClientInformations();
            ChatManager = new Managers.ChatManager(this);

            messageDispatcher.Enqueue(new BotCreatedMessage(), this);
        }
        private static void OnMessageDispatched(MessageDispatcher dispatcher, Message message)
        {
            var bot = (Bot)dispatcher.CurrentProcessor;
            var file = string.Format("{0}/log {1} {2}.log", Plugin.CurrentPlugin.GetPluginDirectory(), bot, Process.GetCurrentProcess().StartTime.ToString("dd MMM HH-mm-ss"));

            // this is thread safe
            try
            {
            File.AppendAllText(file, m_dumper.Dump(message) + "\r\n");
        }
            catch(Exception ex)
            {
                bot.Character.SendError("The log file for {0} can't be written in {1} : {2}", bot.Character, file, ex.Message);
                AllowLogging = false;
            }
        }
 public DispatcherTask(MessageDispatcher dispatcher, object processor)
 {
     Dispatcher = dispatcher;
     Processor  = processor;
 }
 public DispatcherTask(MessageDispatcher dispatcher)
 {
     Dispatcher = dispatcher;
     Processor  = this;
 }
 public DispatcherTask(MessageDispatcher dispatcher, object processor)
 {
     Dispatcher = dispatcher;
     Processor = processor;
 }
 public DispatcherTask(MessageDispatcher dispatcher)
 {
     Dispatcher = dispatcher;
     Processor = this;
 }