* Ported InstantMessageModule to IClientCore
* See http://opensimulator.org/wiki/OpenSim_0.6_IClientAPI#InstantMessageModule.cs0.6.1-post-fixes
parent
73b85d2e84
commit
bec51a9580
|
@ -35,6 +35,7 @@ using log4net;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using Nwc.XmlRpc;
|
using Nwc.XmlRpc;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
|
using OpenSim.Framework.Client;
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
using OpenSim.Region.Environment.Scenes;
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
|
@ -74,12 +75,21 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
|
||||||
if (!m_scenes.Contains(scene))
|
if (!m_scenes.Contains(scene))
|
||||||
{
|
{
|
||||||
m_scenes.Add(scene);
|
m_scenes.Add(scene);
|
||||||
scene.EventManager.OnNewClient += OnNewClient;
|
scene.EventManager.OnClientConnect += OnClientConnect;
|
||||||
scene.EventManager.OnGridInstantMessage += OnGridInstantMessage;
|
scene.EventManager.OnGridInstantMessage += OnGridInstantMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnClientConnect(IClientCore client)
|
||||||
|
{
|
||||||
|
IClientIM clientIM;
|
||||||
|
if(client.TryGet(out clientIM))
|
||||||
|
{
|
||||||
|
clientIM.OnInstantMessage += OnInstantMessage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ReadConfig(IConfigSource config)
|
private void ReadConfig(IConfigSource config)
|
||||||
{
|
{
|
||||||
IConfig cnf = config.Configs["Startup"];
|
IConfig cnf = config.Configs["Startup"];
|
||||||
|
@ -109,11 +119,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void OnNewClient(IClientAPI client)
|
|
||||||
{
|
|
||||||
client.OnInstantMessage += OnInstantMessage;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnInstantMessage(IClientAPI client, UUID fromAgentID,
|
private void OnInstantMessage(IClientAPI client, UUID fromAgentID,
|
||||||
UUID fromAgentSession, UUID toAgentID,
|
UUID fromAgentSession, UUID toAgentID,
|
||||||
UUID imSessionID, uint timestamp, string fromAgentName,
|
UUID imSessionID, uint timestamp, string fromAgentName,
|
||||||
|
|
Loading…
Reference in New Issue