From bcce66ad1f7d34dd1c11c3c7e5315ec83b2809aa Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Tue, 20 Apr 2010 11:42:23 -0700 Subject: [PATCH] Eliminate region archive passing --- .../RegionSyncModule/RegionSyncClient.cs | 14 +----------- .../RegionSyncModule/RegionSyncClientView.cs | 22 ------------------- .../RegionSyncModule/RegionSyncMessage.cs | 8 +++---- 3 files changed, 5 insertions(+), 39 deletions(-) diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClient.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClient.cs index f9e6b92c61..939f594c22 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClient.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClient.cs @@ -166,17 +166,6 @@ namespace OpenSim.Region.Examples.RegionSyncModule m_scene.Heightmap.LoadFromXmlString(Encoding.ASCII.GetString(msg.Data)); return HandlerSuccess(msg, "Syncrhonized terrain"); } - case RegionSyncMessage.MsgType.RegionArchive: - { - IRegionArchiverModule archiver = m_scene.RequestModuleInterface(); - if (archiver == null) - { - return HandlerFailure(msg, "Could not retrieve archiver module."); - } - MemoryStream ms = new MemoryStream(msg.Data); - archiver.DearchiveRegion(ms); - return HandlerSuccess(msg,"Synchronized region"); - } case RegionSyncMessage.MsgType.AddObject: case RegionSyncMessage.MsgType.UpdateObject: { @@ -201,7 +190,7 @@ namespace OpenSim.Region.Examples.RegionSyncModule Vector3 vel = data["vel"].AsVector3(); Quaternion rot = data["rot"].AsQuaternion(); - // We get the UUID of the object to be deleted, find it in the scene + // We get the UUID of the avatar to be updated, find it in the scene if (agentID != UUID.Zero) { ScenePresence presence = m_scene.GetScenePresence(agentID); @@ -313,7 +302,6 @@ namespace OpenSim.Region.Examples.RegionSyncModule m_scene.DeleteAllSceneObjects(); Send(new RegionSyncMessage(RegionSyncMessage.MsgType.GetTerrain)); Send(new RegionSyncMessage(RegionSyncMessage.MsgType.GetObjects)); - //Send(new RegionSyncMessage(RegionSyncMessage.MsgType.GetRegionArchive)); // Register for events which will be forwarded to authoritative scene m_scene.EventManager.OnNewClient += EventManager_OnNewClient; } diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClientView.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClientView.cs index 3ad112a60e..78a80d1174 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClientView.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClientView.cs @@ -140,28 +140,6 @@ namespace OpenSim.Region.Examples.RegionSyncModule Send(new RegionSyncMessage(RegionSyncMessage.MsgType.Terrain, m_scene.Heightmap.SaveToXmlString())); return HandlerSuccess(msg, "Terrain sent"); } - case RegionSyncMessage.MsgType.GetRegionArchive: - { - IRegionArchiverModule archiver = m_scene.RequestModuleInterface(); - if (archiver == null) - { - return HandlerFailure(msg, "Could not retrieve archiver module from scene"); - } - MemoryStream ms = new MemoryStream(); - // Remember the last time we archived this region to the ClientSyncServer - // Any updates after this time cannot be assumed to be in the archive stream - m_archive_time = DateTime.Now.Ticks; - archiver.ArchiveRegion(ms, Guid.Empty); - // *** - // The call to ArchiveRegion is asynchronous. We need a better way to know when it's done. - // For now, just sleep for 1 second. That will support a vary large region to be archived. - // Since this command is typically only executed when a new RegionSyncClient connects and - // is done on a RegionSyncServer thread, it should not impact other RegionSyncClients the - // RegionSyncServer, or the sim. - Thread.Sleep(1000); - Send(new RegionSyncMessage(RegionSyncMessage.MsgType.RegionArchive, ms.ToArray())); - return HandlerSuccess(msg, "Region archive sent"); - } case RegionSyncMessage.MsgType.AgentAdd: { OSDMap data = OSDParser.DeserializeJson(Encoding.ASCII.GetString(msg.Data)) as OSDMap; diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncMessage.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncMessage.cs index 6a0611feed..4911171811 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncMessage.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncMessage.cs @@ -20,17 +20,17 @@ namespace OpenSim.Region.Examples.RegionSyncModule AgentAdd, AgentUpdate, GetTerrain, - GetRegionArchive, GetObjects, - GetObject, + SubscribeObjects, + GetAvatars, + SubscribeAvatars, ChatFromClient, // SIM -> CM Terrain, - RegionArchive, AddObject, UpdateObject, RemoveObject, - AddAvatar, + AddAvatarResponse, UpdateAvatarTerse, RemoveAvatar, ChatFromSim,