diff options
author | mingchen | 2007-07-16 01:25:16 +0000 |
---|---|---|
committer | mingchen | 2007-07-16 01:25:16 +0000 |
commit | 7f10179129d4b5ac4ae5c05ff8598f569b8e6412 (patch) | |
tree | b5a6eac77699fd1857085aedcecf8732db7a0ebd | |
parent | Couple of small changes to NPC test character. (diff) | |
download | opensim-SC_OLD-7f10179129d4b5ac4ae5c05ff8598f569b8e6412.zip opensim-SC_OLD-7f10179129d4b5ac4ae5c05ff8598f569b8e6412.tar.gz opensim-SC_OLD-7f10179129d4b5ac4ae5c05ff8598f569b8e6412.tar.bz2 opensim-SC_OLD-7f10179129d4b5ac4ae5c05ff8598f569b8e6412.tar.xz |
*Fixed bug that incorrectly tabulated 'others' prims on a parcel
*Added support for selected prims (does not yet support prims being sat on)
*Added support for listing avatars with prims on parcel with their prim count
-rw-r--r-- | OpenSim/Framework/General/Interfaces/IClientAPI.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/ParcelData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.API.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/Environment/ParcelManager.cs | 73 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | 23 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObject.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/Program.cs | 1 |
10 files changed, 119 insertions, 14 deletions
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 4c6a0e0..bd258a3 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs | |||
@@ -54,6 +54,7 @@ namespace OpenSim.Framework.Interfaces | |||
54 | 54 | ||
55 | public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); | 55 | public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); |
56 | public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); | 56 | public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); |
57 | public delegate void ObjectDeselect(uint localID, IClientAPI remoteClient); | ||
57 | public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient); | 58 | public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient); |
58 | public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); | 59 | public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); |
59 | public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient); | 60 | public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient); |
@@ -71,7 +72,7 @@ namespace OpenSim.Framework.Interfaces | |||
71 | public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client); | 72 | 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); | 73 | public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client); |
73 | public delegate void ParcelSelectObjects(int parcel_local_id, int request_type, IClientAPI remote_client); | 74 | public delegate void ParcelSelectObjects(int parcel_local_id, int request_type, IClientAPI remote_client); |
74 | 75 | public delegate void ParcelObjectOwnerRequest(int local_id, IClientAPI remote_client); | |
75 | public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client); | 76 | public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client); |
76 | 77 | ||
77 | public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); | 78 | public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); |
@@ -106,6 +107,7 @@ namespace OpenSim.Framework.Interfaces | |||
106 | 107 | ||
107 | event UpdateShape OnUpdatePrimShape; | 108 | event UpdateShape OnUpdatePrimShape; |
108 | event ObjectSelect OnObjectSelect; | 109 | event ObjectSelect OnObjectSelect; |
110 | event ObjectDeselect OnObjectDeselect; | ||
109 | event GenericCall7 OnObjectDescription; | 111 | event GenericCall7 OnObjectDescription; |
110 | event GenericCall7 OnObjectName; | 112 | event GenericCall7 OnObjectName; |
111 | event UpdatePrimFlags OnUpdatePrimFlags; | 113 | event UpdatePrimFlags OnUpdatePrimFlags; |
@@ -128,7 +130,7 @@ namespace OpenSim.Framework.Interfaces | |||
128 | event ParcelJoinRequest OnParcelJoinRequest; | 130 | event ParcelJoinRequest OnParcelJoinRequest; |
129 | event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | 131 | event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; |
130 | event ParcelSelectObjects OnParcelSelectObjects; | 132 | event ParcelSelectObjects OnParcelSelectObjects; |
131 | 133 | event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; | |
132 | event EstateOwnerMessageRequest OnEstateOwnerMessage; | 134 | event EstateOwnerMessageRequest OnEstateOwnerMessage; |
133 | 135 | ||
134 | LLVector3 StartPos | 136 | LLVector3 StartPos |
diff --git a/OpenSim/Framework/General/Types/ParcelData.cs b/OpenSim/Framework/General/Types/ParcelData.cs index 80b9b64..17de655 100644 --- a/OpenSim/Framework/General/Types/ParcelData.cs +++ b/OpenSim/Framework/General/Types/ParcelData.cs | |||
@@ -49,6 +49,7 @@ namespace OpenSim.Framework.Types | |||
49 | public int groupPrims = 0; | 49 | public int groupPrims = 0; |
50 | public int otherPrims = 0; | 50 | public int otherPrims = 0; |
51 | public int ownerPrims = 0; | 51 | public int ownerPrims = 0; |
52 | public int selectedPrims = 0; | ||
52 | public int simwidePrims = 0; | 53 | public int simwidePrims = 0; |
53 | public int simwideArea = 0; | 54 | public int simwideArea = 0; |
54 | public int salePrice = 0; //Unemeplemented. Parcels price. | 55 | public int salePrice = 0; //Unemeplemented. Parcels price. |
@@ -90,6 +91,7 @@ namespace OpenSim.Framework.Types | |||
90 | parcelData.groupPrims = this.groupPrims; | 91 | parcelData.groupPrims = this.groupPrims; |
91 | parcelData.otherPrims = this.otherPrims; | 92 | parcelData.otherPrims = this.otherPrims; |
92 | parcelData.ownerPrims = this.ownerPrims; | 93 | parcelData.ownerPrims = this.ownerPrims; |
94 | parcelData.selectedPrims = this.selectedPrims; | ||
93 | parcelData.isGroupOwned = this.isGroupOwned; | 95 | parcelData.isGroupOwned = this.isGroupOwned; |
94 | parcelData.localID = this.localID; | 96 | parcelData.localID = this.localID; |
95 | parcelData.landingType = this.landingType; | 97 | parcelData.landingType = this.landingType; |
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 6968c41..4815b89 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -240,7 +240,7 @@ namespace OpenSim | |||
240 | LocalWorld.RegionInfo.MasterAvatarAssignedUUID = libsecondlife.LLUUID.Zero; | 240 | LocalWorld.RegionInfo.MasterAvatarAssignedUUID = libsecondlife.LLUUID.Zero; |
241 | LocalWorld.localStorage.LoadParcels((ILocalStorageParcelReceiver)LocalWorld.ParcelManager); | 241 | LocalWorld.localStorage.LoadParcels((ILocalStorageParcelReceiver)LocalWorld.ParcelManager); |
242 | } | 242 | } |
243 | 243 | LocalWorld.performParcelPrimCountUpdate(); | |
244 | LocalWorld.StartTimer(); | 244 | LocalWorld.StartTimer(); |
245 | } | 245 | } |
246 | } | 246 | } |
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index cf0e294..33e34c1 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs | |||
@@ -61,6 +61,7 @@ namespace OpenSim.Region.ClientStack | |||
61 | public event AddNewPrim OnAddPrim; | 61 | public event AddNewPrim OnAddPrim; |
62 | public event UpdateShape OnUpdatePrimShape; | 62 | public event UpdateShape OnUpdatePrimShape; |
63 | public event ObjectSelect OnObjectSelect; | 63 | public event ObjectSelect OnObjectSelect; |
64 | public event ObjectDeselect OnObjectDeselect; | ||
64 | public event GenericCall7 OnObjectDescription; | 65 | public event GenericCall7 OnObjectDescription; |
65 | public event GenericCall7 OnObjectName; | 66 | public event GenericCall7 OnObjectName; |
66 | public event UpdatePrimFlags OnUpdatePrimFlags; | 67 | public event UpdatePrimFlags OnUpdatePrimFlags; |
@@ -85,7 +86,7 @@ namespace OpenSim.Region.ClientStack | |||
85 | public event ParcelJoinRequest OnParcelJoinRequest; | 86 | public event ParcelJoinRequest OnParcelJoinRequest; |
86 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | 87 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; |
87 | public event ParcelSelectObjects OnParcelSelectObjects; | 88 | public event ParcelSelectObjects OnParcelSelectObjects; |
88 | 89 | public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; | |
89 | public event EstateOwnerMessageRequest OnEstateOwnerMessage; | 90 | public event EstateOwnerMessageRequest OnEstateOwnerMessage; |
90 | 91 | ||
91 | /// <summary> | 92 | /// <summary> |
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 37591d9..a8512a7 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | |||
@@ -279,6 +279,16 @@ namespace OpenSim.Region.ClientStack | |||
279 | } | 279 | } |
280 | } | 280 | } |
281 | break; | 281 | break; |
282 | case PacketType.ObjectDeselect: | ||
283 | ObjectDeselectPacket incomingdeselect = (ObjectDeselectPacket)Pack; | ||
284 | for (int i = 0; i < incomingdeselect.ObjectData.Length; i++) | ||
285 | { | ||
286 | if (OnObjectDeselect != null) | ||
287 | { | ||
288 | OnObjectDeselect(incomingdeselect.ObjectData[i].ObjectLocalID, this); | ||
289 | } | ||
290 | } | ||
291 | break; | ||
282 | case PacketType.ObjectFlagUpdate: | 292 | case PacketType.ObjectFlagUpdate: |
283 | ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack; | 293 | ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack; |
284 | if (OnUpdatePrimFlags != null) | 294 | if (OnUpdatePrimFlags != null) |
@@ -601,6 +611,14 @@ namespace OpenSim.Region.ClientStack | |||
601 | OnParcelSelectObjects(selectPacket.ParcelData.LocalID, Convert.ToInt32(selectPacket.ParcelData.ReturnType), this); | 611 | OnParcelSelectObjects(selectPacket.ParcelData.LocalID, Convert.ToInt32(selectPacket.ParcelData.ReturnType), this); |
602 | } | 612 | } |
603 | break; | 613 | break; |
614 | |||
615 | case PacketType.ParcelObjectOwnersRequest: | ||
616 | ParcelObjectOwnersRequestPacket reqPacket = (ParcelObjectOwnersRequestPacket)Pack; | ||
617 | if (OnParcelObjectOwnerRequest != null) | ||
618 | { | ||
619 | OnParcelObjectOwnerRequest(reqPacket.ParcelData.LocalID, this); | ||
620 | } | ||
621 | break; | ||
604 | #endregion | 622 | #endregion |
605 | 623 | ||
606 | #region Estate Packets | 624 | #region Estate Packets |
diff --git a/OpenSim/Region/Environment/ParcelManager.cs b/OpenSim/Region/Environment/ParcelManager.cs index 838a003..e413650 100644 --- a/OpenSim/Region/Environment/ParcelManager.cs +++ b/OpenSim/Region/Environment/ParcelManager.cs | |||
@@ -33,6 +33,7 @@ using OpenSim.Framework.Interfaces; | |||
33 | using OpenSim.Framework.Types; | 33 | using OpenSim.Framework.Types; |
34 | using OpenSim.Region.Environment.Scenes; | 34 | using OpenSim.Region.Environment.Scenes; |
35 | using Avatar = OpenSim.Region.Environment.Scenes.ScenePresence; | 35 | using Avatar = OpenSim.Region.Environment.Scenes.ScenePresence; |
36 | using System.IO; | ||
36 | 37 | ||
37 | namespace OpenSim.Region.Environment | 38 | namespace OpenSim.Region.Environment |
38 | { | 39 | { |
@@ -501,6 +502,11 @@ namespace OpenSim.Region.Environment | |||
501 | { | 502 | { |
502 | parcelList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); | 503 | parcelList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); |
503 | } | 504 | } |
505 | |||
506 | public void handleParcelObjectOwnersRequest(int local_id, IClientAPI remote_client) | ||
507 | { | ||
508 | parcelList[local_id].sendParcelObjectOwners(remote_client); | ||
509 | } | ||
504 | #endregion | 510 | #endregion |
505 | 511 | ||
506 | /// <summary> | 512 | /// <summary> |
@@ -591,7 +597,7 @@ namespace OpenSim.Region.Environment | |||
591 | foreach (Parcel p in parcelOwnersAndParcels[owner]) | 597 | foreach (Parcel p in parcelOwnersAndParcels[owner]) |
592 | { | 598 | { |
593 | simArea += p.parcelData.area; | 599 | simArea += p.parcelData.area; |
594 | simPrims += p.parcelData.ownerPrims + p.parcelData.otherPrims + p.parcelData.groupPrims; | 600 | simPrims += p.parcelData.ownerPrims + p.parcelData.otherPrims + p.parcelData.groupPrims + p.parcelData.selectedPrims; |
595 | } | 601 | } |
596 | 602 | ||
597 | foreach (Parcel p in parcelOwnersAndParcels[owner]) | 603 | foreach (Parcel p in parcelOwnersAndParcels[owner]) |
@@ -713,7 +719,7 @@ namespace OpenSim.Region.Environment | |||
713 | updatePacket.ParcelData.Name = Helpers.StringToField(parcelData.parcelName); | 719 | updatePacket.ParcelData.Name = Helpers.StringToField(parcelData.parcelName); |
714 | updatePacket.ParcelData.OtherCleanTime = 0; //unemplemented | 720 | updatePacket.ParcelData.OtherCleanTime = 0; //unemplemented |
715 | updatePacket.ParcelData.OtherCount = 0; //unemplemented | 721 | updatePacket.ParcelData.OtherCount = 0; //unemplemented |
716 | updatePacket.ParcelData.OtherPrims = parcelData.groupPrims; | 722 | updatePacket.ParcelData.OtherPrims = parcelData.otherPrims; |
717 | updatePacket.ParcelData.OwnerID = parcelData.ownerID; | 723 | updatePacket.ParcelData.OwnerID = parcelData.ownerID; |
718 | updatePacket.ParcelData.OwnerPrims = parcelData.ownerPrims; | 724 | updatePacket.ParcelData.OwnerPrims = parcelData.ownerPrims; |
719 | updatePacket.ParcelData.ParcelFlags = parcelData.parcelFlags; | 725 | updatePacket.ParcelData.ParcelFlags = parcelData.parcelFlags; |
@@ -728,7 +734,7 @@ namespace OpenSim.Region.Environment | |||
728 | updatePacket.ParcelData.RentPrice = 0; | 734 | updatePacket.ParcelData.RentPrice = 0; |
729 | updatePacket.ParcelData.RequestResult = request_result; | 735 | updatePacket.ParcelData.RequestResult = request_result; |
730 | updatePacket.ParcelData.SalePrice = parcelData.salePrice; | 736 | updatePacket.ParcelData.SalePrice = parcelData.salePrice; |
731 | updatePacket.ParcelData.SelectedPrims = 0; //unemeplemented | 737 | updatePacket.ParcelData.SelectedPrims = parcelData.selectedPrims; |
732 | updatePacket.ParcelData.SelfCount = 0;//unemplemented | 738 | updatePacket.ParcelData.SelfCount = 0;//unemplemented |
733 | updatePacket.ParcelData.SequenceID = sequence_id; | 739 | updatePacket.ParcelData.SequenceID = sequence_id; |
734 | if (parcelData.simwideArea > 0) | 740 | if (parcelData.simwideArea > 0) |
@@ -743,7 +749,7 @@ namespace OpenSim.Region.Environment | |||
743 | updatePacket.ParcelData.SnapSelection = snap_selection; | 749 | updatePacket.ParcelData.SnapSelection = snap_selection; |
744 | updatePacket.ParcelData.SnapshotID = parcelData.snapshotID; | 750 | updatePacket.ParcelData.SnapshotID = parcelData.snapshotID; |
745 | updatePacket.ParcelData.Status = (byte)parcelData.parcelStatus; | 751 | updatePacket.ParcelData.Status = (byte)parcelData.parcelStatus; |
746 | updatePacket.ParcelData.TotalPrims = parcelData.ownerPrims + parcelData.groupPrims + parcelData.otherPrims; | 752 | updatePacket.ParcelData.TotalPrims = parcelData.ownerPrims + parcelData.groupPrims + parcelData.otherPrims + parcelData.selectedPrims; |
747 | updatePacket.ParcelData.UserLocation = parcelData.userLocation; | 753 | updatePacket.ParcelData.UserLocation = parcelData.userLocation; |
748 | updatePacket.ParcelData.UserLookAt = parcelData.userLookAt; | 754 | updatePacket.ParcelData.UserLookAt = parcelData.userLookAt; |
749 | remote_client.OutPacket((Packet)updatePacket); | 755 | remote_client.OutPacket((Packet)updatePacket); |
@@ -1042,7 +1048,7 @@ namespace OpenSim.Region.Environment | |||
1042 | 1048 | ||
1043 | 1049 | ||
1044 | bool firstCall = true; | 1050 | bool firstCall = true; |
1045 | int MAX_OBJECTS_PER_PACKET = 255; | 1051 | int MAX_OBJECTS_PER_PACKET = 251; |
1046 | ForceObjectSelectPacket pack = new ForceObjectSelectPacket(); | 1052 | ForceObjectSelectPacket pack = new ForceObjectSelectPacket(); |
1047 | ForceObjectSelectPacket.DataBlock[] data; | 1053 | ForceObjectSelectPacket.DataBlock[] data; |
1048 | while (resultLocalIDs.Count > 0) | 1054 | while (resultLocalIDs.Count > 0) |
@@ -1074,16 +1080,55 @@ namespace OpenSim.Region.Environment | |||
1074 | resultLocalIDs.RemoveAt(0); | 1080 | resultLocalIDs.RemoveAt(0); |
1075 | } | 1081 | } |
1076 | pack.Data = data; | 1082 | pack.Data = data; |
1077 | |||
1078 | remote_client.OutPacket((Packet)pack); | 1083 | remote_client.OutPacket((Packet)pack); |
1079 | } | 1084 | } |
1080 | 1085 | ||
1081 | } | 1086 | } |
1087 | public void sendParcelObjectOwners(IClientAPI remote_client) | ||
1088 | { | ||
1089 | Dictionary<LLUUID, int> ownersAndCount = new Dictionary<LLUUID,int>(); | ||
1090 | foreach(SceneObject obj in primsOverMe) | ||
1091 | { | ||
1092 | if(!ownersAndCount.ContainsKey(obj.rootPrimitive.OwnerID)) | ||
1093 | { | ||
1094 | ownersAndCount.Add(obj.rootPrimitive.OwnerID,0); | ||
1095 | } | ||
1096 | ownersAndCount[obj.rootPrimitive.OwnerID] += obj.primCount; | ||
1097 | } | ||
1098 | if (ownersAndCount.Count > 0) | ||
1099 | { | ||
1100 | |||
1101 | ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock = new ParcelObjectOwnersReplyPacket.DataBlock[32]; | ||
1102 | |||
1103 | if(ownersAndCount.Count < 32) | ||
1104 | { | ||
1105 | dataBlock = new ParcelObjectOwnersReplyPacket.DataBlock[ownersAndCount.Count]; | ||
1106 | } | ||
1107 | |||
1108 | |||
1109 | int num = 0; | ||
1110 | foreach (LLUUID owner in ownersAndCount.Keys) | ||
1111 | { | ||
1112 | dataBlock[num] = new ParcelObjectOwnersReplyPacket.DataBlock(); | ||
1113 | dataBlock[num].Count = ownersAndCount[owner]; | ||
1114 | dataBlock[num].IsGroupOwned = false; //TODO: fix me when group support is added | ||
1115 | dataBlock[num].OnlineStatus = true; //TODO: fix me later | ||
1116 | dataBlock[num].OwnerID = owner; | ||
1117 | |||
1118 | num++; | ||
1119 | } | ||
1120 | |||
1121 | ParcelObjectOwnersReplyPacket pack = new ParcelObjectOwnersReplyPacket(); | ||
1122 | pack.Data = dataBlock; | ||
1123 | remote_client.OutPacket(pack); | ||
1124 | } | ||
1125 | } | ||
1082 | public void resetParcelPrimCounts() | 1126 | public void resetParcelPrimCounts() |
1083 | { | 1127 | { |
1084 | parcelData.groupPrims = 0; | 1128 | parcelData.groupPrims = 0; |
1085 | parcelData.ownerPrims = 0; | 1129 | parcelData.ownerPrims = 0; |
1086 | parcelData.groupPrims = 0; | 1130 | parcelData.otherPrims = 0; |
1131 | parcelData.selectedPrims = 0; | ||
1087 | primsOverMe.Clear(); | 1132 | primsOverMe.Clear(); |
1088 | } | 1133 | } |
1089 | 1134 | ||
@@ -1092,14 +1137,22 @@ namespace OpenSim.Region.Environment | |||
1092 | LLUUID prim_owner = obj.rootPrimitive.OwnerID; | 1137 | LLUUID prim_owner = obj.rootPrimitive.OwnerID; |
1093 | int prim_count = obj.primCount; | 1138 | int prim_count = obj.primCount; |
1094 | 1139 | ||
1095 | if(prim_owner == parcelData.ownerID) | 1140 | if (obj.isSelected) |
1096 | { | 1141 | { |
1097 | parcelData.ownerPrims += prim_count; | 1142 | parcelData.selectedPrims += prim_count; |
1098 | } | 1143 | } |
1099 | else | 1144 | else |
1100 | { | 1145 | { |
1101 | parcelData.otherPrims += prim_count; | 1146 | if (prim_owner == parcelData.ownerID) |
1147 | { | ||
1148 | parcelData.ownerPrims += prim_count; | ||
1149 | } | ||
1150 | else | ||
1151 | { | ||
1152 | parcelData.otherPrims += prim_count; | ||
1153 | } | ||
1102 | } | 1154 | } |
1155 | |||
1103 | primsOverMe.Add(obj); | 1156 | primsOverMe.Add(obj); |
1104 | 1157 | ||
1105 | } | 1158 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 6431bc7..347625a 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | |||
@@ -341,6 +341,29 @@ namespace OpenSim.Region.Environment.Scenes | |||
341 | if (((SceneObject)ent).rootLocalID == primLocalID) | 341 | if (((SceneObject)ent).rootLocalID == primLocalID) |
342 | { | 342 | { |
343 | ((SceneObject)ent).GetProperites(remoteClient); | 343 | ((SceneObject)ent).GetProperites(remoteClient); |
344 | ((SceneObject)ent).isSelected = true; | ||
345 | this.ParcelManager.setPrimsTainted(); | ||
346 | break; | ||
347 | } | ||
348 | } | ||
349 | } | ||
350 | } | ||
351 | |||
352 | /// <summary> | ||
353 | /// | ||
354 | /// </summary> | ||
355 | /// <param name="primLocalID"></param> | ||
356 | /// <param name="remoteClient"></param> | ||
357 | public void DeselectPrim(uint primLocalID, IClientAPI remoteClient) | ||
358 | { | ||
359 | foreach (EntityBase ent in Entities.Values) | ||
360 | { | ||
361 | if (ent is SceneObject) | ||
362 | { | ||
363 | if (((SceneObject)ent).rootLocalID == primLocalID) | ||
364 | { | ||
365 | ((SceneObject)ent).isSelected = false; | ||
366 | this.ParcelManager.setPrimsTainted(); | ||
344 | break; | 367 | break; |
345 | } | 368 | } |
346 | } | 369 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 5e2e494..ba57115 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -537,6 +537,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
537 | client.OnUpdatePrimTexture += this.UpdatePrimTexture; | 537 | client.OnUpdatePrimTexture += this.UpdatePrimTexture; |
538 | client.OnTeleportLocationRequest += this.RequestTeleportLocation; | 538 | client.OnTeleportLocationRequest += this.RequestTeleportLocation; |
539 | client.OnObjectSelect += this.SelectPrim; | 539 | client.OnObjectSelect += this.SelectPrim; |
540 | client.OnObjectDeselect += this.DeselectPrim; | ||
540 | client.OnGrapUpdate += this.MoveObject; | 541 | client.OnGrapUpdate += this.MoveObject; |
541 | client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest; | 542 | client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest; |
542 | client.OnObjectDescription += this.PrimDescription; | 543 | client.OnObjectDescription += this.PrimDescription; |
@@ -549,6 +550,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
549 | client.OnParcelJoinRequest += new ParcelJoinRequest(m_parcelManager.handleParcelJoinRequest); | 550 | client.OnParcelJoinRequest += new ParcelJoinRequest(m_parcelManager.handleParcelJoinRequest); |
550 | client.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(m_parcelManager.handleParcelPropertiesUpdateRequest); | 551 | client.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(m_parcelManager.handleParcelPropertiesUpdateRequest); |
551 | client.OnParcelSelectObjects += new ParcelSelectObjects(m_parcelManager.handleParcelSelectObjectsRequest); | 552 | client.OnParcelSelectObjects += new ParcelSelectObjects(m_parcelManager.handleParcelSelectObjectsRequest); |
553 | client.OnParcelObjectOwnerRequest += new ParcelObjectOwnerRequest(m_parcelManager.handleParcelObjectOwnersRequest); | ||
554 | |||
552 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); | 555 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); |
553 | 556 | ||
554 | } | 557 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObject.cs b/OpenSim/Region/Environment/Scenes/SceneObject.cs index 8de7cdb..e615599 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObject.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObject.cs | |||
@@ -49,6 +49,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
49 | 49 | ||
50 | private EventManager m_eventManager; | 50 | private EventManager m_eventManager; |
51 | 51 | ||
52 | public bool isSelected = false; | ||
53 | |||
52 | public LLUUID rootUUID | 54 | public LLUUID rootUUID |
53 | { | 55 | { |
54 | get | 56 | get |
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index 3e4bfee..d417851 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs | |||
@@ -71,6 +71,7 @@ namespace SimpleApp | |||
71 | 71 | ||
72 | world.LoadWorldMap(); | 72 | world.LoadWorldMap(); |
73 | world.PhysScene.SetTerrain(world.Terrain.getHeights1D()); | 73 | world.PhysScene.SetTerrain(world.Terrain.getHeights1D()); |
74 | world.performParcelPrimCountUpdate(); | ||
74 | 75 | ||
75 | udpServer.LocalWorld = world; | 76 | udpServer.LocalWorld = world; |
76 | 77 | ||