30 using OpenSim.Framework;
31 using OpenSim.Region.CoreModules.Avatar.Attachments;
32 using OpenSim.Region.CoreModules.Avatar.Gods;
33 using OpenSim.Region.Framework.Interfaces;
34 using OpenSim.Region.Framework.Scenes;
36 namespace OpenSim.
Region.RegionCombinerModule
40 private Scene m_rootScene;
41 private Scene m_virtScene;
45 m_rootScene = rootScene;
46 m_virtScene = virtScene;
51 m_virtScene.UnSubscribeToClientPrimEvents(client);
52 m_virtScene.UnSubscribeToClientPrimRezEvents(client);
53 m_virtScene.UnSubscribeToClientInventoryEvents(client);
54 if(m_virtScene.AttachmentsModule != null)
55 ((
AttachmentsModule)m_virtScene.AttachmentsModule).UnsubscribeFromClientEvents(client);
57 m_virtScene.UnSubscribeToClientScriptEvents(client);
60 if (virtGodsModule != null)
61 ((
GodsModule)virtGodsModule).UnsubscribeFromClientEvents(client);
63 m_virtScene.UnSubscribeToClientNetworkEvents(client);
65 m_rootScene.SubscribeToClientPrimEvents(client);
66 client.OnAddPrim += LocalAddNewPrim;
67 client.OnRezObject += LocalRezObject;
69 m_rootScene.SubscribeToClientInventoryEvents(client);
70 if (m_rootScene.AttachmentsModule != null)
71 ((
AttachmentsModule)m_rootScene.AttachmentsModule).SubscribeToClientEvents(client);
73 m_rootScene.SubscribeToClientScriptEvents(client);
76 if (rootGodsModule != null)
77 ((
GodsModule)rootGodsModule).UnsubscribeFromClientEvents(client);
79 m_rootScene.SubscribeToClientNetworkEvents(client);
99 private void LocalRezObject(
IClientAPI remoteclient, UUID itemid, Vector3 rayend, Vector3 raystart,
100 UUID raytargetid, byte bypassraycast,
bool rayendisintersection,
bool rezselected,
bool removeitem,
103 int differenceX = (int)m_virtScene.RegionInfo.RegionLocX - (
int)m_rootScene.RegionInfo.RegionLocX;
104 int differenceY = (int)m_virtScene.RegionInfo.RegionLocY - (
int)m_rootScene.RegionInfo.RegionLocY;
106 rayend.Y += differenceY * (
int)Constants.RegionSize;
108 raystart.Y += differenceY * (
int)Constants.RegionSize;
110 m_rootScene.RezObject(remoteclient, itemid, rayend, raystart, raytargetid, bypassraycast,
111 rayendisintersection, rezselected, removeitem, fromtaskid);
125 private void LocalAddNewPrim(UUID ownerid, UUID groupid, Vector3 rayend, Quaternion rot,
127 byte rayendisintersection)
129 int differenceX = (int)m_virtScene.RegionInfo.RegionLocX - (
int)m_rootScene.RegionInfo.RegionLocX;
130 int differenceY = (int)m_virtScene.RegionInfo.RegionLocY - (
int)m_rootScene.RegionInfo.RegionLocY;
132 rayend.Y += differenceY * (
int)Constants.RegionSize;
134 raystart.Y += differenceY * (
int)Constants.RegionSize;
135 m_rootScene.AddNewPrim(ownerid, groupid, rayend, rot, shape, bypassraycast, raystart, raytargetid,
136 rayendisintersection);
RegionCombinerIndividualEventForwarder(Scene rootScene, Scene virtScene)
void ClientClosed(UUID clientid, Scene scene)
This interface provides god related methods
void ClientConnect(IClientAPI client)