aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/EstateManager.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-01-02 20:25:47 +0000
committerTeravus Ovares2008-01-02 20:25:47 +0000
commita72d33d3a5da5bb48e9c95fd355458be335fee3e (patch)
tree968f98add2cb0e846d98c8f00826d4c22cbe59f9 /OpenSim/Region/Environment/EstateManager.cs
parentFixed buffer overrun bug in ZeroDecodeCommand (diff)
downloadopensim-SC_OLD-a72d33d3a5da5bb48e9c95fd355458be335fee3e.zip
opensim-SC_OLD-a72d33d3a5da5bb48e9c95fd355458be335fee3e.tar.gz
opensim-SC_OLD-a72d33d3a5da5bb48e9c95fd355458be335fee3e.tar.bz2
opensim-SC_OLD-a72d33d3a5da5bb48e9c95fd355458be335fee3e.tar.xz
* Added the ability for Region Owners to add and remove estate managers using the estate tools.
* Estate managers get abilities like the region owner for now. * Estate managers, you'll need to request server admin status to be able to activate the estate tools dialog (haven't figured out why this is the case yet) * Switching from grid mode to standalone or switching grids will make the stored Estate Manager UUIDs not match up with a valid account so you'll see (waiting) listed there instead of a user until you reset them or go back to the grid you added them from.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/EstateManager.cs106
1 files changed, 82 insertions, 24 deletions
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs
index d0dbaea..9fe11fc 100644
--- a/OpenSim/Region/Environment/EstateManager.cs
+++ b/OpenSim/Region/Environment/EstateManager.cs
@@ -155,8 +155,8 @@ namespace OpenSim.Region.Environment
155 switch (Helpers.FieldToUTF8String(packet.MethodData.Method)) 155 switch (Helpers.FieldToUTF8String(packet.MethodData.Method))
156 { 156 {
157 case "getinfo": 157 case "getinfo":
158 158
159 159 //MainLog.Instance.Verbose("ESTATE","CLIENT--->" + packet.ToString());
160 sendRegionInfoPacketToAll(); 160 sendRegionInfoPacketToAll();
161 if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId)) 161 if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId))
162 { 162 {
@@ -198,6 +198,12 @@ namespace OpenSim.Region.Environment
198 EstateChangeCovenant(packet); 198 EstateChangeCovenant(packet);
199 } 199 }
200 break; 200 break;
201 case "estateaccessdelta":
202 if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId))
203 {
204 estateAccessDelta(remote_client, packet);
205 }
206 break;
201 default: 207 default:
202 MainLog.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString()); 208 MainLog.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString());
203 break; 209 break;
@@ -220,53 +226,105 @@ namespace OpenSim.Region.Environment
220 //Sending Estate Settings 226 //Sending Estate Settings
221 returnblock[0].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarFirstName + m_scene.RegionInfo.MasterAvatarLastName); 227 returnblock[0].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarFirstName + m_scene.RegionInfo.MasterAvatarLastName);
222 returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString()); 228 returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString());
223 returnblock[2].Parameter = Helpers.IntToBytes((int)m_scene.RegionInfo.EstateSettings.estateID); 229 returnblock[2].Parameter = Helpers.StringToField(m_scene.RegionInfo.EstateSettings.estateID.ToString());
224 returnblock[3].Parameter = Helpers.IntToBytes(269516800); 230
225 returnblock[4].Parameter = Helpers.IntToBytes(0); 231 // TODO: Resolve Magic numbers here
226 returnblock[5].Parameter = Helpers.IntToBytes(1); 232 returnblock[3].Parameter = Helpers.StringToField("269516800");
227 returnblock[6].Parameter = Helpers.StringToField(LLUUID.Random().ToString()); 233 returnblock[4].Parameter = Helpers.StringToField("0");
228 returnblock[7].Parameter = Helpers.IntToBytes(1160895077); 234 returnblock[5].Parameter = Helpers.StringToField("1");
229 returnblock[8].Parameter = Helpers.IntToBytes(1); 235 returnblock[6].Parameter = Helpers.StringToField(m_scene.RegionInfo.RegionID.ToString());
236 returnblock[7].Parameter = Helpers.StringToField("1160895077");
237 returnblock[8].Parameter = Helpers.StringToField("1");
238
230 packet.ParamList = returnblock; 239 packet.ParamList = returnblock;
240 //MainLog.Instance.Verbose("ESTATE", "SIM--->" + packet.ToString());
231 remote_client.OutPacket(packet, ThrottleOutPacketType.Task); 241 remote_client.OutPacket(packet, ThrottleOutPacketType.Task);
232 242
233 // Stuck here at the moment The client sends a bunch of getinfo methods that need to be decoded the hard way 243 sendEstateManagerList(remote_client, packet);
244
245 }
246
247 private void sendEstateManagerList(IClientAPI remote_client, EstateOwnerMessagePacket packet)
248 {
249 LLUUID invoice = packet.MethodData.Invoice;
250
234 //Sending Estate Managers 251 //Sending Estate Managers
235 packet = new EstateOwnerMessagePacket(); 252 packet = new EstateOwnerMessagePacket();
236 packet.AgentData.TransactionID = LLUUID.Random(); 253 packet.AgentData.TransactionID = LLUUID.Random();
237 packet.AgentData.AgentID=remote_client.AgentId; 254 packet.AgentData.AgentID = remote_client.AgentId;
238 packet.AgentData.SessionID=remote_client.SessionId; 255 packet.AgentData.SessionID = remote_client.SessionId;
239 packet.MethodData.Invoice = invoice; 256 packet.MethodData.Invoice = invoice;
240 packet.MethodData.Method = Helpers.StringToField("setaccess"); 257 packet.MethodData.Method = Helpers.StringToField("setaccess");
241 258
242 LLUUID[] EstateManagers = m_scene.RegionInfo.EstateSettings.estateManagers; 259 LLUUID[] EstateManagers = m_scene.RegionInfo.EstateSettings.estateManagers;
243 260
244 returnblock = new EstateOwnerMessagePacket.ParamListBlock[6+EstateManagers.Length]; 261 EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + EstateManagers.Length];
245 262
246 for (int i = 0; i < (6 + EstateManagers.Length); i++) 263 for (int i = 0; i < (6 + EstateManagers.Length); i++)
247 { 264 {
248 returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock(); 265 returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock();
249 } 266 }
250 int j=0; 267 int j = 0;
251 returnblock[j].Parameter = Helpers.IntToBytes((int)m_scene.RegionInfo.EstateSettings.estateID); j++; 268 returnblock[j].Parameter = Helpers.StringToField(m_scene.RegionInfo.EstateSettings.estateID.ToString()); j++;
252 returnblock[j].Parameter = Helpers.IntToBytes((int)EstateAccessCodex.EstateManagers); j++; 269 returnblock[j].Parameter = Helpers.StringToField(((int)EstateAccessCodex.EstateManagers).ToString()); j++;
253 returnblock[j].Parameter = Helpers.IntToBytes(0); j++; 270 returnblock[j].Parameter = Helpers.StringToField("0"); j++;
254 returnblock[j].Parameter = Helpers.IntToBytes(0); j++; 271 returnblock[j].Parameter = Helpers.StringToField("0"); j++;
255 returnblock[j].Parameter = Helpers.IntToBytes(0); j++; 272 returnblock[j].Parameter = Helpers.StringToField("0"); j++;
256 returnblock[j].Parameter = Helpers.IntToBytes(EstateManagers.Length); j++; 273 returnblock[j].Parameter = Helpers.StringToField(EstateManagers.Length.ToString()); j++;
257 for (int i = 0; i < EstateManagers.Length; i++) 274 for (int i = 0; i < EstateManagers.Length; i++)
258 { 275 {
259 returnblock[j].Parameter = Helpers.StringToField(EstateManagers[i].ToString()); j++; 276 returnblock[j].Parameter = EstateManagers[i].GetBytes(); j++;
260 } 277 }
261 packet.ParamList = returnblock; 278 packet.ParamList = returnblock;
279 //MainLog.Instance.Verbose("ESTATE", "SIM--->" + packet.ToString());
262 remote_client.OutPacket(packet, ThrottleOutPacketType.Task); 280 remote_client.OutPacket(packet, ThrottleOutPacketType.Task);
281 }
282
283 private void estateAccessDelta(IClientAPI remote_client, EstateOwnerMessagePacket packet)
284 {
285 // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups.. etc.
286 int estateAccessType = Convert.ToInt16(Helpers.FieldToUTF8String(packet.ParamList[1].Parameter));
263 287
288 switch (estateAccessType)
289 {
290 case 256:
291
292 // This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml
293 // So make sure you really trust your region owners. because they can add other estate manaagers to your other estates
294 if (packet.AgentData.AgentID == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.PermissionsMngr.BypassPermissions)
295 {
296 m_scene.RegionInfo.EstateSettings.AddEstateManager(new LLUUID(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter)));
297 sendEstateManagerList(remote_client, packet);
298 }
299 else
300 {
301 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
302 }
303
304 break;
305 case 512:
306 // This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml
307 // So make sure you really trust your region owners. because they can add other estate manaagers to your other estates
308 if (packet.AgentData.AgentID == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.PermissionsMngr.BypassPermissions)
309 {
310 m_scene.RegionInfo.EstateSettings.RemoveEstateManager(new LLUUID(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter)));
311 sendEstateManagerList(remote_client, packet);
312 }
313 else
314 {
315 remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
316 }
317 break;
264 318
319 default:
265 320
321 MainLog.Instance.Error("EstateOwnerMessage: Unknown EstateAccessType requested in estateAccessDelta\n" + packet.ToString());
322 break;
323 }
324 //MainLog.Instance.Error("EstateOwnerMessage: estateAccessDelta\n" + packet.ToString());
266 325
267 326
268 } 327 }
269
270 private void estateSetRegionInfoHandler(EstateOwnerMessagePacket packet) 328 private void estateSetRegionInfoHandler(EstateOwnerMessagePacket packet)
271 { 329 {
272 if (packet.ParamList.Length != 9) 330 if (packet.ParamList.Length != 9)