About

Logs chat to the current OpenSim directory under Chatlogs and saves the logs named after the agents.

Code

chat_logger.cs
//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", e.Sender.Name) + ".txt")) {
                w.WriteLine(e.Text);
            }
        }
 
        public override void Stop() {  
            World.OnChat -= World_OnChat;
        } 
    }
}

opensim/mini_region_modules/logging_chat/per_agent.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.