Make chat and instant message modules fully subclassable

LSLKeyTest
Melanie Thielker 2016-06-14 00:03:40 +02:00
parent 3ef5e1a24b
commit 141205532b
2 changed files with 36 additions and 36 deletions

View File

@ -45,18 +45,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private const int DEBUG_CHANNEL = 2147483647;
protected const int DEBUG_CHANNEL = 2147483647;
private bool m_enabled = true;
private int m_saydistance = 20;
private int m_shoutdistance = 100;
private int m_whisperdistance = 10;
private List<Scene> m_scenes = new List<Scene>();
private List<string> FreezeCache = new List<string>();
private string m_adminPrefix = "";
internal object m_syncy = new object();
protected bool m_enabled = true;
protected int m_saydistance = 20;
protected int m_shoutdistance = 100;
protected int m_whisperdistance = 10;
protected List<Scene> m_scenes = new List<Scene>();
protected List<string> FreezeCache = new List<string>();
protected string m_adminPrefix = "";
protected object m_syncy = new object();
internal IConfig m_config;
protected IConfig m_config;
#region ISharedRegionModule Members
public virtual void Initialise(IConfigSource config)
@ -134,7 +134,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
{
}
public Type ReplaceableInterface
public virtual Type ReplaceableInterface
{
get { return null; }
}
@ -152,7 +152,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
client.OnChatFromClient += OnChatFromClient;
}
protected OSChatMessage FixPositionOfChatMessage(OSChatMessage c)
protected virtual OSChatMessage FixPositionOfChatMessage(OSChatMessage c)
{
ScenePresence avatar;
Scene scene = (Scene)c.Scene;
@ -324,7 +324,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully);
}
static private Vector3 CenterOfRegion = new Vector3(128, 128, 30);
static protected Vector3 CenterOfRegion = new Vector3(128, 128, 30);
public virtual void OnChatBroadcast(Object sender, OSChatMessage c)
{
@ -437,7 +437,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
}
Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>();
public void ParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
public virtual void ParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
{
System.Threading.Timer Timer;
if (flags == 0)
@ -456,7 +456,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
}
}
private void OnEndParcelFrozen(object avatar)
protected virtual void OnEndParcelFrozen(object avatar)
{
UUID target = (UUID)avatar;
FreezeCache.Remove(target.ToString());
@ -467,9 +467,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
}
#region SimulatorFeaturesRequest
static OSDInteger m_SayRange, m_WhisperRange, m_ShoutRange;
protected static OSDInteger m_SayRange, m_WhisperRange, m_ShoutRange;
private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features)
protected virtual void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features)
{
OSD extras = new OSDMap();
if (features.ContainsKey("OpenSimExtras"))

View File

@ -45,22 +45,22 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
private static readonly ILog m_log = LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
private Timer m_logTimer = new Timer(10000);
private List<GridInstantMessage> m_logData = new List<GridInstantMessage>();
private string m_restUrl;
protected Timer m_logTimer = new Timer(10000);
protected List<GridInstantMessage> m_logData = new List<GridInstantMessage>();
protected string m_restUrl;
/// <value>
/// Is this module enabled?
/// </value>
private bool m_enabled = false;
protected bool m_enabled = false;
private readonly List<Scene> m_scenes = new List<Scene>();
protected readonly List<Scene> m_scenes = new List<Scene>();
#region Region Module interface
private IMessageTransferModule m_TransferModule = null;
protected IMessageTransferModule m_TransferModule = null;
public void Initialise(IConfigSource config)
public virtual void Initialise(IConfigSource config)
{
if (config.Configs["Messaging"] != null)
{
@ -76,7 +76,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
m_logTimer.Elapsed += LogTimerElapsed;
}
public void AddRegion(Scene scene)
public virtual void AddRegion(Scene scene)
{
if (!m_enabled)
return;
@ -92,7 +92,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
}
public void RegionLoaded(Scene scene)
public virtual void RegionLoaded(Scene scene)
{
if (!m_enabled)
return;
@ -114,7 +114,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
}
public void RemoveRegion(Scene scene)
public virtual void RemoveRegion(Scene scene)
{
if (!m_enabled)
return;
@ -125,7 +125,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
}
void OnClientConnect(IClientCore client)
protected virtual void OnClientConnect(IClientCore client)
{
IClientIM clientIM;
if (client.TryGet(out clientIM))
@ -134,27 +134,27 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
}
public void PostInitialise()
public virtual void PostInitialise()
{
}
public void Close()
public virtual void Close()
{
}
public string Name
public virtual string Name
{
get { return "InstantMessageModule"; }
}
public Type ReplaceableInterface
public virtual Type ReplaceableInterface
{
get { return null; }
}
#endregion
public void OnInstantMessage(IClientAPI client, GridInstantMessage im)
public virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im)
{
byte dialog = im.dialog;
@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
///
/// </summary>
/// <param name="msg"></param>
private void OnGridInstantMessage(GridInstantMessage msg)
protected virtual void OnGridInstantMessage(GridInstantMessage msg)
{
// Just call the Text IM handler above
// This event won't be raised unless we have that agent,
@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
OnInstantMessage(null, msg);
}
private void LogInstantMesssage(GridInstantMessage im)
protected virtual void LogInstantMesssage(GridInstantMessage im)
{
if (m_logData.Count < 20)
{
@ -256,7 +256,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
}
private void LogTimerElapsed(object source, ElapsedEventArgs e)
protected virtual void LogTimerElapsed(object source, ElapsedEventArgs e)
{
lock (m_logData)
{