diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs b/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs index 3dcc020..809d863 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs | |||
@@ -70,6 +70,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
70 | /// If null then the region doesn't have a corresponding scene, and it won't be loaded. | 70 | /// If null then the region doesn't have a corresponding scene, and it won't be loaded. |
71 | /// </summary> | 71 | /// </summary> |
72 | public Scene Scene { get; set; } | 72 | public Scene Scene { get; set; } |
73 | |||
74 | /// <summary> | ||
75 | /// The size of the region being loaded. | ||
76 | /// </summary> | ||
77 | public Vector3 RegionSize { get; set; } | ||
78 | |||
79 | public RegionInfo() | ||
80 | { | ||
81 | RegionSize = new Vector3(256f,256f,float.MaxValue); | ||
82 | } | ||
73 | } | 83 | } |
74 | 84 | ||
75 | /// <summary> | 85 | /// <summary> |
@@ -113,23 +123,34 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
113 | public void StartRegion() | 123 | public void StartRegion() |
114 | { | 124 | { |
115 | m_curX = (m_curX == null) ? 0 : m_curX + 1; | 125 | m_curX = (m_curX == null) ? 0 : m_curX + 1; |
116 | // Note: this doesn't mean we have a real region in this location; this could just be a "hole" | 126 | // Note: this doesn't mean we have a real region in this location; this could just be a "hole" |
117 | } | 127 | } |
118 | 128 | ||
119 | public void SetRegionOriginalID(string id) | 129 | public void SetRegionOriginalID(string id) |
120 | { | 130 | { |
121 | m_curRegion = new RegionInfo(); | 131 | m_curRegion = new RegionInfo(); |
122 | m_curRegion.Location = new Point((int)m_curX, (int)m_curY); | 132 | int x = (int)((m_curX == null) ? 0 : m_curX); |
133 | int y = (int)((m_curY == null) ? 0 : m_curY); | ||
134 | |||
135 | m_curRegion.Location = new Point(x, y); | ||
123 | m_curRegion.OriginalID = id; | 136 | m_curRegion.OriginalID = id; |
124 | // 'curRegion' will be saved in 'm_directory2region' when SetRegionDir() is called | 137 | // 'curRegion' will be saved in 'm_directory2region' when SetRegionDir() is called |
125 | } | 138 | } |
126 | 139 | ||
127 | public void SetRegionDirectory(string directory) | 140 | public void SetRegionDirectory(string directory) |
128 | { | 141 | { |
129 | m_curRegion.Directory = directory; | 142 | if(m_curRegion != null) |
130 | m_directory2region[directory] = m_curRegion; | 143 | { |
144 | m_curRegion.Directory = directory; | ||
145 | m_directory2region[directory] = m_curRegion; | ||
146 | } | ||
131 | } | 147 | } |
132 | 148 | ||
149 | public void SetRegionSize(Vector3 size) | ||
150 | { | ||
151 | if(m_curRegion != null) | ||
152 | m_curRegion.RegionSize = size; | ||
153 | } | ||
133 | 154 | ||
134 | /// <summary> | 155 | /// <summary> |
135 | /// Sets all the scenes present in the simulator. | 156 | /// Sets all the scenes present in the simulator. |
@@ -145,7 +166,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
145 | { | 166 | { |
146 | foreach (RegionInfo archivedRegion in m_directory2region.Values) | 167 | foreach (RegionInfo archivedRegion in m_directory2region.Values) |
147 | { | 168 | { |
148 | Point location = new Point((int)rootScene.RegionInfo.RegionLocX, (int)rootScene.RegionInfo.RegionLocY); | 169 | Point location = new Point((int)rootScene.RegionInfo.RegionLocX, |
170 | (int)rootScene.RegionInfo.RegionLocY); | ||
171 | |||
149 | location.Offset(archivedRegion.Location); | 172 | location.Offset(archivedRegion.Location); |
150 | 173 | ||
151 | Scene scene; | 174 | Scene scene; |
@@ -191,7 +214,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
191 | return false; | 214 | return false; |
192 | string regionDirectory = parts[1]; | 215 | string regionDirectory = parts[1]; |
193 | relativePath = parts[2]; | 216 | relativePath = parts[2]; |
194 | 217 | ||
195 | RegionInfo region; | 218 | RegionInfo region; |
196 | if (m_directory2region.TryGetValue(regionDirectory, out region)) | 219 | if (m_directory2region.TryGetValue(regionDirectory, out region)) |
197 | { | 220 | { |
@@ -228,5 +251,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
228 | return m_newId2region.Keys.ToList(); | 251 | return m_newId2region.Keys.ToList(); |
229 | } | 252 | } |
230 | 253 | ||
254 | public int GetScenesCount() | ||
255 | { | ||
256 | return m_directory2region.Count; | ||
257 | } | ||
231 | } | 258 | } |
232 | } | 259 | } |