diff options
Diffstat (limited to '')
3 files changed, 67 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs b/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs index 423f0b5..89ee61a 100644 --- a/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs +++ b/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs | |||
@@ -152,18 +152,19 @@ namespace OpenSim.Region.Environment.Modules.Grid.Interregion | |||
152 | 152 | ||
153 | public void PostInitialise() | 153 | public void PostInitialise() |
154 | { | 154 | { |
155 | if (m_enabled) | 155 | // Commenting out to remove 'unreachable code' warning since m_enabled is never true |
156 | { | 156 | // if (m_enabled) |
157 | try | 157 | // { |
158 | { | 158 | // try |
159 | m_tcpPort = m_config.Configs["Comms"].GetInt("remoting_port", m_tcpPort); | 159 | // { |
160 | } | 160 | // m_tcpPort = m_config.Configs["Comms"].GetInt("remoting_port", m_tcpPort); |
161 | catch | 161 | // } |
162 | { | 162 | // catch |
163 | } | 163 | // { |
164 | 164 | // } | |
165 | internal_CreateRemotingObjects(); | 165 | // |
166 | } | 166 | // internal_CreateRemotingObjects(); |
167 | // } | ||
167 | } | 168 | } |
168 | 169 | ||
169 | public void Close() | 170 | public void Close() |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs index cba04c4..ce78f21 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs | |||
@@ -26,7 +26,9 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenSim.Region.Environment.Interfaces; | 28 | using OpenSim.Region.Environment.Interfaces; |
29 | using OpenSim.Region.Environment.Modules.World.Serialiser; | ||
29 | using OpenSim.Region.Environment.Scenes; | 30 | using OpenSim.Region.Environment.Scenes; |
31 | using System.Collections.Generic; | ||
30 | using System.Reflection; | 32 | using System.Reflection; |
31 | using log4net; | 33 | using log4net; |
32 | using Nini.Config; | 34 | using Nini.Config; |
@@ -39,32 +41,76 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
39 | public class ArchiverModule : IRegionModule, IRegionArchiver | 41 | public class ArchiverModule : IRegionModule, IRegionArchiver |
40 | { | 42 | { |
41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | |||
45 | /// <summary> | ||
46 | /// Scene to which this module belongs | ||
47 | /// </summary> | ||
48 | /// <param name="scene"></param> | ||
49 | /// <param name="source"></param> | ||
50 | private Scene m_scene; | ||
42 | 51 | ||
43 | public string Name { get { return "ArchiverModule"; } } | 52 | public string Name { get { return "ArchiverModule"; } } |
44 | 53 | ||
45 | public bool IsSharedModule { get { return true; } } | 54 | public bool IsSharedModule { get { return false; } } |
46 | 55 | ||
47 | public void Initialise(Scene scene, IConfigSource source) | 56 | public void Initialise(Scene scene, IConfigSource source) |
48 | { | 57 | { |
49 | scene.RegisterModuleInterface<IRegionArchiver>(this); | 58 | m_scene = scene; |
59 | |||
60 | m_scene.RegisterModuleInterface<IRegionArchiver>(this); | ||
50 | } | 61 | } |
51 | 62 | ||
52 | public void PostInitialise() | 63 | public void PostInitialise() |
53 | { | 64 | { |
54 | } | 65 | } |
55 | 66 | ||
56 | public void Close() | 67 | public void Close() |
57 | { | 68 | { |
58 | } | 69 | } |
59 | 70 | ||
60 | public void ArchiveRegion(Scene scene, string savePath) | 71 | public void ArchiveRegion(string savePath) |
61 | { | 72 | { |
62 | m_log.Warn("[ARCHIVER]: Archive region not yet implemented"); | 73 | m_log.Warn("[ARCHIVER]: Archive region not yet implemented"); |
74 | |||
75 | List<EntityBase> entities = m_scene.GetEntities(); | ||
76 | string serEntities = SerializeObjects(entities); | ||
77 | |||
78 | if (serEntities != null && serEntities.Length > 0) | ||
79 | { | ||
80 | m_log.DebugFormat("[ARCHIVER]: Successfully got serialization for {0} entities", entities.Count); | ||
81 | } | ||
63 | } | 82 | } |
64 | 83 | ||
65 | public void DearchiveRegion(Scene scene, string loadPath) | 84 | public void DearchiveRegion(string loadPath) |
66 | { | 85 | { |
67 | m_log.Warn("[ARCHIVER]: Dearchive region not yet implemented"); | 86 | m_log.Warn("[ARCHIVER]: Dearchive region not yet implemented"); |
68 | } | 87 | } |
88 | |||
89 | /// <summary> | ||
90 | /// Get an xml representation of the given scene objects. | ||
91 | /// </summary> | ||
92 | /// <param name="scene"></param> | ||
93 | /// <returns></returns> | ||
94 | private static string SerializeObjects(List<EntityBase> entities) | ||
95 | { | ||
96 | string serialization = "<scene>"; | ||
97 | |||
98 | List<string> serObjects = new List<string>(); | ||
99 | |||
100 | foreach (EntityBase ent in entities) | ||
101 | { | ||
102 | if (ent is SceneObjectGroup) | ||
103 | { | ||
104 | serObjects.Add(((SceneObjectGroup) ent).ToXmlString2()); | ||
105 | } | ||
106 | } | ||
107 | |||
108 | foreach (string serObject in serObjects) | ||
109 | serialization += serObject; | ||
110 | |||
111 | serialization += "</scene>"; | ||
112 | |||
113 | return serialization; | ||
114 | } | ||
69 | } | 115 | } |
70 | } \ No newline at end of file | 116 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/IRegionArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/IRegionArchiver.cs index 1cebb50..485cf02 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/IRegionArchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/IRegionArchiver.cs | |||
@@ -35,17 +35,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
35 | public interface IRegionArchiver | 35 | public interface IRegionArchiver |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// Archive a region to the given path | 38 | /// Archive the region to the given path |
39 | /// </summary> | 39 | /// </summary> |
40 | /// <param name="scene"></param> | ||
41 | /// <param name="savePath"></param> | 40 | /// <param name="savePath"></param> |
42 | void ArchiveRegion(Scene scene, string savePath); | 41 | void ArchiveRegion(string savePath); |
43 | 42 | ||
44 | /// <summary> | 43 | /// <summary> |
45 | /// Dearchive the given region archive into the scene | 44 | /// Dearchive the given region archive into the scene |
46 | /// </summary> | 45 | /// </summary> |
47 | /// <param name="scene"></param> | ||
48 | /// <param name="loadPath"></param> | 46 | /// <param name="loadPath"></param> |
49 | void DearchiveRegion(Scene scene, string loadPath); | 47 | void DearchiveRegion(string loadPath); |
50 | } | 48 | } |
51 | } | 49 | } |