diff options
author | MW | 2007-12-01 14:20:37 +0000 |
---|---|---|
committer | MW | 2007-12-01 14:20:37 +0000 |
commit | 27f182ac54ffee16da730b2053480944f9ca5412 (patch) | |
tree | 86b7188f3d05afd3753d833a2000827a623e0b55 /OpenSim/Region/Environment/Scenes/Scene.cs | |
parent | set svn:eol-style (diff) | |
download | opensim-SC-27f182ac54ffee16da730b2053480944f9ca5412.zip opensim-SC-27f182ac54ffee16da730b2053480944f9ca5412.tar.gz opensim-SC-27f182ac54ffee16da730b2053480944f9ca5412.tar.bz2 opensim-SC-27f182ac54ffee16da730b2053480944f9ca5412.tar.xz |
Part 1 of a commit. This revision will not compile, part 2 will be added in a couple of minutes that should fix that.
Some work towards persisting Avatar Appearance (what is being worn).
Added OnAvatarNowWearing event to IClientAPI that is triggered by AgentIsNowWearing packets.
stub code to subscribe to this event in AvatarFactoryModule.
Todo: code needs to be added to AvatarFactoryModule to save the uuids to a database and then read them back when that modules TryGetIntialAvatarAppearance() method is called.
Done some changes to Scene to make it easier to subclass it: including changed some private fields to protected and made some methods virtual.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index f2eb486..39f1620 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -96,11 +96,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
96 | 96 | ||
97 | public IXfer XferManager; | 97 | public IXfer XferManager; |
98 | 98 | ||
99 | private IHttpRequests m_httpRequestModule; | 99 | protected IHttpRequests m_httpRequestModule; |
100 | private ISimChat m_simChatModule; | 100 | protected ISimChat m_simChatModule; |
101 | private IXMLRPC m_xmlrpcModule; | 101 | protected IXMLRPC m_xmlrpcModule; |
102 | private IWorldComm m_worldCommModule; | 102 | protected IWorldComm m_worldCommModule; |
103 | private IAvatarFactory m_AvatarFactory; | 103 | protected IAvatarFactory m_AvatarFactory; |
104 | 104 | ||
105 | // Central Update Loop | 105 | // Central Update Loop |
106 | 106 | ||
@@ -128,14 +128,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
128 | get { return m_authenticateHandler; } | 128 | get { return m_authenticateHandler; } |
129 | } | 129 | } |
130 | 130 | ||
131 | private readonly LandManager m_LandManager; | 131 | protected readonly LandManager m_LandManager; |
132 | 132 | ||
133 | public LandManager LandManager | 133 | public LandManager LandManager |
134 | { | 134 | { |
135 | get { return m_LandManager; } | 135 | get { return m_LandManager; } |
136 | } | 136 | } |
137 | 137 | ||
138 | private readonly EstateManager m_estateManager; | 138 | protected readonly EstateManager m_estateManager; |
139 | 139 | ||
140 | public PhysicsScene PhysicsScene | 140 | public PhysicsScene PhysicsScene |
141 | { | 141 | { |
@@ -158,7 +158,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
158 | get { return m_timedilation; } | 158 | get { return m_timedilation; } |
159 | } | 159 | } |
160 | 160 | ||
161 | private readonly PermissionManager m_permissionManager; | 161 | protected readonly PermissionManager m_permissionManager; |
162 | 162 | ||
163 | public PermissionManager PermissionsMngr | 163 | public PermissionManager PermissionsMngr |
164 | { | 164 | { |
@@ -267,7 +267,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
267 | 267 | ||
268 | public override bool OtherRegionUp(RegionInfo otherRegion) | 268 | public override bool OtherRegionUp(RegionInfo otherRegion) |
269 | { | 269 | { |
270 | // Another region is up. We have to tell all our ScenePresences about it | 270 | /* // Another region is up. We have to tell all our ScenePresences about it |
271 | // This fails to get the desired effect and needs further work. | 271 | // This fails to get the desired effect and needs further work. |
272 | 272 | ||
273 | if (RegionInfo.RegionHandle != otherRegion.RegionHandle) | 273 | if (RegionInfo.RegionHandle != otherRegion.RegionHandle) |
@@ -289,7 +289,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
289 | MainLog.Instance.Verbose("INTERGRID", "Got notice about Region at X:" + otherRegion.RegionLocX.ToString() + " Y:" + otherRegion.RegionLocY.ToString() + " but it was too far away to send to the client"); | 289 | MainLog.Instance.Verbose("INTERGRID", "Got notice about Region at X:" + otherRegion.RegionLocX.ToString() + " Y:" + otherRegion.RegionLocY.ToString() + " but it was too far away to send to the client"); |
290 | } | 290 | } |
291 | 291 | ||
292 | } | 292 | }*/ |
293 | return true; | 293 | return true; |
294 | } | 294 | } |
295 | 295 | ||
@@ -366,7 +366,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
366 | } | 366 | } |
367 | } | 367 | } |
368 | // Reset list to nothing. | 368 | // Reset list to nothing. |
369 | m_regionRestartNotifyList = new List<RegionInfo>(); | 369 | m_regionRestartNotifyList.Clear(); |
370 | } | 370 | } |
371 | 371 | ||
372 | public override void Close() | 372 | public override void Close() |
@@ -397,7 +397,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
397 | m_innerScene.Close(); | 397 | m_innerScene.Close(); |
398 | UnRegisterReginWithComms(); | 398 | UnRegisterReginWithComms(); |
399 | 399 | ||
400 | foreach (IRegionModule module in this.Modules.Values) | 400 | foreach (IRegionModule module in Modules.Values) |
401 | { | 401 | { |
402 | if (!module.IsSharedModule) | 402 | if (!module.IsSharedModule) |
403 | { | 403 | { |
@@ -427,6 +427,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
427 | m_xmlrpcModule = RequestModuleInterface<IXMLRPC>(); | 427 | m_xmlrpcModule = RequestModuleInterface<IXMLRPC>(); |
428 | m_worldCommModule = RequestModuleInterface<IWorldComm>(); | 428 | m_worldCommModule = RequestModuleInterface<IWorldComm>(); |
429 | XferManager = RequestModuleInterface<IXfer>(); | 429 | XferManager = RequestModuleInterface<IXfer>(); |
430 | m_AvatarFactory = RequestModuleInterface<IAvatarFactory>(); | ||
430 | } | 431 | } |
431 | 432 | ||
432 | #endregion | 433 | #endregion |
@@ -792,7 +793,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
792 | /// </summary> | 793 | /// </summary> |
793 | /// <param name="addPacket"></param> | 794 | /// <param name="addPacket"></param> |
794 | /// <param name="ownerID"></param> | 795 | /// <param name="ownerID"></param> |
795 | public void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape) | 796 | public virtual void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape) |
796 | { | 797 | { |
797 | 798 | ||
798 | // What we're *supposed* to do is raytrace from the camera position given by the client to the nearest collision | 799 | // What we're *supposed* to do is raytrace from the camera position given by the client to the nearest collision |
@@ -1015,18 +1016,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1015 | EventManager.TriggerOnNewClient(client); | 1016 | EventManager.TriggerOnNewClient(client); |
1016 | } | 1017 | } |
1017 | 1018 | ||
1018 | protected ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child) | 1019 | protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child) |
1019 | { | 1020 | { |
1020 | ScenePresence avatar = null; | 1021 | ScenePresence avatar = null; |
1021 | 1022 | ||
1022 | byte[] visualParams; | 1023 | byte[] visualParams; |
1023 | AvatarWearable[] wearables; | 1024 | AvatarWearable[] wearables; |
1024 | 1025 | LoadAvatarAppearance(client, out visualParams, out wearables); | |
1025 | if (m_AvatarFactory == null || | ||
1026 | !m_AvatarFactory.TryGetIntialAvatarAppearance(client.AgentId, out wearables, out visualParams)) | ||
1027 | { | ||
1028 | AvatarFactoryModule.GetDefaultAvatarAppearance(out wearables, out visualParams); | ||
1029 | } | ||
1030 | 1026 | ||
1031 | avatar = m_innerScene.CreateAndAddScenePresence(client, child, wearables, visualParams); | 1027 | avatar = m_innerScene.CreateAndAddScenePresence(client, child, wearables, visualParams); |
1032 | 1028 | ||
@@ -1038,6 +1034,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
1038 | return avatar; | 1034 | return avatar; |
1039 | } | 1035 | } |
1040 | 1036 | ||
1037 | protected void LoadAvatarAppearance(IClientAPI client, out byte[] visualParams, out AvatarWearable[] wearables) | ||
1038 | { | ||
1039 | if (m_AvatarFactory == null || | ||
1040 | !m_AvatarFactory.TryGetIntialAvatarAppearance(client.AgentId, out wearables, out visualParams)) | ||
1041 | { | ||
1042 | AvatarFactoryModule.GetDefaultAvatarAppearance(out wearables, out visualParams); | ||
1043 | } | ||
1044 | } | ||
1045 | |||
1041 | 1046 | ||
1042 | /// <summary> | 1047 | /// <summary> |
1043 | /// | 1048 | /// |
@@ -1145,6 +1150,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1145 | m_sceneGridService.KillObject = SendKillObject; | 1150 | m_sceneGridService.KillObject = SendKillObject; |
1146 | } | 1151 | } |
1147 | 1152 | ||
1153 | |||
1148 | public void UnRegisterReginWithComms() | 1154 | public void UnRegisterReginWithComms() |
1149 | { | 1155 | { |
1150 | m_sceneGridService.OnRegionUp -= OtherRegionUp; | 1156 | m_sceneGridService.OnRegionUp -= OtherRegionUp; |