About

Logs all the chat on a region in the current OpenSim directory under the directory Chatlogs. Each file will be numbered by the current date in the format dd/MM/yy.

Code

//MRM:C#
///////////////////////////////////////////////////////////////////////////
//  Copyright (C) Wizardry and Steamworks 2013 - License: GNU GPLv3      //
//  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  //
//  rights of fair usage, the disclaimer and warranty conditions.        //
///////////////////////////////////////////////////////////////////////////
 
using OpenSim.Region.OptionalModules.Scripting.Minimodule;
using OpenMetaverse;
using System.IO;
 
namespace OpenSim  
{  
    class MiniModule : MRMBase  
    {  
        public override void Start()  
        {
            if(!Directory.Exists("Chatlogs")) {
                Directory.CreateDirectory("Chatlogs");
            }
            World.OnChat += World_OnChat;
        }
 
        void World_OnChat(IWorld sender, ChatEventArgs e)
        {
            if(e.Channel != 0) return;
            var dir = new DirectoryInfo(@"Chatlogs");
            using (StreamWriter w = File.AppendText(Path.Combine(@"Chatlogs", System.DateTime.Now.ToString("dd/MM/yy")) + ".txt")) {
                w.WriteLine(e.Sender.Name + ":" + e.Text);
            }
        }
 
        public override void Stop() {  
            World.OnChat -= World_OnChat;
        } 
    }
}

opensim/mini_region_modules/logging_chat/one_file.txt ยท Last modified: 2022/04/19 08:28 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.