diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/GodController.cs | 222 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 42 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 257 |
5 files changed, 278 insertions, 248 deletions
diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index 5763e03..8035760 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs | |||
@@ -47,23 +47,35 @@ namespace OpenSim.Region.Framework.Scenes | |||
47 | { | 47 | { |
48 | public class GodController | 48 | public class GodController |
49 | { | 49 | { |
50 | public enum ImplicitGodLevels : int | ||
51 | { | ||
52 | EstateManager = 210, // estate manager implicit god level | ||
53 | RegionOwner = 220 // region owner implicit god level should be >= than estate | ||
54 | } | ||
55 | |||
50 | ScenePresence m_scenePresence; | 56 | ScenePresence m_scenePresence; |
51 | Scene m_scene; | 57 | Scene m_scene; |
52 | protected bool m_allowGridGods; | 58 | protected bool m_allowGridGods; |
59 | protected bool m_forceGridGodsOnly; | ||
53 | protected bool m_regionOwnerIsGod; | 60 | protected bool m_regionOwnerIsGod; |
54 | protected bool m_regionManagerIsGod; | 61 | protected bool m_regionManagerIsGod; |
55 | protected bool m_parcelOwnerIsGod; | ||
56 | protected bool m_forceGodModeAlwaysOn; | 62 | protected bool m_forceGodModeAlwaysOn; |
57 | protected bool m_allowGodActionsWithoutGodMode; | 63 | protected bool m_allowGodActionsWithoutGodMode; |
58 | 64 | ||
59 | protected bool m_viewerUiIsGod = false; | ||
60 | |||
61 | protected int m_userLevel = 0; | 65 | protected int m_userLevel = 0; |
62 | 66 | // the god level from local or grid user rights | |
63 | public GodController(Scene scene, ScenePresence sp) | 67 | protected int m_rightsGodLevel = 0; |
68 | // the level seen by viewers | ||
69 | protected int m_godlevel = 0; | ||
70 | // new level that can be fixed or equal to godlevel, acording to options | ||
71 | protected int m_effectivegodlevel = 0; | ||
72 | protected int m_lastLevelToViewer = 0; | ||
73 | |||
74 | public GodController(Scene scene, ScenePresence sp, int userlevel) | ||
64 | { | 75 | { |
65 | m_scene = scene; | 76 | m_scene = scene; |
66 | m_scenePresence = sp; | 77 | m_scenePresence = sp; |
78 | m_userLevel = userlevel; | ||
67 | 79 | ||
68 | IConfigSource config = scene.Config; | 80 | IConfigSource config = scene.Config; |
69 | 81 | ||
@@ -76,21 +88,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
76 | Util.GetConfigVarFromSections<bool>(config, | 88 | Util.GetConfigVarFromSections<bool>(config, |
77 | "allow_grid_gods", sections, false); | 89 | "allow_grid_gods", sections, false); |
78 | 90 | ||
79 | // The owner of a region is a god in his region only. | 91 | // If grid gods are active, dont allow any other gods |
80 | m_regionOwnerIsGod = | 92 | m_forceGridGodsOnly = |
81 | Util.GetConfigVarFromSections<bool>(config, | 93 | Util.GetConfigVarFromSections<bool>(config, |
82 | "region_owner_is_god", sections, true); | 94 | "force_grid_gods_only", sections, false); |
83 | 95 | ||
84 | // Region managers are gods in the regions they manage. | 96 | if(!m_forceGridGodsOnly) |
85 | m_regionManagerIsGod = | 97 | { |
98 | // The owner of a region is a god in his region only. | ||
99 | m_regionOwnerIsGod = | ||
86 | Util.GetConfigVarFromSections<bool>(config, | 100 | Util.GetConfigVarFromSections<bool>(config, |
87 | "region_manager_is_god", sections, false); | 101 | "region_owner_is_god", sections, true); |
88 | 102 | ||
89 | // Parcel owners are gods in their own parcels only. | 103 | // Region managers are gods in the regions they manage. |
90 | m_parcelOwnerIsGod = | 104 | m_regionManagerIsGod = |
91 | Util.GetConfigVarFromSections<bool>(config, | 105 | Util.GetConfigVarFromSections<bool>(config, |
92 | "parcel_owner_is_god", sections, false); | 106 | "region_manager_is_god", sections, false); |
93 | 107 | ||
108 | } | ||
109 | else | ||
110 | m_allowGridGods = true; // reduce potencial user mistakes | ||
111 | |||
94 | // God mode should be turned on in the viewer whenever | 112 | // God mode should be turned on in the viewer whenever |
95 | // the user has god rights somewhere. They may choose | 113 | // the user has god rights somewhere. They may choose |
96 | // to turn it off again, though. | 114 | // to turn it off again, though. |
@@ -105,78 +123,121 @@ namespace OpenSim.Region.Framework.Scenes | |||
105 | Util.GetConfigVarFromSections<bool>(config, | 123 | Util.GetConfigVarFromSections<bool>(config, |
106 | "implicit_gods", sections, false); | 124 | "implicit_gods", sections, false); |
107 | 125 | ||
126 | m_rightsGodLevel = CalcRightsGodLevel(); | ||
127 | |||
128 | if(m_allowGodActionsWithoutGodMode) | ||
129 | { | ||
130 | m_effectivegodlevel = m_rightsGodLevel; | ||
131 | |||
132 | m_forceGodModeAlwaysOn = false; | ||
133 | } | ||
134 | |||
135 | else if(m_forceGodModeAlwaysOn) | ||
136 | { | ||
137 | m_godlevel = m_rightsGodLevel; | ||
138 | m_effectivegodlevel = m_rightsGodLevel; | ||
139 | } | ||
140 | |||
141 | m_scenePresence.isGod = (m_effectivegodlevel >= 200); | ||
142 | m_scenePresence.isLegacyGod = (m_godlevel >= 200); | ||
108 | } | 143 | } |
109 | 144 | ||
110 | protected bool CanBeGod() | 145 | // calculates god level at sp creation from local and grid user god rights |
146 | // for now this is assumed static until user leaves region. | ||
147 | // later estate and gride level updates may update this | ||
148 | protected int CalcRightsGodLevel() | ||
111 | { | 149 | { |
112 | bool canBeGod = false; | 150 | int level = 0; |
151 | if (m_allowGridGods && m_userLevel >= 200) | ||
152 | level = m_userLevel; | ||
113 | 153 | ||
114 | if (m_allowGridGods && m_userLevel > 0) | 154 | if(m_forceGridGodsOnly || level >= (int)ImplicitGodLevels.RegionOwner) |
115 | canBeGod = true; | 155 | return level; |
116 | 156 | ||
117 | if (m_regionOwnerIsGod && m_scene.RegionInfo.EstateSettings.IsEstateOwner(m_scenePresence.UUID)) | 157 | if (m_regionOwnerIsGod && m_scene.RegionInfo.EstateSettings.IsEstateOwner(m_scenePresence.UUID)) |
118 | canBeGod = true; | 158 | level = (int)ImplicitGodLevels.RegionOwner; |
119 | 159 | ||
120 | if (m_regionManagerIsGod && m_scene.Permissions.IsEstateManager(m_scenePresence.UUID)) | 160 | if(level >= (int)ImplicitGodLevels.EstateManager) |
121 | canBeGod = true; | 161 | return level; |
122 | 162 | ||
123 | if (!canBeGod && m_parcelOwnerIsGod) // Skip expensive check if we're already god! | 163 | if (m_regionManagerIsGod && m_scene.Permissions.IsEstateManager(m_scenePresence.UUID)) |
124 | { | 164 | level = (int)ImplicitGodLevels.EstateManager; |
125 | Vector3 pos = m_scenePresence.AbsolutePosition; | ||
126 | ILandObject parcel = m_scene.LandChannel.GetLandObject(pos.X, pos.Y); | ||
127 | if (parcel != null && parcel.LandData.OwnerID == m_scenePresence.UUID) | ||
128 | canBeGod = true; | ||
129 | } | ||
130 | 165 | ||
131 | return canBeGod; | 166 | return level; |
132 | } | 167 | } |
133 | 168 | ||
134 | protected void SyncViewerState() | 169 | protected bool CanBeGod() |
135 | { | 170 | { |
136 | bool canBeGod = CanBeGod(); | 171 | return m_rightsGodLevel >= 200; |
172 | } | ||
137 | 173 | ||
138 | bool shoudBeGod = m_forceGodModeAlwaysOn ? canBeGod : (m_viewerUiIsGod && canBeGod); | 174 | protected void UpdateGodLevels(bool viewerState) |
175 | { | ||
176 | if(!CanBeGod()) | ||
177 | { | ||
178 | m_godlevel = 0; | ||
179 | m_effectivegodlevel = 0; | ||
180 | m_scenePresence.isGod = false; | ||
181 | m_scenePresence.isLegacyGod = false; | ||
182 | return; | ||
183 | } | ||
139 | 184 | ||
140 | int godLevel = m_allowGridGods ? m_userLevel : 200; | 185 | // legacy some are controled by viewer, others are static |
141 | if (!shoudBeGod) | 186 | if(m_allowGodActionsWithoutGodMode) |
142 | godLevel = 0; | 187 | { |
188 | if(viewerState) | ||
189 | m_godlevel = m_rightsGodLevel; | ||
190 | else | ||
191 | m_godlevel = 0; | ||
143 | 192 | ||
144 | if (m_viewerUiIsGod != shoudBeGod) | 193 | m_effectivegodlevel = m_rightsGodLevel; |
194 | } | ||
195 | else | ||
145 | { | 196 | { |
146 | m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)godLevel); | 197 | // new all change with viewer |
147 | m_viewerUiIsGod = shoudBeGod; | 198 | if(viewerState) |
199 | { | ||
200 | m_godlevel = m_rightsGodLevel; | ||
201 | m_effectivegodlevel = m_rightsGodLevel; | ||
202 | } | ||
203 | else | ||
204 | { | ||
205 | m_godlevel = 0; | ||
206 | m_effectivegodlevel = 0; | ||
207 | } | ||
148 | } | 208 | } |
209 | m_scenePresence.isGod = (m_effectivegodlevel >= 200); | ||
210 | m_scenePresence.isLegacyGod = (m_godlevel >= 200); | ||
149 | } | 211 | } |
150 | 212 | ||
151 | public bool RequestGodMode(bool god) | 213 | public void SyncViewerState() |
152 | { | 214 | { |
153 | if (!god) | 215 | if(m_lastLevelToViewer == m_godlevel) |
154 | { | 216 | return; |
155 | if (m_viewerUiIsGod) | ||
156 | m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, 0); | ||
157 | 217 | ||
158 | m_viewerUiIsGod = false; | 218 | m_lastLevelToViewer = m_godlevel; |
159 | 219 | ||
160 | return true; | 220 | if(m_scenePresence.IsChildAgent) |
161 | } | 221 | return; |
162 | 222 | ||
163 | if (!CanBeGod()) | 223 | m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)m_godlevel); |
164 | return false; | 224 | } |
165 | |||
166 | int godLevel = m_allowGridGods ? m_userLevel : 200; | ||
167 | |||
168 | if (!m_viewerUiIsGod) | ||
169 | m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)godLevel); | ||
170 | 225 | ||
171 | m_viewerUiIsGod = true; | 226 | public void RequestGodMode(bool god) |
227 | { | ||
228 | UpdateGodLevels(god); | ||
172 | 229 | ||
173 | return true; | 230 | if(m_lastLevelToViewer != m_godlevel) |
231 | { | ||
232 | m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)m_godlevel); | ||
233 | m_lastLevelToViewer = m_godlevel; | ||
234 | } | ||
174 | } | 235 | } |
175 | 236 | ||
176 | public OSD State() | 237 | public OSD State() |
177 | { | 238 | { |
178 | OSDMap godMap = new OSDMap(2); | 239 | OSDMap godMap = new OSDMap(2); |
179 | 240 | bool m_viewerUiIsGod = m_godlevel >= 200; | |
180 | godMap.Add("ViewerUiIsGod", OSD.FromBoolean(m_viewerUiIsGod)); | 241 | godMap.Add("ViewerUiIsGod", OSD.FromBoolean(m_viewerUiIsGod)); |
181 | 242 | ||
182 | return godMap; | 243 | return godMap; |
@@ -184,45 +245,42 @@ namespace OpenSim.Region.Framework.Scenes | |||
184 | 245 | ||
185 | public void SetState(OSD state) | 246 | public void SetState(OSD state) |
186 | { | 247 | { |
187 | OSDMap s = (OSDMap)state; | 248 | bool newstate = false; |
188 | 249 | if(m_forceGodModeAlwaysOn) | |
189 | if (s.ContainsKey("ViewerUiIsGod")) | 250 | newstate = true; |
190 | m_viewerUiIsGod = s["ViewerUiIsGod"].AsBoolean(); | 251 | else |
252 | { | ||
253 | if(state != null) | ||
254 | { | ||
255 | OSDMap s = (OSDMap)state; | ||
256 | |||
257 | if (s.ContainsKey("ViewerUiIsGod")) | ||
258 | newstate = s["ViewerUiIsGod"].AsBoolean(); | ||
259 | m_lastLevelToViewer = m_godlevel; // we are not changing viewer level by default | ||
260 | } | ||
261 | } | ||
262 | UpdateGodLevels(newstate); | ||
263 | } | ||
191 | 264 | ||
192 | SyncViewerState(); | 265 | public void HasMovedAway() |
266 | { | ||
267 | m_lastLevelToViewer = 0; | ||
193 | } | 268 | } |
194 | 269 | ||
195 | public int UserLevel | 270 | public int UserLevel |
196 | { | 271 | { |
197 | get { return m_userLevel; } | 272 | get { return m_userLevel; } |
198 | set { m_userLevel = UserLevel; } | 273 | set { m_userLevel = value; } |
199 | } | 274 | } |
200 | 275 | ||
201 | public int GodLevel | 276 | public int GodLevel |
202 | { | 277 | { |
203 | get | 278 | get { return m_godlevel; } |
204 | { | ||
205 | int godLevel = m_allowGridGods ? m_userLevel : 200; | ||
206 | if (!m_viewerUiIsGod) | ||
207 | godLevel = 0; | ||
208 | |||
209 | return godLevel; | ||
210 | } | ||
211 | } | 279 | } |
212 | 280 | ||
213 | public int EffectiveLevel | 281 | public int EffectiveLevel |
214 | { | 282 | { |
215 | get | 283 | get { return m_effectivegodlevel; } |
216 | { | ||
217 | int godLevel = m_allowGridGods ? m_userLevel : 200; | ||
218 | if (m_viewerUiIsGod) | ||
219 | return godLevel; | ||
220 | |||
221 | if (m_allowGodActionsWithoutGodMode && CanBeGod()) | ||
222 | return godLevel; | ||
223 | |||
224 | return 0; | ||
225 | } | ||
226 | } | 284 | } |
227 | } | 285 | } |
228 | } | 286 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e3ccf96..cb06540 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -627,6 +627,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
627 | itemCopy.AssetType = item.AssetType; | 627 | itemCopy.AssetType = item.AssetType; |
628 | itemCopy.InvType = item.InvType; | 628 | itemCopy.InvType = item.InvType; |
629 | itemCopy.Folder = recipientFolderId; | 629 | itemCopy.Folder = recipientFolderId; |
630 | itemCopy.Flags = item.Flags; | ||
630 | 631 | ||
631 | if (Permissions.PropagatePermissions() && recipient != senderId) | 632 | if (Permissions.PropagatePermissions() && recipient != senderId) |
632 | { | 633 | { |
@@ -643,7 +644,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
643 | // | 644 | // |
644 | // Transfer | 645 | // Transfer |
645 | // Copy | 646 | // Copy |
646 | // Modufy | 647 | // Modify |
647 | uint permsMask = ~ ((uint)PermissionMask.Copy | | 648 | uint permsMask = ~ ((uint)PermissionMask.Copy | |
648 | (uint)PermissionMask.Transfer | | 649 | (uint)PermissionMask.Transfer | |
649 | (uint)PermissionMask.Modify); | 650 | (uint)PermissionMask.Modify); |
@@ -681,13 +682,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
681 | // a mask | 682 | // a mask |
682 | if (item.InvType == (int)InventoryType.Object) | 683 | if (item.InvType == (int)InventoryType.Object) |
683 | { | 684 | { |
685 | // Create a safe mask for the current perms | ||
686 | uint foldedPerms = (item.CurrentPermissions & 7) << 13; | ||
687 | foldedPerms |= permsMask; | ||
688 | |||
684 | bool isRootMod = (item.CurrentPermissions & | 689 | bool isRootMod = (item.CurrentPermissions & |
685 | (uint)PermissionMask.Modify) != 0 ? | 690 | (uint)PermissionMask.Modify) != 0 ? |
686 | true : false; | 691 | true : false; |
687 | 692 | ||
688 | // Mask the owner perms to the folded perms | 693 | // Mask the owner perms to the folded perms |
689 | PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref ownerPerms); | 694 | ownerPerms &= foldedPerms; |
690 | PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref basePerms); | 695 | basePerms &= foldedPerms; |
691 | 696 | ||
692 | // If the root was mod, let the mask reflect that | 697 | // If the root was mod, let the mask reflect that |
693 | // We also need to adjust the base here, because | 698 | // We also need to adjust the base here, because |
@@ -714,6 +719,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
714 | itemCopy.BasePermissions = basePerms; | 719 | itemCopy.BasePermissions = basePerms; |
715 | itemCopy.CurrentPermissions = ownerPerms; | 720 | itemCopy.CurrentPermissions = ownerPerms; |
716 | itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; | 721 | itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; |
722 | // Need to clear the other inventory slam options. | ||
723 | // That is so we can handle the case where the recipient | ||
724 | // changes the bits in inventory before rezzing | ||
725 | itemCopy.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner); | ||
717 | 726 | ||
718 | itemCopy.NextPermissions = item.NextPermissions; | 727 | itemCopy.NextPermissions = item.NextPermissions; |
719 | 728 | ||
@@ -763,9 +772,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
763 | 772 | ||
764 | itemCopy.GroupID = UUID.Zero; | 773 | itemCopy.GroupID = UUID.Zero; |
765 | itemCopy.GroupOwned = false; | 774 | itemCopy.GroupOwned = false; |
766 | itemCopy.Flags = item.Flags; | 775 | itemCopy.SalePrice = 0; //item.SalePrice; |
767 | itemCopy.SalePrice = item.SalePrice; | 776 | itemCopy.SaleType = 0; //item.SaleType; |
768 | itemCopy.SaleType = item.SaleType; | ||
769 | 777 | ||
770 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); | 778 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); |
771 | if (invAccess != null) | 779 | if (invAccess != null) |
@@ -1240,26 +1248,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
1240 | { | 1248 | { |
1241 | agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); | 1249 | agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); |
1242 | if (taskItem.InvType == (int)InventoryType.Object) | 1250 | if (taskItem.InvType == (int)InventoryType.Object) |
1243 | { | 1251 | agentItem.CurrentPermissions = agentItem.BasePermissions & (((taskItem.CurrentPermissions & 7) << 13) | (taskItem.CurrentPermissions & (uint)PermissionMask.Move)); |
1244 | // Bake the new base permissions from folded permissions | 1252 | else |
1245 | // The folded perms are in the lowest 3 bits of the current perms | 1253 | agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; |
1246 | // We use base permissions here to avoid baking the "Locked" status | ||
1247 | // into the item as it is passed. | ||
1248 | uint perms = taskItem.BasePermissions & taskItem.NextPermissions; | ||
1249 | PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms); | ||
1250 | // Avoid the "lock trap" - move must always be enabled but the above may remove it | ||
1251 | // Add it back here. | ||
1252 | agentItem.BasePermissions = perms | (uint)PermissionMask.Move; | ||
1253 | // Newly given items cannot be "locked" on rez. Make sure by | ||
1254 | // setting current equal to base. | ||
1255 | } | ||
1256 | 1254 | ||
1257 | agentItem.CurrentPermissions = agentItem.BasePermissions; | 1255 | agentItem.CurrentPermissions = agentItem.BasePermissions; |
1258 | 1256 | ||
1259 | agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; | 1257 | agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; |
1258 | agentItem.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner); | ||
1260 | agentItem.NextPermissions = taskItem.NextPermissions; | 1259 | agentItem.NextPermissions = taskItem.NextPermissions; |
1261 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); | 1260 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); |
1262 | agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; | 1261 | // Group permissions make no sense here |
1262 | agentItem.GroupPermissions = 0; | ||
1263 | } | 1263 | } |
1264 | else | 1264 | else |
1265 | { | 1265 | { |
@@ -1267,7 +1267,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1267 | agentItem.CurrentPermissions = taskItem.CurrentPermissions; | 1267 | agentItem.CurrentPermissions = taskItem.CurrentPermissions; |
1268 | agentItem.NextPermissions = taskItem.NextPermissions; | 1268 | agentItem.NextPermissions = taskItem.NextPermissions; |
1269 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions; | 1269 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions; |
1270 | agentItem.GroupPermissions = taskItem.GroupPermissions; | 1270 | agentItem.GroupPermissions = 0; |
1271 | } | 1271 | } |
1272 | 1272 | ||
1273 | message = null; | 1273 | message = null; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b97cceb..99be06b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -5242,6 +5242,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5242 | BaseMask &= NextOwnerMask | (uint)PermissionMask.Export; | 5242 | BaseMask &= NextOwnerMask | (uint)PermissionMask.Export; |
5243 | OwnerMask &= NextOwnerMask; | 5243 | OwnerMask &= NextOwnerMask; |
5244 | EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export; | 5244 | EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export; |
5245 | GroupMask = 0; // Giving an object zaps group permissions | ||
5245 | 5246 | ||
5246 | Inventory.ApplyNextOwnerPermissions(); | 5247 | Inventory.ApplyNextOwnerPermissions(); |
5247 | } | 5248 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index a50f162..6557003 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -1358,6 +1358,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1358 | { | 1358 | { |
1359 | if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) | 1359 | if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) |
1360 | { | 1360 | { |
1361 | // m_log.DebugFormat ( | ||
1362 | // "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}", | ||
1363 | // item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions); | ||
1364 | |||
1361 | if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) | 1365 | if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) |
1362 | item.CurrentPermissions &= ~(uint)PermissionMask.Copy; | 1366 | item.CurrentPermissions &= ~(uint)PermissionMask.Copy; |
1363 | if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) | 1367 | if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 339f1b1..dbca68b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -92,6 +92,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
92 | 92 | ||
93 | public bool isNPC { get; private set; } | 93 | public bool isNPC { get; private set; } |
94 | 94 | ||
95 | // simple yes or no isGOD from god level >= 200 | ||
96 | // should only be set by GodController | ||
97 | // we have two to suport legacy behaviour | ||
98 | // isLegacyGod was controlled by viewer in older versions | ||
99 | // isGod may now be also controled by viewer acording to options | ||
100 | public bool isLegacyGod { get; set; } | ||
101 | public bool isGod { get; set; } | ||
102 | |||
95 | private PresenceType m_presenceType; | 103 | private PresenceType m_presenceType; |
96 | public PresenceType PresenceType { | 104 | public PresenceType PresenceType { |
97 | get {return m_presenceType;} | 105 | get {return m_presenceType;} |
@@ -155,7 +163,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
155 | public static readonly float MOVEMENT = .25f; | 163 | public static readonly float MOVEMENT = .25f; |
156 | public static readonly float SIGNIFICANT_MOVEMENT = 16.0f; | 164 | public static readonly float SIGNIFICANT_MOVEMENT = 16.0f; |
157 | public static readonly float CHILDUPDATES_MOVEMENT = 100.0f; | 165 | public static readonly float CHILDUPDATES_MOVEMENT = 100.0f; |
158 | public static readonly float CHILDUPDATES_TIME = 10000f; // min time between child updates (ms) | 166 | public static readonly float CHILDUPDATES_TIME = 2000f; // min time between child updates (ms) |
159 | 167 | ||
160 | private UUID m_previusParcelUUID = UUID.Zero; | 168 | private UUID m_previusParcelUUID = UUID.Zero; |
161 | private UUID m_currentParcelUUID = UUID.Zero; | 169 | private UUID m_currentParcelUUID = UUID.Zero; |
@@ -186,7 +194,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
186 | m_currentParcelHide = true; | 194 | m_currentParcelHide = true; |
187 | 195 | ||
188 | if (m_previusParcelUUID != UUID.Zero || checksame) | 196 | if (m_previusParcelUUID != UUID.Zero || checksame) |
189 | ParcelCrossCheck(m_currentParcelUUID,m_previusParcelUUID,m_currentParcelHide, m_previusParcelHide, oldhide,checksame); | 197 | ParcelCrossCheck(m_currentParcelUUID, m_previusParcelUUID, m_currentParcelHide, m_previusParcelHide, oldhide,checksame); |
190 | } | 198 | } |
191 | } | 199 | } |
192 | } | 200 | } |
@@ -267,8 +275,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
267 | private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; | 275 | private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; |
268 | private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; | 276 | private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; |
269 | private bool MouseDown = false; | 277 | private bool MouseDown = false; |
270 | // private SceneObjectGroup proxyObjectGroup; | ||
271 | //private SceneObjectPart proxyObjectPart = null; | ||
272 | public Vector3 lastKnownAllowedPosition; | 278 | public Vector3 lastKnownAllowedPosition; |
273 | public bool sentMessageAboutRestrictedParcelFlyingDown; | 279 | public bool sentMessageAboutRestrictedParcelFlyingDown; |
274 | public Vector4 CollisionPlane = Vector4.UnitW; | 280 | public Vector4 CollisionPlane = Vector4.UnitW; |
@@ -281,9 +287,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
281 | 287 | ||
282 | private bool m_followCamAuto = false; | 288 | private bool m_followCamAuto = false; |
283 | 289 | ||
284 | // private object m_forceToApplyLock = new object(); | ||
285 | // private bool m_forceToApplyValid; | ||
286 | // private Vector3 m_forceToApply; | ||
287 | private int m_userFlags; | 290 | private int m_userFlags; |
288 | public int UserFlags | 291 | public int UserFlags |
289 | { | 292 | { |
@@ -304,9 +307,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
304 | set { PhysicsActor.IsColliding = value; } | 307 | set { PhysicsActor.IsColliding = value; } |
305 | } | 308 | } |
306 | 309 | ||
307 | // private int m_lastColCount = -1; //KF: Look for Collision chnages | ||
308 | // private int m_updateCount = 0; //KF: Update Anims for a while | ||
309 | // private static readonly int UPDATE_COUNT = 10; // how many frames to update for | ||
310 | private List<uint> m_lastColliders = new List<uint>(); | 310 | private List<uint> m_lastColliders = new List<uint>(); |
311 | 311 | ||
312 | private TeleportFlags m_teleportFlags; | 312 | private TeleportFlags m_teleportFlags; |
@@ -332,8 +332,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
332 | 332 | ||
333 | private float m_sitAvatarHeight = 2.0f; | 333 | private float m_sitAvatarHeight = 2.0f; |
334 | 334 | ||
335 | private bool childUpdatesBusy = false; | 335 | private bool m_childUpdatesBusy = false; |
336 | private int lastChildUpdatesTime; | 336 | private int m_lastChildUpdatesTime; |
337 | private int m_lastChildAgentUpdateGodLevel; | ||
338 | private float m_lastChildAgentUpdateDrawDistance; | ||
337 | private Vector3 m_lastChildAgentUpdatePosition; | 339 | private Vector3 m_lastChildAgentUpdatePosition; |
338 | // private Vector3 m_lastChildAgentUpdateCamPosition; | 340 | // private Vector3 m_lastChildAgentUpdateCamPosition; |
339 | 341 | ||
@@ -348,8 +350,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
348 | private float m_healRate = 1f; | 350 | private float m_healRate = 1f; |
349 | private float m_healRatePerFrame = 0.05f; | 351 | private float m_healRatePerFrame = 0.05f; |
350 | 352 | ||
351 | // protected ulong crossingFromRegion; | ||
352 | |||
353 | private readonly Vector3[] Dir_Vectors = new Vector3[12]; | 353 | private readonly Vector3[] Dir_Vectors = new Vector3[12]; |
354 | 354 | ||
355 | protected int m_reprioritizationLastTime; | 355 | protected int m_reprioritizationLastTime; |
@@ -372,10 +372,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
372 | private const int NumMovementsBetweenRayCast = 5; | 372 | private const int NumMovementsBetweenRayCast = 5; |
373 | 373 | ||
374 | private bool CameraConstraintActive; | 374 | private bool CameraConstraintActive; |
375 | //private int m_moveToPositionStateStatus; | ||
376 | //***************************************************** | ||
377 | 375 | ||
378 | //private bool m_collisionEventFlag = false; | ||
379 | private object m_collisionEventLock = new Object(); | 376 | private object m_collisionEventLock = new Object(); |
380 | 377 | ||
381 | private int m_movementAnimationUpdateCounter = 0; | 378 | private int m_movementAnimationUpdateCounter = 0; |
@@ -529,7 +526,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
529 | private bool m_doingCamRayCast = false; | 526 | private bool m_doingCamRayCast = false; |
530 | 527 | ||
531 | public Vector3 CameraPosition { get; set; } | 528 | public Vector3 CameraPosition { get; set; } |
532 | |||
533 | public Quaternion CameraRotation { get; private set; } | 529 | public Quaternion CameraRotation { get; private set; } |
534 | 530 | ||
535 | // Use these three vectors to figure out what the agent is looking at | 531 | // Use these three vectors to figure out what the agent is looking at |
@@ -589,7 +585,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
589 | public bool AllowMovement { get; set; } | 585 | public bool AllowMovement { get; set; } |
590 | 586 | ||
591 | private bool m_setAlwaysRun; | 587 | private bool m_setAlwaysRun; |
592 | |||
593 | public bool SetAlwaysRun | 588 | public bool SetAlwaysRun |
594 | { | 589 | { |
595 | get | 590 | get |
@@ -613,7 +608,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
613 | } | 608 | } |
614 | } | 609 | } |
615 | 610 | ||
616 | |||
617 | public byte State { get; set; } | 611 | public byte State { get; set; } |
618 | 612 | ||
619 | private AgentManager.ControlFlags m_AgentControlFlags; | 613 | private AgentManager.ControlFlags m_AgentControlFlags; |
@@ -935,27 +929,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
935 | seeds = Scene.CapsModule.GetChildrenSeeds(UUID); | 929 | seeds = Scene.CapsModule.GetChildrenSeeds(UUID); |
936 | else | 930 | else |
937 | seeds = new Dictionary<ulong, string>(); | 931 | seeds = new Dictionary<ulong, string>(); |
938 | |||
939 | /* we can't do this anymore | ||
940 | List<ulong> old = new List<ulong>(); | ||
941 | foreach (ulong handle in seeds.Keys) | ||
942 | { | ||
943 | uint x, y; | ||
944 | Util.RegionHandleToRegionLoc(handle, out x, out y); | ||
945 | // if (Util.IsOutsideView(DrawDistance, x, Scene.RegionInfo.RegionLocX, y, Scene.RegionInfo.RegionLocY,)) | ||
946 | { | ||
947 | old.Add(handle); | ||
948 | } | ||
949 | } | ||
950 | |||
951 | DropOldNeighbours(old); | ||
952 | |||
953 | if (Scene.CapsModule != null) | ||
954 | Scene.CapsModule.SetChildrenSeed(UUID, seeds); | ||
955 | */ | ||
956 | KnownRegions = seeds; | 932 | KnownRegions = seeds; |
957 | //m_log.Debug(" ++++++++++AFTER+++++++++++++ "); | ||
958 | //DumpKnownRegions(); | ||
959 | } | 933 | } |
960 | 934 | ||
961 | public void DumpKnownRegions() | 935 | public void DumpKnownRegions() |
@@ -1045,8 +1019,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1045 | public ScenePresence( | 1019 | public ScenePresence( |
1046 | IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) | 1020 | IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) |
1047 | { | 1021 | { |
1048 | GodController = new GodController(world, this); | ||
1049 | |||
1050 | m_scene = world; | 1022 | m_scene = world; |
1051 | AttachmentsSyncLock = new Object(); | 1023 | AttachmentsSyncLock = new Object(); |
1052 | AllowMovement = true; | 1024 | AllowMovement = true; |
@@ -1072,8 +1044,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1072 | else | 1044 | else |
1073 | m_userFlags = 0; | 1045 | m_userFlags = 0; |
1074 | 1046 | ||
1047 | int userlevel = 0; | ||
1075 | if (account != null) | 1048 | if (account != null) |
1076 | GodController.UserLevel = account.UserLevel; | 1049 | userlevel = account.UserLevel; |
1050 | |||
1051 | GodController = new GodController(world, this, userlevel); | ||
1077 | 1052 | ||
1078 | // IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); | 1053 | // IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); |
1079 | // if (gm != null) | 1054 | // if (gm != null) |
@@ -1087,7 +1062,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1087 | m_reprioritizationLastDrawDistance = DrawDistance; | 1062 | m_reprioritizationLastDrawDistance = DrawDistance; |
1088 | 1063 | ||
1089 | // disable updates workjobs for now | 1064 | // disable updates workjobs for now |
1090 | childUpdatesBusy = true; | 1065 | m_childUpdatesBusy = true; |
1091 | m_reprioritizationBusy = true; | 1066 | m_reprioritizationBusy = true; |
1092 | 1067 | ||
1093 | AdjustKnownSeeds(); | 1068 | AdjustKnownSeeds(); |
@@ -1289,7 +1264,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1289 | IsLoggingIn = false; | 1264 | IsLoggingIn = false; |
1290 | } | 1265 | } |
1291 | 1266 | ||
1292 | IsChildAgent = false; | 1267 | IsChildAgent = false; |
1293 | } | 1268 | } |
1294 | 1269 | ||
1295 | m_log.DebugFormat("[MakeRootAgent] out lock: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 1270 | m_log.DebugFormat("[MakeRootAgent] out lock: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
@@ -1299,7 +1274,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1299 | // Should not be needed if we are not trying to tell this region to close | 1274 | // Should not be needed if we are not trying to tell this region to close |
1300 | // DoNotCloseAfterTeleport = false; | 1275 | // DoNotCloseAfterTeleport = false; |
1301 | 1276 | ||
1302 | |||
1303 | RegionHandle = m_scene.RegionInfo.RegionHandle; | 1277 | RegionHandle = m_scene.RegionInfo.RegionHandle; |
1304 | 1278 | ||
1305 | m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene); | 1279 | m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene); |
@@ -1442,7 +1416,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1442 | } | 1416 | } |
1443 | } | 1417 | } |
1444 | 1418 | ||
1445 | |||
1446 | m_log.DebugFormat("[MakeRootAgent] position and physical: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 1419 | m_log.DebugFormat("[MakeRootAgent] position and physical: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
1447 | m_scene.SwapRootAgentCount(false); | 1420 | m_scene.SwapRootAgentCount(false); |
1448 | 1421 | ||
@@ -1777,17 +1750,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1777 | 1750 | ||
1778 | if (m_AngularVelocity.Z > 0) | 1751 | if (m_AngularVelocity.Z > 0) |
1779 | { | 1752 | { |
1780 | |||
1781 | float leftOverToMin = m_AngularVelocity.Z - rollMinRadians; | 1753 | float leftOverToMin = m_AngularVelocity.Z - rollMinRadians; |
1782 | if (amount > leftOverToMin) | 1754 | if (amount > leftOverToMin) |
1783 | return -leftOverToMin; | 1755 | return -leftOverToMin; |
1784 | else | 1756 | else |
1785 | return -amount; | 1757 | return -amount; |
1786 | |||
1787 | } | 1758 | } |
1788 | else | 1759 | else |
1789 | { | 1760 | { |
1790 | |||
1791 | float leftOverToMin = -m_AngularVelocity.Z - rollMinRadians; | 1761 | float leftOverToMin = -m_AngularVelocity.Z - rollMinRadians; |
1792 | if (amount > leftOverToMin) | 1762 | if (amount > leftOverToMin) |
1793 | return leftOverToMin; | 1763 | return leftOverToMin; |
@@ -1796,8 +1766,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1796 | } | 1766 | } |
1797 | } | 1767 | } |
1798 | 1768 | ||
1799 | |||
1800 | |||
1801 | // neighbouring regions we have enabled a child agent in | 1769 | // neighbouring regions we have enabled a child agent in |
1802 | // holds the seed cap for the child agent in that region | 1770 | // holds the seed cap for the child agent in that region |
1803 | private Dictionary<ulong, string> m_knownChildRegions = new Dictionary<ulong, string>(); | 1771 | private Dictionary<ulong, string> m_knownChildRegions = new Dictionary<ulong, string>(); |
@@ -1810,7 +1778,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1810 | 1778 | ||
1811 | private Dictionary<ulong, spRegionSizeInfo> m_knownChildRegionsSizeInfo = new Dictionary<ulong, spRegionSizeInfo>(); | 1779 | private Dictionary<ulong, spRegionSizeInfo> m_knownChildRegionsSizeInfo = new Dictionary<ulong, spRegionSizeInfo>(); |
1812 | 1780 | ||
1813 | |||
1814 | public void AddNeighbourRegionSizeInfo(GridRegion region) | 1781 | public void AddNeighbourRegionSizeInfo(GridRegion region) |
1815 | { | 1782 | { |
1816 | lock (m_knownChildRegions) | 1783 | lock (m_knownChildRegions) |
@@ -1941,7 +1908,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1941 | lock (m_originRegionIDAccessLock) | 1908 | lock (m_originRegionIDAccessLock) |
1942 | originID = m_originRegionID; | 1909 | originID = m_originRegionID; |
1943 | 1910 | ||
1944 | |||
1945 | while (originID.Equals(UUID.Zero) && count-- > 0) | 1911 | while (originID.Equals(UUID.Zero) && count-- > 0) |
1946 | { | 1912 | { |
1947 | lock (m_originRegionIDAccessLock) | 1913 | lock (m_originRegionIDAccessLock) |
@@ -2063,13 +2029,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2063 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); | 2029 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); |
2064 | } | 2030 | } |
2065 | 2031 | ||
2066 | |||
2067 | // Tell the client that we're totally ready | 2032 | // Tell the client that we're totally ready |
2068 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | 2033 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); |
2069 | 2034 | ||
2070 | m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2035 | m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2071 | 2036 | ||
2072 | |||
2073 | if (!string.IsNullOrEmpty(m_callbackURI)) | 2037 | if (!string.IsNullOrEmpty(m_callbackURI)) |
2074 | { | 2038 | { |
2075 | // We cannot sleep here since this would hold up the inbound packet processing thread, as | 2039 | // We cannot sleep here since this would hold up the inbound packet processing thread, as |
@@ -2098,7 +2062,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2098 | // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); | 2062 | // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); |
2099 | // } | 2063 | // } |
2100 | 2064 | ||
2101 | |||
2102 | m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2065 | m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2103 | 2066 | ||
2104 | if(m_teleportFlags > 0) | 2067 | if(m_teleportFlags > 0) |
@@ -2118,17 +2081,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
2118 | m_log.DebugFormat("[CompleteMovement] HG"); | 2081 | m_log.DebugFormat("[CompleteMovement] HG"); |
2119 | } | 2082 | } |
2120 | 2083 | ||
2121 | if(!IsChildAgent && !isNPC) | ||
2122 | |||
2123 | // start sending terrain patchs | ||
2124 | if (!gotCrossUpdate && !isNPC) | ||
2125 | Scene.SendLayerData(ControllingClient); | ||
2126 | |||
2127 | m_previusParcelHide = false; | 2084 | m_previusParcelHide = false; |
2128 | m_previusParcelUUID = UUID.Zero; | 2085 | m_previusParcelUUID = UUID.Zero; |
2129 | m_currentParcelHide = false; | 2086 | m_currentParcelHide = false; |
2130 | m_currentParcelUUID = UUID.Zero; | 2087 | m_currentParcelUUID = UUID.Zero; |
2131 | 2088 | ||
2089 | if(!isNPC) | ||
2090 | { | ||
2091 | GodController.SyncViewerState(); | ||
2092 | |||
2093 | // start sending terrain patchs | ||
2094 | if (!gotCrossUpdate) | ||
2095 | Scene.SendLayerData(ControllingClient); | ||
2096 | } | ||
2132 | // send initial land overlay and parcel | 2097 | // send initial land overlay and parcel |
2133 | ILandChannel landch = m_scene.LandChannel; | 2098 | ILandChannel landch = m_scene.LandChannel; |
2134 | if (landch != null) | 2099 | if (landch != null) |
@@ -2177,7 +2142,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2177 | if (haveAnims) | 2142 | if (haveAnims) |
2178 | SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); | 2143 | SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); |
2179 | 2144 | ||
2180 | |||
2181 | // we should be able to receive updates, etc | 2145 | // we should be able to receive updates, etc |
2182 | // so release them | 2146 | // so release them |
2183 | m_inTransit = false; | 2147 | m_inTransit = false; |
@@ -2192,7 +2156,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2192 | if (p == this) | 2156 | if (p == this) |
2193 | continue; | 2157 | continue; |
2194 | 2158 | ||
2195 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 2159 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
2196 | continue; | 2160 | continue; |
2197 | 2161 | ||
2198 | SendAppearanceToAgentNF(p); | 2162 | SendAppearanceToAgentNF(p); |
@@ -2242,7 +2206,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2242 | continue; | 2206 | continue; |
2243 | } | 2207 | } |
2244 | 2208 | ||
2245 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 2209 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
2246 | continue; | 2210 | continue; |
2247 | 2211 | ||
2248 | SendAttachmentsToAgentNF(p); | 2212 | SendAttachmentsToAgentNF(p); |
@@ -2259,10 +2223,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2259 | { | 2223 | { |
2260 | m_agentTransfer.EnableChildAgents(this); | 2224 | m_agentTransfer.EnableChildAgents(this); |
2261 | } | 2225 | } |
2262 | // let updates be sent, with some delay | ||
2263 | lastChildUpdatesTime = Util.EnvironmentTickCount() + 10000; | ||
2264 | childUpdatesBusy = false; // allow them | ||
2265 | } | 2226 | } |
2227 | // let updates be sent, with some delay | ||
2228 | m_lastChildUpdatesTime = Util.EnvironmentTickCount() + 10000; | ||
2229 | m_lastChildAgentUpdateGodLevel = GodController.GodLevel; | ||
2230 | m_lastChildAgentUpdateDrawDistance = DrawDistance; | ||
2231 | m_lastChildAgentUpdatePosition = AbsolutePosition; | ||
2232 | m_childUpdatesBusy = false; // allow them | ||
2266 | } | 2233 | } |
2267 | 2234 | ||
2268 | m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2235 | m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
@@ -2292,7 +2259,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2292 | m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2259 | m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2293 | 2260 | ||
2294 | } | 2261 | } |
2295 | |||
2296 | } | 2262 | } |
2297 | finally | 2263 | finally |
2298 | { | 2264 | { |
@@ -2301,14 +2267,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2301 | crossingFlags = 0; | 2267 | crossingFlags = 0; |
2302 | m_inTransit = false; | 2268 | m_inTransit = false; |
2303 | } | 2269 | } |
2304 | // if hide force a check | 2270 | |
2305 | // if (!IsChildAgent && newhide) | ||
2306 | // { | ||
2307 | // ParcelLoginCheck(m_currentParcelUUID); | ||
2308 | // m_currentParcelHide = newhide; | ||
2309 | // } | ||
2310 | |||
2311 | |||
2312 | m_scene.EventManager.OnRegionHeartbeatEnd += RegionHeartbeatEnd; | 2271 | m_scene.EventManager.OnRegionHeartbeatEnd += RegionHeartbeatEnd; |
2313 | 2272 | ||
2314 | m_log.DebugFormat("[CompleteMovement] end: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2273 | m_log.DebugFormat("[CompleteMovement] end: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
@@ -3220,7 +3179,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3220 | if (part == null) | 3179 | if (part == null) |
3221 | return; | 3180 | return; |
3222 | 3181 | ||
3223 | |||
3224 | if (PhysicsActor != null) | 3182 | if (PhysicsActor != null) |
3225 | m_sitAvatarHeight = PhysicsActor.Size.Z * 0.5f; | 3183 | m_sitAvatarHeight = PhysicsActor.Size.Z * 0.5f; |
3226 | 3184 | ||
@@ -3249,7 +3207,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3249 | 3207 | ||
3250 | if (canSit) | 3208 | if (canSit) |
3251 | { | 3209 | { |
3252 | |||
3253 | if (PhysicsActor != null) | 3210 | if (PhysicsActor != null) |
3254 | { | 3211 | { |
3255 | // We can remove the physicsActor until they stand up. | 3212 | // We can remove the physicsActor until they stand up. |
@@ -3360,7 +3317,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3360 | return false; | 3317 | return false; |
3361 | } | 3318 | } |
3362 | 3319 | ||
3363 | |||
3364 | private bool CanEnterLandPosition(Vector3 testPos) | 3320 | private bool CanEnterLandPosition(Vector3 testPos) |
3365 | { | 3321 | { |
3366 | ILandObject land = m_scene.LandChannel.GetLandObject(testPos.X, testPos.Y); | 3322 | ILandObject land = m_scene.LandChannel.GetLandObject(testPos.X, testPos.Y); |
@@ -3440,7 +3396,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3440 | ControllingClient.SendSitResponse( | 3396 | ControllingClient.SendSitResponse( |
3441 | part.ParentGroup.UUID, offset, Orientation, true, cameraAtOffset, cameraEyeOffset, forceMouselook); | 3397 | part.ParentGroup.UUID, offset, Orientation, true, cameraAtOffset, cameraEyeOffset, forceMouselook); |
3442 | 3398 | ||
3443 | |||
3444 | SendAvatarDataToAllAgents(); | 3399 | SendAvatarDataToAllAgents(); |
3445 | 3400 | ||
3446 | if (status == 3) | 3401 | if (status == 3) |
@@ -3650,8 +3605,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3650 | Animator.avnChangeAnim(animID, addRemove, sendPack); | 3605 | Animator.avnChangeAnim(animID, addRemove, sendPack); |
3651 | } | 3606 | } |
3652 | 3607 | ||
3653 | |||
3654 | |||
3655 | /// <summary> | 3608 | /// <summary> |
3656 | /// Rotate the avatar to the given rotation and apply a movement in the given relative vector | 3609 | /// Rotate the avatar to the given rotation and apply a movement in the given relative vector |
3657 | /// </summary> | 3610 | /// </summary> |
@@ -3858,7 +3811,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3858 | if (!remoteClient.IsActive) | 3811 | if (!remoteClient.IsActive) |
3859 | return; | 3812 | return; |
3860 | 3813 | ||
3861 | if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID && p.GodController.GodLevel < 200) | 3814 | if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID && !p.isLegacyGod) |
3862 | return; | 3815 | return; |
3863 | 3816 | ||
3864 | //m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity); | 3817 | //m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity); |
@@ -3968,7 +3921,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3968 | // get the avatar, then a kill if can't see it | 3921 | // get the avatar, then a kill if can't see it |
3969 | p.SendInitialAvatarDataToAgent(this); | 3922 | p.SendInitialAvatarDataToAgent(this); |
3970 | 3923 | ||
3971 | if (p.ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && GodController.GodLevel < 200) | 3924 | if (p.ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !isLegacyGod) |
3972 | return; | 3925 | return; |
3973 | 3926 | ||
3974 | p.SendAppearanceToAgentNF(this); | 3927 | p.SendAppearanceToAgentNF(this); |
@@ -4016,7 +3969,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4016 | foreach (ScenePresence p in presences) | 3969 | foreach (ScenePresence p in presences) |
4017 | { | 3970 | { |
4018 | p.ControllingClient.SendAvatarDataImmediate(this); | 3971 | p.ControllingClient.SendAvatarDataImmediate(this); |
4019 | if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 3972 | if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
4020 | // either just kill the object | 3973 | // either just kill the object |
4021 | // p.ControllingClient.SendKillObject(new List<uint> {LocalId}); | 3974 | // p.ControllingClient.SendKillObject(new List<uint> {LocalId}); |
4022 | // or also attachments viewer may still know about | 3975 | // or also attachments viewer may still know about |
@@ -4029,7 +3982,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4029 | public void SendInitialAvatarDataToAgent(ScenePresence p) | 3982 | public void SendInitialAvatarDataToAgent(ScenePresence p) |
4030 | { | 3983 | { |
4031 | p.ControllingClient.SendAvatarDataImmediate(this); | 3984 | p.ControllingClient.SendAvatarDataImmediate(this); |
4032 | if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 3985 | if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
4033 | // either just kill the object | 3986 | // either just kill the object |
4034 | // p.ControllingClient.SendKillObject(new List<uint> {LocalId}); | 3987 | // p.ControllingClient.SendKillObject(new List<uint> {LocalId}); |
4035 | // or also attachments viewer may still know about | 3988 | // or also attachments viewer may still know about |
@@ -4043,7 +3996,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4043 | public void SendAvatarDataToAgent(ScenePresence avatar) | 3996 | public void SendAvatarDataToAgent(ScenePresence avatar) |
4044 | { | 3997 | { |
4045 | //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID); | 3998 | //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID); |
4046 | if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodController.GodLevel < 200) | 3999 | if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.isLegacyGod) |
4047 | return; | 4000 | return; |
4048 | avatar.ControllingClient.SendAvatarDataImmediate(this); | 4001 | avatar.ControllingClient.SendAvatarDataImmediate(this); |
4049 | } | 4002 | } |
@@ -4088,7 +4041,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4088 | { | 4041 | { |
4089 | // m_log.DebugFormat( | 4042 | // m_log.DebugFormat( |
4090 | // "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); | 4043 | // "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); |
4091 | if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodController.GodLevel < 200) | 4044 | if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.isLegacyGod) |
4092 | return; | 4045 | return; |
4093 | SendAppearanceToAgentNF(avatar); | 4046 | SendAppearanceToAgentNF(avatar); |
4094 | } | 4047 | } |
@@ -4104,7 +4057,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4104 | if (IsChildAgent || Animator == null) | 4057 | if (IsChildAgent || Animator == null) |
4105 | return; | 4058 | return; |
4106 | 4059 | ||
4107 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 4060 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
4108 | return; | 4061 | return; |
4109 | 4062 | ||
4110 | Animator.SendAnimPackToClient(p.ControllingClient); | 4063 | Animator.SendAnimPackToClient(p.ControllingClient); |
@@ -4115,7 +4068,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4115 | if (IsChildAgent) | 4068 | if (IsChildAgent) |
4116 | return; | 4069 | return; |
4117 | 4070 | ||
4118 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 4071 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
4119 | return; | 4072 | return; |
4120 | 4073 | ||
4121 | p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); | 4074 | p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); |
@@ -4140,7 +4093,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4140 | 4093 | ||
4141 | m_scene.ForEachScenePresence(delegate(ScenePresence p) | 4094 | m_scene.ForEachScenePresence(delegate(ScenePresence p) |
4142 | { | 4095 | { |
4143 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 4096 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
4144 | return; | 4097 | return; |
4145 | p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); | 4098 | p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); |
4146 | }); | 4099 | }); |
@@ -4175,7 +4128,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4175 | if(DrawDistance > minregionSize && m_reprioritizationLastDrawDistance > minregionSize) | 4128 | if(DrawDistance > minregionSize && m_reprioritizationLastDrawDistance > minregionSize) |
4176 | byDrawdistance = false; | 4129 | byDrawdistance = false; |
4177 | else | 4130 | else |
4178 | byDrawdistance = (Math.Abs(DrawDistance-m_reprioritizationLastDrawDistance) > 0.5f * limit); | 4131 | byDrawdistance = (Math.Abs(DrawDistance - m_reprioritizationLastDrawDistance) > 0.5f * limit); |
4179 | } | 4132 | } |
4180 | 4133 | ||
4181 | int tdiff = Util.EnvironmentTickCountSubtract(m_reprioritizationLastTime); | 4134 | int tdiff = Util.EnvironmentTickCountSubtract(m_reprioritizationLastTime); |
@@ -4224,7 +4177,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4224 | // updates priority recalc | 4177 | // updates priority recalc |
4225 | checkRePrioritization(); | 4178 | checkRePrioritization(); |
4226 | 4179 | ||
4227 | if(childUpdatesBusy) | 4180 | if(m_childUpdatesBusy) |
4228 | return; | 4181 | return; |
4229 | 4182 | ||
4230 | //possible KnownRegionHandles always contains current region and this check is not needed | 4183 | //possible KnownRegionHandles always contains current region and this check is not needed |
@@ -4234,37 +4187,52 @@ namespace OpenSim.Region.Framework.Scenes | |||
4234 | 4187 | ||
4235 | if(KnownRegionHandles.Count > minhandles) | 4188 | if(KnownRegionHandles.Count > minhandles) |
4236 | { | 4189 | { |
4237 | int tdiff = Util.EnvironmentTickCountSubtract(lastChildUpdatesTime); | 4190 | int tdiff = Util.EnvironmentTickCountSubtract(m_lastChildUpdatesTime); |
4238 | if(tdiff > CHILDUPDATES_TIME) | 4191 | if(tdiff < CHILDUPDATES_TIME) |
4192 | return; | ||
4193 | |||
4194 | bool doUpdate = false; | ||
4195 | if(m_lastChildAgentUpdateGodLevel != GodController.GodLevel) | ||
4196 | doUpdate = true; | ||
4197 | |||
4198 | if(!doUpdate && Math.Abs(DrawDistance - m_lastChildAgentUpdateDrawDistance) > 32.0f) | ||
4199 | doUpdate = true; | ||
4200 | |||
4201 | if(!doUpdate) | ||
4239 | { | 4202 | { |
4240 | diff = pos - m_lastChildAgentUpdatePosition; | 4203 | diff = pos - m_lastChildAgentUpdatePosition; |
4241 | if (diff.LengthSquared() > CHILDUPDATES_MOVEMENT) | 4204 | if (diff.LengthSquared() > CHILDUPDATES_MOVEMENT) |
4242 | { | 4205 | doUpdate = true; |
4243 | childUpdatesBusy = true; | 4206 | } |
4244 | m_lastChildAgentUpdatePosition = pos; | 4207 | |
4208 | if(doUpdate) | ||
4209 | { | ||
4210 | m_childUpdatesBusy = true; | ||
4211 | m_lastChildAgentUpdatePosition = pos; | ||
4212 | m_lastChildAgentUpdateGodLevel = GodController.GodLevel; | ||
4213 | m_lastChildAgentUpdateDrawDistance = DrawDistance; | ||
4245 | // m_lastChildAgentUpdateCamPosition = CameraPosition; | 4214 | // m_lastChildAgentUpdateCamPosition = CameraPosition; |
4246 | 4215 | ||
4247 | AgentPosition agentpos = new AgentPosition(); | 4216 | AgentPosition agentpos = new AgentPosition(); |
4248 | agentpos.AgentID = new UUID(UUID.Guid); | 4217 | agentpos.AgentID = new UUID(UUID.Guid); |
4249 | agentpos.SessionID = ControllingClient.SessionId; | 4218 | agentpos.SessionID = ControllingClient.SessionId; |
4250 | agentpos.Size = Appearance.AvatarSize; | 4219 | agentpos.Size = Appearance.AvatarSize; |
4251 | agentpos.Center = CameraPosition; | 4220 | agentpos.Center = CameraPosition; |
4252 | agentpos.Far = DrawDistance; | 4221 | agentpos.Far = DrawDistance; |
4253 | agentpos.Position = AbsolutePosition; | 4222 | agentpos.Position = AbsolutePosition; |
4254 | agentpos.Velocity = Velocity; | 4223 | agentpos.Velocity = Velocity; |
4255 | agentpos.RegionHandle = RegionHandle; | 4224 | agentpos.RegionHandle = RegionHandle; |
4256 | agentpos.GodData = GodController.State(); | 4225 | agentpos.GodData = GodController.State(); |
4257 | agentpos.Throttles = ControllingClient.GetThrottlesPacked(1); | 4226 | agentpos.Throttles = ControllingClient.GetThrottlesPacked(1); |
4258 | 4227 | ||
4259 | // Let's get this out of the update loop | 4228 | // Let's get this out of the update loop |
4260 | Util.FireAndForget( | 4229 | Util.FireAndForget( |
4261 | o => | 4230 | o => |
4262 | { | 4231 | { |
4263 | m_scene.SendOutChildAgentUpdates(agentpos, this); | 4232 | m_scene.SendOutChildAgentUpdates(agentpos, this); |
4264 | lastChildUpdatesTime = Util.EnvironmentTickCount(); | 4233 | m_lastChildUpdatesTime = Util.EnvironmentTickCount(); |
4265 | childUpdatesBusy = false; | 4234 | m_childUpdatesBusy = false; |
4266 | }, null, "ScenePresence.SendOutChildAgentUpdates"); | 4235 | }, null, "ScenePresence.SendOutChildAgentUpdates"); |
4267 | } | ||
4268 | } | 4236 | } |
4269 | } | 4237 | } |
4270 | } | 4238 | } |
@@ -4505,9 +4473,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
4505 | if (isNPC) | 4473 | if (isNPC) |
4506 | return; | 4474 | return; |
4507 | 4475 | ||
4508 | bool success = GodController.RequestGodMode(godStatus); | 4476 | bool wasgod = isLegacyGod; |
4509 | if (success && godStatus) | 4477 | GodController.RequestGodMode(godStatus); |
4510 | parcelGodCheck(m_currentParcelUUID, GodController.GodLevel >= 200); | 4478 | if (wasgod != isLegacyGod) |
4479 | parcelGodCheck(m_currentParcelUUID); | ||
4511 | } | 4480 | } |
4512 | 4481 | ||
4513 | #region Child Agent Updates | 4482 | #region Child Agent Updates |
@@ -4606,6 +4575,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4606 | cAgent.UpAxis = CameraUpAxis; | 4575 | cAgent.UpAxis = CameraUpAxis; |
4607 | 4576 | ||
4608 | cAgent.Far = DrawDistance; | 4577 | cAgent.Far = DrawDistance; |
4578 | cAgent.GodData = GodController.State(); | ||
4609 | 4579 | ||
4610 | // Throttles | 4580 | // Throttles |
4611 | cAgent.Throttles = ControllingClient.GetThrottlesPacked(1); | 4581 | cAgent.Throttles = ControllingClient.GetThrottlesPacked(1); |
@@ -4686,7 +4656,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4686 | Quaternion camRot = Util.Axes2Rot(CameraAtAxis, CameraLeftAxis, CameraUpAxis); | 4656 | Quaternion camRot = Util.Axes2Rot(CameraAtAxis, CameraLeftAxis, CameraUpAxis); |
4687 | CameraRotation = camRot; | 4657 | CameraRotation = camRot; |
4688 | 4658 | ||
4689 | |||
4690 | ParentUUID = cAgent.ParentPart; | 4659 | ParentUUID = cAgent.ParentPart; |
4691 | PrevSitOffset = cAgent.SitOffset; | 4660 | PrevSitOffset = cAgent.SitOffset; |
4692 | 4661 | ||
@@ -4872,7 +4841,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4872 | ControllingClient.SendAgentAlertMessage("Physics is having a problem with your avatar. You may not be able to move until you relog.", true); | 4841 | ControllingClient.SendAgentAlertMessage("Physics is having a problem with your avatar. You may not be able to move until you relog.", true); |
4873 | } | 4842 | } |
4874 | 4843 | ||
4875 | |||
4876 | /// <summary> | 4844 | /// <summary> |
4877 | /// Event called by the physics plugin to tell the avatar about a collision. | 4845 | /// Event called by the physics plugin to tell the avatar about a collision. |
4878 | /// </summary> | 4846 | /// </summary> |
@@ -4941,7 +4909,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4941 | RaiseCollisionScriptEvents(coldata); | 4909 | RaiseCollisionScriptEvents(coldata); |
4942 | 4910 | ||
4943 | // Gods do not take damage and Invulnerable is set depending on parcel/region flags | 4911 | // Gods do not take damage and Invulnerable is set depending on parcel/region flags |
4944 | if (Invulnerable || GodController.GodLevel > 0) | 4912 | if (Invulnerable || isLegacyGod) |
4945 | return; | 4913 | return; |
4946 | 4914 | ||
4947 | // The following may be better in the ICombatModule | 4915 | // The following may be better in the ICombatModule |
@@ -5226,7 +5194,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5226 | if (p != this && sog.HasPrivateAttachmentPoint) | 5194 | if (p != this && sog.HasPrivateAttachmentPoint) |
5227 | return; | 5195 | return; |
5228 | 5196 | ||
5229 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 5197 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
5230 | return; | 5198 | return; |
5231 | 5199 | ||
5232 | SendTerseUpdateToAgentNF(p); | 5200 | SendTerseUpdateToAgentNF(p); |
@@ -5340,7 +5308,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5340 | if (p == this) | 5308 | if (p == this) |
5341 | continue; | 5309 | continue; |
5342 | 5310 | ||
5343 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 5311 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
5344 | continue; | 5312 | continue; |
5345 | 5313 | ||
5346 | p.ControllingClient.SendEntityUpdate(rootpart, rootflag); | 5314 | p.ControllingClient.SendEntityUpdate(rootpart, rootflag); |
@@ -5392,14 +5360,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
5392 | if (sog.HasPrivateAttachmentPoint) | 5360 | if (sog.HasPrivateAttachmentPoint) |
5393 | return; | 5361 | return; |
5394 | 5362 | ||
5395 | |||
5396 | List<ScenePresence> allPresences = m_scene.GetScenePresences(); | 5363 | List<ScenePresence> allPresences = m_scene.GetScenePresences(); |
5397 | foreach (ScenePresence p in allPresences) | 5364 | foreach (ScenePresence p in allPresences) |
5398 | { | 5365 | { |
5399 | if (p == this) | 5366 | if (p == this) |
5400 | continue; | 5367 | continue; |
5401 | 5368 | ||
5402 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 5369 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
5403 | continue; | 5370 | continue; |
5404 | 5371 | ||
5405 | p.ControllingClient.SendEntityUpdate(rootpart, flag); | 5372 | p.ControllingClient.SendEntityUpdate(rootpart, flag); |
@@ -5449,7 +5416,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5449 | if (p == this) | 5416 | if (p == this) |
5450 | continue; | 5417 | continue; |
5451 | 5418 | ||
5452 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 5419 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
5453 | continue; | 5420 | continue; |
5454 | 5421 | ||
5455 | p.ControllingClient.SendEntityUpdate(part, flag); | 5422 | p.ControllingClient.SendEntityUpdate(part, flag); |
@@ -5490,7 +5457,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5490 | { | 5457 | { |
5491 | if (p == this) | 5458 | if (p == this) |
5492 | continue; | 5459 | continue; |
5493 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 5460 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
5494 | continue; | 5461 | continue; |
5495 | 5462 | ||
5496 | p.ControllingClient.SendEntityUpdate(part, flag); | 5463 | p.ControllingClient.SendEntityUpdate(part, flag); |
@@ -6128,7 +6095,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6128 | // the TP point. This behaviour mimics agni. | 6095 | // the TP point. This behaviour mimics agni. |
6129 | if (land.LandData.LandingType == (byte)LandingType.LandingPoint && | 6096 | if (land.LandData.LandingType == (byte)LandingType.LandingPoint && |
6130 | land.LandData.UserLocation != Vector3.Zero && | 6097 | land.LandData.UserLocation != Vector3.Zero && |
6131 | GodController.GodLevel < 200 && | 6098 | !isLegacyGod && |
6132 | ((land.LandData.OwnerID != m_uuid && | 6099 | ((land.LandData.OwnerID != m_uuid && |
6133 | !m_scene.Permissions.IsGod(m_uuid) && | 6100 | !m_scene.Permissions.IsGod(m_uuid) && |
6134 | !m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) || | 6101 | !m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) || |
@@ -6153,7 +6120,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6153 | string reason; | 6120 | string reason; |
6154 | 6121 | ||
6155 | // dont mess with gods | 6122 | // dont mess with gods |
6156 | if(GodController.GodLevel >= 200 || m_scene.Permissions.IsGod(m_uuid)) | 6123 | if(isLegacyGod || m_scene.Permissions.IsGod(m_uuid)) |
6157 | return true; | 6124 | return true; |
6158 | 6125 | ||
6159 | // respect region owner and managers | 6126 | // respect region owner and managers |
@@ -6439,7 +6406,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6439 | 6406 | ||
6440 | } | 6407 | } |
6441 | 6408 | ||
6442 | private void parcelGodCheck(UUID currentParcelID, bool isGod) | 6409 | private void parcelGodCheck(UUID currentParcelID) |
6443 | { | 6410 | { |
6444 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); | 6411 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); |
6445 | 6412 | ||
@@ -6450,7 +6417,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6450 | 6417 | ||
6451 | if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID) | 6418 | if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID) |
6452 | { | 6419 | { |
6453 | if (isGod) | 6420 | if (isLegacyGod) |
6454 | p.SendViewTo(this); | 6421 | p.SendViewTo(this); |
6455 | else | 6422 | else |
6456 | p.SendKillTo(this); | 6423 | p.SendKillTo(this); |
@@ -6459,7 +6426,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6459 | } | 6426 | } |
6460 | 6427 | ||
6461 | private void ParcelCrossCheck(UUID currentParcelID,UUID previusParcelID, | 6428 | private void ParcelCrossCheck(UUID currentParcelID,UUID previusParcelID, |
6462 | bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check) | 6429 | bool currentParcelHide, bool previusParcelHide, bool oldhide, bool check) |
6463 | { | 6430 | { |
6464 | List<ScenePresence> killsToSendto = new List<ScenePresence>(); | 6431 | List<ScenePresence> killsToSendto = new List<ScenePresence>(); |
6465 | List<ScenePresence> killsToSendme = new List<ScenePresence>(); | 6432 | List<ScenePresence> killsToSendme = new List<ScenePresence>(); |
@@ -6501,7 +6468,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6501 | continue; | 6468 | continue; |
6502 | 6469 | ||
6503 | // those not on parcel dont see me | 6470 | // those not on parcel dont see me |
6504 | if (currentParcelID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 6471 | if (currentParcelID != p.currentParcelUUID && !p.isLegacyGod) |
6505 | { | 6472 | { |
6506 | killsToSendto.Add(p); // they dont see me | 6473 | killsToSendto.Add(p); // they dont see me |
6507 | } | 6474 | } |
@@ -6527,9 +6494,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
6527 | // only those on previus parcel need receive kills | 6494 | // only those on previus parcel need receive kills |
6528 | if (previusParcelID == p.currentParcelUUID) | 6495 | if (previusParcelID == p.currentParcelUUID) |
6529 | { | 6496 | { |
6530 | if(p.GodController.GodLevel < 200) | 6497 | if(!p.isLegacyGod) |
6531 | killsToSendto.Add(p); // they dont see me | 6498 | killsToSendto.Add(p); // they dont see me |
6532 | if(GodController.GodLevel < 200) | 6499 | if(!isLegacyGod) |
6533 | killsToSendme.Add(p); // i dont see them | 6500 | killsToSendme.Add(p); // i dont see them |
6534 | } | 6501 | } |
6535 | // only those on new parcel need see | 6502 | // only those on new parcel need see |
@@ -6551,7 +6518,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6551 | continue; | 6518 | continue; |
6552 | 6519 | ||
6553 | // those not on new parcel dont see me | 6520 | // those not on new parcel dont see me |
6554 | if (currentParcelID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 6521 | if (currentParcelID != p.currentParcelUUID && !p.isLegacyGod) |
6555 | { | 6522 | { |
6556 | killsToSendto.Add(p); // they dont see me | 6523 | killsToSendto.Add(p); // they dont see me |
6557 | } | 6524 | } |
@@ -6577,7 +6544,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6577 | if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) | 6544 | if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) |
6578 | continue; | 6545 | continue; |
6579 | // only those old parcel need kills | 6546 | // only those old parcel need kills |
6580 | if (previusParcelID == p.currentParcelUUID && GodController.GodLevel < 200) | 6547 | if (previusParcelID == p.currentParcelUUID && !isLegacyGod) |
6581 | { | 6548 | { |
6582 | killsToSendme.Add(p); // i dont see them | 6549 | killsToSendme.Add(p); // i dont see them |
6583 | } | 6550 | } |
@@ -6634,13 +6601,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
6634 | 6601 | ||
6635 | public void HasMovedAway(bool nearRegion) | 6602 | public void HasMovedAway(bool nearRegion) |
6636 | { | 6603 | { |
6637 | |||
6638 | if (nearRegion) | 6604 | if (nearRegion) |
6639 | { | 6605 | { |
6640 | if (Scene.AttachmentsModule != null) | 6606 | if (Scene.AttachmentsModule != null) |
6641 | Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); | 6607 | Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); |
6642 | 6608 | ||
6643 | if (!ParcelHideThisAvatar || GodController.GodLevel >= 200) | 6609 | if (!ParcelHideThisAvatar || isLegacyGod) |
6644 | return; | 6610 | return; |
6645 | 6611 | ||
6646 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); | 6612 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); |
@@ -6657,6 +6623,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6657 | } | 6623 | } |
6658 | else | 6624 | else |
6659 | { | 6625 | { |
6626 | GodController.HasMovedAway(); | ||
6660 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); | 6627 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); |
6661 | foreach (ScenePresence p in allpresences) | 6628 | foreach (ScenePresence p in allpresences) |
6662 | { | 6629 | { |