示例#1
0
        /// <summary>
        /// Write to a log
        /// </summary>
        /// <param name="content">the content to log</param>
        /// <param name="channel">which log to append it to</param>
        /// <param name="keepItQuiet">Announce it in game or not</param>
        public void WriteToLog(string content, string channel, bool beQuiet = false)
        {
            //Write to the log file first
            WriteLine(content, channel);

            //Quiet means only write to file, non-quiet means write to whomever is subscribed
            if (!beQuiet)
            {
                //write to people in game
                IEnumerable <IPlayer> peeps = LiveCache.GetAll <IPlayer>().Where(peep => peep.Template <IPlayerTemplate>() != null && peep.Template <IPlayerTemplate>().Account != null &&
                                                                                 peep.Template <IPlayerTemplate>().Account.LogChannelSubscriptions.Contains(channel));

                foreach (IPlayer peep in peeps)
                {
                    peep.WriteTo(new string[] { content });
                }
            }
        }
示例#2
0
        /// <summary>
        /// Write to a log
        /// </summary>
        /// <param name="content">the content to log</param>
        /// <param name="channel">which log to append it to</param>
        /// <param name="keepItQuiet">Announce it in game or not</param>
        public void WriteToLog(string content, string channel, bool beQuiet = false)
        {
            //Write to the log file first
            WriteToFile(content, channel);

            //Quiet means only write to file, non-quiet means write to whomever is subscribed
            if (!beQuiet)
            {
                //write to people in game
                var peeps = LiveCache.GetAll <IPlayer>().Where(peep => ((ICharacter)peep.DataTemplate).Account.LogChannelSubscriptions.Contains(channel));

                foreach (var peep in peeps)
                {
                    peep.WriteTo(new string[] { content });
                }

                //Low Priority TODO: Write to some source that can push to the web
            }
        }