diff options
author | mingchen | 2007-07-15 21:02:13 +0000 |
---|---|---|
committer | mingchen | 2007-07-15 21:02:13 +0000 |
commit | 6510aea0ed33134c09d25be690a69e1fff4a3282 (patch) | |
tree | 977e759a9ae61b788439e68ce01bd94dfae4c1fc | |
parent | * Primitives are now loaded from Datastore during scene initialisation. (diff) | |
download | opensim-SC-6510aea0ed33134c09d25be690a69e1fff4a3282.zip opensim-SC-6510aea0ed33134c09d25be690a69e1fff4a3282.tar.gz opensim-SC-6510aea0ed33134c09d25be690a69e1fff4a3282.tar.bz2 opensim-SC-6510aea0ed33134c09d25be690a69e1fff4a3282.tar.xz |
*Added support for the "show" button that highlights objects over the selected Objects
*Known bug, client does some weird "showing" when more than 255 objects are meant to be selected (linked objects count as one object)
-rw-r--r-- | OpenSim/Framework/General/Interfaces/IClientAPI.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.API.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientViewBase.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Environment/ParcelManager.cs | 89 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObject.cs | 3 |
7 files changed, 91 insertions, 17 deletions
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index fbd239f..4c6a0e0 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs | |||
@@ -69,7 +69,8 @@ namespace OpenSim.Framework.Interfaces | |||
69 | public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); | 69 | public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); |
70 | public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client); | 70 | public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client); |
71 | public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client); | 71 | public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client); |
72 | public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client); // NOTETOSELFremove the packet part | 72 | public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client); |
73 | public delegate void ParcelSelectObjects(int parcel_local_id, int request_type, IClientAPI remote_client); | ||
73 | 74 | ||
74 | public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client); | 75 | public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client); |
75 | 76 | ||
@@ -126,6 +127,7 @@ namespace OpenSim.Framework.Interfaces | |||
126 | event ParcelDivideRequest OnParcelDivideRequest; | 127 | event ParcelDivideRequest OnParcelDivideRequest; |
127 | event ParcelJoinRequest OnParcelJoinRequest; | 128 | event ParcelJoinRequest OnParcelJoinRequest; |
128 | event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | 129 | event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; |
130 | event ParcelSelectObjects OnParcelSelectObjects; | ||
129 | 131 | ||
130 | event EstateOwnerMessageRequest OnEstateOwnerMessage; | 132 | event EstateOwnerMessageRequest OnEstateOwnerMessage; |
131 | 133 | ||
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index 5458795..cf0e294 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs | |||
@@ -84,6 +84,7 @@ namespace OpenSim.Region.ClientStack | |||
84 | public event ParcelDivideRequest OnParcelDivideRequest; | 84 | public event ParcelDivideRequest OnParcelDivideRequest; |
85 | public event ParcelJoinRequest OnParcelJoinRequest; | 85 | public event ParcelJoinRequest OnParcelJoinRequest; |
86 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | 86 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; |
87 | public event ParcelSelectObjects OnParcelSelectObjects; | ||
87 | 88 | ||
88 | public event EstateOwnerMessageRequest OnEstateOwnerMessage; | 89 | public event EstateOwnerMessageRequest OnEstateOwnerMessage; |
89 | 90 | ||
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 169f2c4..37591d9 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | |||
@@ -594,6 +594,13 @@ namespace OpenSim.Region.ClientStack | |||
594 | 594 | ||
595 | } | 595 | } |
596 | break; | 596 | break; |
597 | case PacketType.ParcelSelectObjects: | ||
598 | ParcelSelectObjectsPacket selectPacket = (ParcelSelectObjectsPacket)Pack; | ||
599 | if (OnParcelSelectObjects != null) | ||
600 | { | ||
601 | OnParcelSelectObjects(selectPacket.ParcelData.LocalID, Convert.ToInt32(selectPacket.ParcelData.ReturnType), this); | ||
602 | } | ||
603 | break; | ||
597 | #endregion | 604 | #endregion |
598 | 605 | ||
599 | #region Estate Packets | 606 | #region Estate Packets |
diff --git a/OpenSim/Region/ClientStack/ClientViewBase.cs b/OpenSim/Region/ClientStack/ClientViewBase.cs index 2bc3ed8..cc04bda 100644 --- a/OpenSim/Region/ClientStack/ClientViewBase.cs +++ b/OpenSim/Region/ClientStack/ClientViewBase.cs | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | /* | 1 | /* |
3 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
4 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
diff --git a/OpenSim/Region/Environment/ParcelManager.cs b/OpenSim/Region/Environment/ParcelManager.cs index 4f836ef..838a003 100644 --- a/OpenSim/Region/Environment/ParcelManager.cs +++ b/OpenSim/Region/Environment/ParcelManager.cs | |||
@@ -66,6 +66,12 @@ namespace OpenSim.Region.Environment | |||
66 | public const int PARCEL_RESULT_ONE_PARCEL = 0; // The request they made contained only one parcel | 66 | public const int PARCEL_RESULT_ONE_PARCEL = 0; // The request they made contained only one parcel |
67 | public const int PARCEL_RESULT_MULTIPLE_PARCELS = 1; // The request they made contained more than one parcel | 67 | public const int PARCEL_RESULT_MULTIPLE_PARCELS = 1; // The request they made contained more than one parcel |
68 | 68 | ||
69 | //ParcelSelectObjects | ||
70 | public const int PARCEL_SELECT_OBJECTS_OWNER = 2; | ||
71 | public const int PARCEL_SELECT_OBJECTS_GROUP = 4; | ||
72 | public const int PARCEL_SELECT_OBJECTS_OTHER = 8; | ||
73 | |||
74 | |||
69 | //These are other constants. Yay! | 75 | //These are other constants. Yay! |
70 | public const int START_PARCEL_LOCAL_ID = 1; | 76 | public const int START_PARCEL_LOCAL_ID = 1; |
71 | #endregion | 77 | #endregion |
@@ -490,6 +496,11 @@ namespace OpenSim.Region.Environment | |||
490 | join(west, south, east, north, remote_client.AgentId); | 496 | join(west, south, east, north, remote_client.AgentId); |
491 | 497 | ||
492 | } | 498 | } |
499 | |||
500 | public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) | ||
501 | { | ||
502 | parcelList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); | ||
503 | } | ||
493 | #endregion | 504 | #endregion |
494 | 505 | ||
495 | /// <summary> | 506 | /// <summary> |
@@ -532,10 +543,14 @@ namespace OpenSim.Region.Environment | |||
532 | p.resetParcelPrimCounts(); | 543 | p.resetParcelPrimCounts(); |
533 | } | 544 | } |
534 | } | 545 | } |
546 | public void setPrimsTainted() | ||
547 | { | ||
548 | this.parcelPrimCountTainted = true; | ||
549 | } | ||
535 | 550 | ||
536 | public void addPrimToParcelCounts(SceneObject obj) | 551 | public void addPrimToParcelCounts(SceneObject obj) |
537 | { | 552 | { |
538 | LLVector3 position = obj.rootPrimitive.Pos; | 553 | LLVector3 position = obj.Pos; |
539 | Parcel parcelUnderPrim = getParcel(position.X, position.Y); | 554 | Parcel parcelUnderPrim = getParcel(position.X, position.Y); |
540 | if (parcelUnderPrim != null) | 555 | if (parcelUnderPrim != null) |
541 | { | 556 | { |
@@ -551,13 +566,6 @@ namespace OpenSim.Region.Environment | |||
551 | } | 566 | } |
552 | } | 567 | } |
553 | 568 | ||
554 | public void setPrimsTainted() | ||
555 | { | ||
556 | this.parcelPrimCountTainted = true; | ||
557 | } | ||
558 | |||
559 | |||
560 | |||
561 | public void finalizeParcelPrimCountUpdate() | 569 | public void finalizeParcelPrimCountUpdate() |
562 | { | 570 | { |
563 | //Get Simwide prim count for owner | 571 | //Get Simwide prim count for owner |
@@ -1010,6 +1018,67 @@ namespace OpenSim.Region.Environment | |||
1010 | } | 1018 | } |
1011 | #endregion | 1019 | #endregion |
1012 | 1020 | ||
1021 | public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client) | ||
1022 | { | ||
1023 | List<uint> resultLocalIDs = new List<uint>(); | ||
1024 | foreach (SceneObject obj in primsOverMe) | ||
1025 | { | ||
1026 | if (obj.rootLocalID > 0) | ||
1027 | { | ||
1028 | if (request_type == ParcelManager.PARCEL_SELECT_OBJECTS_OWNER && obj.rootPrimitive.OwnerID == this.parcelData.ownerID) | ||
1029 | { | ||
1030 | resultLocalIDs.Add(obj.rootLocalID); | ||
1031 | } | ||
1032 | else if (request_type == ParcelManager.PARCEL_SELECT_OBJECTS_GROUP && false) //TODO: change false to group support! | ||
1033 | { | ||
1034 | |||
1035 | } | ||
1036 | else if (request_type == ParcelManager.PARCEL_SELECT_OBJECTS_OTHER && obj.rootPrimitive.OwnerID != remote_client.AgentId) | ||
1037 | { | ||
1038 | resultLocalIDs.Add(obj.rootLocalID); | ||
1039 | } | ||
1040 | } | ||
1041 | } | ||
1042 | |||
1043 | |||
1044 | bool firstCall = true; | ||
1045 | int MAX_OBJECTS_PER_PACKET = 255; | ||
1046 | ForceObjectSelectPacket pack = new ForceObjectSelectPacket(); | ||
1047 | ForceObjectSelectPacket.DataBlock[] data; | ||
1048 | while (resultLocalIDs.Count > 0) | ||
1049 | { | ||
1050 | if (firstCall) | ||
1051 | { | ||
1052 | pack._Header.ResetList = true; | ||
1053 | firstCall = false; | ||
1054 | } | ||
1055 | else | ||
1056 | { | ||
1057 | pack._Header.ResetList = false; | ||
1058 | } | ||
1059 | |||
1060 | if (resultLocalIDs.Count > MAX_OBJECTS_PER_PACKET) | ||
1061 | { | ||
1062 | data = new ForceObjectSelectPacket.DataBlock[MAX_OBJECTS_PER_PACKET]; | ||
1063 | } | ||
1064 | else | ||
1065 | { | ||
1066 | data = new ForceObjectSelectPacket.DataBlock[resultLocalIDs.Count]; | ||
1067 | } | ||
1068 | |||
1069 | int i; | ||
1070 | for (i = 0; i < MAX_OBJECTS_PER_PACKET && resultLocalIDs.Count > 0; i++) | ||
1071 | { | ||
1072 | data[i] = new ForceObjectSelectPacket.DataBlock(); | ||
1073 | data[i].LocalID = Convert.ToUInt32(resultLocalIDs[0]); | ||
1074 | resultLocalIDs.RemoveAt(0); | ||
1075 | } | ||
1076 | pack.Data = data; | ||
1077 | |||
1078 | remote_client.OutPacket((Packet)pack); | ||
1079 | } | ||
1080 | |||
1081 | } | ||
1013 | public void resetParcelPrimCounts() | 1082 | public void resetParcelPrimCounts() |
1014 | { | 1083 | { |
1015 | parcelData.groupPrims = 0; | 1084 | parcelData.groupPrims = 0; |
@@ -1027,10 +1096,6 @@ namespace OpenSim.Region.Environment | |||
1027 | { | 1096 | { |
1028 | parcelData.ownerPrims += prim_count; | 1097 | parcelData.ownerPrims += prim_count; |
1029 | } | 1098 | } |
1030 | else if (prim_owner == parcelData.groupID) | ||
1031 | { | ||
1032 | parcelData.groupPrims += prim_count; | ||
1033 | } | ||
1034 | else | 1099 | else |
1035 | { | 1100 | { |
1036 | parcelData.otherPrims += prim_count; | 1101 | parcelData.otherPrims += prim_count; |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 0186ba8..a06679a 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -229,7 +229,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
229 | } | 229 | } |
230 | 230 | ||
231 | this.parcelPrimCheckCount++; | 231 | this.parcelPrimCheckCount++; |
232 | if (this.parcelPrimCheckCount > 100) //check every 10 seconds for tainted prims | 232 | if (this.parcelPrimCheckCount > 50) //check every 5 seconds for tainted prims |
233 | { | 233 | { |
234 | if (m_parcelManager.parcelPrimCountTainted) | 234 | if (m_parcelManager.parcelPrimCountTainted) |
235 | { | 235 | { |
@@ -534,6 +534,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
534 | client.OnParcelDivideRequest += new ParcelDivideRequest(m_parcelManager.handleParcelDivideRequest); | 534 | client.OnParcelDivideRequest += new ParcelDivideRequest(m_parcelManager.handleParcelDivideRequest); |
535 | client.OnParcelJoinRequest += new ParcelJoinRequest(m_parcelManager.handleParcelJoinRequest); | 535 | client.OnParcelJoinRequest += new ParcelJoinRequest(m_parcelManager.handleParcelJoinRequest); |
536 | client.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(m_parcelManager.handleParcelPropertiesUpdateRequest); | 536 | client.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(m_parcelManager.handleParcelPropertiesUpdateRequest); |
537 | client.OnParcelSelectObjects += new ParcelSelectObjects(m_parcelManager.handleParcelSelectObjectsRequest); | ||
537 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); | 538 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); |
538 | 539 | ||
539 | } | 540 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObject.cs b/OpenSim/Region/Environment/Scenes/SceneObject.cs index 95db271..c925584 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObject.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObject.cs | |||
@@ -170,8 +170,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
170 | dupe.children.Add(dupe.rootPrimitive); | 170 | dupe.children.Add(dupe.rootPrimitive); |
171 | dupe.rootPrimitive.Pos = this.Pos; | 171 | dupe.rootPrimitive.Pos = this.Pos; |
172 | dupe.Rotation = this.Rotation; | 172 | dupe.Rotation = this.Rotation; |
173 | LLUUID rootu = dupe.rootUUID; | 173 | dupe.LocalId = m_world.PrimIDAllocate(); |
174 | uint rooti = dupe.rootLocalID; | ||
175 | 174 | ||
176 | dupe.registerEvents(); | 175 | dupe.registerEvents(); |
177 | return dupe; | 176 | return dupe; |