Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

LSLKeyTest
Diva Canto 2016-06-13 18:04:50 -07:00
commit 467de7a2f0
3 changed files with 110 additions and 111 deletions

View File

@ -51,33 +51,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// A shim around LLUDPServer that implements the IClientNetworkServer interface /// A shim around LLUDPServer that implements the IClientNetworkServer interface
/// </summary> /// </summary>
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LLUDPServerShim")] [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LLUDPServerShim")]
public sealed class LLUDPServerShim : INonSharedRegionModule public class LLUDPServerShim : INonSharedRegionModule
{ {
private bool m_Enabled = true; protected IConfigSource m_Config;
private IConfigSource m_Config; protected LLUDPServer m_udpServer;
LLUDPServer m_udpServer;
#region INonSharedRegionModule #region INonSharedRegionModule
public string Name public virtual string Name
{ {
get { return "LLUDPServerShim"; } get { return "LLUDPServerShim"; }
} }
public Type ReplaceableInterface public virtual Type ReplaceableInterface
{ {
get { return null; } get { return null; }
} }
public void Initialise(IConfigSource source) public virtual void Initialise(IConfigSource source)
{ {
m_Config = source; m_Config = source;
} }
public void Close() public virtual void Close()
{ {
} }
public void AddRegion(Scene scene) public virtual void AddRegion(Scene scene)
{ {
uint port = (uint)scene.RegionInfo.InternalEndPoint.Port; uint port = (uint)scene.RegionInfo.InternalEndPoint.Port;
@ -88,23 +87,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AddScene(scene); AddScene(scene);
} }
public void RemoveRegion(Scene scene) public virtual void RemoveRegion(Scene scene)
{ {
Stop(); Stop();
} }
public void RegionLoaded(Scene scene) public virtual void RegionLoaded(Scene scene)
{ {
Start(); Start();
} }
#endregion #endregion
public void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) public virtual void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager)
{ {
m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager); m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager);
} }
public void AddScene(IScene scene) public virtual void AddScene(IScene scene)
{ {
m_udpServer.AddScene(scene); m_udpServer.AddScene(scene);
@ -228,17 +227,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
StatVerbosity.Debug)); StatVerbosity.Debug));
} }
public bool HandlesRegion(Location x) public virtual bool HandlesRegion(Location x)
{ {
return m_udpServer.HandlesRegion(x); return m_udpServer.HandlesRegion(x);
} }
public void Start() public virtual void Start()
{ {
m_udpServer.Start(); m_udpServer.Start();
} }
public void Stop() public virtual void Stop()
{ {
m_udpServer.Stop(); m_udpServer.Stop();
} }
@ -257,7 +256,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public const int MTU = 1400; public const int MTU = 1400;
/// <summary>Number of forced client logouts due to no receipt of packets before timeout.</summary> /// <summary>Number of forced client logouts due to no receipt of packets before timeout.</summary>
public int ClientLogoutsDueToNoReceives { get; private set; } public int ClientLogoutsDueToNoReceives { get; protected set; }
/// <summary> /// <summary>
/// Default packet debug level given to new clients /// Default packet debug level given to new clients
@ -284,12 +283,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <summary>Handlers for incoming packets</summary> /// <summary>Handlers for incoming packets</summary>
//PacketEventDictionary packetEvents = new PacketEventDictionary(); //PacketEventDictionary packetEvents = new PacketEventDictionary();
/// <summary>Incoming packets that are awaiting handling</summary> /// <summary>Incoming packets that are awaiting handling</summary>
//private OpenMetaverse.BlockingQueue<IncomingPacket> packetInbox = new OpenMetaverse.BlockingQueue<IncomingPacket>(); //protected OpenMetaverse.BlockingQueue<IncomingPacket> packetInbox = new OpenMetaverse.BlockingQueue<IncomingPacket>();
private OpenSim.Framework.BlockingQueue<IncomingPacket> packetInbox = new OpenSim.Framework.BlockingQueue<IncomingPacket>(); protected OpenSim.Framework.BlockingQueue<IncomingPacket> packetInbox = new OpenSim.Framework.BlockingQueue<IncomingPacket>();
/// <summary>Bandwidth throttle for this UDP server</summary> /// <summary>Bandwidth throttle for this UDP server</summary>
public TokenBucket Throttle { get; private set; } public TokenBucket Throttle { get; protected set; }
/// <summary>Per client throttle rates enforced by this server</summary> /// <summary>Per client throttle rates enforced by this server</summary>
/// <remarks> /// <remarks>
@ -297,43 +296,43 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// The other rates (resend, asset, etc.) are the defaults for a new client and can be changed (and usually /// The other rates (resend, asset, etc.) are the defaults for a new client and can be changed (and usually
/// do get changed immediately). They do not need to sum to the total. /// do get changed immediately). They do not need to sum to the total.
/// </remarks> /// </remarks>
public ThrottleRates ThrottleRates { get; private set; } public ThrottleRates ThrottleRates { get; protected set; }
/// <summary>Manages authentication for agent circuits</summary> /// <summary>Manages authentication for agent circuits</summary>
private AgentCircuitManager m_circuitManager; protected AgentCircuitManager m_circuitManager;
/// <summary>Reference to the scene this UDP server is attached to</summary> /// <summary>Reference to the scene this UDP server is attached to</summary>
public Scene Scene { get; private set; } public Scene Scene { get; protected set; }
/// <summary>The X/Y coordinates of the scene this UDP server is attached to</summary> /// <summary>The X/Y coordinates of the scene this UDP server is attached to</summary>
private Location m_location; protected Location m_location;
/// <summary>The size of the receive buffer for the UDP socket. This value /// <summary>The size of the receive buffer for the UDP socket. This value
/// is passed up to the operating system and used in the system networking /// is passed up to the operating system and used in the system networking
/// stack. Use zero to leave this value as the default</summary> /// stack. Use zero to leave this value as the default</summary>
private int m_recvBufferSize; protected int m_recvBufferSize;
/// <summary>Flag to process packets asynchronously or synchronously</summary> /// <summary>Flag to process packets asynchronously or synchronously</summary>
private bool m_asyncPacketHandling; protected bool m_asyncPacketHandling;
/// <summary>Tracks whether or not a packet was sent each round so we know /// <summary>Tracks whether or not a packet was sent each round so we know
/// whether or not to sleep</summary> /// whether or not to sleep</summary>
private bool m_packetSent; protected bool m_packetSent;
/// <summary>Environment.TickCount of the last time that packet stats were reported to the scene</summary> /// <summary>Environment.TickCount of the last time that packet stats were reported to the scene</summary>
private int m_elapsedMSSinceLastStatReport = 0; protected int m_elapsedMSSinceLastStatReport = 0;
/// <summary>Environment.TickCount of the last time the outgoing packet handler executed</summary> /// <summary>Environment.TickCount of the last time the outgoing packet handler executed</summary>
private int m_tickLastOutgoingPacketHandler; protected int m_tickLastOutgoingPacketHandler;
/// <summary>Keeps track of the number of elapsed milliseconds since the last time the outgoing packet handler looped</summary> /// <summary>Keeps track of the number of elapsed milliseconds since the last time the outgoing packet handler looped</summary>
private int m_elapsedMSOutgoingPacketHandler; protected int m_elapsedMSOutgoingPacketHandler;
/// <summary>Keeps track of the number of 100 millisecond periods elapsed in the outgoing packet handler executed</summary> /// <summary>Keeps track of the number of 100 millisecond periods elapsed in the outgoing packet handler executed</summary>
private int m_elapsed100MSOutgoingPacketHandler; protected int m_elapsed100MSOutgoingPacketHandler;
/// <summary>Keeps track of the number of 500 millisecond periods elapsed in the outgoing packet handler executed</summary> /// <summary>Keeps track of the number of 500 millisecond periods elapsed in the outgoing packet handler executed</summary>
private int m_elapsed500MSOutgoingPacketHandler; protected int m_elapsed500MSOutgoingPacketHandler;
/// <summary>Flag to signal when clients should check for resends</summary> /// <summary>Flag to signal when clients should check for resends</summary>
protected bool m_resendUnacked; protected bool m_resendUnacked;
@ -344,7 +343,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <summary>Flag to signal when clients should send pings</summary> /// <summary>Flag to signal when clients should send pings</summary>
protected bool m_sendPing; protected bool m_sendPing;
private int m_animationSequenceNumber; protected int m_animationSequenceNumber;
public int NextAnimationSequenceNumber public int NextAnimationSequenceNumber
{ {
@ -359,7 +358,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private ExpiringCache<IPEndPoint, Queue<UDPPacketBuffer>> m_pendingCache = new ExpiringCache<IPEndPoint, Queue<UDPPacketBuffer>>(); protected ExpiringCache<IPEndPoint, Queue<UDPPacketBuffer>> m_pendingCache = new ExpiringCache<IPEndPoint, Queue<UDPPacketBuffer>>();
/// <summary> /// <summary>
/// Event used to signal when queued packets are available for sending. /// Event used to signal when queued packets are available for sending.
@ -369,25 +368,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// Some data is sent immediately and not queued. That data would not trigger this event. /// Some data is sent immediately and not queued. That data would not trigger this event.
/// WRONG use. May be usefull in future revision /// WRONG use. May be usefull in future revision
/// </remarks> /// </remarks>
// private AutoResetEvent m_dataPresentEvent = new AutoResetEvent(false); // protected AutoResetEvent m_dataPresentEvent = new AutoResetEvent(false);
private Pool<IncomingPacket> m_incomingPacketPool; protected Pool<IncomingPacket> m_incomingPacketPool;
/// <summary> /// <summary>
/// Stat for number of packets in the main pool awaiting use. /// Stat for number of packets in the main pool awaiting use.
/// </summary> /// </summary>
private Stat m_poolCountStat; protected Stat m_poolCountStat;
/// <summary> /// <summary>
/// Stat for number of packets in the inbound packet pool awaiting use. /// Stat for number of packets in the inbound packet pool awaiting use.
/// </summary> /// </summary>
private Stat m_incomingPacketPoolStat; protected Stat m_incomingPacketPoolStat;
private int m_defaultRTO = 0; protected int m_defaultRTO = 0;
private int m_maxRTO = 0; protected int m_maxRTO = 0;
private int m_ackTimeout = 0; protected int m_ackTimeout = 0;
private int m_pausedAckTimeout = 0; protected int m_pausedAckTimeout = 0;
private bool m_disableFacelights = false; protected bool m_disableFacelights = false;
public Socket Server { get { return null; } } public Socket Server { get { return null; } }
@ -409,28 +408,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <summary> /// <summary>
/// Record how many inbound packets could not be recognized as LLUDP packets. /// Record how many inbound packets could not be recognized as LLUDP packets.
/// </summary> /// </summary>
public int IncomingMalformedPacketCount { get; private set; } public int IncomingMalformedPacketCount { get; protected set; }
/// <summary> /// <summary>
/// Record how many inbound packets could not be associated with a simulator circuit. /// Record how many inbound packets could not be associated with a simulator circuit.
/// </summary> /// </summary>
public int IncomingOrphanedPacketCount { get; private set; } public int IncomingOrphanedPacketCount { get; protected set; }
/// <summary> /// <summary>
/// Record current outgoing client for monitoring purposes. /// Record current outgoing client for monitoring purposes.
/// </summary> /// </summary>
private IClientAPI m_currentOutgoingClient; protected IClientAPI m_currentOutgoingClient;
/// <summary> /// <summary>
/// Recording current incoming client for monitoring purposes. /// Recording current incoming client for monitoring purposes.
/// </summary> /// </summary>
private IClientAPI m_currentIncomingClient; protected IClientAPI m_currentIncomingClient;
/// <summary> /// <summary>
/// Queue some low priority but potentially high volume async requests so that they don't overwhelm available /// Queue some low priority but potentially high volume async requests so that they don't overwhelm available
/// threadpool threads. /// threadpool threads.
/// </summary> /// </summary>
public JobEngine IpahEngine { get; private set; } public JobEngine IpahEngine { get; protected set; }
/// <summary> /// <summary>
/// Run queue empty processing within a single persistent thread. /// Run queue empty processing within a single persistent thread.
@ -440,7 +439,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// connection schedule its own job in the threadpool which causes performance problems when there are many /// connection schedule its own job in the threadpool which causes performance problems when there are many
/// connections. /// connections.
/// </remarks> /// </remarks>
public JobEngine OqrEngine { get; private set; } public JobEngine OqrEngine { get; protected set; }
public LLUDPServer( public LLUDPServer(
IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port,
@ -662,7 +661,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// If the outgoing UDP thread times out, then return client that was being processed to help with debugging. /// If the outgoing UDP thread times out, then return client that was being processed to help with debugging.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
private string GetWatchdogIncomingAlarmData() protected string GetWatchdogIncomingAlarmData()
{ {
return string.Format( return string.Format(
"Client is {0}", "Client is {0}",
@ -673,7 +672,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// If the outgoing UDP thread times out, then return client that was being processed to help with debugging. /// If the outgoing UDP thread times out, then return client that was being processed to help with debugging.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
private string GetWatchdogOutgoingAlarmData() protected string GetWatchdogOutgoingAlarmData()
{ {
return string.Format( return string.Format(
"Client is {0}", "Client is {0}",
@ -1237,7 +1236,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
outgoingPacket.TickCount = Environment.TickCount & Int32.MaxValue; outgoingPacket.TickCount = Environment.TickCount & Int32.MaxValue;
} }
private void RecordMalformedInboundPacket(IPEndPoint endPoint) protected void RecordMalformedInboundPacket(IPEndPoint endPoint)
{ {
// if (m_malformedCount < 100) // if (m_malformedCount < 100)
// m_log.DebugFormat("[LLUDPSERVER]: Dropped malformed packet: " + e.ToString()); // m_log.DebugFormat("[LLUDPSERVER]: Dropped malformed packet: " + e.ToString());
@ -1666,7 +1665,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#endregion BinaryStats #endregion BinaryStats
private void HandleUseCircuitCode(object o) protected void HandleUseCircuitCode(object o)
{ {
IPEndPoint endPoint = null; IPEndPoint endPoint = null;
IClientAPI client = null; IClientAPI client = null;
@ -1775,7 +1774,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
} }
/* /*
private void HandleCompleteMovementIntoRegion(object o) protected void HandleCompleteMovementIntoRegion(object o)
{ {
IPEndPoint endPoint = null; IPEndPoint endPoint = null;
IClientAPI client = null; IClientAPI client = null;
@ -1895,7 +1894,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// </remarks> /// </remarks>
/// <param name="remoteEndpoint"></param> /// <param name="remoteEndpoint"></param>
/// <param name="sequenceNumber"></param> /// <param name="sequenceNumber"></param>
private void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber) protected void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber)
{ {
PacketAckPacket ack = new PacketAckPacket(); PacketAckPacket ack = new PacketAckPacket();
ack.Header.Reliable = false; ack.Header.Reliable = false;
@ -1919,7 +1918,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AsyncBeginSend(buffer); AsyncBeginSend(buffer);
} }
private bool IsClientAuthorized(UseCircuitCodePacket useCircuitCode, out AuthenticateResponse sessionInfo) protected bool IsClientAuthorized(UseCircuitCodePacket useCircuitCode, out AuthenticateResponse sessionInfo)
{ {
UUID agentID = useCircuitCode.CircuitCode.ID; UUID agentID = useCircuitCode.CircuitCode.ID;
UUID sessionID = useCircuitCode.CircuitCode.SessionID; UUID sessionID = useCircuitCode.CircuitCode.SessionID;
@ -1989,7 +1988,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// </remarks> /// </remarks>
/// <param name='client'></param> /// <param name='client'></param>
/// <param name='timeoutTicks'></param> /// <param name='timeoutTicks'></param>
private void DeactivateClientDueToTimeout(LLClientView client, int timeoutTicks) protected void DeactivateClientDueToTimeout(LLClientView client, int timeoutTicks)
{ {
lock (client.CloseSyncLock) lock (client.CloseSyncLock)
{ {
@ -2010,7 +2009,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
client.Close(true,true); client.Close(true,true);
} }
private void IncomingPacketHandler() protected void IncomingPacketHandler()
{ {
Thread.CurrentThread.Priority = ThreadPriority.Highest; Thread.CurrentThread.Priority = ThreadPriority.Highest;
IncomingPacket incomingPacket; IncomingPacket incomingPacket;
@ -2052,7 +2051,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
Watchdog.RemoveThread(); Watchdog.RemoveThread();
} }
private void OutgoingPacketHandler() protected void OutgoingPacketHandler()
{ {
Thread.CurrentThread.Priority = ThreadPriority.Highest; Thread.CurrentThread.Priority = ThreadPriority.Highest;
@ -2181,27 +2180,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#region Emergency Monitoring #region Emergency Monitoring
// Alternative packet handler fuull of instrumentation // Alternative packet handler fuull of instrumentation
// Handy for hunting bugs // Handy for hunting bugs
private Stopwatch watch1 = new Stopwatch(); protected Stopwatch watch1 = new Stopwatch();
private Stopwatch watch2 = new Stopwatch(); protected Stopwatch watch2 = new Stopwatch();
private float avgProcessingTicks = 0; protected float avgProcessingTicks = 0;
private float avgResendUnackedTicks = 0; protected float avgResendUnackedTicks = 0;
private float avgSendAcksTicks = 0; protected float avgSendAcksTicks = 0;
private float avgSendPingTicks = 0; protected float avgSendPingTicks = 0;
private float avgDequeueTicks = 0; protected float avgDequeueTicks = 0;
private long nticks = 0; protected long nticks = 0;
private long nticksUnack = 0; protected long nticksUnack = 0;
private long nticksAck = 0; protected long nticksAck = 0;
private long nticksPing = 0; protected long nticksPing = 0;
private int npacksSent = 0; protected int npacksSent = 0;
private int npackNotSent = 0; protected int npackNotSent = 0;
/// <summary> /// <summary>
/// Number of inbound packets processed since startup. /// Number of inbound packets processed since startup.
/// </summary> /// </summary>
public long IncomingPacketsProcessed { get; private set; } public long IncomingPacketsProcessed { get; protected set; }
private void MonitoredClientOutgoingPacketHandler(IClientAPI client) protected void MonitoredClientOutgoingPacketHandler(IClientAPI client)
{ {
nticks++; nticks++;
watch1.Start(); watch1.Start();
@ -2296,7 +2295,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#endregion #endregion
private void ProcessInPacket(IncomingPacket incomingPacket) protected void ProcessInPacket(IncomingPacket incomingPacket)
{ {
Packet packet = incomingPacket.Packet; Packet packet = incomingPacket.Packet;
LLClientView client = incomingPacket.Client; LLClientView client = incomingPacket.Client;

View File

@ -45,18 +45,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
private static readonly ILog m_log = private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private const int DEBUG_CHANNEL = 2147483647; protected const int DEBUG_CHANNEL = 2147483647;
private bool m_enabled = true; protected bool m_enabled = true;
private int m_saydistance = 20; protected int m_saydistance = 20;
private int m_shoutdistance = 100; protected int m_shoutdistance = 100;
private int m_whisperdistance = 10; protected int m_whisperdistance = 10;
private List<Scene> m_scenes = new List<Scene>(); protected List<Scene> m_scenes = new List<Scene>();
private List<string> FreezeCache = new List<string>(); protected List<string> FreezeCache = new List<string>();
private string m_adminPrefix = ""; protected string m_adminPrefix = "";
internal object m_syncy = new object(); protected object m_syncy = new object();
internal IConfig m_config; protected IConfig m_config;
#region ISharedRegionModule Members #region ISharedRegionModule Members
public virtual void Initialise(IConfigSource config) 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; } get { return null; }
} }
@ -152,7 +152,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
client.OnChatFromClient += OnChatFromClient; client.OnChatFromClient += OnChatFromClient;
} }
protected OSChatMessage FixPositionOfChatMessage(OSChatMessage c) protected virtual OSChatMessage FixPositionOfChatMessage(OSChatMessage c)
{ {
ScenePresence avatar; ScenePresence avatar;
Scene scene = (Scene)c.Scene; 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); 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) 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>(); 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; System.Threading.Timer Timer;
if (flags == 0) 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; UUID target = (UUID)avatar;
FreezeCache.Remove(target.ToString()); FreezeCache.Remove(target.ToString());
@ -467,9 +467,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
} }
#region SimulatorFeaturesRequest #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(); OSD extras = new OSDMap();
if (features.ContainsKey("OpenSimExtras")) if (features.ContainsKey("OpenSimExtras"))

View File

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