remove gods event subscription to gods module from scene
parent
63f3a16b72
commit
f84dbafb0c
|
@ -47,6 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
|||
m_scene = scene;
|
||||
m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
|
||||
m_scene.RegisterModuleInterface<IGodsModule>(this);
|
||||
m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
|
@ -54,6 +55,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
|||
public string Name { get { return "Gods Module"; } }
|
||||
public bool IsSharedModule { get { return false; } }
|
||||
|
||||
public void SubscribeToClientEvents(IClientAPI client)
|
||||
{
|
||||
client.OnGodKickUser += KickUser;
|
||||
client.OnRequestGodlikePowers += RequestGodlikePowers;
|
||||
}
|
||||
|
||||
public void UnsubscribeFromClientEvents(IClientAPI client)
|
||||
{
|
||||
client.OnGodKickUser -= KickUser;
|
||||
client.OnRequestGodlikePowers -= RequestGodlikePowers;
|
||||
}
|
||||
|
||||
public void RequestGodlikePowers(
|
||||
UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient)
|
||||
{
|
||||
|
|
|
@ -2787,7 +2787,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
SubscribeToClientScriptEvents(client);
|
||||
SubscribeToClientParcelEvents(client);
|
||||
SubscribeToClientGridEvents(client);
|
||||
SubscribeToClientGodEvents(client);
|
||||
SubscribeToClientNetworkEvents(client);
|
||||
}
|
||||
|
||||
|
@ -2798,8 +2797,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
|
||||
public virtual void SubscribeToClientPrimEvents(IClientAPI client)
|
||||
{
|
||||
|
||||
{
|
||||
client.OnUpdatePrimGroupPosition += m_sceneGraph.UpdatePrimPosition;
|
||||
client.OnUpdatePrimSinglePosition += m_sceneGraph.UpdatePrimSinglePosition;
|
||||
client.OnUpdatePrimGroupRotation += m_sceneGraph.UpdatePrimRotation;
|
||||
|
@ -2898,14 +2896,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
client.OnSetStartLocationRequest += SetHomeRezPoint;
|
||||
client.OnRegionHandleRequest += RegionHandleRequest;
|
||||
}
|
||||
|
||||
public virtual void SubscribeToClientGodEvents(IClientAPI client)
|
||||
{
|
||||
IGodsModule godsModule = RequestModuleInterface<IGodsModule>();
|
||||
client.OnGodKickUser += godsModule.KickUser;
|
||||
client.OnRequestGodlikePowers += godsModule.RequestGodlikePowers;
|
||||
}
|
||||
|
||||
|
||||
public virtual void SubscribeToClientNetworkEvents(IClientAPI client)
|
||||
{
|
||||
client.OnNetworkStatsUpdate += StatsReporter.AddPacketsStats;
|
||||
|
@ -2915,6 +2906,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// <summary>
|
||||
/// Unsubscribe the client from events.
|
||||
/// </summary>
|
||||
/// FIXME: Not called anywhere!
|
||||
/// <param name="client">The IClientAPI of the client</param>
|
||||
public virtual void UnSubscribeToClientEvents(IClientAPI client)
|
||||
{
|
||||
|
@ -2926,8 +2918,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
UnSubscribeToClientScriptEvents(client);
|
||||
UnSubscribeToClientParcelEvents(client);
|
||||
UnSubscribeToClientGridEvents(client);
|
||||
UnSubscribeToClientGodEvents(client);
|
||||
|
||||
UnSubscribeToClientNetworkEvents(client);
|
||||
}
|
||||
|
||||
|
@ -3036,13 +3026,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
client.OnRegionHandleRequest -= RegionHandleRequest;
|
||||
}
|
||||
|
||||
public virtual void UnSubscribeToClientGodEvents(IClientAPI client)
|
||||
{
|
||||
IGodsModule godsModule = RequestModuleInterface<IGodsModule>();
|
||||
client.OnGodKickUser -= godsModule.KickUser;
|
||||
client.OnRequestGodlikePowers -= godsModule.RequestGodlikePowers;
|
||||
}
|
||||
|
||||
public virtual void UnSubscribeToClientNetworkEvents(IClientAPI client)
|
||||
{
|
||||
client.OnNetworkStatsUpdate -= StatsReporter.AddPacketsStats;
|
||||
|
@ -5256,4 +5239,4 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
return offsets.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,6 +29,8 @@ using System;
|
|||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.CoreModules.Avatar.Attachments;
|
||||
using OpenSim.Region.CoreModules.Avatar.Gods;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.RegionCombinerModule
|
||||
|
@ -47,22 +49,31 @@ namespace OpenSim.Region.RegionCombinerModule
|
|||
public void ClientConnect(IClientAPI client)
|
||||
{
|
||||
m_virtScene.UnSubscribeToClientPrimEvents(client);
|
||||
m_virtScene.UnSubscribeToClientPrimRezEvents(client);
|
||||
m_virtScene.UnSubscribeToClientPrimRezEvents(client);
|
||||
m_virtScene.UnSubscribeToClientInventoryEvents(client);
|
||||
((AttachmentsModule)m_virtScene.AttachmentsModule).UnsubscribeFromClientEvents(client);
|
||||
//m_virtScene.UnSubscribeToClientTeleportEvents(client);
|
||||
m_virtScene.UnSubscribeToClientScriptEvents(client);
|
||||
m_virtScene.UnSubscribeToClientGodEvents(client);
|
||||
|
||||
IGodsModule virtGodsModule = m_virtScene.RequestModuleInterface<IGodsModule>();
|
||||
if (virtGodsModule != null)
|
||||
((GodsModule)virtGodsModule).UnsubscribeFromClientEvents(client);
|
||||
|
||||
m_virtScene.UnSubscribeToClientNetworkEvents(client);
|
||||
|
||||
m_rootScene.SubscribeToClientPrimEvents(client);
|
||||
client.OnAddPrim += LocalAddNewPrim;
|
||||
client.OnRezObject += LocalRezObject;
|
||||
|
||||
m_rootScene.SubscribeToClientInventoryEvents(client);
|
||||
((AttachmentsModule)m_rootScene.AttachmentsModule).SubscribeToClientEvents(client);
|
||||
((AttachmentsModule)m_rootScene.AttachmentsModule).SubscribeToClientEvents(client);
|
||||
//m_rootScene.SubscribeToClientTeleportEvents(client);
|
||||
m_rootScene.SubscribeToClientScriptEvents(client);
|
||||
m_rootScene.SubscribeToClientGodEvents(client);
|
||||
|
||||
IGodsModule rootGodsModule = m_virtScene.RequestModuleInterface<IGodsModule>();
|
||||
if (rootGodsModule != null)
|
||||
((GodsModule)rootGodsModule).UnsubscribeFromClientEvents(client);
|
||||
|
||||
m_rootScene.SubscribeToClientNetworkEvents(client);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue