aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTeravus Ovares2008-01-02 10:06:43 +0000
committerTeravus Ovares2008-01-02 10:06:43 +0000
commit3a83be1721155d606d564dfd4c3bd36560a95c4a (patch)
tree89522b7d998345fe49bcbfe3f501cb9033935105
parent* Trying to address TextureSender issues (diff)
downloadopensim-SC_OLD-3a83be1721155d606d564dfd4c3bd36560a95c4a.zip
opensim-SC_OLD-3a83be1721155d606d564dfd4c3bd36560a95c4a.tar.gz
opensim-SC_OLD-3a83be1721155d606d564dfd4c3bd36560a95c4a.tar.bz2
opensim-SC_OLD-3a83be1721155d606d564dfd4c3bd36560a95c4a.tar.xz
* Did a bit of estate work. Added some fields to EstateSettings.xml for estate managers.
* You can put UUIDs in those fields to give other users some ability to help manage a sim you own. * Also started decoding the EstateOwnerMessage packet convolutions.
-rw-r--r--OpenSim/Framework/EstateSettings.cs252
-rw-r--r--OpenSim/Region/Environment/EstateManager.cs78
-rw-r--r--OpenSim/Region/Environment/PermissionManager.cs15
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs9
4 files changed, 349 insertions, 5 deletions
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs
index 6dd6e00..1078c10 100644
--- a/OpenSim/Framework/EstateSettings.cs
+++ b/OpenSim/Framework/EstateSettings.cs
@@ -487,6 +487,204 @@ namespace OpenSim.Framework
487 } 487 }
488 } 488 }
489 489
490 private LLUUID m_estateManager0;
491 private LLUUID m_estateManager1;
492 private LLUUID m_estateManager2;
493 private LLUUID m_estateManager3;
494 private LLUUID m_estateManager4;
495 private LLUUID m_estateManager5;
496 private LLUUID m_estateManager6;
497 private LLUUID m_estateManager7;
498 private LLUUID m_estateManager8;
499 private LLUUID m_estateManager9;
500
501 public LLUUID[] estateManagers
502 {
503 get {
504 // returns a condensed array of LLUUIDs
505 return GetEstateManagers();
506
507 }
508 set
509 {
510 // Sets a Condensed array of LLUUIDS
511 int i = 0;
512 for (i = 0; i < value.Length; i++)
513 {
514 switch (i)
515 {
516 case 0:
517 m_estateManager0 = value[i];
518 break;
519 case 1:
520 m_estateManager1 = value[i];
521 break;
522 case 2:
523 m_estateManager2 = value[i];
524 break;
525 case 3:
526 m_estateManager3 = value[i];
527 break;
528 case 4:
529 m_estateManager4 = value[i];
530 break;
531 case 5:
532 m_estateManager5 = value[i];
533 break;
534 case 6:
535 m_estateManager6 = value[i];
536 break;
537 case 7:
538 m_estateManager7 = value[i];
539 break;
540 case 8:
541 m_estateManager8 = value[i];
542 break;
543 case 9:
544 m_estateManager9 = value[i];
545 break;
546 }
547
548 }
549 // Clear the rest of them.. as they're no longer valid
550 for (int j = i; j < 10; j++)
551 {
552 switch (i)
553 {
554 case 0:
555 m_estateManager0 = LLUUID.Zero;
556 break;
557 case 1:
558 m_estateManager1 = LLUUID.Zero;
559 break;
560 case 2:
561 m_estateManager2 = LLUUID.Zero;
562 break;
563 case 3:
564 m_estateManager3 = LLUUID.Zero;
565 break;
566 case 4:
567 m_estateManager4 = LLUUID.Zero;
568 break;
569 case 5:
570 m_estateManager5 = LLUUID.Zero;
571 break;
572 case 6:
573 m_estateManager6 = LLUUID.Zero;
574 break;
575 case 7:
576 m_estateManager7 = LLUUID.Zero;
577 break;
578 case 8:
579 m_estateManager8 = LLUUID.Zero;
580 break;
581 case 9:
582 m_estateManager9 = LLUUID.Zero;
583 break;
584 }
585 }
586 for (i = 0; i < 10; i++)
587 {
588 // Writes out the Estate managers to the XML file.
589 configMember.forceSetConfigurationOption("estate_manager_" + i, (GetEstateManagerAtPos(i)).ToString());
590
591 }
592 }
593 }
594
595
596
597 #region EstateManager Get Methods to sort out skipped spots in the XML (suser error)
598
599 private LLUUID GetEstateManagerAtPos(int pos)
600 {
601 // This is a helper for writing them out to the xml file
602 switch (pos)
603 {
604 case 0:
605 return m_estateManager0;
606
607 case 1:
608 return m_estateManager1;
609
610 case 2:
611 return m_estateManager2;
612
613 case 3:
614 return m_estateManager3;
615
616 case 4:
617 return m_estateManager4;
618
619 case 5:
620 return m_estateManager5;
621
622 case 6:
623 return m_estateManager6;
624
625 case 7:
626 return m_estateManager7;
627
628 case 8:
629 return m_estateManager8;
630
631 case 9:
632 return m_estateManager9;
633
634 default:
635 return LLUUID.Zero;
636
637 }
638 }
639 private LLUUID[] GetEstateManagers()
640 {
641 int numEstateManagers = GetNumberOfEstateManagers();
642 LLUUID[] rEstateManagers = new LLUUID[numEstateManagers];
643
644 int pos = 0;
645
646 for (int i = 0; i < numEstateManagers; i++)
647 {
648 pos = GetNextEstateManager(pos);
649
650 rEstateManagers[i] = GetEstateManagerAtPos(pos);
651
652 }
653 return rEstateManagers;
654 }
655
656 private int GetNextEstateManager(int startpos)
657 {
658 // This is a utility function that skips over estate managers set to LLUUID.Zero
659 int i = startpos;
660 for (i=startpos;i<10;i++)
661 {
662 if (GetEstateManagerAtPos(i) != LLUUID.Zero) return i;
663 }
664 return i;
665
666 }
667 private int GetNumberOfEstateManagers()
668 {
669 // This function returns the number of estate managers set
670 // Regardless of whether there is a skipped spot
671 int numEstateManagers = 0;
672 if (m_estateManager0 != LLUUID.Zero) numEstateManagers++;
673 if (m_estateManager1 != LLUUID.Zero) numEstateManagers++;
674 if (m_estateManager2 != LLUUID.Zero) numEstateManagers++;
675 if (m_estateManager3 != LLUUID.Zero) numEstateManagers++;
676 if (m_estateManager4 != LLUUID.Zero) numEstateManagers++;
677 if (m_estateManager5 != LLUUID.Zero) numEstateManagers++;
678 if (m_estateManager6 != LLUUID.Zero) numEstateManagers++;
679 if (m_estateManager7 != LLUUID.Zero) numEstateManagers++;
680 if (m_estateManager8 != LLUUID.Zero) numEstateManagers++;
681 if (m_estateManager9 != LLUUID.Zero) numEstateManagers++;
682
683 return numEstateManagers;
684 }
685
686 #endregion
687
490 private ConfigurationMember configMember; 688 private ConfigurationMember configMember;
491 689
492 public EstateSettings() 690 public EstateSettings()
@@ -582,6 +780,28 @@ namespace OpenSim.Framework
582 "20.0", true); 780 "20.0", true);
583 configMember.addConfigurationOption("terrain_image_id", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, 781 configMember.addConfigurationOption("terrain_image_id", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
584 "", "00000000-0000-0000-0000-000000000000", true); 782 "", "00000000-0000-0000-0000-000000000000", true);
783
784 configMember.addConfigurationOption("estate_manager_0", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
785 "", "00000000-0000-0000-0000-000000000000", true);
786 configMember.addConfigurationOption("estate_manager_1", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
787 "", "00000000-0000-0000-0000-000000000000", true);
788 configMember.addConfigurationOption("estate_manager_2", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
789 "", "00000000-0000-0000-0000-000000000000", true);
790 configMember.addConfigurationOption("estate_manager_3", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
791 "", "00000000-0000-0000-0000-000000000000", true);
792 configMember.addConfigurationOption("estate_manager_4", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
793 "", "00000000-0000-0000-0000-000000000000", true);
794 configMember.addConfigurationOption("estate_manager_5", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
795 "", "00000000-0000-0000-0000-000000000000", true);
796 configMember.addConfigurationOption("estate_manager_6", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
797 "", "00000000-0000-0000-0000-000000000000", true);
798 configMember.addConfigurationOption("estate_manager_7", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
799 "", "00000000-0000-0000-0000-000000000000", true);
800 configMember.addConfigurationOption("estate_manager_8", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
801 "", "00000000-0000-0000-0000-000000000000", true);
802 configMember.addConfigurationOption("estate_manager_9", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
803 "", "00000000-0000-0000-0000-000000000000", true);
804
585 } 805 }
586 806
587 public bool handleIncomingConfiguration(string configuration_key, object configuration_result) 807 public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
@@ -703,6 +923,38 @@ namespace OpenSim.Framework
703 case "terrain_image_id": 923 case "terrain_image_id":
704 m_terrainImageID = (LLUUID) configuration_result; 924 m_terrainImageID = (LLUUID) configuration_result;
705 break; 925 break;
926
927 case "estate_manager_0":
928 m_estateManager0 = (LLUUID)configuration_result;
929 break;
930 case "estate_manager_1":
931 m_estateManager1 = (LLUUID)configuration_result;
932 break;
933 case "estate_manager_2":
934 m_estateManager2 = (LLUUID)configuration_result;
935 break;
936 case "estate_manager_3":
937 m_estateManager3 = (LLUUID)configuration_result;
938 break;
939 case "estate_manager_4":
940 m_estateManager4 = (LLUUID)configuration_result;
941 break;
942 case "estate_manager_5":
943 m_estateManager5 = (LLUUID)configuration_result;
944 break;
945 case "estate_manager_6":
946 m_estateManager6 = (LLUUID)configuration_result;
947 break;
948 case "estate_manager_7":
949 m_estateManager7 = (LLUUID)configuration_result;
950 break;
951 case "estate_manager_8":
952 m_estateManager8 = (LLUUID)configuration_result;
953 break;
954 case "estate_manager_9":
955 m_estateManager9 = (LLUUID)configuration_result;
956 break;
957
706 } 958 }
707 959
708 return true; 960 return true;
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs
index 3ca9796..d0dbaea 100644
--- a/OpenSim/Region/Environment/EstateManager.cs
+++ b/OpenSim/Region/Environment/EstateManager.cs
@@ -44,6 +44,15 @@ namespace OpenSim.Region.Environment
44 private Scene m_scene; 44 private Scene m_scene;
45 private RegionInfo m_regInfo; 45 private RegionInfo m_regInfo;
46 46
47 public enum EstateAccessCodex : uint
48 {
49 AccessOptions = 17,
50 AllowedGroups = 18,
51 EstateBans = 20,
52 EstateManagers = 24
53 }
54
55
47 public EstateManager(Scene scene, RegionInfo reginfo) 56 public EstateManager(Scene scene, RegionInfo reginfo)
48 { 57 {
49 m_scene = scene; 58 m_scene = scene;
@@ -146,7 +155,13 @@ namespace OpenSim.Region.Environment
146 switch (Helpers.FieldToUTF8String(packet.MethodData.Method)) 155 switch (Helpers.FieldToUTF8String(packet.MethodData.Method))
147 { 156 {
148 case "getinfo": 157 case "getinfo":
158
159
149 sendRegionInfoPacketToAll(); 160 sendRegionInfoPacketToAll();
161 if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId))
162 {
163 sendDetailedEstateData(remote_client, packet);
164 }
150 break; 165 break;
151 case "setregioninfo": 166 case "setregioninfo":
152 if (m_scene.PermissionsMngr.CanEditEstateTerrain(remote_client.AgentId)) 167 if (m_scene.PermissionsMngr.CanEditEstateTerrain(remote_client.AgentId))
@@ -189,6 +204,69 @@ namespace OpenSim.Region.Environment
189 } 204 }
190 } 205 }
191 206
207 private void sendDetailedEstateData(IClientAPI remote_client, EstateOwnerMessagePacket packet)
208 {
209
210 LLUUID invoice = packet.MethodData.Invoice;
211 packet.AgentData.TransactionID = LLUUID.Random();
212 packet.MethodData.Method = Helpers.StringToField("estateupdateinfo");
213 EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[9];
214
215 for (int i = 0; i < 9; i++)
216 {
217 returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock();
218 }
219
220 //Sending Estate Settings
221 returnblock[0].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarFirstName + m_scene.RegionInfo.MasterAvatarLastName);
222 returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString());
223 returnblock[2].Parameter = Helpers.IntToBytes((int)m_scene.RegionInfo.EstateSettings.estateID);
224 returnblock[3].Parameter = Helpers.IntToBytes(269516800);
225 returnblock[4].Parameter = Helpers.IntToBytes(0);
226 returnblock[5].Parameter = Helpers.IntToBytes(1);
227 returnblock[6].Parameter = Helpers.StringToField(LLUUID.Random().ToString());
228 returnblock[7].Parameter = Helpers.IntToBytes(1160895077);
229 returnblock[8].Parameter = Helpers.IntToBytes(1);
230 packet.ParamList = returnblock;
231 remote_client.OutPacket(packet, ThrottleOutPacketType.Task);
232
233 // Stuck here at the moment The client sends a bunch of getinfo methods that need to be decoded the hard way
234 //Sending Estate Managers
235 packet = new EstateOwnerMessagePacket();
236 packet.AgentData.TransactionID = LLUUID.Random();
237 packet.AgentData.AgentID=remote_client.AgentId;
238 packet.AgentData.SessionID=remote_client.SessionId;
239 packet.MethodData.Invoice = invoice;
240 packet.MethodData.Method = Helpers.StringToField("setaccess");
241
242 LLUUID[] EstateManagers = m_scene.RegionInfo.EstateSettings.estateManagers;
243
244 returnblock = new EstateOwnerMessagePacket.ParamListBlock[6+EstateManagers.Length];
245
246 for (int i = 0; i < (6 + EstateManagers.Length); i++)
247 {
248 returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock();
249 }
250 int j=0;
251 returnblock[j].Parameter = Helpers.IntToBytes((int)m_scene.RegionInfo.EstateSettings.estateID); j++;
252 returnblock[j].Parameter = Helpers.IntToBytes((int)EstateAccessCodex.EstateManagers); j++;
253 returnblock[j].Parameter = Helpers.IntToBytes(0); j++;
254 returnblock[j].Parameter = Helpers.IntToBytes(0); j++;
255 returnblock[j].Parameter = Helpers.IntToBytes(0); j++;
256 returnblock[j].Parameter = Helpers.IntToBytes(EstateManagers.Length); j++;
257 for (int i = 0; i < EstateManagers.Length; i++)
258 {
259 returnblock[j].Parameter = Helpers.StringToField(EstateManagers[i].ToString()); j++;
260 }
261 packet.ParamList = returnblock;
262 remote_client.OutPacket(packet, ThrottleOutPacketType.Task);
263
264
265
266
267
268 }
269
192 private void estateSetRegionInfoHandler(EstateOwnerMessagePacket packet) 270 private void estateSetRegionInfoHandler(EstateOwnerMessagePacket packet)
193 { 271 {
194 if (packet.ParamList.Length != 9) 272 if (packet.ParamList.Length != 9)
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs
index 76601ec..db1cac5 100644
--- a/OpenSim/Region/Environment/PermissionManager.cs
+++ b/OpenSim/Region/Environment/PermissionManager.cs
@@ -83,13 +83,20 @@ namespace OpenSim.Region.Environment
83 return m_scene.RegionInfo.MasterAvatarAssignedUUID == user; 83 return m_scene.RegionInfo.MasterAvatarAssignedUUID == user;
84 } 84 }
85 85
86 protected virtual bool IsEstateManager(LLUUID user) 86 public virtual bool IsEstateManager(LLUUID user)
87 { 87 {
88 if (m_bypassPermissions) 88 if (m_bypassPermissions)
89 { 89 {
90 return true; 90 return true;
91 } 91 }
92 92
93 LLUUID[] estatemanagers = m_scene.RegionInfo.EstateSettings.estateManagers;
94 for (int i = 0; i < estatemanagers.Length; i++)
95 {
96 if (estatemanagers[i] == user)
97 return true;
98 }
99
93 return false; 100 return false;
94 } 101 }
95 102
@@ -414,7 +421,7 @@ namespace OpenSim.Region.Environment
414 421
415 #region Estate Permissions 422 #region Estate Permissions
416 423
417 protected virtual bool GenericEstatePermission(LLUUID user) 424 public virtual bool GenericEstatePermission(LLUUID user)
418 { 425 {
419 // Default: deny 426 // Default: deny
420 bool permission = false; 427 bool permission = false;
@@ -439,8 +446,8 @@ namespace OpenSim.Region.Environment
439 { 446 {
440 // Since this is potentially going on a grid... 447 // Since this is potentially going on a grid...
441 448
442 //return GenericEstatePermission(AgentId); 449 return GenericEstatePermission(user);
443 return m_scene.RegionInfo.MasterAvatarAssignedUUID == user; 450 //return m_scene.RegionInfo.MasterAvatarAssignedUUID == user;
444 } 451 }
445 452
446 #endregion 453 #endregion
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 9454de0..3aa9583 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -320,7 +320,14 @@ namespace OpenSim.Region.Environment.Scenes
320 320
321 // TODO: m_animations and m_animationSeqs should always be of the same length. 321 // TODO: m_animations and m_animationSeqs should always be of the same length.
322 // Move them into an object to (hopefully) avoid threading issues. 322 // Move them into an object to (hopefully) avoid threading issues.
323 m_animations.Add(Animations.AnimsLLUUID["STAND"]); 323 try
324 {
325 m_animations.Add(Animations.AnimsLLUUID["STAND"]);
326 }
327 catch (KeyNotFoundException)
328 {
329 MainLog.Instance.Warn("AVATAR", "KeyNotFound Exception playing avatar stand animation");
330 }
324 m_animationSeqs.Add(1); 331 m_animationSeqs.Add(1);
325 332
326 RegisterToEvents(); 333 RegisterToEvents();