diff options
author | John Hurliman | 2010-02-22 14:10:19 -0800 |
---|---|---|
committer | John Hurliman | 2010-02-22 14:10:19 -0800 |
commit | 71c6559a91a58d93588dcdd8c74b5fce0c1a3780 (patch) | |
tree | cca5b1ea88ad4b29156767afdd77e37ec072c8a7 /OpenSim/Region | |
parent | * Adds CreatorID to asset metadata. This is just the plumbing to support Crea... (diff) | |
parent | Merge branch 'presence-refactor' of ssh://diva@opensimulator.org/var/git/open... (diff) | |
download | opensim-SC_OLD-71c6559a91a58d93588dcdd8c74b5fce0c1a3780.zip opensim-SC_OLD-71c6559a91a58d93588dcdd8c74b5fce0c1a3780.tar.gz opensim-SC_OLD-71c6559a91a58d93588dcdd8c74b5fce0c1a3780.tar.bz2 opensim-SC_OLD-71c6559a91a58d93588dcdd8c74b5fce0c1a3780.tar.xz |
Merge branch 'presence-refactor' of ssh://opensimulator.org/var/git/opensim into presence-refactor
Diffstat (limited to 'OpenSim/Region')
32 files changed, 382 insertions, 5144 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index acd6a14..7e81650 100755 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -194,6 +194,8 @@ namespace OpenSim | |||
194 | 194 | ||
195 | PrintFileToConsole("startuplogo.txt"); | 195 | PrintFileToConsole("startuplogo.txt"); |
196 | 196 | ||
197 | m_log.InfoFormat("[NETWORK]: Using {0} as SYSTEMIP", Util.GetLocalHost().ToString()); | ||
198 | |||
197 | // For now, start at the 'root' level by default | 199 | // For now, start at the 'root' level by default |
198 | if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it | 200 | if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it |
199 | ChangeSelectedRegion("region", | 201 | ChangeSelectedRegion("region", |
@@ -417,7 +419,7 @@ namespace OpenSim | |||
417 | // kick client... | 419 | // kick client... |
418 | if (alert != null) | 420 | if (alert != null) |
419 | presence.ControllingClient.Kick(alert); | 421 | presence.ControllingClient.Kick(alert); |
420 | else | 422 | else |
421 | presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n"); | 423 | presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n"); |
422 | 424 | ||
423 | // ...and close on our side | 425 | // ...and close on our side |
@@ -624,7 +626,6 @@ namespace OpenSim | |||
624 | } | 626 | } |
625 | } | 627 | } |
626 | 628 | ||
627 | |||
628 | /// <summary> | 629 | /// <summary> |
629 | /// Load, Unload, and list Region modules in use | 630 | /// Load, Unload, and list Region modules in use |
630 | /// </summary> | 631 | /// </summary> |
@@ -924,7 +925,6 @@ namespace OpenSim | |||
924 | scene.RegionInfo.RegionLocX, | 925 | scene.RegionInfo.RegionLocX, |
925 | scene.RegionInfo.RegionLocY, | 926 | scene.RegionInfo.RegionLocY, |
926 | scene.RegionInfo.InternalEndPoint.Port)); | 927 | scene.RegionInfo.InternalEndPoint.Port)); |
927 | |||
928 | }); | 928 | }); |
929 | break; | 929 | break; |
930 | 930 | ||
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 1f5946b..afc5270 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -5224,7 +5224,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5224 | args.Type = ChatTypeEnum.Shout; | 5224 | args.Type = ChatTypeEnum.Shout; |
5225 | args.Position = new Vector3(); | 5225 | args.Position = new Vector3(); |
5226 | args.Scene = Scene; | 5226 | args.Scene = Scene; |
5227 | args.Sender = this; | 5227 | args.Sender = this; |
5228 | ChatMessage handlerChatFromClient2 = OnChatFromClient; | 5228 | ChatMessage handlerChatFromClient2 = OnChatFromClient; |
5229 | if (handlerChatFromClient2 != null) | 5229 | if (handlerChatFromClient2 != null) |
5230 | handlerChatFromClient2(this, args); | 5230 | handlerChatFromClient2(this, args); |
@@ -11036,4855 +11036,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11036 | /// <param name="Pack">OpenMetaverse.packet</param> | 11036 | /// <param name="Pack">OpenMetaverse.packet</param> |
11037 | public void ProcessInPacket(Packet Pack) | 11037 | public void ProcessInPacket(Packet Pack) |
11038 | { | 11038 | { |
11039 | 11039 | // m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack); | |
11040 | if (ProcessPacketMethod(Pack)) | ||
11041 | { | ||
11042 | PacketPool.Instance.ReturnPacket(Pack); | ||
11043 | return; | ||
11044 | } | ||
11045 | |||
11046 | // Main packet processing conditional | ||
11047 | switch (Pack.Type) | ||
11048 | { | ||
11049 | #region CommentedOut | ||
11050 | /* | ||
11051 | #region Scene/Avatar | ||
11052 | |||
11053 | |||
11054 | case PacketType.AvatarPropertiesRequest: | ||
11055 | AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack; | ||
11056 | |||
11057 | #region Packet Session and User Check | ||
11058 | if (m_checkPackets) | ||
11059 | { | ||
11060 | if (avatarProperties.AgentData.SessionID != SessionId || | ||
11061 | avatarProperties.AgentData.AgentID != AgentId) | ||
11062 | break; | ||
11063 | } | ||
11064 | #endregion | ||
11065 | |||
11066 | RequestAvatarProperties handlerRequestAvatarProperties = OnRequestAvatarProperties; | ||
11067 | if (handlerRequestAvatarProperties != null) | ||
11068 | { | ||
11069 | handlerRequestAvatarProperties(this, avatarProperties.AgentData.AvatarID); | ||
11070 | } | ||
11071 | |||
11072 | break; | ||
11073 | |||
11074 | case PacketType.ChatFromViewer: | ||
11075 | ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; | ||
11076 | |||
11077 | #region Packet Session and User Check | ||
11078 | if (m_checkPackets) | ||
11079 | { | ||
11080 | if (inchatpack.AgentData.SessionID != SessionId || | ||
11081 | inchatpack.AgentData.AgentID != AgentId) | ||
11082 | break; | ||
11083 | } | ||
11084 | #endregion | ||
11085 | |||
11086 | string fromName = String.Empty; //ClientAvatar.firstname + " " + ClientAvatar.lastname; | ||
11087 | byte[] message = inchatpack.ChatData.Message; | ||
11088 | byte type = inchatpack.ChatData.Type; | ||
11089 | Vector3 fromPos = new Vector3(); // ClientAvatar.Pos; | ||
11090 | // UUID fromAgentID = AgentId; | ||
11091 | |||
11092 | int channel = inchatpack.ChatData.Channel; | ||
11093 | |||
11094 | if (OnChatFromClient != null) | ||
11095 | { | ||
11096 | OSChatMessage args = new OSChatMessage(); | ||
11097 | args.Channel = channel; | ||
11098 | args.From = fromName; | ||
11099 | args.Message = Utils.BytesToString(message); | ||
11100 | args.Type = (ChatTypeEnum)type; | ||
11101 | args.Position = fromPos; | ||
11102 | |||
11103 | args.Scene = Scene; | ||
11104 | args.Sender = this; | ||
11105 | args.SenderUUID = this.AgentId; | ||
11106 | |||
11107 | ChatMessage handlerChatFromClient = OnChatFromClient; | ||
11108 | if (handlerChatFromClient != null) | ||
11109 | handlerChatFromClient(this, args); | ||
11110 | } | ||
11111 | break; | ||
11112 | |||
11113 | case PacketType.AvatarPropertiesUpdate: | ||
11114 | AvatarPropertiesUpdatePacket avatarProps = (AvatarPropertiesUpdatePacket)Pack; | ||
11115 | |||
11116 | #region Packet Session and User Check | ||
11117 | if (m_checkPackets) | ||
11118 | { | ||
11119 | if (avatarProps.AgentData.SessionID != SessionId || | ||
11120 | avatarProps.AgentData.AgentID != AgentId) | ||
11121 | break; | ||
11122 | } | ||
11123 | #endregion | ||
11124 | |||
11125 | UpdateAvatarProperties handlerUpdateAvatarProperties = OnUpdateAvatarProperties; | ||
11126 | if (handlerUpdateAvatarProperties != null) | ||
11127 | { | ||
11128 | AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = avatarProps.PropertiesData; | ||
11129 | UserProfileData UserProfile = new UserProfileData(); | ||
11130 | UserProfile.ID = AgentId; | ||
11131 | UserProfile.AboutText = Utils.BytesToString(Properties.AboutText); | ||
11132 | UserProfile.FirstLifeAboutText = Utils.BytesToString(Properties.FLAboutText); | ||
11133 | UserProfile.FirstLifeImage = Properties.FLImageID; | ||
11134 | UserProfile.Image = Properties.ImageID; | ||
11135 | UserProfile.ProfileUrl = Utils.BytesToString(Properties.ProfileURL); | ||
11136 | |||
11137 | handlerUpdateAvatarProperties(this, UserProfile); | ||
11138 | } | ||
11139 | break; | ||
11140 | |||
11141 | case PacketType.ScriptDialogReply: | ||
11142 | ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack; | ||
11143 | |||
11144 | #region Packet Session and User Check | ||
11145 | if (m_checkPackets) | ||
11146 | { | ||
11147 | if (rdialog.AgentData.SessionID != SessionId || | ||
11148 | rdialog.AgentData.AgentID != AgentId) | ||
11149 | break; | ||
11150 | } | ||
11151 | #endregion | ||
11152 | |||
11153 | int ch = rdialog.Data.ChatChannel; | ||
11154 | byte[] msg = rdialog.Data.ButtonLabel; | ||
11155 | if (OnChatFromClient != null) | ||
11156 | { | ||
11157 | OSChatMessage args = new OSChatMessage(); | ||
11158 | args.Channel = ch; | ||
11159 | args.From = String.Empty; | ||
11160 | args.Message = Utils.BytesToString(msg); | ||
11161 | args.Type = ChatTypeEnum.Shout; | ||
11162 | args.Position = new Vector3(); | ||
11163 | args.Scene = Scene; | ||
11164 | args.Sender = this; | ||
11165 | ChatMessage handlerChatFromClient2 = OnChatFromClient; | ||
11166 | if (handlerChatFromClient2 != null) | ||
11167 | handlerChatFromClient2(this, args); | ||
11168 | } | ||
11169 | |||
11170 | break; | ||
11171 | |||
11172 | case PacketType.ImprovedInstantMessage: | ||
11173 | ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack; | ||
11174 | |||
11175 | #region Packet Session and User Check | ||
11176 | if (m_checkPackets) | ||
11177 | { | ||
11178 | if (msgpack.AgentData.SessionID != SessionId || | ||
11179 | msgpack.AgentData.AgentID != AgentId) | ||
11180 | break; | ||
11181 | } | ||
11182 | #endregion | ||
11183 | |||
11184 | string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName); | ||
11185 | string IMmessage = Utils.BytesToString(msgpack.MessageBlock.Message); | ||
11186 | ImprovedInstantMessage handlerInstantMessage = OnInstantMessage; | ||
11187 | |||
11188 | if (handlerInstantMessage != null) | ||
11189 | { | ||
11190 | GridInstantMessage im = new GridInstantMessage(Scene, | ||
11191 | msgpack.AgentData.AgentID, | ||
11192 | IMfromName, | ||
11193 | msgpack.MessageBlock.ToAgentID, | ||
11194 | msgpack.MessageBlock.Dialog, | ||
11195 | msgpack.MessageBlock.FromGroup, | ||
11196 | IMmessage, | ||
11197 | msgpack.MessageBlock.ID, | ||
11198 | msgpack.MessageBlock.Offline != 0 ? true : false, | ||
11199 | msgpack.MessageBlock.Position, | ||
11200 | msgpack.MessageBlock.BinaryBucket); | ||
11201 | |||
11202 | handlerInstantMessage(this, im); | ||
11203 | } | ||
11204 | break; | ||
11205 | |||
11206 | case PacketType.AcceptFriendship: | ||
11207 | AcceptFriendshipPacket afriendpack = (AcceptFriendshipPacket)Pack; | ||
11208 | |||
11209 | #region Packet Session and User Check | ||
11210 | if (m_checkPackets) | ||
11211 | { | ||
11212 | if (afriendpack.AgentData.SessionID != SessionId || | ||
11213 | afriendpack.AgentData.AgentID != AgentId) | ||
11214 | break; | ||
11215 | } | ||
11216 | #endregion | ||
11217 | |||
11218 | // My guess is this is the folder to stick the calling card into | ||
11219 | List<UUID> callingCardFolders = new List<UUID>(); | ||
11220 | |||
11221 | UUID agentID = afriendpack.AgentData.AgentID; | ||
11222 | UUID transactionID = afriendpack.TransactionBlock.TransactionID; | ||
11223 | |||
11224 | for (int fi = 0; fi < afriendpack.FolderData.Length; fi++) | ||
11225 | { | ||
11226 | callingCardFolders.Add(afriendpack.FolderData[fi].FolderID); | ||
11227 | } | ||
11228 | |||
11229 | FriendActionDelegate handlerApproveFriendRequest = OnApproveFriendRequest; | ||
11230 | if (handlerApproveFriendRequest != null) | ||
11231 | { | ||
11232 | handlerApproveFriendRequest(this, agentID, transactionID, callingCardFolders); | ||
11233 | } | ||
11234 | break; | ||
11235 | |||
11236 | case PacketType.DeclineFriendship: | ||
11237 | DeclineFriendshipPacket dfriendpack = (DeclineFriendshipPacket)Pack; | ||
11238 | |||
11239 | #region Packet Session and User Check | ||
11240 | if (m_checkPackets) | ||
11241 | { | ||
11242 | if (dfriendpack.AgentData.SessionID != SessionId || | ||
11243 | dfriendpack.AgentData.AgentID != AgentId) | ||
11244 | break; | ||
11245 | } | ||
11246 | #endregion | ||
11247 | |||
11248 | if (OnDenyFriendRequest != null) | ||
11249 | { | ||
11250 | OnDenyFriendRequest(this, | ||
11251 | dfriendpack.AgentData.AgentID, | ||
11252 | dfriendpack.TransactionBlock.TransactionID, | ||
11253 | null); | ||
11254 | } | ||
11255 | break; | ||
11256 | |||
11257 | case PacketType.TerminateFriendship: | ||
11258 | TerminateFriendshipPacket tfriendpack = (TerminateFriendshipPacket)Pack; | ||
11259 | |||
11260 | #region Packet Session and User Check | ||
11261 | if (m_checkPackets) | ||
11262 | { | ||
11263 | if (tfriendpack.AgentData.SessionID != SessionId || | ||
11264 | tfriendpack.AgentData.AgentID != AgentId) | ||
11265 | break; | ||
11266 | } | ||
11267 | #endregion | ||
11268 | |||
11269 | UUID listOwnerAgentID = tfriendpack.AgentData.AgentID; | ||
11270 | UUID exFriendID = tfriendpack.ExBlock.OtherID; | ||
11271 | |||
11272 | FriendshipTermination handlerTerminateFriendship = OnTerminateFriendship; | ||
11273 | if (handlerTerminateFriendship != null) | ||
11274 | { | ||
11275 | handlerTerminateFriendship(this, listOwnerAgentID, exFriendID); | ||
11276 | } | ||
11277 | break; | ||
11278 | |||
11279 | case PacketType.RezObject: | ||
11280 | RezObjectPacket rezPacket = (RezObjectPacket)Pack; | ||
11281 | |||
11282 | #region Packet Session and User Check | ||
11283 | if (m_checkPackets) | ||
11284 | { | ||
11285 | if (rezPacket.AgentData.SessionID != SessionId || | ||
11286 | rezPacket.AgentData.AgentID != AgentId) | ||
11287 | break; | ||
11288 | } | ||
11289 | #endregion | ||
11290 | |||
11291 | RezObject handlerRezObject = OnRezObject; | ||
11292 | if (handlerRezObject != null) | ||
11293 | { | ||
11294 | handlerRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd, | ||
11295 | rezPacket.RezData.RayStart, rezPacket.RezData.RayTargetID, | ||
11296 | rezPacket.RezData.BypassRaycast, rezPacket.RezData.RayEndIsIntersection, | ||
11297 | rezPacket.RezData.RezSelected, rezPacket.RezData.RemoveItem, | ||
11298 | rezPacket.RezData.FromTaskID); | ||
11299 | } | ||
11300 | break; | ||
11301 | |||
11302 | case PacketType.DeRezObject: | ||
11303 | DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)Pack; | ||
11304 | |||
11305 | #region Packet Session and User Check | ||
11306 | if (m_checkPackets) | ||
11307 | { | ||
11308 | if (DeRezPacket.AgentData.SessionID != SessionId || | ||
11309 | DeRezPacket.AgentData.AgentID != AgentId) | ||
11310 | break; | ||
11311 | } | ||
11312 | #endregion | ||
11313 | |||
11314 | DeRezObject handlerDeRezObject = OnDeRezObject; | ||
11315 | if (handlerDeRezObject != null) | ||
11316 | { | ||
11317 | List<uint> deRezIDs = new List<uint>(); | ||
11318 | |||
11319 | foreach (DeRezObjectPacket.ObjectDataBlock data in | ||
11320 | DeRezPacket.ObjectData) | ||
11321 | { | ||
11322 | deRezIDs.Add(data.ObjectLocalID); | ||
11323 | } | ||
11324 | // It just so happens that the values on the DeRezAction enumerator match the Destination | ||
11325 | // values given by a Second Life client | ||
11326 | handlerDeRezObject(this, deRezIDs, | ||
11327 | DeRezPacket.AgentBlock.GroupID, | ||
11328 | (DeRezAction)DeRezPacket.AgentBlock.Destination, | ||
11329 | DeRezPacket.AgentBlock.DestinationID); | ||
11330 | |||
11331 | } | ||
11332 | break; | ||
11333 | |||
11334 | case PacketType.ModifyLand: | ||
11335 | ModifyLandPacket modify = (ModifyLandPacket)Pack; | ||
11336 | |||
11337 | #region Packet Session and User Check | ||
11338 | if (m_checkPackets) | ||
11339 | { | ||
11340 | if (modify.AgentData.SessionID != SessionId || | ||
11341 | modify.AgentData.AgentID != AgentId) | ||
11342 | break; | ||
11343 | } | ||
11344 | |||
11345 | #endregion | ||
11346 | //m_log.Info("[LAND]: LAND:" + modify.ToString()); | ||
11347 | if (modify.ParcelData.Length > 0) | ||
11348 | { | ||
11349 | if (OnModifyTerrain != null) | ||
11350 | { | ||
11351 | for (int i = 0; i < modify.ParcelData.Length; i++) | ||
11352 | { | ||
11353 | ModifyTerrain handlerModifyTerrain = OnModifyTerrain; | ||
11354 | if (handlerModifyTerrain != null) | ||
11355 | { | ||
11356 | handlerModifyTerrain(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds, | ||
11357 | modify.ModifyBlock.BrushSize, | ||
11358 | modify.ModifyBlock.Action, modify.ParcelData[i].North, | ||
11359 | modify.ParcelData[i].West, modify.ParcelData[i].South, | ||
11360 | modify.ParcelData[i].East, AgentId); | ||
11361 | } | ||
11362 | } | ||
11363 | } | ||
11364 | } | ||
11365 | |||
11366 | break; | ||
11367 | |||
11368 | case PacketType.RegionHandshakeReply: | ||
11369 | |||
11370 | Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply; | ||
11371 | if (handlerRegionHandShakeReply != null) | ||
11372 | { | ||
11373 | handlerRegionHandShakeReply(this); | ||
11374 | } | ||
11375 | |||
11376 | break; | ||
11377 | |||
11378 | case PacketType.AgentWearablesRequest: | ||
11379 | GenericCall2 handlerRequestWearables = OnRequestWearables; | ||
11380 | |||
11381 | if (handlerRequestWearables != null) | ||
11382 | { | ||
11383 | handlerRequestWearables(); | ||
11384 | } | ||
11385 | |||
11386 | Action<IClientAPI> handlerRequestAvatarsData = OnRequestAvatarsData; | ||
11387 | |||
11388 | if (handlerRequestAvatarsData != null) | ||
11389 | { | ||
11390 | handlerRequestAvatarsData(this); | ||
11391 | } | ||
11392 | |||
11393 | break; | ||
11394 | |||
11395 | case PacketType.AgentSetAppearance: | ||
11396 | AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack; | ||
11397 | |||
11398 | #region Packet Session and User Check | ||
11399 | if (m_checkPackets) | ||
11400 | { | ||
11401 | if (appear.AgentData.SessionID != SessionId || | ||
11402 | appear.AgentData.AgentID != AgentId) | ||
11403 | break; | ||
11404 | } | ||
11405 | #endregion | ||
11406 | |||
11407 | SetAppearance handlerSetAppearance = OnSetAppearance; | ||
11408 | if (handlerSetAppearance != null) | ||
11409 | { | ||
11410 | // Temporarily protect ourselves from the mantis #951 failure. | ||
11411 | // However, we could do this for several other handlers where a failure isn't terminal | ||
11412 | // for the client session anyway, in order to protect ourselves against bad code in plugins | ||
11413 | try | ||
11414 | { | ||
11415 | byte[] visualparams = new byte[appear.VisualParam.Length]; | ||
11416 | for (int i = 0; i < appear.VisualParam.Length; i++) | ||
11417 | visualparams[i] = appear.VisualParam[i].ParamValue; | ||
11418 | |||
11419 | Primitive.TextureEntry te = null; | ||
11420 | if (appear.ObjectData.TextureEntry.Length > 1) | ||
11421 | te = new Primitive.TextureEntry(appear.ObjectData.TextureEntry, 0, appear.ObjectData.TextureEntry.Length); | ||
11422 | |||
11423 | handlerSetAppearance(te, visualparams); | ||
11424 | } | ||
11425 | catch (Exception e) | ||
11426 | { | ||
11427 | m_log.ErrorFormat( | ||
11428 | "[CLIENT VIEW]: AgentSetApperance packet handler threw an exception, {0}", | ||
11429 | e); | ||
11430 | } | ||
11431 | } | ||
11432 | |||
11433 | break; | ||
11434 | |||
11435 | case PacketType.AgentIsNowWearing: | ||
11436 | if (OnAvatarNowWearing != null) | ||
11437 | { | ||
11438 | AgentIsNowWearingPacket nowWearing = (AgentIsNowWearingPacket)Pack; | ||
11439 | |||
11440 | #region Packet Session and User Check | ||
11441 | if (m_checkPackets) | ||
11442 | { | ||
11443 | if (nowWearing.AgentData.SessionID != SessionId || | ||
11444 | nowWearing.AgentData.AgentID != AgentId) | ||
11445 | break; | ||
11446 | } | ||
11447 | #endregion | ||
11448 | |||
11449 | AvatarWearingArgs wearingArgs = new AvatarWearingArgs(); | ||
11450 | for (int i = 0; i < nowWearing.WearableData.Length; i++) | ||
11451 | { | ||
11452 | AvatarWearingArgs.Wearable wearable = | ||
11453 | new AvatarWearingArgs.Wearable(nowWearing.WearableData[i].ItemID, | ||
11454 | nowWearing.WearableData[i].WearableType); | ||
11455 | wearingArgs.NowWearing.Add(wearable); | ||
11456 | } | ||
11457 | |||
11458 | AvatarNowWearing handlerAvatarNowWearing = OnAvatarNowWearing; | ||
11459 | if (handlerAvatarNowWearing != null) | ||
11460 | { | ||
11461 | handlerAvatarNowWearing(this, wearingArgs); | ||
11462 | } | ||
11463 | } | ||
11464 | break; | ||
11465 | |||
11466 | case PacketType.RezSingleAttachmentFromInv: | ||
11467 | RezSingleAttachmentFromInv handlerRezSingleAttachment = OnRezSingleAttachmentFromInv; | ||
11468 | if (handlerRezSingleAttachment != null) | ||
11469 | { | ||
11470 | RezSingleAttachmentFromInvPacket rez = (RezSingleAttachmentFromInvPacket)Pack; | ||
11471 | |||
11472 | #region Packet Session and User Check | ||
11473 | if (m_checkPackets) | ||
11474 | { | ||
11475 | if (rez.AgentData.SessionID != SessionId || | ||
11476 | rez.AgentData.AgentID != AgentId) | ||
11477 | break; | ||
11478 | } | ||
11479 | #endregion | ||
11480 | |||
11481 | handlerRezSingleAttachment(this, rez.ObjectData.ItemID, | ||
11482 | rez.ObjectData.AttachmentPt); | ||
11483 | } | ||
11484 | |||
11485 | break; | ||
11486 | |||
11487 | case PacketType.RezMultipleAttachmentsFromInv: | ||
11488 | RezMultipleAttachmentsFromInv handlerRezMultipleAttachments = OnRezMultipleAttachmentsFromInv; | ||
11489 | if (handlerRezMultipleAttachments != null) | ||
11490 | { | ||
11491 | RezMultipleAttachmentsFromInvPacket rez = (RezMultipleAttachmentsFromInvPacket)Pack; | ||
11492 | handlerRezMultipleAttachments(this, rez.HeaderData, | ||
11493 | rez.ObjectData); | ||
11494 | } | ||
11495 | |||
11496 | break; | ||
11497 | |||
11498 | case PacketType.DetachAttachmentIntoInv: | ||
11499 | UUIDNameRequest handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv; | ||
11500 | if (handlerDetachAttachmentIntoInv != null) | ||
11501 | { | ||
11502 | DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack; | ||
11503 | |||
11504 | #region Packet Session and User Check | ||
11505 | // UNSUPPORTED ON THIS PACKET | ||
11506 | #endregion | ||
11507 | |||
11508 | UUID itemID = detachtoInv.ObjectData.ItemID; | ||
11509 | // UUID ATTACH_agentID = detachtoInv.ObjectData.AgentID; | ||
11510 | |||
11511 | handlerDetachAttachmentIntoInv(itemID, this); | ||
11512 | } | ||
11513 | break; | ||
11514 | |||
11515 | case PacketType.ObjectAttach: | ||
11516 | if (OnObjectAttach != null) | ||
11517 | { | ||
11518 | ObjectAttachPacket att = (ObjectAttachPacket)Pack; | ||
11519 | |||
11520 | #region Packet Session and User Check | ||
11521 | if (m_checkPackets) | ||
11522 | { | ||
11523 | if (att.AgentData.SessionID != SessionId || | ||
11524 | att.AgentData.AgentID != AgentId) | ||
11525 | break; | ||
11526 | } | ||
11527 | #endregion | ||
11528 | |||
11529 | ObjectAttach handlerObjectAttach = OnObjectAttach; | ||
11530 | |||
11531 | if (handlerObjectAttach != null) | ||
11532 | { | ||
11533 | if (att.ObjectData.Length > 0) | ||
11534 | { | ||
11535 | handlerObjectAttach(this, att.ObjectData[0].ObjectLocalID, att.AgentData.AttachmentPoint, att.ObjectData[0].Rotation, false); | ||
11536 | } | ||
11537 | } | ||
11538 | } | ||
11539 | break; | ||
11540 | |||
11541 | case PacketType.ObjectDetach: | ||
11542 | ObjectDetachPacket dett = (ObjectDetachPacket)Pack; | ||
11543 | |||
11544 | #region Packet Session and User Check | ||
11545 | if (m_checkPackets) | ||
11546 | { | ||
11547 | if (dett.AgentData.SessionID != SessionId || | ||
11548 | dett.AgentData.AgentID != AgentId) | ||
11549 | break; | ||
11550 | } | ||
11551 | #endregion | ||
11552 | |||
11553 | for (int j = 0; j < dett.ObjectData.Length; j++) | ||
11554 | { | ||
11555 | uint obj = dett.ObjectData[j].ObjectLocalID; | ||
11556 | ObjectDeselect handlerObjectDetach = OnObjectDetach; | ||
11557 | if (handlerObjectDetach != null) | ||
11558 | { | ||
11559 | handlerObjectDetach(obj, this); | ||
11560 | } | ||
11561 | |||
11562 | } | ||
11563 | break; | ||
11564 | |||
11565 | case PacketType.ObjectDrop: | ||
11566 | ObjectDropPacket dropp = (ObjectDropPacket)Pack; | ||
11567 | |||
11568 | #region Packet Session and User Check | ||
11569 | if (m_checkPackets) | ||
11570 | { | ||
11571 | if (dropp.AgentData.SessionID != SessionId || | ||
11572 | dropp.AgentData.AgentID != AgentId) | ||
11573 | break; | ||
11574 | } | ||
11575 | #endregion | ||
11576 | |||
11577 | for (int j = 0; j < dropp.ObjectData.Length; j++) | ||
11578 | { | ||
11579 | uint obj = dropp.ObjectData[j].ObjectLocalID; | ||
11580 | ObjectDrop handlerObjectDrop = OnObjectDrop; | ||
11581 | if (handlerObjectDrop != null) | ||
11582 | { | ||
11583 | handlerObjectDrop(obj, this); | ||
11584 | } | ||
11585 | } | ||
11586 | break; | ||
11587 | |||
11588 | case PacketType.SetAlwaysRun: | ||
11589 | SetAlwaysRunPacket run = (SetAlwaysRunPacket)Pack; | ||
11590 | |||
11591 | #region Packet Session and User Check | ||
11592 | if (m_checkPackets) | ||
11593 | { | ||
11594 | if (run.AgentData.SessionID != SessionId || | ||
11595 | run.AgentData.AgentID != AgentId) | ||
11596 | break; | ||
11597 | } | ||
11598 | #endregion | ||
11599 | |||
11600 | SetAlwaysRun handlerSetAlwaysRun = OnSetAlwaysRun; | ||
11601 | if (handlerSetAlwaysRun != null) | ||
11602 | handlerSetAlwaysRun(this, run.AgentData.AlwaysRun); | ||
11603 | |||
11604 | break; | ||
11605 | |||
11606 | case PacketType.CompleteAgentMovement: | ||
11607 | GenericCall2 handlerCompleteMovementToRegion = OnCompleteMovementToRegion; | ||
11608 | if (handlerCompleteMovementToRegion != null) | ||
11609 | { | ||
11610 | handlerCompleteMovementToRegion(); | ||
11611 | } | ||
11612 | handlerCompleteMovementToRegion = null; | ||
11613 | |||
11614 | break; | ||
11615 | |||
11616 | case PacketType.AgentAnimation: | ||
11617 | AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack; | ||
11618 | |||
11619 | #region Packet Session and User Check | ||
11620 | if (m_checkPackets) | ||
11621 | { | ||
11622 | if (AgentAni.AgentData.SessionID != SessionId || | ||
11623 | AgentAni.AgentData.AgentID != AgentId) | ||
11624 | break; | ||
11625 | } | ||
11626 | #endregion | ||
11627 | |||
11628 | StartAnim handlerStartAnim = null; | ||
11629 | StopAnim handlerStopAnim = null; | ||
11630 | |||
11631 | for (int i = 0; i < AgentAni.AnimationList.Length; i++) | ||
11632 | { | ||
11633 | if (AgentAni.AnimationList[i].StartAnim) | ||
11634 | { | ||
11635 | handlerStartAnim = OnStartAnim; | ||
11636 | if (handlerStartAnim != null) | ||
11637 | { | ||
11638 | handlerStartAnim(this, AgentAni.AnimationList[i].AnimID); | ||
11639 | } | ||
11640 | } | ||
11641 | else | ||
11642 | { | ||
11643 | handlerStopAnim = OnStopAnim; | ||
11644 | if (handlerStopAnim != null) | ||
11645 | { | ||
11646 | handlerStopAnim(this, AgentAni.AnimationList[i].AnimID); | ||
11647 | } | ||
11648 | } | ||
11649 | } | ||
11650 | break; | ||
11651 | |||
11652 | case PacketType.AgentRequestSit: | ||
11653 | if (OnAgentRequestSit != null) | ||
11654 | { | ||
11655 | AgentRequestSitPacket agentRequestSit = (AgentRequestSitPacket)Pack; | ||
11656 | |||
11657 | #region Packet Session and User Check | ||
11658 | if (m_checkPackets) | ||
11659 | { | ||
11660 | if (agentRequestSit.AgentData.SessionID != SessionId || | ||
11661 | agentRequestSit.AgentData.AgentID != AgentId) | ||
11662 | break; | ||
11663 | } | ||
11664 | #endregion | ||
11665 | |||
11666 | AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit; | ||
11667 | if (handlerAgentRequestSit != null) | ||
11668 | handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID, | ||
11669 | agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset); | ||
11670 | } | ||
11671 | break; | ||
11672 | |||
11673 | case PacketType.AgentSit: | ||
11674 | if (OnAgentSit != null) | ||
11675 | { | ||
11676 | AgentSitPacket agentSit = (AgentSitPacket)Pack; | ||
11677 | |||
11678 | #region Packet Session and User Check | ||
11679 | if (m_checkPackets) | ||
11680 | { | ||
11681 | if (agentSit.AgentData.SessionID != SessionId || | ||
11682 | agentSit.AgentData.AgentID != AgentId) | ||
11683 | break; | ||
11684 | } | ||
11685 | #endregion | ||
11686 | |||
11687 | AgentSit handlerAgentSit = OnAgentSit; | ||
11688 | if (handlerAgentSit != null) | ||
11689 | { | ||
11690 | OnAgentSit(this, agentSit.AgentData.AgentID); | ||
11691 | } | ||
11692 | } | ||
11693 | break; | ||
11694 | |||
11695 | case PacketType.SoundTrigger: | ||
11696 | SoundTriggerPacket soundTriggerPacket = (SoundTriggerPacket)Pack; | ||
11697 | |||
11698 | #region Packet Session and User Check | ||
11699 | if (m_checkPackets) | ||
11700 | { | ||
11701 | // UNSUPPORTED ON THIS PACKET | ||
11702 | } | ||
11703 | #endregion | ||
11704 | |||
11705 | SoundTrigger handlerSoundTrigger = OnSoundTrigger; | ||
11706 | if (handlerSoundTrigger != null) | ||
11707 | { | ||
11708 | handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, soundTriggerPacket.SoundData.OwnerID, | ||
11709 | soundTriggerPacket.SoundData.ObjectID, soundTriggerPacket.SoundData.ParentID, | ||
11710 | soundTriggerPacket.SoundData.Gain, soundTriggerPacket.SoundData.Position, | ||
11711 | soundTriggerPacket.SoundData.Handle); | ||
11712 | |||
11713 | } | ||
11714 | break; | ||
11715 | |||
11716 | case PacketType.AvatarPickerRequest: | ||
11717 | AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack; | ||
11718 | |||
11719 | #region Packet Session and User Check | ||
11720 | if (m_checkPackets) | ||
11721 | { | ||
11722 | if (avRequestQuery.AgentData.SessionID != SessionId || | ||
11723 | avRequestQuery.AgentData.AgentID != AgentId) | ||
11724 | break; | ||
11725 | } | ||
11726 | #endregion | ||
11727 | |||
11728 | AvatarPickerRequestPacket.AgentDataBlock Requestdata = avRequestQuery.AgentData; | ||
11729 | AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data; | ||
11730 | //m_log.Debug("Agent Sends:" + Utils.BytesToString(querydata.Name)); | ||
11731 | |||
11732 | AvatarPickerRequest handlerAvatarPickerRequest = OnAvatarPickerRequest; | ||
11733 | if (handlerAvatarPickerRequest != null) | ||
11734 | { | ||
11735 | handlerAvatarPickerRequest(this, Requestdata.AgentID, Requestdata.QueryID, | ||
11736 | Utils.BytesToString(querydata.Name)); | ||
11737 | } | ||
11738 | break; | ||
11739 | |||
11740 | case PacketType.AgentDataUpdateRequest: | ||
11741 | AgentDataUpdateRequestPacket avRequestDataUpdatePacket = (AgentDataUpdateRequestPacket)Pack; | ||
11742 | |||
11743 | #region Packet Session and User Check | ||
11744 | if (m_checkPackets) | ||
11745 | { | ||
11746 | if (avRequestDataUpdatePacket.AgentData.SessionID != SessionId || | ||
11747 | avRequestDataUpdatePacket.AgentData.AgentID != AgentId) | ||
11748 | break; | ||
11749 | } | ||
11750 | #endregion | ||
11751 | |||
11752 | FetchInventory handlerAgentDataUpdateRequest = OnAgentDataUpdateRequest; | ||
11753 | |||
11754 | if (handlerAgentDataUpdateRequest != null) | ||
11755 | { | ||
11756 | handlerAgentDataUpdateRequest(this, avRequestDataUpdatePacket.AgentData.AgentID, avRequestDataUpdatePacket.AgentData.SessionID); | ||
11757 | } | ||
11758 | |||
11759 | break; | ||
11760 | |||
11761 | case PacketType.UserInfoRequest: | ||
11762 | UserInfoRequest handlerUserInfoRequest = OnUserInfoRequest; | ||
11763 | if (handlerUserInfoRequest != null) | ||
11764 | { | ||
11765 | handlerUserInfoRequest(this); | ||
11766 | } | ||
11767 | else | ||
11768 | { | ||
11769 | SendUserInfoReply(false, true, ""); | ||
11770 | } | ||
11771 | break; | ||
11772 | |||
11773 | case PacketType.UpdateUserInfo: | ||
11774 | UpdateUserInfoPacket updateUserInfo = (UpdateUserInfoPacket)Pack; | ||
11775 | |||
11776 | #region Packet Session and User Check | ||
11777 | if (m_checkPackets) | ||
11778 | { | ||
11779 | if (updateUserInfo.AgentData.SessionID != SessionId || | ||
11780 | updateUserInfo.AgentData.AgentID != AgentId) | ||
11781 | break; | ||
11782 | } | ||
11783 | #endregion | ||
11784 | |||
11785 | UpdateUserInfo handlerUpdateUserInfo = OnUpdateUserInfo; | ||
11786 | if (handlerUpdateUserInfo != null) | ||
11787 | { | ||
11788 | bool visible = true; | ||
11789 | string DirectoryVisibility = | ||
11790 | Utils.BytesToString(updateUserInfo.UserData.DirectoryVisibility); | ||
11791 | if (DirectoryVisibility == "hidden") | ||
11792 | visible = false; | ||
11793 | |||
11794 | handlerUpdateUserInfo( | ||
11795 | updateUserInfo.UserData.IMViaEMail, | ||
11796 | visible, this); | ||
11797 | } | ||
11798 | break; | ||
11799 | |||
11800 | case PacketType.SetStartLocationRequest: | ||
11801 | SetStartLocationRequestPacket avSetStartLocationRequestPacket = (SetStartLocationRequestPacket)Pack; | ||
11802 | |||
11803 | #region Packet Session and User Check | ||
11804 | if (m_checkPackets) | ||
11805 | { | ||
11806 | if (avSetStartLocationRequestPacket.AgentData.SessionID != SessionId || | ||
11807 | avSetStartLocationRequestPacket.AgentData.AgentID != AgentId) | ||
11808 | break; | ||
11809 | } | ||
11810 | #endregion | ||
11811 | |||
11812 | if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId) | ||
11813 | { | ||
11814 | TeleportLocationRequest handlerSetStartLocationRequest = OnSetStartLocationRequest; | ||
11815 | if (handlerSetStartLocationRequest != null) | ||
11816 | { | ||
11817 | handlerSetStartLocationRequest(this, 0, avSetStartLocationRequestPacket.StartLocationData.LocationPos, | ||
11818 | avSetStartLocationRequestPacket.StartLocationData.LocationLookAt, | ||
11819 | avSetStartLocationRequestPacket.StartLocationData.LocationID); | ||
11820 | } | ||
11821 | } | ||
11822 | break; | ||
11823 | |||
11824 | case PacketType.AgentThrottle: | ||
11825 | AgentThrottlePacket atpack = (AgentThrottlePacket)Pack; | ||
11826 | |||
11827 | #region Packet Session and User Check | ||
11828 | if (m_checkPackets) | ||
11829 | { | ||
11830 | if (atpack.AgentData.SessionID != SessionId || | ||
11831 | atpack.AgentData.AgentID != AgentId) | ||
11832 | break; | ||
11833 | } | ||
11834 | #endregion | ||
11835 | |||
11836 | m_udpClient.SetThrottles(atpack.Throttle.Throttles); | ||
11837 | break; | ||
11838 | |||
11839 | case PacketType.AgentPause: | ||
11840 | m_udpClient.IsPaused = true; | ||
11841 | break; | ||
11842 | |||
11843 | case PacketType.AgentResume: | ||
11844 | m_udpClient.IsPaused = false; | ||
11845 | SendStartPingCheck(m_udpClient.CurrentPingSequence++); | ||
11846 | |||
11847 | break; | ||
11848 | |||
11849 | case PacketType.ForceScriptControlRelease: | ||
11850 | ForceReleaseControls handlerForceReleaseControls = OnForceReleaseControls; | ||
11851 | if (handlerForceReleaseControls != null) | ||
11852 | { | ||
11853 | handlerForceReleaseControls(this, AgentId); | ||
11854 | } | ||
11855 | break; | ||
11856 | |||
11857 | #endregion | ||
11858 | |||
11859 | |||
11860 | //#region Objects/m_sceneObjects | ||
11861 | |||
11862 | case PacketType.ObjectLink: | ||
11863 | ObjectLinkPacket link = (ObjectLinkPacket)Pack; | ||
11864 | |||
11865 | #region Packet Session and User Check | ||
11866 | if (m_checkPackets) | ||
11867 | { | ||
11868 | if (link.AgentData.SessionID != SessionId || | ||
11869 | link.AgentData.AgentID != AgentId) | ||
11870 | break; | ||
11871 | } | ||
11872 | #endregion | ||
11873 | |||
11874 | uint parentprimid = 0; | ||
11875 | List<uint> childrenprims = new List<uint>(); | ||
11876 | if (link.ObjectData.Length > 1) | ||
11877 | { | ||
11878 | parentprimid = link.ObjectData[0].ObjectLocalID; | ||
11879 | |||
11880 | for (int i = 1; i < link.ObjectData.Length; i++) | ||
11881 | { | ||
11882 | childrenprims.Add(link.ObjectData[i].ObjectLocalID); | ||
11883 | } | ||
11884 | } | ||
11885 | LinkObjects handlerLinkObjects = OnLinkObjects; | ||
11886 | if (handlerLinkObjects != null) | ||
11887 | { | ||
11888 | handlerLinkObjects(this, parentprimid, childrenprims); | ||
11889 | } | ||
11890 | break; | ||
11891 | |||
11892 | case PacketType.ObjectDelink: | ||
11893 | ObjectDelinkPacket delink = (ObjectDelinkPacket)Pack; | ||
11894 | |||
11895 | #region Packet Session and User Check | ||
11896 | if (m_checkPackets) | ||
11897 | { | ||
11898 | if (delink.AgentData.SessionID != SessionId || | ||
11899 | delink.AgentData.AgentID != AgentId) | ||
11900 | break; | ||
11901 | } | ||
11902 | #endregion | ||
11903 | |||
11904 | // It appears the prim at index 0 is not always the root prim (for | ||
11905 | // instance, when one prim of a link set has been edited independently | ||
11906 | // of the others). Therefore, we'll pass all the ids onto the delink | ||
11907 | // method for it to decide which is the root. | ||
11908 | List<uint> prims = new List<uint>(); | ||
11909 | for (int i = 0; i < delink.ObjectData.Length; i++) | ||
11910 | { | ||
11911 | prims.Add(delink.ObjectData[i].ObjectLocalID); | ||
11912 | } | ||
11913 | DelinkObjects handlerDelinkObjects = OnDelinkObjects; | ||
11914 | if (handlerDelinkObjects != null) | ||
11915 | { | ||
11916 | handlerDelinkObjects(prims); | ||
11917 | } | ||
11918 | |||
11919 | break; | ||
11920 | |||
11921 | case PacketType.ObjectAdd: | ||
11922 | if (OnAddPrim != null) | ||
11923 | { | ||
11924 | ObjectAddPacket addPacket = (ObjectAddPacket)Pack; | ||
11925 | |||
11926 | #region Packet Session and User Check | ||
11927 | if (m_checkPackets) | ||
11928 | { | ||
11929 | if (addPacket.AgentData.SessionID != SessionId || | ||
11930 | addPacket.AgentData.AgentID != AgentId) | ||
11931 | break; | ||
11932 | } | ||
11933 | #endregion | ||
11934 | |||
11935 | PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); | ||
11936 | // m_log.Info("[REZData]: " + addPacket.ToString()); | ||
11937 | //BypassRaycast: 1 | ||
11938 | //RayStart: <69.79469, 158.2652, 98.40343> | ||
11939 | //RayEnd: <61.97724, 141.995, 92.58341> | ||
11940 | //RayTargetID: 00000000-0000-0000-0000-000000000000 | ||
11941 | |||
11942 | //Check to see if adding the prim is allowed; useful for any module wanting to restrict the | ||
11943 | //object from rezing initially | ||
11944 | |||
11945 | AddNewPrim handlerAddPrim = OnAddPrim; | ||
11946 | if (handlerAddPrim != null) | ||
11947 | handlerAddPrim(AgentId, ActiveGroupId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection); | ||
11948 | } | ||
11949 | break; | ||
11950 | |||
11951 | case PacketType.ObjectShape: | ||
11952 | ObjectShapePacket shapePacket = (ObjectShapePacket)Pack; | ||
11953 | |||
11954 | #region Packet Session and User Check | ||
11955 | if (m_checkPackets) | ||
11956 | { | ||
11957 | if (shapePacket.AgentData.SessionID != SessionId || | ||
11958 | shapePacket.AgentData.AgentID != AgentId) | ||
11959 | break; | ||
11960 | } | ||
11961 | #endregion | ||
11962 | |||
11963 | UpdateShape handlerUpdatePrimShape = null; | ||
11964 | for (int i = 0; i < shapePacket.ObjectData.Length; i++) | ||
11965 | { | ||
11966 | handlerUpdatePrimShape = OnUpdatePrimShape; | ||
11967 | if (handlerUpdatePrimShape != null) | ||
11968 | { | ||
11969 | UpdateShapeArgs shapeData = new UpdateShapeArgs(); | ||
11970 | shapeData.ObjectLocalID = shapePacket.ObjectData[i].ObjectLocalID; | ||
11971 | shapeData.PathBegin = shapePacket.ObjectData[i].PathBegin; | ||
11972 | shapeData.PathCurve = shapePacket.ObjectData[i].PathCurve; | ||
11973 | shapeData.PathEnd = shapePacket.ObjectData[i].PathEnd; | ||
11974 | shapeData.PathRadiusOffset = shapePacket.ObjectData[i].PathRadiusOffset; | ||
11975 | shapeData.PathRevolutions = shapePacket.ObjectData[i].PathRevolutions; | ||
11976 | shapeData.PathScaleX = shapePacket.ObjectData[i].PathScaleX; | ||
11977 | shapeData.PathScaleY = shapePacket.ObjectData[i].PathScaleY; | ||
11978 | shapeData.PathShearX = shapePacket.ObjectData[i].PathShearX; | ||
11979 | shapeData.PathShearY = shapePacket.ObjectData[i].PathShearY; | ||
11980 | shapeData.PathSkew = shapePacket.ObjectData[i].PathSkew; | ||
11981 | shapeData.PathTaperX = shapePacket.ObjectData[i].PathTaperX; | ||
11982 | shapeData.PathTaperY = shapePacket.ObjectData[i].PathTaperY; | ||
11983 | shapeData.PathTwist = shapePacket.ObjectData[i].PathTwist; | ||
11984 | shapeData.PathTwistBegin = shapePacket.ObjectData[i].PathTwistBegin; | ||
11985 | shapeData.ProfileBegin = shapePacket.ObjectData[i].ProfileBegin; | ||
11986 | shapeData.ProfileCurve = shapePacket.ObjectData[i].ProfileCurve; | ||
11987 | shapeData.ProfileEnd = shapePacket.ObjectData[i].ProfileEnd; | ||
11988 | shapeData.ProfileHollow = shapePacket.ObjectData[i].ProfileHollow; | ||
11989 | |||
11990 | handlerUpdatePrimShape(m_agentId, shapePacket.ObjectData[i].ObjectLocalID, | ||
11991 | shapeData); | ||
11992 | } | ||
11993 | } | ||
11994 | break; | ||
11995 | |||
11996 | case PacketType.ObjectExtraParams: | ||
11997 | ObjectExtraParamsPacket extraPar = (ObjectExtraParamsPacket)Pack; | ||
11998 | |||
11999 | #region Packet Session and User Check | ||
12000 | if (m_checkPackets) | ||
12001 | { | ||
12002 | if (extraPar.AgentData.SessionID != SessionId || | ||
12003 | extraPar.AgentData.AgentID != AgentId) | ||
12004 | break; | ||
12005 | } | ||
12006 | #endregion | ||
12007 | |||
12008 | ObjectExtraParams handlerUpdateExtraParams = OnUpdateExtraParams; | ||
12009 | if (handlerUpdateExtraParams != null) | ||
12010 | { | ||
12011 | for (int i = 0; i < extraPar.ObjectData.Length; i++) | ||
12012 | { | ||
12013 | handlerUpdateExtraParams(m_agentId, extraPar.ObjectData[i].ObjectLocalID, | ||
12014 | extraPar.ObjectData[i].ParamType, | ||
12015 | extraPar.ObjectData[i].ParamInUse, extraPar.ObjectData[i].ParamData); | ||
12016 | } | ||
12017 | } | ||
12018 | break; | ||
12019 | |||
12020 | case PacketType.ObjectDuplicate: | ||
12021 | ObjectDuplicatePacket dupe = (ObjectDuplicatePacket)Pack; | ||
12022 | |||
12023 | #region Packet Session and User Check | ||
12024 | if (m_checkPackets) | ||
12025 | { | ||
12026 | if (dupe.AgentData.SessionID != SessionId || | ||
12027 | dupe.AgentData.AgentID != AgentId) | ||
12028 | break; | ||
12029 | } | ||
12030 | #endregion | ||
12031 | |||
12032 | ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData; | ||
12033 | |||
12034 | ObjectDuplicate handlerObjectDuplicate = null; | ||
12035 | |||
12036 | for (int i = 0; i < dupe.ObjectData.Length; i++) | ||
12037 | { | ||
12038 | handlerObjectDuplicate = OnObjectDuplicate; | ||
12039 | if (handlerObjectDuplicate != null) | ||
12040 | { | ||
12041 | handlerObjectDuplicate(dupe.ObjectData[i].ObjectLocalID, dupe.SharedData.Offset, | ||
12042 | dupe.SharedData.DuplicateFlags, AgentandGroupData.AgentID, | ||
12043 | AgentandGroupData.GroupID); | ||
12044 | } | ||
12045 | } | ||
12046 | |||
12047 | break; | ||
12048 | |||
12049 | case PacketType.RequestMultipleObjects: | ||
12050 | RequestMultipleObjectsPacket incomingRequest = (RequestMultipleObjectsPacket)Pack; | ||
12051 | |||
12052 | #region Packet Session and User Check | ||
12053 | if (m_checkPackets) | ||
12054 | { | ||
12055 | if (incomingRequest.AgentData.SessionID != SessionId || | ||
12056 | incomingRequest.AgentData.AgentID != AgentId) | ||
12057 | break; | ||
12058 | } | ||
12059 | #endregion | ||
12060 | |||
12061 | ObjectRequest handlerObjectRequest = null; | ||
12062 | |||
12063 | for (int i = 0; i < incomingRequest.ObjectData.Length; i++) | ||
12064 | { | ||
12065 | handlerObjectRequest = OnObjectRequest; | ||
12066 | if (handlerObjectRequest != null) | ||
12067 | { | ||
12068 | handlerObjectRequest(incomingRequest.ObjectData[i].ID, this); | ||
12069 | } | ||
12070 | } | ||
12071 | break; | ||
12072 | |||
12073 | case PacketType.ObjectSelect: | ||
12074 | ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack; | ||
12075 | |||
12076 | #region Packet Session and User Check | ||
12077 | if (m_checkPackets) | ||
12078 | { | ||
12079 | if (incomingselect.AgentData.SessionID != SessionId || | ||
12080 | incomingselect.AgentData.AgentID != AgentId) | ||
12081 | break; | ||
12082 | } | ||
12083 | #endregion | ||
12084 | |||
12085 | ObjectSelect handlerObjectSelect = null; | ||
12086 | |||
12087 | for (int i = 0; i < incomingselect.ObjectData.Length; i++) | ||
12088 | { | ||
12089 | handlerObjectSelect = OnObjectSelect; | ||
12090 | if (handlerObjectSelect != null) | ||
12091 | { | ||
12092 | handlerObjectSelect(incomingselect.ObjectData[i].ObjectLocalID, this); | ||
12093 | } | ||
12094 | } | ||
12095 | break; | ||
12096 | |||
12097 | case PacketType.ObjectDeselect: | ||
12098 | ObjectDeselectPacket incomingdeselect = (ObjectDeselectPacket)Pack; | ||
12099 | |||
12100 | #region Packet Session and User Check | ||
12101 | if (m_checkPackets) | ||
12102 | { | ||
12103 | if (incomingdeselect.AgentData.SessionID != SessionId || | ||
12104 | incomingdeselect.AgentData.AgentID != AgentId) | ||
12105 | break; | ||
12106 | } | ||
12107 | #endregion | ||
12108 | |||
12109 | ObjectDeselect handlerObjectDeselect = null; | ||
12110 | |||
12111 | for (int i = 0; i < incomingdeselect.ObjectData.Length; i++) | ||
12112 | { | ||
12113 | handlerObjectDeselect = OnObjectDeselect; | ||
12114 | if (handlerObjectDeselect != null) | ||
12115 | { | ||
12116 | OnObjectDeselect(incomingdeselect.ObjectData[i].ObjectLocalID, this); | ||
12117 | } | ||
12118 | } | ||
12119 | break; | ||
12120 | |||
12121 | case PacketType.ObjectPosition: | ||
12122 | // DEPRECATED: but till libsecondlife removes it, people will use it | ||
12123 | ObjectPositionPacket position = (ObjectPositionPacket)Pack; | ||
12124 | |||
12125 | #region Packet Session and User Check | ||
12126 | if (m_checkPackets) | ||
12127 | { | ||
12128 | if (position.AgentData.SessionID != SessionId || | ||
12129 | position.AgentData.AgentID != AgentId) | ||
12130 | break; | ||
12131 | } | ||
12132 | #endregion | ||
12133 | |||
12134 | |||
12135 | for (int i = 0; i < position.ObjectData.Length; i++) | ||
12136 | { | ||
12137 | UpdateVector handlerUpdateVector = OnUpdatePrimGroupPosition; | ||
12138 | if (handlerUpdateVector != null) | ||
12139 | handlerUpdateVector(position.ObjectData[i].ObjectLocalID, position.ObjectData[i].Position, this); | ||
12140 | } | ||
12141 | |||
12142 | break; | ||
12143 | |||
12144 | case PacketType.ObjectScale: | ||
12145 | // DEPRECATED: but till libsecondlife removes it, people will use it | ||
12146 | ObjectScalePacket scale = (ObjectScalePacket)Pack; | ||
12147 | |||
12148 | #region Packet Session and User Check | ||
12149 | if (m_checkPackets) | ||
12150 | { | ||
12151 | if (scale.AgentData.SessionID != SessionId || | ||
12152 | scale.AgentData.AgentID != AgentId) | ||
12153 | break; | ||
12154 | } | ||
12155 | #endregion | ||
12156 | |||
12157 | for (int i = 0; i < scale.ObjectData.Length; i++) | ||
12158 | { | ||
12159 | UpdateVector handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; | ||
12160 | if (handlerUpdatePrimGroupScale != null) | ||
12161 | handlerUpdatePrimGroupScale(scale.ObjectData[i].ObjectLocalID, scale.ObjectData[i].Scale, this); | ||
12162 | } | ||
12163 | |||
12164 | break; | ||
12165 | |||
12166 | case PacketType.ObjectRotation: | ||
12167 | // DEPRECATED: but till libsecondlife removes it, people will use it | ||
12168 | ObjectRotationPacket rotation = (ObjectRotationPacket)Pack; | ||
12169 | |||
12170 | #region Packet Session and User Check | ||
12171 | if (m_checkPackets) | ||
12172 | { | ||
12173 | if (rotation.AgentData.SessionID != SessionId || | ||
12174 | rotation.AgentData.AgentID != AgentId) | ||
12175 | break; | ||
12176 | } | ||
12177 | #endregion | ||
12178 | |||
12179 | for (int i = 0; i < rotation.ObjectData.Length; i++) | ||
12180 | { | ||
12181 | UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; | ||
12182 | if (handlerUpdatePrimRotation != null) | ||
12183 | handlerUpdatePrimRotation(rotation.ObjectData[i].ObjectLocalID, rotation.ObjectData[i].Rotation, this); | ||
12184 | } | ||
12185 | |||
12186 | break; | ||
12187 | |||
12188 | case PacketType.ObjectFlagUpdate: | ||
12189 | ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack; | ||
12190 | |||
12191 | #region Packet Session and User Check | ||
12192 | if (m_checkPackets) | ||
12193 | { | ||
12194 | if (flags.AgentData.SessionID != SessionId || | ||
12195 | flags.AgentData.AgentID != AgentId) | ||
12196 | break; | ||
12197 | } | ||
12198 | #endregion | ||
12199 | |||
12200 | UpdatePrimFlags handlerUpdatePrimFlags = OnUpdatePrimFlags; | ||
12201 | |||
12202 | if (handlerUpdatePrimFlags != null) | ||
12203 | { | ||
12204 | byte[] data = Pack.ToBytes(); | ||
12205 | // 46,47,48 are special positions within the packet | ||
12206 | // This may change so perhaps we need a better way | ||
12207 | // of storing this (OMV.FlagUpdatePacket.UsePhysics,etc?) | ||
12208 | bool UsePhysics = (data[46] != 0) ? true : false; | ||
12209 | bool IsTemporary = (data[47] != 0) ? true : false; | ||
12210 | bool IsPhantom = (data[48] != 0) ? true : false; | ||
12211 | handlerUpdatePrimFlags(flags.AgentData.ObjectLocalID, UsePhysics, IsTemporary, IsPhantom, this); | ||
12212 | } | ||
12213 | break; | ||
12214 | case PacketType.ObjectImage: | ||
12215 | ObjectImagePacket imagePack = (ObjectImagePacket)Pack; | ||
12216 | |||
12217 | UpdatePrimTexture handlerUpdatePrimTexture = null; | ||
12218 | for (int i = 0; i < imagePack.ObjectData.Length; i++) | ||
12219 | { | ||
12220 | handlerUpdatePrimTexture = OnUpdatePrimTexture; | ||
12221 | if (handlerUpdatePrimTexture != null) | ||
12222 | { | ||
12223 | handlerUpdatePrimTexture(imagePack.ObjectData[i].ObjectLocalID, | ||
12224 | imagePack.ObjectData[i].TextureEntry, this); | ||
12225 | } | ||
12226 | } | ||
12227 | break; | ||
12228 | |||
12229 | case PacketType.ObjectGrab: | ||
12230 | ObjectGrabPacket grab = (ObjectGrabPacket)Pack; | ||
12231 | |||
12232 | #region Packet Session and User Check | ||
12233 | if (m_checkPackets) | ||
12234 | { | ||
12235 | if (grab.AgentData.SessionID != SessionId || | ||
12236 | grab.AgentData.AgentID != AgentId) | ||
12237 | break; | ||
12238 | } | ||
12239 | #endregion | ||
12240 | |||
12241 | GrabObject handlerGrabObject = OnGrabObject; | ||
12242 | |||
12243 | if (handlerGrabObject != null) | ||
12244 | { | ||
12245 | List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>(); | ||
12246 | if ((grab.SurfaceInfo != null) && (grab.SurfaceInfo.Length > 0)) | ||
12247 | { | ||
12248 | foreach (ObjectGrabPacket.SurfaceInfoBlock surfaceInfo in grab.SurfaceInfo) | ||
12249 | { | ||
12250 | SurfaceTouchEventArgs arg = new SurfaceTouchEventArgs(); | ||
12251 | arg.Binormal = surfaceInfo.Binormal; | ||
12252 | arg.FaceIndex = surfaceInfo.FaceIndex; | ||
12253 | arg.Normal = surfaceInfo.Normal; | ||
12254 | arg.Position = surfaceInfo.Position; | ||
12255 | arg.STCoord = surfaceInfo.STCoord; | ||
12256 | arg.UVCoord = surfaceInfo.UVCoord; | ||
12257 | touchArgs.Add(arg); | ||
12258 | } | ||
12259 | } | ||
12260 | handlerGrabObject(grab.ObjectData.LocalID, grab.ObjectData.GrabOffset, this, touchArgs); | ||
12261 | } | ||
12262 | break; | ||
12263 | |||
12264 | case PacketType.ObjectGrabUpdate: | ||
12265 | ObjectGrabUpdatePacket grabUpdate = (ObjectGrabUpdatePacket)Pack; | ||
12266 | |||
12267 | #region Packet Session and User Check | ||
12268 | if (m_checkPackets) | ||
12269 | { | ||
12270 | if (grabUpdate.AgentData.SessionID != SessionId || | ||
12271 | grabUpdate.AgentData.AgentID != AgentId) | ||
12272 | break; | ||
12273 | } | ||
12274 | #endregion | ||
12275 | |||
12276 | MoveObject handlerGrabUpdate = OnGrabUpdate; | ||
12277 | |||
12278 | if (handlerGrabUpdate != null) | ||
12279 | { | ||
12280 | List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>(); | ||
12281 | if ((grabUpdate.SurfaceInfo != null) && (grabUpdate.SurfaceInfo.Length > 0)) | ||
12282 | { | ||
12283 | foreach (ObjectGrabUpdatePacket.SurfaceInfoBlock surfaceInfo in grabUpdate.SurfaceInfo) | ||
12284 | { | ||
12285 | SurfaceTouchEventArgs arg = new SurfaceTouchEventArgs(); | ||
12286 | arg.Binormal = surfaceInfo.Binormal; | ||
12287 | arg.FaceIndex = surfaceInfo.FaceIndex; | ||
12288 | arg.Normal = surfaceInfo.Normal; | ||
12289 | arg.Position = surfaceInfo.Position; | ||
12290 | arg.STCoord = surfaceInfo.STCoord; | ||
12291 | arg.UVCoord = surfaceInfo.UVCoord; | ||
12292 | touchArgs.Add(arg); | ||
12293 | } | ||
12294 | } | ||
12295 | handlerGrabUpdate(grabUpdate.ObjectData.ObjectID, grabUpdate.ObjectData.GrabOffsetInitial, | ||
12296 | grabUpdate.ObjectData.GrabPosition, this, touchArgs); | ||
12297 | } | ||
12298 | break; | ||
12299 | |||
12300 | case PacketType.ObjectDeGrab: | ||
12301 | ObjectDeGrabPacket deGrab = (ObjectDeGrabPacket)Pack; | ||
12302 | |||
12303 | #region Packet Session and User Check | ||
12304 | if (m_checkPackets) | ||
12305 | { | ||
12306 | if (deGrab.AgentData.SessionID != SessionId || | ||
12307 | deGrab.AgentData.AgentID != AgentId) | ||
12308 | break; | ||
12309 | } | ||
12310 | #endregion | ||
12311 | |||
12312 | DeGrabObject handlerDeGrabObject = OnDeGrabObject; | ||
12313 | if (handlerDeGrabObject != null) | ||
12314 | { | ||
12315 | List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>(); | ||
12316 | if ((deGrab.SurfaceInfo != null) && (deGrab.SurfaceInfo.Length > 0)) | ||
12317 | { | ||
12318 | foreach (ObjectDeGrabPacket.SurfaceInfoBlock surfaceInfo in deGrab.SurfaceInfo) | ||
12319 | { | ||
12320 | SurfaceTouchEventArgs arg = new SurfaceTouchEventArgs(); | ||
12321 | arg.Binormal = surfaceInfo.Binormal; | ||
12322 | arg.FaceIndex = surfaceInfo.FaceIndex; | ||
12323 | arg.Normal = surfaceInfo.Normal; | ||
12324 | arg.Position = surfaceInfo.Position; | ||
12325 | arg.STCoord = surfaceInfo.STCoord; | ||
12326 | arg.UVCoord = surfaceInfo.UVCoord; | ||
12327 | touchArgs.Add(arg); | ||
12328 | } | ||
12329 | } | ||
12330 | handlerDeGrabObject(deGrab.ObjectData.LocalID, this, touchArgs); | ||
12331 | } | ||
12332 | break; | ||
12333 | |||
12334 | case PacketType.ObjectSpinStart: | ||
12335 | //m_log.Warn("[CLIENT]: unhandled ObjectSpinStart packet"); | ||
12336 | ObjectSpinStartPacket spinStart = (ObjectSpinStartPacket)Pack; | ||
12337 | |||
12338 | #region Packet Session and User Check | ||
12339 | if (m_checkPackets) | ||
12340 | { | ||
12341 | if (spinStart.AgentData.SessionID != SessionId || | ||
12342 | spinStart.AgentData.AgentID != AgentId) | ||
12343 | break; | ||
12344 | } | ||
12345 | #endregion | ||
12346 | |||
12347 | SpinStart handlerSpinStart = OnSpinStart; | ||
12348 | if (handlerSpinStart != null) | ||
12349 | { | ||
12350 | handlerSpinStart(spinStart.ObjectData.ObjectID, this); | ||
12351 | } | ||
12352 | break; | ||
12353 | case PacketType.ObjectSpinUpdate: | ||
12354 | //m_log.Warn("[CLIENT]: unhandled ObjectSpinUpdate packet"); | ||
12355 | ObjectSpinUpdatePacket spinUpdate = (ObjectSpinUpdatePacket)Pack; | ||
12356 | |||
12357 | #region Packet Session and User Check | ||
12358 | if (m_checkPackets) | ||
12359 | { | ||
12360 | if (spinUpdate.AgentData.SessionID != SessionId || | ||
12361 | spinUpdate.AgentData.AgentID != AgentId) | ||
12362 | break; | ||
12363 | } | ||
12364 | #endregion | ||
12365 | |||
12366 | Vector3 axis; | ||
12367 | float angle; | ||
12368 | spinUpdate.ObjectData.Rotation.GetAxisAngle(out axis, out angle); | ||
12369 | //m_log.Warn("[CLIENT]: ObjectSpinUpdate packet rot axis:" + axis + " angle:" + angle); | ||
12370 | |||
12371 | SpinObject handlerSpinUpdate = OnSpinUpdate; | ||
12372 | if (handlerSpinUpdate != null) | ||
12373 | { | ||
12374 | handlerSpinUpdate(spinUpdate.ObjectData.ObjectID, spinUpdate.ObjectData.Rotation, this); | ||
12375 | } | ||
12376 | break; | ||
12377 | |||
12378 | |||
12379 | case PacketType.ObjectSpinStop: | ||
12380 | //m_log.Warn("[CLIENT]: unhandled ObjectSpinStop packet"); | ||
12381 | ObjectSpinStopPacket spinStop = (ObjectSpinStopPacket)Pack; | ||
12382 | |||
12383 | #region Packet Session and User Check | ||
12384 | if (m_checkPackets) | ||
12385 | { | ||
12386 | if (spinStop.AgentData.SessionID != SessionId || | ||
12387 | spinStop.AgentData.AgentID != AgentId) | ||
12388 | break; | ||
12389 | } | ||
12390 | #endregion | ||
12391 | |||
12392 | SpinStop handlerSpinStop = OnSpinStop; | ||
12393 | if (handlerSpinStop != null) | ||
12394 | { | ||
12395 | handlerSpinStop(spinStop.ObjectData.ObjectID, this); | ||
12396 | } | ||
12397 | break; | ||
12398 | |||
12399 | case PacketType.ObjectDescription: | ||
12400 | ObjectDescriptionPacket objDes = (ObjectDescriptionPacket)Pack; | ||
12401 | |||
12402 | #region Packet Session and User Check | ||
12403 | if (m_checkPackets) | ||
12404 | { | ||
12405 | if (objDes.AgentData.SessionID != SessionId || | ||
12406 | objDes.AgentData.AgentID != AgentId) | ||
12407 | break; | ||
12408 | } | ||
12409 | #endregion | ||
12410 | |||
12411 | GenericCall7 handlerObjectDescription = null; | ||
12412 | |||
12413 | for (int i = 0; i < objDes.ObjectData.Length; i++) | ||
12414 | { | ||
12415 | handlerObjectDescription = OnObjectDescription; | ||
12416 | if (handlerObjectDescription != null) | ||
12417 | { | ||
12418 | handlerObjectDescription(this, objDes.ObjectData[i].LocalID, | ||
12419 | Util.FieldToString(objDes.ObjectData[i].Description)); | ||
12420 | } | ||
12421 | } | ||
12422 | break; | ||
12423 | |||
12424 | case PacketType.ObjectName: | ||
12425 | ObjectNamePacket objName = (ObjectNamePacket)Pack; | ||
12426 | |||
12427 | #region Packet Session and User Check | ||
12428 | if (m_checkPackets) | ||
12429 | { | ||
12430 | if (objName.AgentData.SessionID != SessionId || | ||
12431 | objName.AgentData.AgentID != AgentId) | ||
12432 | break; | ||
12433 | } | ||
12434 | #endregion | ||
12435 | |||
12436 | GenericCall7 handlerObjectName = null; | ||
12437 | for (int i = 0; i < objName.ObjectData.Length; i++) | ||
12438 | { | ||
12439 | handlerObjectName = OnObjectName; | ||
12440 | if (handlerObjectName != null) | ||
12441 | { | ||
12442 | handlerObjectName(this, objName.ObjectData[i].LocalID, | ||
12443 | Util.FieldToString(objName.ObjectData[i].Name)); | ||
12444 | } | ||
12445 | } | ||
12446 | break; | ||
12447 | |||
12448 | case PacketType.ObjectPermissions: | ||
12449 | if (OnObjectPermissions != null) | ||
12450 | { | ||
12451 | ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket)Pack; | ||
12452 | |||
12453 | #region Packet Session and User Check | ||
12454 | if (m_checkPackets) | ||
12455 | { | ||
12456 | if (newobjPerms.AgentData.SessionID != SessionId || | ||
12457 | newobjPerms.AgentData.AgentID != AgentId) | ||
12458 | break; | ||
12459 | } | ||
12460 | #endregion | ||
12461 | |||
12462 | UUID AgentID = newobjPerms.AgentData.AgentID; | ||
12463 | UUID SessionID = newobjPerms.AgentData.SessionID; | ||
12464 | |||
12465 | ObjectPermissions handlerObjectPermissions = null; | ||
12466 | |||
12467 | for (int i = 0; i < newobjPerms.ObjectData.Length; i++) | ||
12468 | { | ||
12469 | ObjectPermissionsPacket.ObjectDataBlock permChanges = newobjPerms.ObjectData[i]; | ||
12470 | |||
12471 | byte field = permChanges.Field; | ||
12472 | uint localID = permChanges.ObjectLocalID; | ||
12473 | uint mask = permChanges.Mask; | ||
12474 | byte set = permChanges.Set; | ||
12475 | |||
12476 | handlerObjectPermissions = OnObjectPermissions; | ||
12477 | |||
12478 | if (handlerObjectPermissions != null) | ||
12479 | handlerObjectPermissions(this, AgentID, SessionID, field, localID, mask, set); | ||
12480 | } | ||
12481 | } | ||
12482 | |||
12483 | // Here's our data, | ||
12484 | // PermField contains the field the info goes into | ||
12485 | // PermField determines which mask we're changing | ||
12486 | // | ||
12487 | // chmask is the mask of the change | ||
12488 | // setTF is whether we're adding it or taking it away | ||
12489 | // | ||
12490 | // objLocalID is the localID of the object. | ||
12491 | |||
12492 | // Unfortunately, we have to pass the event the packet because objData is an array | ||
12493 | // That means multiple object perms may be updated in a single packet. | ||
12494 | |||
12495 | break; | ||
12496 | |||
12497 | case PacketType.Undo: | ||
12498 | UndoPacket undoitem = (UndoPacket)Pack; | ||
12499 | |||
12500 | #region Packet Session and User Check | ||
12501 | if (m_checkPackets) | ||
12502 | { | ||
12503 | if (undoitem.AgentData.SessionID != SessionId || | ||
12504 | undoitem.AgentData.AgentID != AgentId) | ||
12505 | break; | ||
12506 | } | ||
12507 | #endregion | ||
12508 | |||
12509 | if (undoitem.ObjectData.Length > 0) | ||
12510 | { | ||
12511 | for (int i = 0; i < undoitem.ObjectData.Length; i++) | ||
12512 | { | ||
12513 | UUID objiD = undoitem.ObjectData[i].ObjectID; | ||
12514 | AgentSit handlerOnUndo = OnUndo; | ||
12515 | if (handlerOnUndo != null) | ||
12516 | { | ||
12517 | handlerOnUndo(this, objiD); | ||
12518 | } | ||
12519 | |||
12520 | } | ||
12521 | } | ||
12522 | break; | ||
12523 | |||
12524 | case PacketType.ObjectDuplicateOnRay: | ||
12525 | ObjectDuplicateOnRayPacket dupeOnRay = (ObjectDuplicateOnRayPacket)Pack; | ||
12526 | |||
12527 | #region Packet Session and User Check | ||
12528 | if (m_checkPackets) | ||
12529 | { | ||
12530 | if (dupeOnRay.AgentData.SessionID != SessionId || | ||
12531 | dupeOnRay.AgentData.AgentID != AgentId) | ||
12532 | break; | ||
12533 | } | ||
12534 | #endregion | ||
12535 | |||
12536 | ObjectDuplicateOnRay handlerObjectDuplicateOnRay = null; | ||
12537 | |||
12538 | for (int i = 0; i < dupeOnRay.ObjectData.Length; i++) | ||
12539 | { | ||
12540 | handlerObjectDuplicateOnRay = OnObjectDuplicateOnRay; | ||
12541 | if (handlerObjectDuplicateOnRay != null) | ||
12542 | { | ||
12543 | handlerObjectDuplicateOnRay(dupeOnRay.ObjectData[i].ObjectLocalID, dupeOnRay.AgentData.DuplicateFlags, | ||
12544 | dupeOnRay.AgentData.AgentID, dupeOnRay.AgentData.GroupID, dupeOnRay.AgentData.RayTargetID, dupeOnRay.AgentData.RayEnd, | ||
12545 | dupeOnRay.AgentData.RayStart, dupeOnRay.AgentData.BypassRaycast, dupeOnRay.AgentData.RayEndIsIntersection, | ||
12546 | dupeOnRay.AgentData.CopyCenters, dupeOnRay.AgentData.CopyRotates); | ||
12547 | } | ||
12548 | } | ||
12549 | |||
12550 | break; | ||
12551 | |||
12552 | case PacketType.RequestObjectPropertiesFamily: | ||
12553 | //This powers the little tooltip that appears when you move your mouse over an object | ||
12554 | RequestObjectPropertiesFamilyPacket packToolTip = (RequestObjectPropertiesFamilyPacket)Pack; | ||
12555 | |||
12556 | #region Packet Session and User Check | ||
12557 | if (m_checkPackets) | ||
12558 | { | ||
12559 | if (packToolTip.AgentData.SessionID != SessionId || | ||
12560 | packToolTip.AgentData.AgentID != AgentId) | ||
12561 | break; | ||
12562 | } | ||
12563 | #endregion | ||
12564 | |||
12565 | RequestObjectPropertiesFamilyPacket.ObjectDataBlock packObjBlock = packToolTip.ObjectData; | ||
12566 | |||
12567 | RequestObjectPropertiesFamily handlerRequestObjectPropertiesFamily = OnRequestObjectPropertiesFamily; | ||
12568 | |||
12569 | if (handlerRequestObjectPropertiesFamily != null) | ||
12570 | { | ||
12571 | handlerRequestObjectPropertiesFamily(this, m_agentId, packObjBlock.RequestFlags, | ||
12572 | packObjBlock.ObjectID); | ||
12573 | } | ||
12574 | |||
12575 | break; | ||
12576 | |||
12577 | case PacketType.ObjectIncludeInSearch: | ||
12578 | //This lets us set objects to appear in search (stuff like DataSnapshot, etc) | ||
12579 | ObjectIncludeInSearchPacket packInSearch = (ObjectIncludeInSearchPacket)Pack; | ||
12580 | ObjectIncludeInSearch handlerObjectIncludeInSearch = null; | ||
12581 | |||
12582 | #region Packet Session and User Check | ||
12583 | if (m_checkPackets) | ||
12584 | { | ||
12585 | if (packInSearch.AgentData.SessionID != SessionId || | ||
12586 | packInSearch.AgentData.AgentID != AgentId) | ||
12587 | break; | ||
12588 | } | ||
12589 | #endregion | ||
12590 | |||
12591 | foreach (ObjectIncludeInSearchPacket.ObjectDataBlock objData in packInSearch.ObjectData) | ||
12592 | { | ||
12593 | bool inSearch = objData.IncludeInSearch; | ||
12594 | uint localID = objData.ObjectLocalID; | ||
12595 | |||
12596 | handlerObjectIncludeInSearch = OnObjectIncludeInSearch; | ||
12597 | |||
12598 | if (handlerObjectIncludeInSearch != null) | ||
12599 | { | ||
12600 | handlerObjectIncludeInSearch(this, inSearch, localID); | ||
12601 | } | ||
12602 | } | ||
12603 | break; | ||
12604 | |||
12605 | case PacketType.ScriptAnswerYes: | ||
12606 | ScriptAnswerYesPacket scriptAnswer = (ScriptAnswerYesPacket)Pack; | ||
12607 | |||
12608 | #region Packet Session and User Check | ||
12609 | if (m_checkPackets) | ||
12610 | { | ||
12611 | if (scriptAnswer.AgentData.SessionID != SessionId || | ||
12612 | scriptAnswer.AgentData.AgentID != AgentId) | ||
12613 | break; | ||
12614 | } | ||
12615 | #endregion | ||
12616 | |||
12617 | ScriptAnswer handlerScriptAnswer = OnScriptAnswer; | ||
12618 | if (handlerScriptAnswer != null) | ||
12619 | { | ||
12620 | handlerScriptAnswer(this, scriptAnswer.Data.TaskID, scriptAnswer.Data.ItemID, scriptAnswer.Data.Questions); | ||
12621 | } | ||
12622 | break; | ||
12623 | |||
12624 | case PacketType.ObjectClickAction: | ||
12625 | ObjectClickActionPacket ocpacket = (ObjectClickActionPacket)Pack; | ||
12626 | |||
12627 | #region Packet Session and User Check | ||
12628 | if (m_checkPackets) | ||
12629 | { | ||
12630 | if (ocpacket.AgentData.SessionID != SessionId || | ||
12631 | ocpacket.AgentData.AgentID != AgentId) | ||
12632 | break; | ||
12633 | } | ||
12634 | #endregion | ||
12635 | |||
12636 | GenericCall7 handlerObjectClickAction = OnObjectClickAction; | ||
12637 | if (handlerObjectClickAction != null) | ||
12638 | { | ||
12639 | foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData) | ||
12640 | { | ||
12641 | byte action = odata.ClickAction; | ||
12642 | uint localID = odata.ObjectLocalID; | ||
12643 | handlerObjectClickAction(this, localID, action.ToString()); | ||
12644 | } | ||
12645 | } | ||
12646 | break; | ||
12647 | |||
12648 | case PacketType.ObjectMaterial: | ||
12649 | ObjectMaterialPacket ompacket = (ObjectMaterialPacket)Pack; | ||
12650 | |||
12651 | #region Packet Session and User Check | ||
12652 | if (m_checkPackets) | ||
12653 | { | ||
12654 | if (ompacket.AgentData.SessionID != SessionId || | ||
12655 | ompacket.AgentData.AgentID != AgentId) | ||
12656 | break; | ||
12657 | } | ||
12658 | #endregion | ||
12659 | |||
12660 | GenericCall7 handlerObjectMaterial = OnObjectMaterial; | ||
12661 | if (handlerObjectMaterial != null) | ||
12662 | { | ||
12663 | foreach (ObjectMaterialPacket.ObjectDataBlock odata in ompacket.ObjectData) | ||
12664 | { | ||
12665 | byte material = odata.Material; | ||
12666 | uint localID = odata.ObjectLocalID; | ||
12667 | handlerObjectMaterial(this, localID, material.ToString()); | ||
12668 | } | ||
12669 | } | ||
12670 | break; | ||
12671 | |||
12672 | //#endregion | ||
12673 | |||
12674 | //#region Inventory/Asset/Other related packets | ||
12675 | |||
12676 | case PacketType.RequestImage: | ||
12677 | RequestImagePacket imageRequest = (RequestImagePacket)Pack; | ||
12678 | //m_log.Debug("image request: " + Pack.ToString()); | ||
12679 | |||
12680 | #region Packet Session and User Check | ||
12681 | if (m_checkPackets) | ||
12682 | { | ||
12683 | if (imageRequest.AgentData.SessionID != SessionId || | ||
12684 | imageRequest.AgentData.AgentID != AgentId) | ||
12685 | break; | ||
12686 | } | ||
12687 | #endregion | ||
12688 | |||
12689 | //handlerTextureRequest = null; | ||
12690 | for (int i = 0; i < imageRequest.RequestImage.Length; i++) | ||
12691 | { | ||
12692 | if (OnRequestTexture != null) | ||
12693 | { | ||
12694 | TextureRequestArgs args = new TextureRequestArgs(); | ||
12695 | |||
12696 | RequestImagePacket.RequestImageBlock block = imageRequest.RequestImage[i]; | ||
12697 | |||
12698 | args.RequestedAssetID = block.Image; | ||
12699 | args.DiscardLevel = block.DiscardLevel; | ||
12700 | args.PacketNumber = block.Packet; | ||
12701 | args.Priority = block.DownloadPriority; | ||
12702 | args.requestSequence = imageRequest.Header.Sequence; | ||
12703 | |||
12704 | // NOTE: This is not a built in part of the LLUDP protocol, but we double the | ||
12705 | // priority of avatar textures to get avatars rezzing in faster than the | ||
12706 | // surrounding scene | ||
12707 | if ((ImageType)block.Type == ImageType.Baked) | ||
12708 | args.Priority *= 2.0f; | ||
12709 | |||
12710 | //handlerTextureRequest = OnRequestTexture; | ||
12711 | |||
12712 | //if (handlerTextureRequest != null) | ||
12713 | //OnRequestTexture(this, args); | ||
12714 | |||
12715 | // in the end, we null this, so we have to check if it's null | ||
12716 | if (m_imageManager != null) | ||
12717 | { | ||
12718 | m_imageManager.EnqueueReq(args); | ||
12719 | } | ||
12720 | } | ||
12721 | } | ||
12722 | break; | ||
12723 | |||
12724 | case PacketType.TransferRequest: | ||
12725 | //m_log.Debug("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request"); | ||
12726 | |||
12727 | TransferRequestPacket transfer = (TransferRequestPacket)Pack; | ||
12728 | //m_log.Debug("Transfer Request: " + transfer.ToString()); | ||
12729 | // Validate inventory transfers | ||
12730 | // Has to be done here, because AssetCache can't do it | ||
12731 | // | ||
12732 | UUID taskID = UUID.Zero; | ||
12733 | if (transfer.TransferInfo.SourceType == 3) | ||
12734 | { | ||
12735 | taskID = new UUID(transfer.TransferInfo.Params, 48); | ||
12736 | UUID itemID = new UUID(transfer.TransferInfo.Params, 64); | ||
12737 | UUID requestID = new UUID(transfer.TransferInfo.Params, 80); | ||
12738 | if (!(((Scene)m_scene).Permissions.BypassPermissions())) | ||
12739 | { | ||
12740 | if (taskID != UUID.Zero) // Prim | ||
12741 | { | ||
12742 | SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); | ||
12743 | if (part == null) | ||
12744 | break; | ||
12745 | |||
12746 | if (part.OwnerID != AgentId) | ||
12747 | break; | ||
12748 | |||
12749 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) | ||
12750 | break; | ||
12751 | |||
12752 | TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID); | ||
12753 | if (ti == null) | ||
12754 | break; | ||
12755 | |||
12756 | if (ti.OwnerID != AgentId) | ||
12757 | break; | ||
12758 | |||
12759 | if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) | ||
12760 | break; | ||
12761 | |||
12762 | if (ti.AssetID != requestID) | ||
12763 | break; | ||
12764 | } | ||
12765 | else // Agent | ||
12766 | { | ||
12767 | IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>(); | ||
12768 | InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, AgentId); | ||
12769 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
12770 | if (assetRequestItem == null) | ||
12771 | { | ||
12772 | assetRequestItem = ((Scene)m_scene).CommsManager.UserProfileCacheService.LibraryRoot.FindItem(itemID); | ||
12773 | if (assetRequestItem == null) | ||
12774 | return; | ||
12775 | } | ||
12776 | |||
12777 | // At this point, we need to apply perms | ||
12778 | // only to notecards and scripts. All | ||
12779 | // other asset types are always available | ||
12780 | // | ||
12781 | if (assetRequestItem.AssetType == 10) | ||
12782 | { | ||
12783 | if (!((Scene)m_scene).Permissions.CanViewScript(itemID, UUID.Zero, AgentId)) | ||
12784 | { | ||
12785 | SendAgentAlertMessage("Insufficient permissions to view script", false); | ||
12786 | break; | ||
12787 | } | ||
12788 | } | ||
12789 | else if (assetRequestItem.AssetType == 7) | ||
12790 | { | ||
12791 | if (!((Scene)m_scene).Permissions.CanViewNotecard(itemID, UUID.Zero, AgentId)) | ||
12792 | { | ||
12793 | SendAgentAlertMessage("Insufficient permissions to view notecard", false); | ||
12794 | break; | ||
12795 | } | ||
12796 | } | ||
12797 | |||
12798 | if (assetRequestItem.AssetID != requestID) | ||
12799 | break; | ||
12800 | } | ||
12801 | } | ||
12802 | } | ||
12803 | |||
12804 | //m_assetCache.AddAssetRequest(this, transfer); | ||
12805 | |||
12806 | MakeAssetRequest(transfer, taskID); | ||
12807 | |||
12808 | // RequestAsset = OnRequestAsset; | ||
12809 | // if (RequestAsset != null) | ||
12810 | // { | ||
12811 | // RequestAsset(this, transfer); | ||
12812 | // } | ||
12813 | |||
12814 | break; | ||
12815 | |||
12816 | case PacketType.AssetUploadRequest: | ||
12817 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; | ||
12818 | |||
12819 | |||
12820 | // m_log.Debug("upload request " + request.ToString()); | ||
12821 | // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); | ||
12822 | UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); | ||
12823 | |||
12824 | UDPAssetUploadRequest handlerAssetUploadRequest = OnAssetUploadRequest; | ||
12825 | |||
12826 | if (handlerAssetUploadRequest != null) | ||
12827 | { | ||
12828 | handlerAssetUploadRequest(this, temp, | ||
12829 | request.AssetBlock.TransactionID, request.AssetBlock.Type, | ||
12830 | request.AssetBlock.AssetData, request.AssetBlock.StoreLocal, | ||
12831 | request.AssetBlock.Tempfile); | ||
12832 | } | ||
12833 | break; | ||
12834 | |||
12835 | case PacketType.RequestXfer: | ||
12836 | RequestXferPacket xferReq = (RequestXferPacket)Pack; | ||
12837 | |||
12838 | RequestXfer handlerRequestXfer = OnRequestXfer; | ||
12839 | |||
12840 | if (handlerRequestXfer != null) | ||
12841 | { | ||
12842 | handlerRequestXfer(this, xferReq.XferID.ID, Util.FieldToString(xferReq.XferID.Filename)); | ||
12843 | } | ||
12844 | break; | ||
12845 | |||
12846 | case PacketType.SendXferPacket: | ||
12847 | SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack; | ||
12848 | |||
12849 | XferReceive handlerXferReceive = OnXferReceive; | ||
12850 | if (handlerXferReceive != null) | ||
12851 | { | ||
12852 | handlerXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data); | ||
12853 | } | ||
12854 | break; | ||
12855 | |||
12856 | case PacketType.ConfirmXferPacket: | ||
12857 | ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack; | ||
12858 | |||
12859 | ConfirmXfer handlerConfirmXfer = OnConfirmXfer; | ||
12860 | if (handlerConfirmXfer != null) | ||
12861 | { | ||
12862 | handlerConfirmXfer(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet); | ||
12863 | } | ||
12864 | break; | ||
12865 | |||
12866 | case PacketType.AbortXfer: | ||
12867 | AbortXferPacket abortXfer = (AbortXferPacket)Pack; | ||
12868 | AbortXfer handlerAbortXfer = OnAbortXfer; | ||
12869 | if (handlerAbortXfer != null) | ||
12870 | { | ||
12871 | handlerAbortXfer(this, abortXfer.XferID.ID); | ||
12872 | } | ||
12873 | |||
12874 | break; | ||
12875 | |||
12876 | case PacketType.CreateInventoryFolder: | ||
12877 | CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; | ||
12878 | |||
12879 | #region Packet Session and User Check | ||
12880 | if (m_checkPackets) | ||
12881 | { | ||
12882 | if (invFolder.AgentData.SessionID != SessionId || | ||
12883 | invFolder.AgentData.AgentID != AgentId) | ||
12884 | break; | ||
12885 | } | ||
12886 | #endregion | ||
12887 | |||
12888 | CreateInventoryFolder handlerCreateInventoryFolder = OnCreateNewInventoryFolder; | ||
12889 | if (handlerCreateInventoryFolder != null) | ||
12890 | { | ||
12891 | handlerCreateInventoryFolder(this, invFolder.FolderData.FolderID, | ||
12892 | (ushort)invFolder.FolderData.Type, | ||
12893 | Util.FieldToString(invFolder.FolderData.Name), | ||
12894 | invFolder.FolderData.ParentID); | ||
12895 | } | ||
12896 | break; | ||
12897 | |||
12898 | case PacketType.UpdateInventoryFolder: | ||
12899 | if (OnUpdateInventoryFolder != null) | ||
12900 | { | ||
12901 | UpdateInventoryFolderPacket invFolderx = (UpdateInventoryFolderPacket)Pack; | ||
12902 | |||
12903 | #region Packet Session and User Check | ||
12904 | if (m_checkPackets) | ||
12905 | { | ||
12906 | if (invFolderx.AgentData.SessionID != SessionId || | ||
12907 | invFolderx.AgentData.AgentID != AgentId) | ||
12908 | break; | ||
12909 | } | ||
12910 | #endregion | ||
12911 | |||
12912 | UpdateInventoryFolder handlerUpdateInventoryFolder = null; | ||
12913 | |||
12914 | for (int i = 0; i < invFolderx.FolderData.Length; i++) | ||
12915 | { | ||
12916 | handlerUpdateInventoryFolder = OnUpdateInventoryFolder; | ||
12917 | if (handlerUpdateInventoryFolder != null) | ||
12918 | { | ||
12919 | OnUpdateInventoryFolder(this, invFolderx.FolderData[i].FolderID, | ||
12920 | (ushort)invFolderx.FolderData[i].Type, | ||
12921 | Util.FieldToString(invFolderx.FolderData[i].Name), | ||
12922 | invFolderx.FolderData[i].ParentID); | ||
12923 | } | ||
12924 | } | ||
12925 | } | ||
12926 | break; | ||
12927 | |||
12928 | case PacketType.MoveInventoryFolder: | ||
12929 | if (OnMoveInventoryFolder != null) | ||
12930 | { | ||
12931 | MoveInventoryFolderPacket invFoldery = (MoveInventoryFolderPacket)Pack; | ||
12932 | |||
12933 | #region Packet Session and User Check | ||
12934 | if (m_checkPackets) | ||
12935 | { | ||
12936 | if (invFoldery.AgentData.SessionID != SessionId || | ||
12937 | invFoldery.AgentData.AgentID != AgentId) | ||
12938 | break; | ||
12939 | } | ||
12940 | #endregion | ||
12941 | |||
12942 | MoveInventoryFolder handlerMoveInventoryFolder = null; | ||
12943 | |||
12944 | for (int i = 0; i < invFoldery.InventoryData.Length; i++) | ||
12945 | { | ||
12946 | handlerMoveInventoryFolder = OnMoveInventoryFolder; | ||
12947 | if (handlerMoveInventoryFolder != null) | ||
12948 | { | ||
12949 | OnMoveInventoryFolder(this, invFoldery.InventoryData[i].FolderID, | ||
12950 | invFoldery.InventoryData[i].ParentID); | ||
12951 | } | ||
12952 | } | ||
12953 | } | ||
12954 | break; | ||
12955 | |||
12956 | case PacketType.CreateInventoryItem: | ||
12957 | CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; | ||
12958 | |||
12959 | #region Packet Session and User Check | ||
12960 | if (m_checkPackets) | ||
12961 | { | ||
12962 | if (createItem.AgentData.SessionID != SessionId || | ||
12963 | createItem.AgentData.AgentID != AgentId) | ||
12964 | break; | ||
12965 | } | ||
12966 | #endregion | ||
12967 | |||
12968 | CreateNewInventoryItem handlerCreateNewInventoryItem = OnCreateNewInventoryItem; | ||
12969 | if (handlerCreateNewInventoryItem != null) | ||
12970 | { | ||
12971 | handlerCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID, | ||
12972 | createItem.InventoryBlock.FolderID, | ||
12973 | createItem.InventoryBlock.CallbackID, | ||
12974 | Util.FieldToString(createItem.InventoryBlock.Description), | ||
12975 | Util.FieldToString(createItem.InventoryBlock.Name), | ||
12976 | createItem.InventoryBlock.InvType, | ||
12977 | createItem.InventoryBlock.Type, | ||
12978 | createItem.InventoryBlock.WearableType, | ||
12979 | createItem.InventoryBlock.NextOwnerMask, | ||
12980 | Util.UnixTimeSinceEpoch()); | ||
12981 | } | ||
12982 | break; | ||
12983 | |||
12984 | case PacketType.FetchInventory: | ||
12985 | if (OnFetchInventory != null) | ||
12986 | { | ||
12987 | FetchInventoryPacket FetchInventoryx = (FetchInventoryPacket)Pack; | ||
12988 | |||
12989 | #region Packet Session and User Check | ||
12990 | if (m_checkPackets) | ||
12991 | { | ||
12992 | if (FetchInventoryx.AgentData.SessionID != SessionId || | ||
12993 | FetchInventoryx.AgentData.AgentID != AgentId) | ||
12994 | break; | ||
12995 | } | ||
12996 | #endregion | ||
12997 | |||
12998 | FetchInventory handlerFetchInventory = null; | ||
12999 | |||
13000 | for (int i = 0; i < FetchInventoryx.InventoryData.Length; i++) | ||
13001 | { | ||
13002 | handlerFetchInventory = OnFetchInventory; | ||
13003 | |||
13004 | if (handlerFetchInventory != null) | ||
13005 | { | ||
13006 | OnFetchInventory(this, FetchInventoryx.InventoryData[i].ItemID, | ||
13007 | FetchInventoryx.InventoryData[i].OwnerID); | ||
13008 | } | ||
13009 | } | ||
13010 | } | ||
13011 | break; | ||
13012 | |||
13013 | case PacketType.FetchInventoryDescendents: | ||
13014 | FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; | ||
13015 | |||
13016 | #region Packet Session and User Check | ||
13017 | if (m_checkPackets) | ||
13018 | { | ||
13019 | if (Fetch.AgentData.SessionID != SessionId || | ||
13020 | Fetch.AgentData.AgentID != AgentId) | ||
13021 | break; | ||
13022 | } | ||
13023 | #endregion | ||
13024 | |||
13025 | FetchInventoryDescendents handlerFetchInventoryDescendents = OnFetchInventoryDescendents; | ||
13026 | if (handlerFetchInventoryDescendents != null) | ||
13027 | { | ||
13028 | handlerFetchInventoryDescendents(this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID, | ||
13029 | Fetch.InventoryData.FetchFolders, Fetch.InventoryData.FetchItems, | ||
13030 | Fetch.InventoryData.SortOrder); | ||
13031 | } | ||
13032 | break; | ||
13033 | |||
13034 | case PacketType.PurgeInventoryDescendents: | ||
13035 | PurgeInventoryDescendentsPacket Purge = (PurgeInventoryDescendentsPacket)Pack; | ||
13036 | |||
13037 | #region Packet Session and User Check | ||
13038 | if (m_checkPackets) | ||
13039 | { | ||
13040 | if (Purge.AgentData.SessionID != SessionId || | ||
13041 | Purge.AgentData.AgentID != AgentId) | ||
13042 | break; | ||
13043 | } | ||
13044 | #endregion | ||
13045 | |||
13046 | PurgeInventoryDescendents handlerPurgeInventoryDescendents = OnPurgeInventoryDescendents; | ||
13047 | if (handlerPurgeInventoryDescendents != null) | ||
13048 | { | ||
13049 | handlerPurgeInventoryDescendents(this, Purge.InventoryData.FolderID); | ||
13050 | } | ||
13051 | break; | ||
13052 | |||
13053 | case PacketType.UpdateInventoryItem: | ||
13054 | UpdateInventoryItemPacket inventoryItemUpdate = (UpdateInventoryItemPacket)Pack; | ||
13055 | |||
13056 | #region Packet Session and User Check | ||
13057 | if (m_checkPackets) | ||
13058 | { | ||
13059 | if (inventoryItemUpdate.AgentData.SessionID != SessionId || | ||
13060 | inventoryItemUpdate.AgentData.AgentID != AgentId) | ||
13061 | break; | ||
13062 | } | ||
13063 | #endregion | ||
13064 | |||
13065 | if (OnUpdateInventoryItem != null) | ||
13066 | { | ||
13067 | UpdateInventoryItem handlerUpdateInventoryItem = null; | ||
13068 | for (int i = 0; i < inventoryItemUpdate.InventoryData.Length; i++) | ||
13069 | { | ||
13070 | handlerUpdateInventoryItem = OnUpdateInventoryItem; | ||
13071 | |||
13072 | if (handlerUpdateInventoryItem != null) | ||
13073 | { | ||
13074 | InventoryItemBase itemUpd = new InventoryItemBase(); | ||
13075 | itemUpd.ID = inventoryItemUpdate.InventoryData[i].ItemID; | ||
13076 | itemUpd.Name = Util.FieldToString(inventoryItemUpdate.InventoryData[i].Name); | ||
13077 | itemUpd.Description = Util.FieldToString(inventoryItemUpdate.InventoryData[i].Description); | ||
13078 | itemUpd.GroupID = inventoryItemUpdate.InventoryData[i].GroupID; | ||
13079 | itemUpd.GroupOwned = inventoryItemUpdate.InventoryData[i].GroupOwned; | ||
13080 | itemUpd.GroupPermissions = inventoryItemUpdate.InventoryData[i].GroupMask; | ||
13081 | itemUpd.NextPermissions = inventoryItemUpdate.InventoryData[i].NextOwnerMask; | ||
13082 | itemUpd.EveryOnePermissions = inventoryItemUpdate.InventoryData[i].EveryoneMask; | ||
13083 | itemUpd.CreationDate = inventoryItemUpdate.InventoryData[i].CreationDate; | ||
13084 | itemUpd.Folder = inventoryItemUpdate.InventoryData[i].FolderID; | ||
13085 | itemUpd.InvType = inventoryItemUpdate.InventoryData[i].InvType; | ||
13086 | itemUpd.SalePrice = inventoryItemUpdate.InventoryData[i].SalePrice; | ||
13087 | itemUpd.SaleType = inventoryItemUpdate.InventoryData[i].SaleType; | ||
13088 | itemUpd.Flags = inventoryItemUpdate.InventoryData[i].Flags; | ||
13089 | |||
13090 | OnUpdateInventoryItem(this, inventoryItemUpdate.InventoryData[i].TransactionID, | ||
13091 | inventoryItemUpdate.InventoryData[i].ItemID, | ||
13092 | itemUpd); | ||
13093 | } | ||
13094 | } | ||
13095 | } | ||
13096 | break; | ||
13097 | |||
13098 | case PacketType.CopyInventoryItem: | ||
13099 | CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket)Pack; | ||
13100 | |||
13101 | #region Packet Session and User Check | ||
13102 | if (m_checkPackets) | ||
13103 | { | ||
13104 | if (copyitem.AgentData.SessionID != SessionId || | ||
13105 | copyitem.AgentData.AgentID != AgentId) | ||
13106 | break; | ||
13107 | } | ||
13108 | #endregion | ||
13109 | |||
13110 | CopyInventoryItem handlerCopyInventoryItem = null; | ||
13111 | if (OnCopyInventoryItem != null) | ||
13112 | { | ||
13113 | foreach (CopyInventoryItemPacket.InventoryDataBlock datablock in copyitem.InventoryData) | ||
13114 | { | ||
13115 | handlerCopyInventoryItem = OnCopyInventoryItem; | ||
13116 | if (handlerCopyInventoryItem != null) | ||
13117 | { | ||
13118 | handlerCopyInventoryItem(this, datablock.CallbackID, datablock.OldAgentID, | ||
13119 | datablock.OldItemID, datablock.NewFolderID, | ||
13120 | Util.FieldToString(datablock.NewName)); | ||
13121 | } | ||
13122 | } | ||
13123 | } | ||
13124 | break; | ||
13125 | |||
13126 | case PacketType.MoveInventoryItem: | ||
13127 | MoveInventoryItemPacket moveitem = (MoveInventoryItemPacket)Pack; | ||
13128 | |||
13129 | #region Packet Session and User Check | ||
13130 | if (m_checkPackets) | ||
13131 | { | ||
13132 | if (moveitem.AgentData.SessionID != SessionId || | ||
13133 | moveitem.AgentData.AgentID != AgentId) | ||
13134 | break; | ||
13135 | } | ||
13136 | #endregion | ||
13137 | |||
13138 | if (OnMoveInventoryItem != null) | ||
13139 | { | ||
13140 | MoveInventoryItem handlerMoveInventoryItem = null; | ||
13141 | InventoryItemBase itm = null; | ||
13142 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | ||
13143 | foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData) | ||
13144 | { | ||
13145 | itm = new InventoryItemBase(datablock.ItemID, AgentId); | ||
13146 | itm.Folder = datablock.FolderID; | ||
13147 | itm.Name = Util.FieldToString(datablock.NewName); | ||
13148 | // weird, comes out as empty string | ||
13149 | //m_log.DebugFormat("[XXX] new name: {0}", itm.Name); | ||
13150 | items.Add(itm); | ||
13151 | } | ||
13152 | handlerMoveInventoryItem = OnMoveInventoryItem; | ||
13153 | if (handlerMoveInventoryItem != null) | ||
13154 | { | ||
13155 | handlerMoveInventoryItem(this, items); | ||
13156 | } | ||
13157 | } | ||
13158 | break; | ||
13159 | |||
13160 | case PacketType.RemoveInventoryItem: | ||
13161 | RemoveInventoryItemPacket removeItem = (RemoveInventoryItemPacket)Pack; | ||
13162 | |||
13163 | #region Packet Session and User Check | ||
13164 | if (m_checkPackets) | ||
13165 | { | ||
13166 | if (removeItem.AgentData.SessionID != SessionId || | ||
13167 | removeItem.AgentData.AgentID != AgentId) | ||
13168 | break; | ||
13169 | } | ||
13170 | #endregion | ||
13171 | |||
13172 | if (OnRemoveInventoryItem != null) | ||
13173 | { | ||
13174 | RemoveInventoryItem handlerRemoveInventoryItem = null; | ||
13175 | List<UUID> uuids = new List<UUID>(); | ||
13176 | foreach (RemoveInventoryItemPacket.InventoryDataBlock datablock in removeItem.InventoryData) | ||
13177 | { | ||
13178 | uuids.Add(datablock.ItemID); | ||
13179 | } | ||
13180 | handlerRemoveInventoryItem = OnRemoveInventoryItem; | ||
13181 | if (handlerRemoveInventoryItem != null) | ||
13182 | { | ||
13183 | handlerRemoveInventoryItem(this, uuids); | ||
13184 | } | ||
13185 | |||
13186 | } | ||
13187 | break; | ||
13188 | |||
13189 | case PacketType.RemoveInventoryFolder: | ||
13190 | RemoveInventoryFolderPacket removeFolder = (RemoveInventoryFolderPacket)Pack; | ||
13191 | |||
13192 | #region Packet Session and User Check | ||
13193 | if (m_checkPackets) | ||
13194 | { | ||
13195 | if (removeFolder.AgentData.SessionID != SessionId || | ||
13196 | removeFolder.AgentData.AgentID != AgentId) | ||
13197 | break; | ||
13198 | } | ||
13199 | #endregion | ||
13200 | |||
13201 | if (OnRemoveInventoryFolder != null) | ||
13202 | { | ||
13203 | RemoveInventoryFolder handlerRemoveInventoryFolder = null; | ||
13204 | List<UUID> uuids = new List<UUID>(); | ||
13205 | foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData) | ||
13206 | { | ||
13207 | uuids.Add(datablock.FolderID); | ||
13208 | } | ||
13209 | handlerRemoveInventoryFolder = OnRemoveInventoryFolder; | ||
13210 | if (handlerRemoveInventoryFolder != null) | ||
13211 | { | ||
13212 | handlerRemoveInventoryFolder(this, uuids); | ||
13213 | } | ||
13214 | } | ||
13215 | break; | ||
13216 | |||
13217 | case PacketType.RemoveInventoryObjects: | ||
13218 | RemoveInventoryObjectsPacket removeObject = (RemoveInventoryObjectsPacket)Pack; | ||
13219 | #region Packet Session and User Check | ||
13220 | if (m_checkPackets) | ||
13221 | { | ||
13222 | if (removeObject.AgentData.SessionID != SessionId || | ||
13223 | removeObject.AgentData.AgentID != AgentId) | ||
13224 | break; | ||
13225 | } | ||
13226 | #endregion | ||
13227 | if (OnRemoveInventoryFolder != null) | ||
13228 | { | ||
13229 | RemoveInventoryFolder handlerRemoveInventoryFolder = null; | ||
13230 | List<UUID> uuids = new List<UUID>(); | ||
13231 | foreach (RemoveInventoryObjectsPacket.FolderDataBlock datablock in removeObject.FolderData) | ||
13232 | { | ||
13233 | uuids.Add(datablock.FolderID); | ||
13234 | } | ||
13235 | handlerRemoveInventoryFolder = OnRemoveInventoryFolder; | ||
13236 | if (handlerRemoveInventoryFolder != null) | ||
13237 | { | ||
13238 | handlerRemoveInventoryFolder(this, uuids); | ||
13239 | } | ||
13240 | } | ||
13241 | |||
13242 | if (OnRemoveInventoryItem != null) | ||
13243 | { | ||
13244 | RemoveInventoryItem handlerRemoveInventoryItem = null; | ||
13245 | List<UUID> uuids = new List<UUID>(); | ||
13246 | foreach (RemoveInventoryObjectsPacket.ItemDataBlock datablock in removeObject.ItemData) | ||
13247 | { | ||
13248 | uuids.Add(datablock.ItemID); | ||
13249 | } | ||
13250 | handlerRemoveInventoryItem = OnRemoveInventoryItem; | ||
13251 | if (handlerRemoveInventoryItem != null) | ||
13252 | { | ||
13253 | handlerRemoveInventoryItem(this, uuids); | ||
13254 | } | ||
13255 | } | ||
13256 | break; | ||
13257 | |||
13258 | case PacketType.RequestTaskInventory: | ||
13259 | RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; | ||
13260 | |||
13261 | #region Packet Session and User Check | ||
13262 | if (m_checkPackets) | ||
13263 | { | ||
13264 | if (requesttask.AgentData.SessionID != SessionId || | ||
13265 | requesttask.AgentData.AgentID != AgentId) | ||
13266 | break; | ||
13267 | } | ||
13268 | #endregion | ||
13269 | |||
13270 | RequestTaskInventory handlerRequestTaskInventory = OnRequestTaskInventory; | ||
13271 | if (handlerRequestTaskInventory != null) | ||
13272 | { | ||
13273 | handlerRequestTaskInventory(this, requesttask.InventoryData.LocalID); | ||
13274 | } | ||
13275 | break; | ||
13276 | |||
13277 | case PacketType.UpdateTaskInventory: | ||
13278 | UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack; | ||
13279 | |||
13280 | #region Packet Session and User Check | ||
13281 | if (m_checkPackets) | ||
13282 | { | ||
13283 | if (updatetask.AgentData.SessionID != SessionId || | ||
13284 | updatetask.AgentData.AgentID != AgentId) | ||
13285 | break; | ||
13286 | } | ||
13287 | #endregion | ||
13288 | |||
13289 | if (OnUpdateTaskInventory != null) | ||
13290 | { | ||
13291 | if (updatetask.UpdateData.Key == 0) | ||
13292 | { | ||
13293 | UpdateTaskInventory handlerUpdateTaskInventory = OnUpdateTaskInventory; | ||
13294 | if (handlerUpdateTaskInventory != null) | ||
13295 | { | ||
13296 | TaskInventoryItem newTaskItem = new TaskInventoryItem(); | ||
13297 | newTaskItem.ItemID = updatetask.InventoryData.ItemID; | ||
13298 | newTaskItem.ParentID = updatetask.InventoryData.FolderID; | ||
13299 | newTaskItem.CreatorID = updatetask.InventoryData.CreatorID; | ||
13300 | newTaskItem.OwnerID = updatetask.InventoryData.OwnerID; | ||
13301 | newTaskItem.GroupID = updatetask.InventoryData.GroupID; | ||
13302 | newTaskItem.BasePermissions = updatetask.InventoryData.BaseMask; | ||
13303 | newTaskItem.CurrentPermissions = updatetask.InventoryData.OwnerMask; | ||
13304 | newTaskItem.GroupPermissions = updatetask.InventoryData.GroupMask; | ||
13305 | newTaskItem.EveryonePermissions = updatetask.InventoryData.EveryoneMask; | ||
13306 | newTaskItem.NextPermissions = updatetask.InventoryData.NextOwnerMask; | ||
13307 | //newTaskItem.GroupOwned=updatetask.InventoryData.GroupOwned; | ||
13308 | newTaskItem.Type = updatetask.InventoryData.Type; | ||
13309 | newTaskItem.InvType = updatetask.InventoryData.InvType; | ||
13310 | newTaskItem.Flags = updatetask.InventoryData.Flags; | ||
13311 | //newTaskItem.SaleType=updatetask.InventoryData.SaleType; | ||
13312 | //newTaskItem.SalePrice=updatetask.InventoryData.SalePrice;; | ||
13313 | newTaskItem.Name = Util.FieldToString(updatetask.InventoryData.Name); | ||
13314 | newTaskItem.Description = Util.FieldToString(updatetask.InventoryData.Description); | ||
13315 | newTaskItem.CreationDate = (uint)updatetask.InventoryData.CreationDate; | ||
13316 | handlerUpdateTaskInventory(this, updatetask.InventoryData.TransactionID, | ||
13317 | newTaskItem, updatetask.UpdateData.LocalID); | ||
13318 | } | ||
13319 | } | ||
13320 | } | ||
13321 | |||
13322 | break; | ||
13323 | |||
13324 | case PacketType.RemoveTaskInventory: | ||
13325 | |||
13326 | RemoveTaskInventoryPacket removeTask = (RemoveTaskInventoryPacket)Pack; | ||
13327 | |||
13328 | #region Packet Session and User Check | ||
13329 | if (m_checkPackets) | ||
13330 | { | ||
13331 | if (removeTask.AgentData.SessionID != SessionId || | ||
13332 | removeTask.AgentData.AgentID != AgentId) | ||
13333 | break; | ||
13334 | } | ||
13335 | #endregion | ||
13336 | |||
13337 | RemoveTaskInventory handlerRemoveTaskItem = OnRemoveTaskItem; | ||
13338 | |||
13339 | if (handlerRemoveTaskItem != null) | ||
13340 | { | ||
13341 | handlerRemoveTaskItem(this, removeTask.InventoryData.ItemID, removeTask.InventoryData.LocalID); | ||
13342 | } | ||
13343 | |||
13344 | break; | ||
13345 | |||
13346 | case PacketType.MoveTaskInventory: | ||
13347 | |||
13348 | MoveTaskInventoryPacket moveTaskInventoryPacket = (MoveTaskInventoryPacket)Pack; | ||
13349 | |||
13350 | #region Packet Session and User Check | ||
13351 | if (m_checkPackets) | ||
13352 | { | ||
13353 | if (moveTaskInventoryPacket.AgentData.SessionID != SessionId || | ||
13354 | moveTaskInventoryPacket.AgentData.AgentID != AgentId) | ||
13355 | break; | ||
13356 | } | ||
13357 | #endregion | ||
13358 | |||
13359 | MoveTaskInventory handlerMoveTaskItem = OnMoveTaskItem; | ||
13360 | |||
13361 | if (handlerMoveTaskItem != null) | ||
13362 | { | ||
13363 | handlerMoveTaskItem( | ||
13364 | this, moveTaskInventoryPacket.AgentData.FolderID, | ||
13365 | moveTaskInventoryPacket.InventoryData.LocalID, | ||
13366 | moveTaskInventoryPacket.InventoryData.ItemID); | ||
13367 | } | ||
13368 | |||
13369 | break; | ||
13370 | |||
13371 | case PacketType.RezScript: | ||
13372 | //m_log.Debug(Pack.ToString()); | ||
13373 | RezScriptPacket rezScriptx = (RezScriptPacket)Pack; | ||
13374 | |||
13375 | #region Packet Session and User Check | ||
13376 | if (m_checkPackets) | ||
13377 | { | ||
13378 | if (rezScriptx.AgentData.SessionID != SessionId || | ||
13379 | rezScriptx.AgentData.AgentID != AgentId) | ||
13380 | break; | ||
13381 | } | ||
13382 | #endregion | ||
13383 | |||
13384 | RezScript handlerRezScript = OnRezScript; | ||
13385 | InventoryItemBase item = new InventoryItemBase(); | ||
13386 | item.ID = rezScriptx.InventoryBlock.ItemID; | ||
13387 | item.Folder = rezScriptx.InventoryBlock.FolderID; | ||
13388 | item.CreatorId = rezScriptx.InventoryBlock.CreatorID.ToString(); | ||
13389 | item.Owner = rezScriptx.InventoryBlock.OwnerID; | ||
13390 | item.BasePermissions = rezScriptx.InventoryBlock.BaseMask; | ||
13391 | item.CurrentPermissions = rezScriptx.InventoryBlock.OwnerMask; | ||
13392 | item.EveryOnePermissions = rezScriptx.InventoryBlock.EveryoneMask; | ||
13393 | item.NextPermissions = rezScriptx.InventoryBlock.NextOwnerMask; | ||
13394 | item.GroupPermissions = rezScriptx.InventoryBlock.GroupMask; | ||
13395 | item.GroupOwned = rezScriptx.InventoryBlock.GroupOwned; | ||
13396 | item.GroupID = rezScriptx.InventoryBlock.GroupID; | ||
13397 | item.AssetType = rezScriptx.InventoryBlock.Type; | ||
13398 | item.InvType = rezScriptx.InventoryBlock.InvType; | ||
13399 | item.Flags = rezScriptx.InventoryBlock.Flags; | ||
13400 | item.SaleType = rezScriptx.InventoryBlock.SaleType; | ||
13401 | item.SalePrice = rezScriptx.InventoryBlock.SalePrice; | ||
13402 | item.Name = Util.FieldToString(rezScriptx.InventoryBlock.Name); | ||
13403 | item.Description = Util.FieldToString(rezScriptx.InventoryBlock.Description); | ||
13404 | item.CreationDate = rezScriptx.InventoryBlock.CreationDate; | ||
13405 | |||
13406 | if (handlerRezScript != null) | ||
13407 | { | ||
13408 | handlerRezScript(this, item, rezScriptx.InventoryBlock.TransactionID, rezScriptx.UpdateBlock.ObjectLocalID); | ||
13409 | } | ||
13410 | break; | ||
13411 | |||
13412 | case PacketType.MapLayerRequest: | ||
13413 | RequestMapLayer(); | ||
13414 | break; | ||
13415 | case PacketType.MapBlockRequest: | ||
13416 | MapBlockRequestPacket MapRequest = (MapBlockRequestPacket)Pack; | ||
13417 | |||
13418 | #region Packet Session and User Check | ||
13419 | if (m_checkPackets) | ||
13420 | { | ||
13421 | if (MapRequest.AgentData.SessionID != SessionId || | ||
13422 | MapRequest.AgentData.AgentID != AgentId) | ||
13423 | break; | ||
13424 | } | ||
13425 | #endregion | ||
13426 | |||
13427 | RequestMapBlocks handlerRequestMapBlocks = OnRequestMapBlocks; | ||
13428 | if (handlerRequestMapBlocks != null) | ||
13429 | { | ||
13430 | handlerRequestMapBlocks(this, MapRequest.PositionData.MinX, MapRequest.PositionData.MinY, | ||
13431 | MapRequest.PositionData.MaxX, MapRequest.PositionData.MaxY, MapRequest.AgentData.Flags); | ||
13432 | } | ||
13433 | break; | ||
13434 | case PacketType.MapNameRequest: | ||
13435 | MapNameRequestPacket map = (MapNameRequestPacket)Pack; | ||
13436 | |||
13437 | #region Packet Session and User Check | ||
13438 | if (m_checkPackets) | ||
13439 | { | ||
13440 | if (map.AgentData.SessionID != SessionId || | ||
13441 | map.AgentData.AgentID != AgentId) | ||
13442 | break; | ||
13443 | } | ||
13444 | #endregion | ||
13445 | |||
13446 | string mapName = Util.UTF8.GetString(map.NameData.Name, 0, | ||
13447 | map.NameData.Name.Length - 1); | ||
13448 | RequestMapName handlerMapNameRequest = OnMapNameRequest; | ||
13449 | if (handlerMapNameRequest != null) | ||
13450 | { | ||
13451 | handlerMapNameRequest(this, mapName); | ||
13452 | } | ||
13453 | break; | ||
13454 | |||
13455 | case PacketType.TeleportLandmarkRequest: | ||
13456 | TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack; | ||
13457 | |||
13458 | #region Packet Session and User Check | ||
13459 | if (m_checkPackets) | ||
13460 | { | ||
13461 | if (tpReq.Info.SessionID != SessionId || | ||
13462 | tpReq.Info.AgentID != AgentId) | ||
13463 | break; | ||
13464 | } | ||
13465 | #endregion | ||
13466 | |||
13467 | UUID lmid = tpReq.Info.LandmarkID; | ||
13468 | AssetLandmark lm; | ||
13469 | if (lmid != UUID.Zero) | ||
13470 | { | ||
13471 | //AssetBase lma = m_assetCache.GetAsset(lmid, false); | ||
13472 | AssetBase lma = m_assetService.Get(lmid.ToString()); | ||
13473 | |||
13474 | if (lma == null) | ||
13475 | { | ||
13476 | // Failed to find landmark | ||
13477 | TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel); | ||
13478 | tpCancel.Info.SessionID = tpReq.Info.SessionID; | ||
13479 | tpCancel.Info.AgentID = tpReq.Info.AgentID; | ||
13480 | OutPacket(tpCancel, ThrottleOutPacketType.Task); | ||
13481 | } | ||
13482 | |||
13483 | try | ||
13484 | { | ||
13485 | lm = new AssetLandmark(lma); | ||
13486 | } | ||
13487 | catch (NullReferenceException) | ||
13488 | { | ||
13489 | // asset not found generates null ref inside the assetlandmark constructor. | ||
13490 | TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel); | ||
13491 | tpCancel.Info.SessionID = tpReq.Info.SessionID; | ||
13492 | tpCancel.Info.AgentID = tpReq.Info.AgentID; | ||
13493 | OutPacket(tpCancel, ThrottleOutPacketType.Task); | ||
13494 | break; | ||
13495 | } | ||
13496 | } | ||
13497 | else | ||
13498 | { | ||
13499 | // Teleport home request | ||
13500 | UUIDNameRequest handlerTeleportHomeRequest = OnTeleportHomeRequest; | ||
13501 | if (handlerTeleportHomeRequest != null) | ||
13502 | { | ||
13503 | handlerTeleportHomeRequest(AgentId, this); | ||
13504 | } | ||
13505 | break; | ||
13506 | } | ||
13507 | |||
13508 | TeleportLandmarkRequest handlerTeleportLandmarkRequest = OnTeleportLandmarkRequest; | ||
13509 | if (handlerTeleportLandmarkRequest != null) | ||
13510 | { | ||
13511 | handlerTeleportLandmarkRequest(this, lm.RegionID, lm.Position); | ||
13512 | } | ||
13513 | else | ||
13514 | { | ||
13515 | //no event handler so cancel request | ||
13516 | |||
13517 | |||
13518 | TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel); | ||
13519 | tpCancel.Info.AgentID = tpReq.Info.AgentID; | ||
13520 | tpCancel.Info.SessionID = tpReq.Info.SessionID; | ||
13521 | OutPacket(tpCancel, ThrottleOutPacketType.Task); | ||
13522 | |||
13523 | } | ||
13524 | break; | ||
13525 | |||
13526 | case PacketType.TeleportLocationRequest: | ||
13527 | TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack; | ||
13528 | // m_log.Debug(tpLocReq.ToString()); | ||
13529 | |||
13530 | #region Packet Session and User Check | ||
13531 | if (m_checkPackets) | ||
13532 | { | ||
13533 | if (tpLocReq.AgentData.SessionID != SessionId || | ||
13534 | tpLocReq.AgentData.AgentID != AgentId) | ||
13535 | break; | ||
13536 | } | ||
13537 | #endregion | ||
13538 | |||
13539 | TeleportLocationRequest handlerTeleportLocationRequest = OnTeleportLocationRequest; | ||
13540 | if (handlerTeleportLocationRequest != null) | ||
13541 | { | ||
13542 | handlerTeleportLocationRequest(this, tpLocReq.Info.RegionHandle, tpLocReq.Info.Position, | ||
13543 | tpLocReq.Info.LookAt, 16); | ||
13544 | } | ||
13545 | else | ||
13546 | { | ||
13547 | //no event handler so cancel request | ||
13548 | TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel); | ||
13549 | tpCancel.Info.SessionID = tpLocReq.AgentData.SessionID; | ||
13550 | tpCancel.Info.AgentID = tpLocReq.AgentData.AgentID; | ||
13551 | OutPacket(tpCancel, ThrottleOutPacketType.Task); | ||
13552 | } | ||
13553 | break; | ||
13554 | |||
13555 | //#endregion | ||
13556 | |||
13557 | case PacketType.UUIDNameRequest: | ||
13558 | UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack; | ||
13559 | |||
13560 | foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock) | ||
13561 | { | ||
13562 | UUIDNameRequest handlerNameRequest = OnNameFromUUIDRequest; | ||
13563 | if (handlerNameRequest != null) | ||
13564 | { | ||
13565 | handlerNameRequest(UUIDBlock.ID, this); | ||
13566 | } | ||
13567 | } | ||
13568 | break; | ||
13569 | |||
13570 | //#region Parcel related packets | ||
13571 | |||
13572 | |||
13573 | case PacketType.RegionHandleRequest: | ||
13574 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; | ||
13575 | |||
13576 | RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest; | ||
13577 | if (handlerRegionHandleRequest != null) | ||
13578 | { | ||
13579 | handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); | ||
13580 | } | ||
13581 | break; | ||
13582 | |||
13583 | case PacketType.ParcelInfoRequest: | ||
13584 | ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack; | ||
13585 | |||
13586 | #region Packet Session and User Check | ||
13587 | if (m_checkPackets) | ||
13588 | { | ||
13589 | if (pirPack.AgentData.SessionID != SessionId || | ||
13590 | pirPack.AgentData.AgentID != AgentId) | ||
13591 | break; | ||
13592 | } | ||
13593 | #endregion | ||
13594 | |||
13595 | ParcelInfoRequest handlerParcelInfoRequest = OnParcelInfoRequest; | ||
13596 | if (handlerParcelInfoRequest != null) | ||
13597 | { | ||
13598 | handlerParcelInfoRequest(this, pirPack.Data.ParcelID); | ||
13599 | } | ||
13600 | break; | ||
13601 | |||
13602 | case PacketType.ParcelAccessListRequest: | ||
13603 | ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack; | ||
13604 | |||
13605 | #region Packet Session and User Check | ||
13606 | if (m_checkPackets) | ||
13607 | { | ||
13608 | if (requestPacket.AgentData.SessionID != SessionId || | ||
13609 | requestPacket.AgentData.AgentID != AgentId) | ||
13610 | break; | ||
13611 | } | ||
13612 | #endregion | ||
13613 | |||
13614 | ParcelAccessListRequest handlerParcelAccessListRequest = OnParcelAccessListRequest; | ||
13615 | |||
13616 | if (handlerParcelAccessListRequest != null) | ||
13617 | { | ||
13618 | handlerParcelAccessListRequest(requestPacket.AgentData.AgentID, requestPacket.AgentData.SessionID, | ||
13619 | requestPacket.Data.Flags, requestPacket.Data.SequenceID, | ||
13620 | requestPacket.Data.LocalID, this); | ||
13621 | } | ||
13622 | break; | ||
13623 | |||
13624 | case PacketType.ParcelAccessListUpdate: | ||
13625 | ParcelAccessListUpdatePacket updatePacket = (ParcelAccessListUpdatePacket)Pack; | ||
13626 | |||
13627 | #region Packet Session and User Check | ||
13628 | if (m_checkPackets) | ||
13629 | { | ||
13630 | if (updatePacket.AgentData.SessionID != SessionId || | ||
13631 | updatePacket.AgentData.AgentID != AgentId) | ||
13632 | break; | ||
13633 | } | ||
13634 | #endregion | ||
13635 | |||
13636 | List<ParcelManager.ParcelAccessEntry> entries = new List<ParcelManager.ParcelAccessEntry>(); | ||
13637 | foreach (ParcelAccessListUpdatePacket.ListBlock block in updatePacket.List) | ||
13638 | { | ||
13639 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | ||
13640 | entry.AgentID = block.ID; | ||
13641 | entry.Flags = (AccessList)block.Flags; | ||
13642 | entry.Time = new DateTime(); | ||
13643 | entries.Add(entry); | ||
13644 | } | ||
13645 | |||
13646 | ParcelAccessListUpdateRequest handlerParcelAccessListUpdateRequest = OnParcelAccessListUpdateRequest; | ||
13647 | if (handlerParcelAccessListUpdateRequest != null) | ||
13648 | { | ||
13649 | handlerParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID, | ||
13650 | updatePacket.AgentData.SessionID, updatePacket.Data.Flags, | ||
13651 | updatePacket.Data.LocalID, entries, this); | ||
13652 | } | ||
13653 | break; | ||
13654 | |||
13655 | case PacketType.ParcelPropertiesRequest: | ||
13656 | |||
13657 | ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket)Pack; | ||
13658 | |||
13659 | #region Packet Session and User Check | ||
13660 | if (m_checkPackets) | ||
13661 | { | ||
13662 | if (propertiesRequest.AgentData.SessionID != SessionId || | ||
13663 | propertiesRequest.AgentData.AgentID != AgentId) | ||
13664 | break; | ||
13665 | } | ||
13666 | #endregion | ||
13667 | |||
13668 | ParcelPropertiesRequest handlerParcelPropertiesRequest = OnParcelPropertiesRequest; | ||
13669 | if (handlerParcelPropertiesRequest != null) | ||
13670 | { | ||
13671 | handlerParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West), | ||
13672 | (int)Math.Round(propertiesRequest.ParcelData.South), | ||
13673 | (int)Math.Round(propertiesRequest.ParcelData.East), | ||
13674 | (int)Math.Round(propertiesRequest.ParcelData.North), | ||
13675 | propertiesRequest.ParcelData.SequenceID, | ||
13676 | propertiesRequest.ParcelData.SnapSelection, this); | ||
13677 | } | ||
13678 | break; | ||
13679 | |||
13680 | case PacketType.ParcelDivide: | ||
13681 | ParcelDividePacket landDivide = (ParcelDividePacket)Pack; | ||
13682 | |||
13683 | #region Packet Session and User Check | ||
13684 | if (m_checkPackets) | ||
13685 | { | ||
13686 | if (landDivide.AgentData.SessionID != SessionId || | ||
13687 | landDivide.AgentData.AgentID != AgentId) | ||
13688 | break; | ||
13689 | } | ||
13690 | #endregion | ||
13691 | |||
13692 | ParcelDivideRequest handlerParcelDivideRequest = OnParcelDivideRequest; | ||
13693 | if (handlerParcelDivideRequest != null) | ||
13694 | { | ||
13695 | handlerParcelDivideRequest((int)Math.Round(landDivide.ParcelData.West), | ||
13696 | (int)Math.Round(landDivide.ParcelData.South), | ||
13697 | (int)Math.Round(landDivide.ParcelData.East), | ||
13698 | (int)Math.Round(landDivide.ParcelData.North), this); | ||
13699 | } | ||
13700 | break; | ||
13701 | |||
13702 | case PacketType.ParcelJoin: | ||
13703 | ParcelJoinPacket landJoin = (ParcelJoinPacket)Pack; | ||
13704 | |||
13705 | #region Packet Session and User Check | ||
13706 | if (m_checkPackets) | ||
13707 | { | ||
13708 | if (landJoin.AgentData.SessionID != SessionId || | ||
13709 | landJoin.AgentData.AgentID != AgentId) | ||
13710 | break; | ||
13711 | } | ||
13712 | #endregion | ||
13713 | |||
13714 | ParcelJoinRequest handlerParcelJoinRequest = OnParcelJoinRequest; | ||
13715 | |||
13716 | if (handlerParcelJoinRequest != null) | ||
13717 | { | ||
13718 | handlerParcelJoinRequest((int)Math.Round(landJoin.ParcelData.West), | ||
13719 | (int)Math.Round(landJoin.ParcelData.South), | ||
13720 | (int)Math.Round(landJoin.ParcelData.East), | ||
13721 | (int)Math.Round(landJoin.ParcelData.North), this); | ||
13722 | } | ||
13723 | break; | ||
13724 | |||
13725 | case PacketType.ParcelPropertiesUpdate: | ||
13726 | ParcelPropertiesUpdatePacket parcelPropertiesPacket = (ParcelPropertiesUpdatePacket)Pack; | ||
13727 | |||
13728 | #region Packet Session and User Check | ||
13729 | if (m_checkPackets) | ||
13730 | { | ||
13731 | if (parcelPropertiesPacket.AgentData.SessionID != SessionId || | ||
13732 | parcelPropertiesPacket.AgentData.AgentID != AgentId) | ||
13733 | break; | ||
13734 | } | ||
13735 | #endregion | ||
13736 | |||
13737 | ParcelPropertiesUpdateRequest handlerParcelPropertiesUpdateRequest = OnParcelPropertiesUpdateRequest; | ||
13738 | |||
13739 | if (handlerParcelPropertiesUpdateRequest != null) | ||
13740 | { | ||
13741 | LandUpdateArgs args = new LandUpdateArgs(); | ||
13742 | |||
13743 | args.AuthBuyerID = parcelPropertiesPacket.ParcelData.AuthBuyerID; | ||
13744 | args.Category = (ParcelCategory)parcelPropertiesPacket.ParcelData.Category; | ||
13745 | args.Desc = Utils.BytesToString(parcelPropertiesPacket.ParcelData.Desc); | ||
13746 | args.GroupID = parcelPropertiesPacket.ParcelData.GroupID; | ||
13747 | args.LandingType = parcelPropertiesPacket.ParcelData.LandingType; | ||
13748 | args.MediaAutoScale = parcelPropertiesPacket.ParcelData.MediaAutoScale; | ||
13749 | args.MediaID = parcelPropertiesPacket.ParcelData.MediaID; | ||
13750 | args.MediaURL = Utils.BytesToString(parcelPropertiesPacket.ParcelData.MediaURL); | ||
13751 | args.MusicURL = Utils.BytesToString(parcelPropertiesPacket.ParcelData.MusicURL); | ||
13752 | args.Name = Utils.BytesToString(parcelPropertiesPacket.ParcelData.Name); | ||
13753 | args.ParcelFlags = parcelPropertiesPacket.ParcelData.ParcelFlags; | ||
13754 | args.PassHours = parcelPropertiesPacket.ParcelData.PassHours; | ||
13755 | args.PassPrice = parcelPropertiesPacket.ParcelData.PassPrice; | ||
13756 | args.SalePrice = parcelPropertiesPacket.ParcelData.SalePrice; | ||
13757 | args.SnapshotID = parcelPropertiesPacket.ParcelData.SnapshotID; | ||
13758 | args.UserLocation = parcelPropertiesPacket.ParcelData.UserLocation; | ||
13759 | args.UserLookAt = parcelPropertiesPacket.ParcelData.UserLookAt; | ||
13760 | handlerParcelPropertiesUpdateRequest(args, parcelPropertiesPacket.ParcelData.LocalID, this); | ||
13761 | } | ||
13762 | break; | ||
13763 | |||
13764 | case PacketType.ParcelSelectObjects: | ||
13765 | ParcelSelectObjectsPacket selectPacket = (ParcelSelectObjectsPacket)Pack; | ||
13766 | |||
13767 | #region Packet Session and User Check | ||
13768 | if (m_checkPackets) | ||
13769 | { | ||
13770 | if (selectPacket.AgentData.SessionID != SessionId || | ||
13771 | selectPacket.AgentData.AgentID != AgentId) | ||
13772 | break; | ||
13773 | } | ||
13774 | #endregion | ||
13775 | |||
13776 | List<UUID> returnIDs = new List<UUID>(); | ||
13777 | |||
13778 | foreach (ParcelSelectObjectsPacket.ReturnIDsBlock rb in | ||
13779 | selectPacket.ReturnIDs) | ||
13780 | { | ||
13781 | returnIDs.Add(rb.ReturnID); | ||
13782 | } | ||
13783 | |||
13784 | ParcelSelectObjects handlerParcelSelectObjects = OnParcelSelectObjects; | ||
13785 | |||
13786 | if (handlerParcelSelectObjects != null) | ||
13787 | { | ||
13788 | handlerParcelSelectObjects(selectPacket.ParcelData.LocalID, | ||
13789 | Convert.ToInt32(selectPacket.ParcelData.ReturnType), returnIDs, this); | ||
13790 | } | ||
13791 | break; | ||
13792 | |||
13793 | case PacketType.ParcelObjectOwnersRequest: | ||
13794 | //m_log.Debug(Pack.ToString()); | ||
13795 | ParcelObjectOwnersRequestPacket reqPacket = (ParcelObjectOwnersRequestPacket)Pack; | ||
13796 | |||
13797 | #region Packet Session and User Check | ||
13798 | if (m_checkPackets) | ||
13799 | { | ||
13800 | if (reqPacket.AgentData.SessionID != SessionId || | ||
13801 | reqPacket.AgentData.AgentID != AgentId) | ||
13802 | break; | ||
13803 | } | ||
13804 | #endregion | ||
13805 | |||
13806 | ParcelObjectOwnerRequest handlerParcelObjectOwnerRequest = OnParcelObjectOwnerRequest; | ||
13807 | |||
13808 | if (handlerParcelObjectOwnerRequest != null) | ||
13809 | { | ||
13810 | handlerParcelObjectOwnerRequest(reqPacket.ParcelData.LocalID, this); | ||
13811 | } | ||
13812 | break; | ||
13813 | |||
13814 | case PacketType.ParcelGodForceOwner: | ||
13815 | ParcelGodForceOwnerPacket godForceOwnerPacket = (ParcelGodForceOwnerPacket)Pack; | ||
13816 | |||
13817 | #region Packet Session and User Check | ||
13818 | if (m_checkPackets) | ||
13819 | { | ||
13820 | if (godForceOwnerPacket.AgentData.SessionID != SessionId || | ||
13821 | godForceOwnerPacket.AgentData.AgentID != AgentId) | ||
13822 | break; | ||
13823 | } | ||
13824 | #endregion | ||
13825 | |||
13826 | ParcelGodForceOwner handlerParcelGodForceOwner = OnParcelGodForceOwner; | ||
13827 | if (handlerParcelGodForceOwner != null) | ||
13828 | { | ||
13829 | handlerParcelGodForceOwner(godForceOwnerPacket.Data.LocalID, godForceOwnerPacket.Data.OwnerID, this); | ||
13830 | } | ||
13831 | break; | ||
13832 | |||
13833 | case PacketType.ParcelRelease: | ||
13834 | ParcelReleasePacket releasePacket = (ParcelReleasePacket)Pack; | ||
13835 | |||
13836 | #region Packet Session and User Check | ||
13837 | if (m_checkPackets) | ||
13838 | { | ||
13839 | if (releasePacket.AgentData.SessionID != SessionId || | ||
13840 | releasePacket.AgentData.AgentID != AgentId) | ||
13841 | break; | ||
13842 | } | ||
13843 | #endregion | ||
13844 | |||
13845 | ParcelAbandonRequest handlerParcelAbandonRequest = OnParcelAbandonRequest; | ||
13846 | if (handlerParcelAbandonRequest != null) | ||
13847 | { | ||
13848 | handlerParcelAbandonRequest(releasePacket.Data.LocalID, this); | ||
13849 | } | ||
13850 | break; | ||
13851 | |||
13852 | case PacketType.ParcelReclaim: | ||
13853 | ParcelReclaimPacket reclaimPacket = (ParcelReclaimPacket)Pack; | ||
13854 | |||
13855 | #region Packet Session and User Check | ||
13856 | if (m_checkPackets) | ||
13857 | { | ||
13858 | if (reclaimPacket.AgentData.SessionID != SessionId || | ||
13859 | reclaimPacket.AgentData.AgentID != AgentId) | ||
13860 | break; | ||
13861 | } | ||
13862 | #endregion | ||
13863 | |||
13864 | ParcelReclaim handlerParcelReclaim = OnParcelReclaim; | ||
13865 | if (handlerParcelReclaim != null) | ||
13866 | { | ||
13867 | handlerParcelReclaim(reclaimPacket.Data.LocalID, this); | ||
13868 | } | ||
13869 | break; | ||
13870 | |||
13871 | case PacketType.ParcelReturnObjects: | ||
13872 | |||
13873 | |||
13874 | ParcelReturnObjectsPacket parcelReturnObjects = (ParcelReturnObjectsPacket)Pack; | ||
13875 | |||
13876 | #region Packet Session and User Check | ||
13877 | if (m_checkPackets) | ||
13878 | { | ||
13879 | if (parcelReturnObjects.AgentData.SessionID != SessionId || | ||
13880 | parcelReturnObjects.AgentData.AgentID != AgentId) | ||
13881 | break; | ||
13882 | } | ||
13883 | #endregion | ||
13884 | |||
13885 | UUID[] puserselectedOwnerIDs = new UUID[parcelReturnObjects.OwnerIDs.Length]; | ||
13886 | for (int parceliterator = 0; parceliterator < parcelReturnObjects.OwnerIDs.Length; parceliterator++) | ||
13887 | puserselectedOwnerIDs[parceliterator] = parcelReturnObjects.OwnerIDs[parceliterator].OwnerID; | ||
13888 | |||
13889 | UUID[] puserselectedTaskIDs = new UUID[parcelReturnObjects.TaskIDs.Length]; | ||
13890 | |||
13891 | for (int parceliterator = 0; parceliterator < parcelReturnObjects.TaskIDs.Length; parceliterator++) | ||
13892 | puserselectedTaskIDs[parceliterator] = parcelReturnObjects.TaskIDs[parceliterator].TaskID; | ||
13893 | |||
13894 | ParcelReturnObjectsRequest handlerParcelReturnObjectsRequest = OnParcelReturnObjectsRequest; | ||
13895 | if (handlerParcelReturnObjectsRequest != null) | ||
13896 | { | ||
13897 | handlerParcelReturnObjectsRequest(parcelReturnObjects.ParcelData.LocalID, parcelReturnObjects.ParcelData.ReturnType, puserselectedOwnerIDs, puserselectedTaskIDs, this); | ||
13898 | |||
13899 | } | ||
13900 | break; | ||
13901 | |||
13902 | case PacketType.ParcelSetOtherCleanTime: | ||
13903 | ParcelSetOtherCleanTimePacket parcelSetOtherCleanTimePacket = (ParcelSetOtherCleanTimePacket)Pack; | ||
13904 | |||
13905 | #region Packet Session and User Check | ||
13906 | if (m_checkPackets) | ||
13907 | { | ||
13908 | if (parcelSetOtherCleanTimePacket.AgentData.SessionID != SessionId || | ||
13909 | parcelSetOtherCleanTimePacket.AgentData.AgentID != AgentId) | ||
13910 | break; | ||
13911 | } | ||
13912 | #endregion | ||
13913 | |||
13914 | ParcelSetOtherCleanTime handlerParcelSetOtherCleanTime = OnParcelSetOtherCleanTime; | ||
13915 | if (handlerParcelSetOtherCleanTime != null) | ||
13916 | { | ||
13917 | handlerParcelSetOtherCleanTime(this, | ||
13918 | parcelSetOtherCleanTimePacket.ParcelData.LocalID, | ||
13919 | parcelSetOtherCleanTimePacket.ParcelData.OtherCleanTime); | ||
13920 | } | ||
13921 | break; | ||
13922 | |||
13923 | case PacketType.LandStatRequest: | ||
13924 | LandStatRequestPacket lsrp = (LandStatRequestPacket)Pack; | ||
13925 | |||
13926 | #region Packet Session and User Check | ||
13927 | if (m_checkPackets) | ||
13928 | { | ||
13929 | if (lsrp.AgentData.SessionID != SessionId || | ||
13930 | lsrp.AgentData.AgentID != AgentId) | ||
13931 | break; | ||
13932 | } | ||
13933 | #endregion | ||
13934 | |||
13935 | GodLandStatRequest handlerLandStatRequest = OnLandStatRequest; | ||
13936 | if (handlerLandStatRequest != null) | ||
13937 | { | ||
13938 | handlerLandStatRequest(lsrp.RequestData.ParcelLocalID, lsrp.RequestData.ReportType, lsrp.RequestData.RequestFlags, Utils.BytesToString(lsrp.RequestData.Filter), this); | ||
13939 | } | ||
13940 | break; | ||
13941 | |||
13942 | case PacketType.ParcelDwellRequest: | ||
13943 | ParcelDwellRequestPacket dwellrq = | ||
13944 | (ParcelDwellRequestPacket)Pack; | ||
13945 | |||
13946 | #region Packet Session and User Check | ||
13947 | if (m_checkPackets) | ||
13948 | { | ||
13949 | if (dwellrq.AgentData.SessionID != SessionId || | ||
13950 | dwellrq.AgentData.AgentID != AgentId) | ||
13951 | break; | ||
13952 | } | ||
13953 | #endregion | ||
13954 | |||
13955 | ParcelDwellRequest handlerParcelDwellRequest = OnParcelDwellRequest; | ||
13956 | if (handlerParcelDwellRequest != null) | ||
13957 | { | ||
13958 | handlerParcelDwellRequest(dwellrq.Data.LocalID, this); | ||
13959 | } | ||
13960 | break; | ||
13961 | |||
13962 | //#endregion | ||
13963 | |||
13964 | //#region Estate Packets | ||
13965 | |||
13966 | case PacketType.EstateOwnerMessage: | ||
13967 | EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack; | ||
13968 | //m_log.Debug(messagePacket.ToString()); | ||
13969 | |||
13970 | #region Packet Session and User Check | ||
13971 | if (m_checkPackets) | ||
13972 | { | ||
13973 | if (messagePacket.AgentData.SessionID != SessionId || | ||
13974 | messagePacket.AgentData.AgentID != AgentId) | ||
13975 | break; | ||
13976 | } | ||
13977 | #endregion | ||
13978 | |||
13979 | switch (Utils.BytesToString(messagePacket.MethodData.Method)) | ||
13980 | { | ||
13981 | case "getinfo": | ||
13982 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
13983 | { | ||
13984 | OnDetailedEstateDataRequest(this, messagePacket.MethodData.Invoice); | ||
13985 | } | ||
13986 | break; | ||
13987 | case "setregioninfo": | ||
13988 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
13989 | { | ||
13990 | OnSetEstateFlagsRequest(convertParamStringToBool(messagePacket.ParamList[0].Parameter), convertParamStringToBool(messagePacket.ParamList[1].Parameter), | ||
13991 | convertParamStringToBool(messagePacket.ParamList[2].Parameter), !convertParamStringToBool(messagePacket.ParamList[3].Parameter), | ||
13992 | Convert.ToInt16(Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[4].Parameter), Culture.NumberFormatInfo)), | ||
13993 | (float)Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[5].Parameter), Culture.NumberFormatInfo), | ||
13994 | Convert.ToInt16(Utils.BytesToString(messagePacket.ParamList[6].Parameter)), | ||
13995 | convertParamStringToBool(messagePacket.ParamList[7].Parameter), convertParamStringToBool(messagePacket.ParamList[8].Parameter)); | ||
13996 | } | ||
13997 | break; | ||
13998 | // case "texturebase": | ||
13999 | // if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14000 | // { | ||
14001 | // foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) | ||
14002 | // { | ||
14003 | // string s = Utils.BytesToString(block.Parameter); | ||
14004 | // string[] splitField = s.Split(' '); | ||
14005 | // if (splitField.Length == 2) | ||
14006 | // { | ||
14007 | // UUID tempUUID = new UUID(splitField[1]); | ||
14008 | // OnSetEstateTerrainBaseTexture(this, Convert.ToInt16(splitField[0]), tempUUID); | ||
14009 | // } | ||
14010 | // } | ||
14011 | // } | ||
14012 | // break; | ||
14013 | case "texturedetail": | ||
14014 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14015 | { | ||
14016 | foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) | ||
14017 | { | ||
14018 | string s = Utils.BytesToString(block.Parameter); | ||
14019 | string[] splitField = s.Split(' '); | ||
14020 | if (splitField.Length == 2) | ||
14021 | { | ||
14022 | Int16 corner = Convert.ToInt16(splitField[0]); | ||
14023 | UUID textureUUID = new UUID(splitField[1]); | ||
14024 | |||
14025 | OnSetEstateTerrainDetailTexture(this, corner, textureUUID); | ||
14026 | } | ||
14027 | } | ||
14028 | } | ||
14029 | |||
14030 | break; | ||
14031 | case "textureheights": | ||
14032 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14033 | { | ||
14034 | foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) | ||
14035 | { | ||
14036 | string s = Utils.BytesToString(block.Parameter); | ||
14037 | string[] splitField = s.Split(' '); | ||
14038 | if (splitField.Length == 3) | ||
14039 | { | ||
14040 | Int16 corner = Convert.ToInt16(splitField[0]); | ||
14041 | float lowValue = (float)Convert.ToDecimal(splitField[1], Culture.NumberFormatInfo); | ||
14042 | float highValue = (float)Convert.ToDecimal(splitField[2], Culture.NumberFormatInfo); | ||
14043 | |||
14044 | OnSetEstateTerrainTextureHeights(this, corner, lowValue, highValue); | ||
14045 | } | ||
14046 | } | ||
14047 | } | ||
14048 | break; | ||
14049 | case "texturecommit": | ||
14050 | OnCommitEstateTerrainTextureRequest(this); | ||
14051 | break; | ||
14052 | case "setregionterrain": | ||
14053 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14054 | { | ||
14055 | if (messagePacket.ParamList.Length != 9) | ||
14056 | { | ||
14057 | m_log.Error("EstateOwnerMessage: SetRegionTerrain method has a ParamList of invalid length"); | ||
14058 | } | ||
14059 | else | ||
14060 | { | ||
14061 | try | ||
14062 | { | ||
14063 | string tmp = Utils.BytesToString(messagePacket.ParamList[0].Parameter); | ||
14064 | if (!tmp.Contains(".")) tmp += ".00"; | ||
14065 | float WaterHeight = (float)Convert.ToDecimal(tmp, Culture.NumberFormatInfo); | ||
14066 | tmp = Utils.BytesToString(messagePacket.ParamList[1].Parameter); | ||
14067 | if (!tmp.Contains(".")) tmp += ".00"; | ||
14068 | float TerrainRaiseLimit = (float)Convert.ToDecimal(tmp, Culture.NumberFormatInfo); | ||
14069 | tmp = Utils.BytesToString(messagePacket.ParamList[2].Parameter); | ||
14070 | if (!tmp.Contains(".")) tmp += ".00"; | ||
14071 | float TerrainLowerLimit = (float)Convert.ToDecimal(tmp, Culture.NumberFormatInfo); | ||
14072 | bool UseEstateSun = convertParamStringToBool(messagePacket.ParamList[3].Parameter); | ||
14073 | bool UseFixedSun = convertParamStringToBool(messagePacket.ParamList[4].Parameter); | ||
14074 | float SunHour = (float)Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[5].Parameter), Culture.NumberFormatInfo); | ||
14075 | bool UseGlobal = convertParamStringToBool(messagePacket.ParamList[6].Parameter); | ||
14076 | bool EstateFixedSun = convertParamStringToBool(messagePacket.ParamList[7].Parameter); | ||
14077 | float EstateSunHour = (float)Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[8].Parameter), Culture.NumberFormatInfo); | ||
14078 | |||
14079 | OnSetRegionTerrainSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseEstateSun, UseFixedSun, SunHour, UseGlobal, EstateFixedSun, EstateSunHour); | ||
14080 | |||
14081 | } | ||
14082 | catch (Exception ex) | ||
14083 | { | ||
14084 | m_log.Error("EstateOwnerMessage: Exception while setting terrain settings: \n" + messagePacket + "\n" + ex); | ||
14085 | } | ||
14086 | } | ||
14087 | } | ||
14088 | |||
14089 | break; | ||
14090 | case "restart": | ||
14091 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14092 | { | ||
14093 | // There's only 1 block in the estateResetSim.. and that's the number of seconds till restart. | ||
14094 | foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) | ||
14095 | { | ||
14096 | float timeSeconds; | ||
14097 | Utils.TryParseSingle(Utils.BytesToString(block.Parameter), out timeSeconds); | ||
14098 | timeSeconds = (int)timeSeconds; | ||
14099 | OnEstateRestartSimRequest(this, (int)timeSeconds); | ||
14100 | |||
14101 | } | ||
14102 | } | ||
14103 | break; | ||
14104 | case "estatechangecovenantid": | ||
14105 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14106 | { | ||
14107 | foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) | ||
14108 | { | ||
14109 | UUID newCovenantID = new UUID(Utils.BytesToString(block.Parameter)); | ||
14110 | OnEstateChangeCovenantRequest(this, newCovenantID); | ||
14111 | } | ||
14112 | } | ||
14113 | break; | ||
14114 | case "estateaccessdelta": // Estate access delta manages the banlist and allow list too. | ||
14115 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14116 | { | ||
14117 | int estateAccessType = Convert.ToInt16(Utils.BytesToString(messagePacket.ParamList[1].Parameter)); | ||
14118 | OnUpdateEstateAccessDeltaRequest(this, messagePacket.MethodData.Invoice, estateAccessType, new UUID(Utils.BytesToString(messagePacket.ParamList[2].Parameter))); | ||
14119 | |||
14120 | } | ||
14121 | break; | ||
14122 | case "simulatormessage": | ||
14123 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14124 | { | ||
14125 | UUID invoice = messagePacket.MethodData.Invoice; | ||
14126 | UUID SenderID = new UUID(Utils.BytesToString(messagePacket.ParamList[2].Parameter)); | ||
14127 | string SenderName = Utils.BytesToString(messagePacket.ParamList[3].Parameter); | ||
14128 | string Message = Utils.BytesToString(messagePacket.ParamList[4].Parameter); | ||
14129 | UUID sessionID = messagePacket.AgentData.SessionID; | ||
14130 | OnSimulatorBlueBoxMessageRequest(this, invoice, SenderID, sessionID, SenderName, Message); | ||
14131 | } | ||
14132 | break; | ||
14133 | case "instantmessage": | ||
14134 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14135 | { | ||
14136 | if (messagePacket.ParamList.Length < 5) | ||
14137 | break; | ||
14138 | UUID invoice = messagePacket.MethodData.Invoice; | ||
14139 | UUID SenderID = new UUID(Utils.BytesToString(messagePacket.ParamList[2].Parameter)); | ||
14140 | string SenderName = Utils.BytesToString(messagePacket.ParamList[3].Parameter); | ||
14141 | string Message = Utils.BytesToString(messagePacket.ParamList[4].Parameter); | ||
14142 | UUID sessionID = messagePacket.AgentData.SessionID; | ||
14143 | OnEstateBlueBoxMessageRequest(this, invoice, SenderID, sessionID, SenderName, Message); | ||
14144 | } | ||
14145 | break; | ||
14146 | case "setregiondebug": | ||
14147 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14148 | { | ||
14149 | UUID invoice = messagePacket.MethodData.Invoice; | ||
14150 | UUID SenderID = messagePacket.AgentData.AgentID; | ||
14151 | bool scripted = convertParamStringToBool(messagePacket.ParamList[0].Parameter); | ||
14152 | bool collisionEvents = convertParamStringToBool(messagePacket.ParamList[1].Parameter); | ||
14153 | bool physics = convertParamStringToBool(messagePacket.ParamList[2].Parameter); | ||
14154 | |||
14155 | OnEstateDebugRegionRequest(this, invoice, SenderID, scripted, collisionEvents, physics); | ||
14156 | } | ||
14157 | break; | ||
14158 | case "teleporthomeuser": | ||
14159 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14160 | { | ||
14161 | UUID invoice = messagePacket.MethodData.Invoice; | ||
14162 | UUID SenderID = messagePacket.AgentData.AgentID; | ||
14163 | UUID Prey; | ||
14164 | |||
14165 | UUID.TryParse(Utils.BytesToString(messagePacket.ParamList[1].Parameter), out Prey); | ||
14166 | |||
14167 | OnEstateTeleportOneUserHomeRequest(this, invoice, SenderID, Prey); | ||
14168 | } | ||
14169 | break; | ||
14170 | case "teleporthomeallusers": | ||
14171 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14172 | { | ||
14173 | UUID invoice = messagePacket.MethodData.Invoice; | ||
14174 | UUID SenderID = messagePacket.AgentData.AgentID; | ||
14175 | OnEstateTeleportAllUsersHomeRequest(this, invoice, SenderID); | ||
14176 | } | ||
14177 | break; | ||
14178 | case "colliders": | ||
14179 | handlerLandStatRequest = OnLandStatRequest; | ||
14180 | if (handlerLandStatRequest != null) | ||
14181 | { | ||
14182 | handlerLandStatRequest(0, 1, 0, "", this); | ||
14183 | } | ||
14184 | break; | ||
14185 | case "scripts": | ||
14186 | handlerLandStatRequest = OnLandStatRequest; | ||
14187 | if (handlerLandStatRequest != null) | ||
14188 | { | ||
14189 | handlerLandStatRequest(0, 0, 0, "", this); | ||
14190 | } | ||
14191 | break; | ||
14192 | case "terrain": | ||
14193 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14194 | { | ||
14195 | if (messagePacket.ParamList.Length > 0) | ||
14196 | { | ||
14197 | if (Utils.BytesToString(messagePacket.ParamList[0].Parameter) == "bake") | ||
14198 | { | ||
14199 | BakeTerrain handlerBakeTerrain = OnBakeTerrain; | ||
14200 | if (handlerBakeTerrain != null) | ||
14201 | { | ||
14202 | handlerBakeTerrain(this); | ||
14203 | } | ||
14204 | } | ||
14205 | if (Utils.BytesToString(messagePacket.ParamList[0].Parameter) == "download filename") | ||
14206 | { | ||
14207 | if (messagePacket.ParamList.Length > 1) | ||
14208 | { | ||
14209 | RequestTerrain handlerRequestTerrain = OnRequestTerrain; | ||
14210 | if (handlerRequestTerrain != null) | ||
14211 | { | ||
14212 | handlerRequestTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter)); | ||
14213 | } | ||
14214 | } | ||
14215 | } | ||
14216 | if (Utils.BytesToString(messagePacket.ParamList[0].Parameter) == "upload filename") | ||
14217 | { | ||
14218 | if (messagePacket.ParamList.Length > 1) | ||
14219 | { | ||
14220 | RequestTerrain handlerUploadTerrain = OnUploadTerrain; | ||
14221 | if (handlerUploadTerrain != null) | ||
14222 | { | ||
14223 | handlerUploadTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter)); | ||
14224 | } | ||
14225 | } | ||
14226 | } | ||
14227 | |||
14228 | } | ||
14229 | |||
14230 | |||
14231 | } | ||
14232 | break; | ||
14233 | |||
14234 | case "estatechangeinfo": | ||
14235 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
14236 | { | ||
14237 | UUID invoice = messagePacket.MethodData.Invoice; | ||
14238 | UUID SenderID = messagePacket.AgentData.AgentID; | ||
14239 | UInt32 param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter)); | ||
14240 | UInt32 param2 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[2].Parameter)); | ||
14241 | |||
14242 | EstateChangeInfo handlerEstateChangeInfo = OnEstateChangeInfo; | ||
14243 | if (handlerEstateChangeInfo != null) | ||
14244 | { | ||
14245 | handlerEstateChangeInfo(this, invoice, SenderID, param1, param2); | ||
14246 | } | ||
14247 | } | ||
14248 | break; | ||
14249 | |||
14250 | default: | ||
14251 | m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket); | ||
14252 | break; | ||
14253 | } | ||
14254 | |||
14255 | //int parcelID, uint reportType, uint requestflags, string filter | ||
14256 | |||
14257 | //lsrp.RequestData.ParcelLocalID; | ||
14258 | //lsrp.RequestData.ReportType; // 1 = colliders, 0 = scripts | ||
14259 | //lsrp.RequestData.RequestFlags; | ||
14260 | //lsrp.RequestData.Filter; | ||
14261 | |||
14262 | break; | ||
14263 | |||
14264 | case PacketType.RequestRegionInfo: | ||
14265 | RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket)Pack).AgentData; | ||
14266 | |||
14267 | #region Packet Session and User Check | ||
14268 | if (m_checkPackets) | ||
14269 | { | ||
14270 | if (mPacket.SessionID != SessionId || | ||
14271 | mPacket.AgentID != AgentId) | ||
14272 | break; | ||
14273 | } | ||
14274 | #endregion | ||
14275 | |||
14276 | RegionInfoRequest handlerRegionInfoRequest = OnRegionInfoRequest; | ||
14277 | if (handlerRegionInfoRequest != null) | ||
14278 | { | ||
14279 | handlerRegionInfoRequest(this); | ||
14280 | } | ||
14281 | break; | ||
14282 | |||
14283 | case PacketType.EstateCovenantRequest: | ||
14284 | |||
14285 | //EstateCovenantRequestPacket.AgentDataBlock epack = | ||
14286 | // ((EstateCovenantRequestPacket)Pack).AgentData; | ||
14287 | |||
14288 | EstateCovenantRequest handlerEstateCovenantRequest = OnEstateCovenantRequest; | ||
14289 | if (handlerEstateCovenantRequest != null) | ||
14290 | { | ||
14291 | handlerEstateCovenantRequest(this); | ||
14292 | } | ||
14293 | break; | ||
14294 | |||
14295 | //#endregion | ||
14296 | |||
14297 | //#region GodPackets | ||
14298 | |||
14299 | case PacketType.RequestGodlikePowers: | ||
14300 | RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket)Pack; | ||
14301 | RequestGodlikePowersPacket.RequestBlockBlock rblock = rglpPack.RequestBlock; | ||
14302 | UUID token = rblock.Token; | ||
14303 | |||
14304 | RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData; | ||
14305 | |||
14306 | RequestGodlikePowers handlerReqGodlikePowers = OnRequestGodlikePowers; | ||
14307 | |||
14308 | if (handlerReqGodlikePowers != null) | ||
14309 | { | ||
14310 | handlerReqGodlikePowers(ablock.AgentID, ablock.SessionID, token, rblock.Godlike, this); | ||
14311 | } | ||
14312 | |||
14313 | break; | ||
14314 | |||
14315 | case PacketType.GodKickUser: | ||
14316 | GodKickUserPacket gkupack = (GodKickUserPacket)Pack; | ||
14317 | |||
14318 | if (gkupack.UserInfo.GodSessionID == SessionId && AgentId == gkupack.UserInfo.GodID) | ||
14319 | { | ||
14320 | GodKickUser handlerGodKickUser = OnGodKickUser; | ||
14321 | if (handlerGodKickUser != null) | ||
14322 | { | ||
14323 | handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, | ||
14324 | gkupack.UserInfo.AgentID, gkupack.UserInfo.KickFlags, gkupack.UserInfo.Reason,gkupack.UserInfo); | ||
14325 | } | ||
14326 | } | ||
14327 | else | ||
14328 | { | ||
14329 | SendAgentAlertMessage("Kick request denied", false); | ||
14330 | } | ||
14331 | //KickUserPacket kupack = new KickUserPacket(); | ||
14332 | //KickUserPacket.UserInfoBlock kupackib = kupack.UserInfo; | ||
14333 | |||
14334 | //kupack.UserInfo.AgentID = gkupack.UserInfo.AgentID; | ||
14335 | //kupack.UserInfo.SessionID = gkupack.UserInfo.GodSessionID; | ||
14336 | |||
14337 | //kupack.TargetBlock.TargetIP = (uint)0; | ||
14338 | //kupack.TargetBlock.TargetPort = (ushort)0; | ||
14339 | //kupack.UserInfo.Reason = gkupack.UserInfo.Reason; | ||
14340 | |||
14341 | //OutPacket(kupack, ThrottleOutPacketType.Task); | ||
14342 | break; | ||
14343 | |||
14344 | //#endregion | ||
14345 | |||
14346 | //#region Economy/Transaction Packets | ||
14347 | |||
14348 | case PacketType.MoneyBalanceRequest: | ||
14349 | MoneyBalanceRequestPacket moneybalancerequestpacket = (MoneyBalanceRequestPacket)Pack; | ||
14350 | |||
14351 | #region Packet Session and User Check | ||
14352 | if (m_checkPackets) | ||
14353 | { | ||
14354 | if (moneybalancerequestpacket.AgentData.SessionID != SessionId || | ||
14355 | moneybalancerequestpacket.AgentData.AgentID != AgentId) | ||
14356 | break; | ||
14357 | } | ||
14358 | #endregion | ||
14359 | |||
14360 | MoneyBalanceRequest handlerMoneyBalanceRequest = OnMoneyBalanceRequest; | ||
14361 | |||
14362 | if (handlerMoneyBalanceRequest != null) | ||
14363 | { | ||
14364 | handlerMoneyBalanceRequest(this, moneybalancerequestpacket.AgentData.AgentID, moneybalancerequestpacket.AgentData.SessionID, moneybalancerequestpacket.MoneyData.TransactionID); | ||
14365 | } | ||
14366 | |||
14367 | break; | ||
14368 | |||
14369 | case PacketType.EconomyDataRequest: | ||
14370 | |||
14371 | |||
14372 | EconomyDataRequest handlerEconomoyDataRequest = OnEconomyDataRequest; | ||
14373 | if (handlerEconomoyDataRequest != null) | ||
14374 | { | ||
14375 | handlerEconomoyDataRequest(AgentId); | ||
14376 | } | ||
14377 | break; | ||
14378 | |||
14379 | case PacketType.RequestPayPrice: | ||
14380 | RequestPayPricePacket requestPayPricePacket = (RequestPayPricePacket)Pack; | ||
14381 | |||
14382 | RequestPayPrice handlerRequestPayPrice = OnRequestPayPrice; | ||
14383 | if (handlerRequestPayPrice != null) | ||
14384 | { | ||
14385 | handlerRequestPayPrice(this, requestPayPricePacket.ObjectData.ObjectID); | ||
14386 | } | ||
14387 | break; | ||
14388 | |||
14389 | case PacketType.ObjectSaleInfo: | ||
14390 | ObjectSaleInfoPacket objectSaleInfoPacket = (ObjectSaleInfoPacket)Pack; | ||
14391 | |||
14392 | #region Packet Session and User Check | ||
14393 | if (m_checkPackets) | ||
14394 | { | ||
14395 | if (objectSaleInfoPacket.AgentData.SessionID != SessionId || | ||
14396 | objectSaleInfoPacket.AgentData.AgentID != AgentId) | ||
14397 | break; | ||
14398 | } | ||
14399 | #endregion | ||
14400 | |||
14401 | ObjectSaleInfo handlerObjectSaleInfo = OnObjectSaleInfo; | ||
14402 | if (handlerObjectSaleInfo != null) | ||
14403 | { | ||
14404 | foreach (ObjectSaleInfoPacket.ObjectDataBlock d | ||
14405 | in objectSaleInfoPacket.ObjectData) | ||
14406 | { | ||
14407 | handlerObjectSaleInfo(this, | ||
14408 | objectSaleInfoPacket.AgentData.AgentID, | ||
14409 | objectSaleInfoPacket.AgentData.SessionID, | ||
14410 | d.LocalID, | ||
14411 | d.SaleType, | ||
14412 | d.SalePrice); | ||
14413 | } | ||
14414 | } | ||
14415 | break; | ||
14416 | |||
14417 | case PacketType.ObjectBuy: | ||
14418 | ObjectBuyPacket objectBuyPacket = (ObjectBuyPacket)Pack; | ||
14419 | |||
14420 | #region Packet Session and User Check | ||
14421 | if (m_checkPackets) | ||
14422 | { | ||
14423 | if (objectBuyPacket.AgentData.SessionID != SessionId || | ||
14424 | objectBuyPacket.AgentData.AgentID != AgentId) | ||
14425 | break; | ||
14426 | } | ||
14427 | #endregion | ||
14428 | |||
14429 | ObjectBuy handlerObjectBuy = OnObjectBuy; | ||
14430 | |||
14431 | if (handlerObjectBuy != null) | ||
14432 | { | ||
14433 | foreach (ObjectBuyPacket.ObjectDataBlock d | ||
14434 | in objectBuyPacket.ObjectData) | ||
14435 | { | ||
14436 | handlerObjectBuy(this, | ||
14437 | objectBuyPacket.AgentData.AgentID, | ||
14438 | objectBuyPacket.AgentData.SessionID, | ||
14439 | objectBuyPacket.AgentData.GroupID, | ||
14440 | objectBuyPacket.AgentData.CategoryID, | ||
14441 | d.ObjectLocalID, | ||
14442 | d.SaleType, | ||
14443 | d.SalePrice); | ||
14444 | } | ||
14445 | } | ||
14446 | break; | ||
14447 | |||
14448 | //#endregion | ||
14449 | |||
14450 | //#region Script Packets | ||
14451 | |||
14452 | case PacketType.GetScriptRunning: | ||
14453 | GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack; | ||
14454 | |||
14455 | GetScriptRunning handlerGetScriptRunning = OnGetScriptRunning; | ||
14456 | if (handlerGetScriptRunning != null) | ||
14457 | { | ||
14458 | handlerGetScriptRunning(this, scriptRunning.Script.ObjectID, scriptRunning.Script.ItemID); | ||
14459 | } | ||
14460 | break; | ||
14461 | |||
14462 | case PacketType.SetScriptRunning: | ||
14463 | SetScriptRunningPacket setScriptRunning = (SetScriptRunningPacket)Pack; | ||
14464 | |||
14465 | #region Packet Session and User Check | ||
14466 | if (m_checkPackets) | ||
14467 | { | ||
14468 | if (setScriptRunning.AgentData.SessionID != SessionId || | ||
14469 | setScriptRunning.AgentData.AgentID != AgentId) | ||
14470 | break; | ||
14471 | } | ||
14472 | #endregion | ||
14473 | |||
14474 | SetScriptRunning handlerSetScriptRunning = OnSetScriptRunning; | ||
14475 | if (handlerSetScriptRunning != null) | ||
14476 | { | ||
14477 | handlerSetScriptRunning(this, setScriptRunning.Script.ObjectID, setScriptRunning.Script.ItemID, setScriptRunning.Script.Running); | ||
14478 | } | ||
14479 | break; | ||
14480 | |||
14481 | case PacketType.ScriptReset: | ||
14482 | ScriptResetPacket scriptResetPacket = (ScriptResetPacket)Pack; | ||
14483 | |||
14484 | #region Packet Session and User Check | ||
14485 | if (m_checkPackets) | ||
14486 | { | ||
14487 | if (scriptResetPacket.AgentData.SessionID != SessionId || | ||
14488 | scriptResetPacket.AgentData.AgentID != AgentId) | ||
14489 | break; | ||
14490 | } | ||
14491 | #endregion | ||
14492 | |||
14493 | ScriptReset handlerScriptReset = OnScriptReset; | ||
14494 | if (handlerScriptReset != null) | ||
14495 | { | ||
14496 | handlerScriptReset(this, scriptResetPacket.Script.ObjectID, scriptResetPacket.Script.ItemID); | ||
14497 | } | ||
14498 | break; | ||
14499 | |||
14500 | //#endregion | ||
14501 | |||
14502 | //#region Gesture Managment | ||
14503 | |||
14504 | case PacketType.ActivateGestures: | ||
14505 | ActivateGesturesPacket activateGesturePacket = (ActivateGesturesPacket)Pack; | ||
14506 | |||
14507 | #region Packet Session and User Check | ||
14508 | if (m_checkPackets) | ||
14509 | { | ||
14510 | if (activateGesturePacket.AgentData.SessionID != SessionId || | ||
14511 | activateGesturePacket.AgentData.AgentID != AgentId) | ||
14512 | break; | ||
14513 | } | ||
14514 | #endregion | ||
14515 | |||
14516 | ActivateGesture handlerActivateGesture = OnActivateGesture; | ||
14517 | if (handlerActivateGesture != null) | ||
14518 | { | ||
14519 | handlerActivateGesture(this, | ||
14520 | activateGesturePacket.Data[0].AssetID, | ||
14521 | activateGesturePacket.Data[0].ItemID); | ||
14522 | } | ||
14523 | else m_log.Error("Null pointer for activateGesture"); | ||
14524 | |||
14525 | break; | ||
14526 | |||
14527 | case PacketType.DeactivateGestures: | ||
14528 | DeactivateGesturesPacket deactivateGesturePacket = (DeactivateGesturesPacket)Pack; | ||
14529 | |||
14530 | #region Packet Session and User Check | ||
14531 | if (m_checkPackets) | ||
14532 | { | ||
14533 | if (deactivateGesturePacket.AgentData.SessionID != SessionId || | ||
14534 | deactivateGesturePacket.AgentData.AgentID != AgentId) | ||
14535 | break; | ||
14536 | } | ||
14537 | #endregion | ||
14538 | |||
14539 | DeactivateGesture handlerDeactivateGesture = OnDeactivateGesture; | ||
14540 | if (handlerDeactivateGesture != null) | ||
14541 | { | ||
14542 | handlerDeactivateGesture(this, deactivateGesturePacket.Data[0].ItemID); | ||
14543 | } | ||
14544 | break; | ||
14545 | case PacketType.ObjectOwner: | ||
14546 | ObjectOwnerPacket objectOwnerPacket = (ObjectOwnerPacket)Pack; | ||
14547 | |||
14548 | #region Packet Session and User Check | ||
14549 | if (m_checkPackets) | ||
14550 | { | ||
14551 | if (objectOwnerPacket.AgentData.SessionID != SessionId || | ||
14552 | objectOwnerPacket.AgentData.AgentID != AgentId) | ||
14553 | break; | ||
14554 | } | ||
14555 | #endregion | ||
14556 | |||
14557 | List<uint> localIDs = new List<uint>(); | ||
14558 | |||
14559 | foreach (ObjectOwnerPacket.ObjectDataBlock d in objectOwnerPacket.ObjectData) | ||
14560 | localIDs.Add(d.ObjectLocalID); | ||
14561 | |||
14562 | ObjectOwner handlerObjectOwner = OnObjectOwner; | ||
14563 | if (handlerObjectOwner != null) | ||
14564 | { | ||
14565 | handlerObjectOwner(this, objectOwnerPacket.HeaderData.OwnerID, objectOwnerPacket.HeaderData.GroupID, localIDs); | ||
14566 | } | ||
14567 | break; | ||
14568 | |||
14569 | //#endregion | ||
14570 | |||
14571 | case PacketType.AgentFOV: | ||
14572 | AgentFOVPacket fovPacket = (AgentFOVPacket)Pack; | ||
14573 | |||
14574 | if (fovPacket.FOVBlock.GenCounter > m_agentFOVCounter) | ||
14575 | { | ||
14576 | m_agentFOVCounter = fovPacket.FOVBlock.GenCounter; | ||
14577 | AgentFOV handlerAgentFOV = OnAgentFOV; | ||
14578 | if (handlerAgentFOV != null) | ||
14579 | { | ||
14580 | handlerAgentFOV(this, fovPacket.FOVBlock.VerticalAngle); | ||
14581 | } | ||
14582 | } | ||
14583 | break; | ||
14584 | |||
14585 | //#region unimplemented handlers | ||
14586 | |||
14587 | case PacketType.ViewerStats: | ||
14588 | // TODO: handle this packet | ||
14589 | //m_log.Warn("[CLIENT]: unhandled ViewerStats packet"); | ||
14590 | break; | ||
14591 | |||
14592 | case PacketType.MapItemRequest: | ||
14593 | MapItemRequestPacket mirpk = (MapItemRequestPacket)Pack; | ||
14594 | |||
14595 | #region Packet Session and User Check | ||
14596 | if (m_checkPackets) | ||
14597 | { | ||
14598 | if (mirpk.AgentData.SessionID != SessionId || | ||
14599 | mirpk.AgentData.AgentID != AgentId) | ||
14600 | break; | ||
14601 | } | ||
14602 | #endregion | ||
14603 | |||
14604 | //m_log.Debug(mirpk.ToString()); | ||
14605 | MapItemRequest handlerMapItemRequest = OnMapItemRequest; | ||
14606 | if (handlerMapItemRequest != null) | ||
14607 | { | ||
14608 | handlerMapItemRequest(this, mirpk.AgentData.Flags, mirpk.AgentData.EstateID, | ||
14609 | mirpk.AgentData.Godlike, mirpk.RequestData.ItemType, | ||
14610 | mirpk.RequestData.RegionHandle); | ||
14611 | |||
14612 | } | ||
14613 | break; | ||
14614 | |||
14615 | case PacketType.TransferAbort: | ||
14616 | // TODO: handle this packet | ||
14617 | //m_log.Warn("[CLIENT]: unhandled TransferAbort packet"); | ||
14618 | break; | ||
14619 | |||
14620 | case PacketType.MuteListRequest: | ||
14621 | MuteListRequestPacket muteListRequest = | ||
14622 | (MuteListRequestPacket)Pack; | ||
14623 | |||
14624 | #region Packet Session and User Check | ||
14625 | if (m_checkPackets) | ||
14626 | { | ||
14627 | if (muteListRequest.AgentData.SessionID != SessionId || | ||
14628 | muteListRequest.AgentData.AgentID != AgentId) | ||
14629 | break; | ||
14630 | } | ||
14631 | #endregion | ||
14632 | |||
14633 | MuteListRequest handlerMuteListRequest = OnMuteListRequest; | ||
14634 | if (handlerMuteListRequest != null) | ||
14635 | { | ||
14636 | handlerMuteListRequest(this, muteListRequest.MuteData.MuteCRC); | ||
14637 | } | ||
14638 | else | ||
14639 | { | ||
14640 | SendUseCachedMuteList(); | ||
14641 | } | ||
14642 | break; | ||
14643 | |||
14644 | case PacketType.UseCircuitCode: | ||
14645 | // Don't display this one, we handle it at a lower level | ||
14646 | break; | ||
14647 | |||
14648 | case PacketType.AgentHeightWidth: | ||
14649 | // TODO: handle this packet | ||
14650 | //m_log.Warn("[CLIENT]: unhandled AgentHeightWidth packet"); | ||
14651 | break; | ||
14652 | |||
14653 | case PacketType.InventoryDescendents: | ||
14654 | // TODO: handle this packet | ||
14655 | //m_log.Warn("[CLIENT]: unhandled InventoryDescent packet"); | ||
14656 | |||
14657 | break; | ||
14658 | |||
14659 | case PacketType.DirPlacesQuery: | ||
14660 | DirPlacesQueryPacket dirPlacesQueryPacket = (DirPlacesQueryPacket)Pack; | ||
14661 | //m_log.Debug(dirPlacesQueryPacket.ToString()); | ||
14662 | |||
14663 | #region Packet Session and User Check | ||
14664 | if (m_checkPackets) | ||
14665 | { | ||
14666 | if (dirPlacesQueryPacket.AgentData.SessionID != SessionId || | ||
14667 | dirPlacesQueryPacket.AgentData.AgentID != AgentId) | ||
14668 | break; | ||
14669 | } | ||
14670 | #endregion | ||
14671 | |||
14672 | DirPlacesQuery handlerDirPlacesQuery = OnDirPlacesQuery; | ||
14673 | if (handlerDirPlacesQuery != null) | ||
14674 | { | ||
14675 | handlerDirPlacesQuery(this, | ||
14676 | dirPlacesQueryPacket.QueryData.QueryID, | ||
14677 | Utils.BytesToString( | ||
14678 | dirPlacesQueryPacket.QueryData.QueryText), | ||
14679 | (int)dirPlacesQueryPacket.QueryData.QueryFlags, | ||
14680 | (int)dirPlacesQueryPacket.QueryData.Category, | ||
14681 | Utils.BytesToString( | ||
14682 | dirPlacesQueryPacket.QueryData.SimName), | ||
14683 | dirPlacesQueryPacket.QueryData.QueryStart); | ||
14684 | } | ||
14685 | break; | ||
14686 | |||
14687 | case PacketType.DirFindQuery: | ||
14688 | DirFindQueryPacket dirFindQueryPacket = (DirFindQueryPacket)Pack; | ||
14689 | |||
14690 | #region Packet Session and User Check | ||
14691 | if (m_checkPackets) | ||
14692 | { | ||
14693 | if (dirFindQueryPacket.AgentData.SessionID != SessionId || | ||
14694 | dirFindQueryPacket.AgentData.AgentID != AgentId) | ||
14695 | break; | ||
14696 | } | ||
14697 | #endregion | ||
14698 | |||
14699 | DirFindQuery handlerDirFindQuery = OnDirFindQuery; | ||
14700 | if (handlerDirFindQuery != null) | ||
14701 | { | ||
14702 | handlerDirFindQuery(this, | ||
14703 | dirFindQueryPacket.QueryData.QueryID, | ||
14704 | Utils.BytesToString( | ||
14705 | dirFindQueryPacket.QueryData.QueryText), | ||
14706 | dirFindQueryPacket.QueryData.QueryFlags, | ||
14707 | dirFindQueryPacket.QueryData.QueryStart); | ||
14708 | } | ||
14709 | break; | ||
14710 | |||
14711 | case PacketType.DirLandQuery: | ||
14712 | DirLandQueryPacket dirLandQueryPacket = (DirLandQueryPacket)Pack; | ||
14713 | |||
14714 | #region Packet Session and User Check | ||
14715 | if (m_checkPackets) | ||
14716 | { | ||
14717 | if (dirLandQueryPacket.AgentData.SessionID != SessionId || | ||
14718 | dirLandQueryPacket.AgentData.AgentID != AgentId) | ||
14719 | break; | ||
14720 | } | ||
14721 | #endregion | ||
14722 | |||
14723 | DirLandQuery handlerDirLandQuery = OnDirLandQuery; | ||
14724 | if (handlerDirLandQuery != null) | ||
14725 | { | ||
14726 | handlerDirLandQuery(this, | ||
14727 | dirLandQueryPacket.QueryData.QueryID, | ||
14728 | dirLandQueryPacket.QueryData.QueryFlags, | ||
14729 | dirLandQueryPacket.QueryData.SearchType, | ||
14730 | dirLandQueryPacket.QueryData.Price, | ||
14731 | dirLandQueryPacket.QueryData.Area, | ||
14732 | dirLandQueryPacket.QueryData.QueryStart); | ||
14733 | } | ||
14734 | break; | ||
14735 | |||
14736 | case PacketType.DirPopularQuery: | ||
14737 | DirPopularQueryPacket dirPopularQueryPacket = (DirPopularQueryPacket)Pack; | ||
14738 | |||
14739 | #region Packet Session and User Check | ||
14740 | if (m_checkPackets) | ||
14741 | { | ||
14742 | if (dirPopularQueryPacket.AgentData.SessionID != SessionId || | ||
14743 | dirPopularQueryPacket.AgentData.AgentID != AgentId) | ||
14744 | break; | ||
14745 | } | ||
14746 | #endregion | ||
14747 | |||
14748 | DirPopularQuery handlerDirPopularQuery = OnDirPopularQuery; | ||
14749 | if (handlerDirPopularQuery != null) | ||
14750 | { | ||
14751 | handlerDirPopularQuery(this, | ||
14752 | dirPopularQueryPacket.QueryData.QueryID, | ||
14753 | dirPopularQueryPacket.QueryData.QueryFlags); | ||
14754 | } | ||
14755 | break; | ||
14756 | |||
14757 | case PacketType.DirClassifiedQuery: | ||
14758 | DirClassifiedQueryPacket dirClassifiedQueryPacket = (DirClassifiedQueryPacket)Pack; | ||
14759 | |||
14760 | #region Packet Session and User Check | ||
14761 | if (m_checkPackets) | ||
14762 | { | ||
14763 | if (dirClassifiedQueryPacket.AgentData.SessionID != SessionId || | ||
14764 | dirClassifiedQueryPacket.AgentData.AgentID != AgentId) | ||
14765 | break; | ||
14766 | } | ||
14767 | #endregion | ||
14768 | |||
14769 | DirClassifiedQuery handlerDirClassifiedQuery = OnDirClassifiedQuery; | ||
14770 | if (handlerDirClassifiedQuery != null) | ||
14771 | { | ||
14772 | handlerDirClassifiedQuery(this, | ||
14773 | dirClassifiedQueryPacket.QueryData.QueryID, | ||
14774 | Utils.BytesToString( | ||
14775 | dirClassifiedQueryPacket.QueryData.QueryText), | ||
14776 | dirClassifiedQueryPacket.QueryData.QueryFlags, | ||
14777 | dirClassifiedQueryPacket.QueryData.Category, | ||
14778 | dirClassifiedQueryPacket.QueryData.QueryStart); | ||
14779 | } | ||
14780 | break; | ||
14781 | |||
14782 | case PacketType.EventInfoRequest: | ||
14783 | EventInfoRequestPacket eventInfoRequestPacket = (EventInfoRequestPacket)Pack; | ||
14784 | |||
14785 | #region Packet Session and User Check | ||
14786 | if (m_checkPackets) | ||
14787 | { | ||
14788 | if (eventInfoRequestPacket.AgentData.SessionID != SessionId || | ||
14789 | eventInfoRequestPacket.AgentData.AgentID != AgentId) | ||
14790 | break; | ||
14791 | } | ||
14792 | #endregion | ||
14793 | |||
14794 | if (OnEventInfoRequest != null) | ||
14795 | { | ||
14796 | OnEventInfoRequest(this, eventInfoRequestPacket.EventData.EventID); | ||
14797 | } | ||
14798 | break; | ||
14799 | |||
14800 | //#region Calling Card | ||
14801 | |||
14802 | case PacketType.OfferCallingCard: | ||
14803 | OfferCallingCardPacket offerCallingCardPacket = (OfferCallingCardPacket)Pack; | ||
14804 | |||
14805 | #region Packet Session and User Check | ||
14806 | if (m_checkPackets) | ||
14807 | { | ||
14808 | if (offerCallingCardPacket.AgentData.SessionID != SessionId || | ||
14809 | offerCallingCardPacket.AgentData.AgentID != AgentId) | ||
14810 | break; | ||
14811 | } | ||
14812 | #endregion | ||
14813 | |||
14814 | if (OnOfferCallingCard != null) | ||
14815 | { | ||
14816 | OnOfferCallingCard(this, | ||
14817 | offerCallingCardPacket.AgentBlock.DestID, | ||
14818 | offerCallingCardPacket.AgentBlock.TransactionID); | ||
14819 | } | ||
14820 | break; | ||
14821 | |||
14822 | case PacketType.AcceptCallingCard: | ||
14823 | AcceptCallingCardPacket acceptCallingCardPacket = (AcceptCallingCardPacket)Pack; | ||
14824 | |||
14825 | #region Packet Session and User Check | ||
14826 | if (m_checkPackets) | ||
14827 | { | ||
14828 | if (acceptCallingCardPacket.AgentData.SessionID != SessionId || | ||
14829 | acceptCallingCardPacket.AgentData.AgentID != AgentId) | ||
14830 | break; | ||
14831 | } | ||
14832 | #endregion | ||
14833 | |||
14834 | // according to http://wiki.secondlife.com/wiki/AcceptCallingCard FolderData should | ||
14835 | // contain exactly one entry | ||
14836 | if (OnAcceptCallingCard != null && acceptCallingCardPacket.FolderData.Length > 0) | ||
14837 | { | ||
14838 | OnAcceptCallingCard(this, | ||
14839 | acceptCallingCardPacket.TransactionBlock.TransactionID, | ||
14840 | acceptCallingCardPacket.FolderData[0].FolderID); | ||
14841 | } | ||
14842 | break; | ||
14843 | |||
14844 | case PacketType.DeclineCallingCard: | ||
14845 | DeclineCallingCardPacket declineCallingCardPacket = (DeclineCallingCardPacket)Pack; | ||
14846 | |||
14847 | #region Packet Session and User Check | ||
14848 | if (m_checkPackets) | ||
14849 | { | ||
14850 | if (declineCallingCardPacket.AgentData.SessionID != SessionId || | ||
14851 | declineCallingCardPacket.AgentData.AgentID != AgentId) | ||
14852 | break; | ||
14853 | } | ||
14854 | #endregion | ||
14855 | |||
14856 | if (OnDeclineCallingCard != null) | ||
14857 | { | ||
14858 | OnDeclineCallingCard(this, | ||
14859 | declineCallingCardPacket.TransactionBlock.TransactionID); | ||
14860 | } | ||
14861 | break; | ||
14862 | //#endregion | ||
14863 | |||
14864 | //#region Groups | ||
14865 | case PacketType.ActivateGroup: | ||
14866 | ActivateGroupPacket activateGroupPacket = (ActivateGroupPacket)Pack; | ||
14867 | |||
14868 | #region Packet Session and User Check | ||
14869 | if (m_checkPackets) | ||
14870 | { | ||
14871 | if (activateGroupPacket.AgentData.SessionID != SessionId || | ||
14872 | activateGroupPacket.AgentData.AgentID != AgentId) | ||
14873 | break; | ||
14874 | } | ||
14875 | #endregion | ||
14876 | |||
14877 | if (m_GroupsModule != null) | ||
14878 | { | ||
14879 | m_GroupsModule.ActivateGroup(this, activateGroupPacket.AgentData.GroupID); | ||
14880 | m_GroupsModule.SendAgentGroupDataUpdate(this); | ||
14881 | } | ||
14882 | break; | ||
14883 | |||
14884 | |||
14885 | case PacketType.GroupTitlesRequest: | ||
14886 | GroupTitlesRequestPacket groupTitlesRequest = | ||
14887 | (GroupTitlesRequestPacket)Pack; | ||
14888 | |||
14889 | #region Packet Session and User Check | ||
14890 | if (m_checkPackets) | ||
14891 | { | ||
14892 | if (groupTitlesRequest.AgentData.SessionID != SessionId || | ||
14893 | groupTitlesRequest.AgentData.AgentID != AgentId) | ||
14894 | break; | ||
14895 | } | ||
14896 | #endregion | ||
14897 | |||
14898 | if (m_GroupsModule != null) | ||
14899 | { | ||
14900 | GroupTitlesReplyPacket groupTitlesReply = (GroupTitlesReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupTitlesReply); | ||
14901 | |||
14902 | groupTitlesReply.AgentData = | ||
14903 | new GroupTitlesReplyPacket.AgentDataBlock(); | ||
14904 | |||
14905 | groupTitlesReply.AgentData.AgentID = AgentId; | ||
14906 | groupTitlesReply.AgentData.GroupID = | ||
14907 | groupTitlesRequest.AgentData.GroupID; | ||
14908 | |||
14909 | groupTitlesReply.AgentData.RequestID = | ||
14910 | groupTitlesRequest.AgentData.RequestID; | ||
14911 | |||
14912 | List<GroupTitlesData> titles = | ||
14913 | m_GroupsModule.GroupTitlesRequest(this, | ||
14914 | groupTitlesRequest.AgentData.GroupID); | ||
14915 | |||
14916 | groupTitlesReply.GroupData = | ||
14917 | new GroupTitlesReplyPacket.GroupDataBlock[titles.Count]; | ||
14918 | |||
14919 | int i = 0; | ||
14920 | foreach (GroupTitlesData d in titles) | ||
14921 | { | ||
14922 | groupTitlesReply.GroupData[i] = | ||
14923 | new GroupTitlesReplyPacket.GroupDataBlock(); | ||
14924 | |||
14925 | groupTitlesReply.GroupData[i].Title = | ||
14926 | Util.StringToBytes256(d.Name); | ||
14927 | groupTitlesReply.GroupData[i].RoleID = | ||
14928 | d.UUID; | ||
14929 | groupTitlesReply.GroupData[i].Selected = | ||
14930 | d.Selected; | ||
14931 | i++; | ||
14932 | } | ||
14933 | |||
14934 | OutPacket(groupTitlesReply, ThrottleOutPacketType.Task); | ||
14935 | } | ||
14936 | break; | ||
14937 | |||
14938 | case PacketType.GroupProfileRequest: | ||
14939 | GroupProfileRequestPacket groupProfileRequest = | ||
14940 | (GroupProfileRequestPacket)Pack; | ||
14941 | |||
14942 | #region Packet Session and User Check | ||
14943 | if (m_checkPackets) | ||
14944 | { | ||
14945 | if (groupProfileRequest.AgentData.SessionID != SessionId || | ||
14946 | groupProfileRequest.AgentData.AgentID != AgentId) | ||
14947 | break; | ||
14948 | } | ||
14949 | #endregion | ||
14950 | |||
14951 | if (m_GroupsModule != null) | ||
14952 | { | ||
14953 | GroupProfileReplyPacket groupProfileReply = (GroupProfileReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupProfileReply); | ||
14954 | |||
14955 | groupProfileReply.AgentData = new GroupProfileReplyPacket.AgentDataBlock(); | ||
14956 | groupProfileReply.GroupData = new GroupProfileReplyPacket.GroupDataBlock(); | ||
14957 | groupProfileReply.AgentData.AgentID = AgentId; | ||
14958 | |||
14959 | GroupProfileData d = m_GroupsModule.GroupProfileRequest(this, | ||
14960 | groupProfileRequest.GroupData.GroupID); | ||
14961 | |||
14962 | groupProfileReply.GroupData.GroupID = d.GroupID; | ||
14963 | groupProfileReply.GroupData.Name = Util.StringToBytes256(d.Name); | ||
14964 | groupProfileReply.GroupData.Charter = Util.StringToBytes1024(d.Charter); | ||
14965 | groupProfileReply.GroupData.ShowInList = d.ShowInList; | ||
14966 | groupProfileReply.GroupData.MemberTitle = Util.StringToBytes256(d.MemberTitle); | ||
14967 | groupProfileReply.GroupData.PowersMask = d.PowersMask; | ||
14968 | groupProfileReply.GroupData.InsigniaID = d.InsigniaID; | ||
14969 | groupProfileReply.GroupData.FounderID = d.FounderID; | ||
14970 | groupProfileReply.GroupData.MembershipFee = d.MembershipFee; | ||
14971 | groupProfileReply.GroupData.OpenEnrollment = d.OpenEnrollment; | ||
14972 | groupProfileReply.GroupData.Money = d.Money; | ||
14973 | groupProfileReply.GroupData.GroupMembershipCount = d.GroupMembershipCount; | ||
14974 | groupProfileReply.GroupData.GroupRolesCount = d.GroupRolesCount; | ||
14975 | groupProfileReply.GroupData.AllowPublish = d.AllowPublish; | ||
14976 | groupProfileReply.GroupData.MaturePublish = d.MaturePublish; | ||
14977 | groupProfileReply.GroupData.OwnerRole = d.OwnerRole; | ||
14978 | |||
14979 | OutPacket(groupProfileReply, ThrottleOutPacketType.Task); | ||
14980 | } | ||
14981 | break; | ||
14982 | |||
14983 | case PacketType.GroupMembersRequest: | ||
14984 | GroupMembersRequestPacket groupMembersRequestPacket = | ||
14985 | (GroupMembersRequestPacket)Pack; | ||
14986 | |||
14987 | #region Packet Session and User Check | ||
14988 | if (m_checkPackets) | ||
14989 | { | ||
14990 | if (groupMembersRequestPacket.AgentData.SessionID != SessionId || | ||
14991 | groupMembersRequestPacket.AgentData.AgentID != AgentId) | ||
14992 | break; | ||
14993 | } | ||
14994 | #endregion | ||
14995 | |||
14996 | if (m_GroupsModule != null) | ||
14997 | { | ||
14998 | List<GroupMembersData> members = | ||
14999 | m_GroupsModule.GroupMembersRequest(this, groupMembersRequestPacket.GroupData.GroupID); | ||
15000 | |||
15001 | int memberCount = members.Count; | ||
15002 | |||
15003 | while (true) | ||
15004 | { | ||
15005 | int blockCount = members.Count; | ||
15006 | if (blockCount > 40) | ||
15007 | blockCount = 40; | ||
15008 | |||
15009 | GroupMembersReplyPacket groupMembersReply = (GroupMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupMembersReply); | ||
15010 | |||
15011 | groupMembersReply.AgentData = | ||
15012 | new GroupMembersReplyPacket.AgentDataBlock(); | ||
15013 | groupMembersReply.GroupData = | ||
15014 | new GroupMembersReplyPacket.GroupDataBlock(); | ||
15015 | groupMembersReply.MemberData = | ||
15016 | new GroupMembersReplyPacket.MemberDataBlock[ | ||
15017 | blockCount]; | ||
15018 | |||
15019 | groupMembersReply.AgentData.AgentID = AgentId; | ||
15020 | groupMembersReply.GroupData.GroupID = | ||
15021 | groupMembersRequestPacket.GroupData.GroupID; | ||
15022 | groupMembersReply.GroupData.RequestID = | ||
15023 | groupMembersRequestPacket.GroupData.RequestID; | ||
15024 | groupMembersReply.GroupData.MemberCount = memberCount; | ||
15025 | |||
15026 | for (int i = 0; i < blockCount; i++) | ||
15027 | { | ||
15028 | GroupMembersData m = members[0]; | ||
15029 | members.RemoveAt(0); | ||
15030 | |||
15031 | groupMembersReply.MemberData[i] = | ||
15032 | new GroupMembersReplyPacket.MemberDataBlock(); | ||
15033 | groupMembersReply.MemberData[i].AgentID = | ||
15034 | m.AgentID; | ||
15035 | groupMembersReply.MemberData[i].Contribution = | ||
15036 | m.Contribution; | ||
15037 | groupMembersReply.MemberData[i].OnlineStatus = | ||
15038 | Util.StringToBytes256(m.OnlineStatus); | ||
15039 | groupMembersReply.MemberData[i].AgentPowers = | ||
15040 | m.AgentPowers; | ||
15041 | groupMembersReply.MemberData[i].Title = | ||
15042 | Util.StringToBytes256(m.Title); | ||
15043 | groupMembersReply.MemberData[i].IsOwner = | ||
15044 | m.IsOwner; | ||
15045 | } | ||
15046 | OutPacket(groupMembersReply, ThrottleOutPacketType.Task); | ||
15047 | if (members.Count == 0) | ||
15048 | break; | ||
15049 | } | ||
15050 | } | ||
15051 | break; | ||
15052 | |||
15053 | case PacketType.GroupRoleDataRequest: | ||
15054 | GroupRoleDataRequestPacket groupRolesRequest = | ||
15055 | (GroupRoleDataRequestPacket)Pack; | ||
15056 | |||
15057 | #region Packet Session and User Check | ||
15058 | if (m_checkPackets) | ||
15059 | { | ||
15060 | if (groupRolesRequest.AgentData.SessionID != SessionId || | ||
15061 | groupRolesRequest.AgentData.AgentID != AgentId) | ||
15062 | break; | ||
15063 | } | ||
15064 | #endregion | ||
15065 | |||
15066 | if (m_GroupsModule != null) | ||
15067 | { | ||
15068 | GroupRoleDataReplyPacket groupRolesReply = (GroupRoleDataReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleDataReply); | ||
15069 | |||
15070 | groupRolesReply.AgentData = | ||
15071 | new GroupRoleDataReplyPacket.AgentDataBlock(); | ||
15072 | |||
15073 | groupRolesReply.AgentData.AgentID = AgentId; | ||
15074 | |||
15075 | groupRolesReply.GroupData = | ||
15076 | new GroupRoleDataReplyPacket.GroupDataBlock(); | ||
15077 | |||
15078 | groupRolesReply.GroupData.GroupID = | ||
15079 | groupRolesRequest.GroupData.GroupID; | ||
15080 | |||
15081 | groupRolesReply.GroupData.RequestID = | ||
15082 | groupRolesRequest.GroupData.RequestID; | ||
15083 | |||
15084 | List<GroupRolesData> titles = | ||
15085 | m_GroupsModule.GroupRoleDataRequest(this, | ||
15086 | groupRolesRequest.GroupData.GroupID); | ||
15087 | |||
15088 | groupRolesReply.GroupData.RoleCount = | ||
15089 | titles.Count; | ||
15090 | |||
15091 | groupRolesReply.RoleData = | ||
15092 | new GroupRoleDataReplyPacket.RoleDataBlock[titles.Count]; | ||
15093 | |||
15094 | int i = 0; | ||
15095 | foreach (GroupRolesData d in titles) | ||
15096 | { | ||
15097 | groupRolesReply.RoleData[i] = | ||
15098 | new GroupRoleDataReplyPacket.RoleDataBlock(); | ||
15099 | |||
15100 | groupRolesReply.RoleData[i].RoleID = | ||
15101 | d.RoleID; | ||
15102 | groupRolesReply.RoleData[i].Name = | ||
15103 | Util.StringToBytes256(d.Name); | ||
15104 | groupRolesReply.RoleData[i].Title = | ||
15105 | Util.StringToBytes256(d.Title); | ||
15106 | groupRolesReply.RoleData[i].Description = | ||
15107 | Util.StringToBytes1024(d.Description); | ||
15108 | groupRolesReply.RoleData[i].Powers = | ||
15109 | d.Powers; | ||
15110 | groupRolesReply.RoleData[i].Members = | ||
15111 | (uint)d.Members; | ||
15112 | |||
15113 | i++; | ||
15114 | } | ||
15115 | |||
15116 | OutPacket(groupRolesReply, ThrottleOutPacketType.Task); | ||
15117 | } | ||
15118 | break; | ||
15119 | |||
15120 | case PacketType.GroupRoleMembersRequest: | ||
15121 | GroupRoleMembersRequestPacket groupRoleMembersRequest = | ||
15122 | (GroupRoleMembersRequestPacket)Pack; | ||
15123 | |||
15124 | #region Packet Session and User Check | ||
15125 | if (m_checkPackets) | ||
15126 | { | ||
15127 | if (groupRoleMembersRequest.AgentData.SessionID != SessionId || | ||
15128 | groupRoleMembersRequest.AgentData.AgentID != AgentId) | ||
15129 | break; | ||
15130 | } | ||
15131 | #endregion | ||
15132 | |||
15133 | if (m_GroupsModule != null) | ||
15134 | { | ||
15135 | List<GroupRoleMembersData> mappings = | ||
15136 | m_GroupsModule.GroupRoleMembersRequest(this, | ||
15137 | groupRoleMembersRequest.GroupData.GroupID); | ||
15138 | |||
15139 | int mappingsCount = mappings.Count; | ||
15140 | |||
15141 | while (mappings.Count > 0) | ||
15142 | { | ||
15143 | int pairs = mappings.Count; | ||
15144 | if (pairs > 32) | ||
15145 | pairs = 32; | ||
15146 | |||
15147 | GroupRoleMembersReplyPacket groupRoleMembersReply = (GroupRoleMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleMembersReply); | ||
15148 | groupRoleMembersReply.AgentData = | ||
15149 | new GroupRoleMembersReplyPacket.AgentDataBlock(); | ||
15150 | groupRoleMembersReply.AgentData.AgentID = | ||
15151 | AgentId; | ||
15152 | groupRoleMembersReply.AgentData.GroupID = | ||
15153 | groupRoleMembersRequest.GroupData.GroupID; | ||
15154 | groupRoleMembersReply.AgentData.RequestID = | ||
15155 | groupRoleMembersRequest.GroupData.RequestID; | ||
15156 | |||
15157 | groupRoleMembersReply.AgentData.TotalPairs = | ||
15158 | (uint)mappingsCount; | ||
15159 | |||
15160 | groupRoleMembersReply.MemberData = | ||
15161 | new GroupRoleMembersReplyPacket.MemberDataBlock[pairs]; | ||
15162 | |||
15163 | for (int i = 0; i < pairs; i++) | ||
15164 | { | ||
15165 | GroupRoleMembersData d = mappings[0]; | ||
15166 | mappings.RemoveAt(0); | ||
15167 | |||
15168 | groupRoleMembersReply.MemberData[i] = | ||
15169 | new GroupRoleMembersReplyPacket.MemberDataBlock(); | ||
15170 | |||
15171 | groupRoleMembersReply.MemberData[i].RoleID = | ||
15172 | d.RoleID; | ||
15173 | groupRoleMembersReply.MemberData[i].MemberID = | ||
15174 | d.MemberID; | ||
15175 | } | ||
15176 | |||
15177 | OutPacket(groupRoleMembersReply, ThrottleOutPacketType.Task); | ||
15178 | } | ||
15179 | } | ||
15180 | break; | ||
15181 | |||
15182 | case PacketType.CreateGroupRequest: | ||
15183 | CreateGroupRequestPacket createGroupRequest = | ||
15184 | (CreateGroupRequestPacket)Pack; | ||
15185 | |||
15186 | #region Packet Session and User Check | ||
15187 | if (m_checkPackets) | ||
15188 | { | ||
15189 | if (createGroupRequest.AgentData.SessionID != SessionId || | ||
15190 | createGroupRequest.AgentData.AgentID != AgentId) | ||
15191 | break; | ||
15192 | } | ||
15193 | #endregion | ||
15194 | |||
15195 | if (m_GroupsModule != null) | ||
15196 | { | ||
15197 | m_GroupsModule.CreateGroup(this, | ||
15198 | Utils.BytesToString(createGroupRequest.GroupData.Name), | ||
15199 | Utils.BytesToString(createGroupRequest.GroupData.Charter), | ||
15200 | createGroupRequest.GroupData.ShowInList, | ||
15201 | createGroupRequest.GroupData.InsigniaID, | ||
15202 | createGroupRequest.GroupData.MembershipFee, | ||
15203 | createGroupRequest.GroupData.OpenEnrollment, | ||
15204 | createGroupRequest.GroupData.AllowPublish, | ||
15205 | createGroupRequest.GroupData.MaturePublish); | ||
15206 | } | ||
15207 | break; | ||
15208 | |||
15209 | case PacketType.UpdateGroupInfo: | ||
15210 | UpdateGroupInfoPacket updateGroupInfo = | ||
15211 | (UpdateGroupInfoPacket)Pack; | ||
15212 | |||
15213 | #region Packet Session and User Check | ||
15214 | if (m_checkPackets) | ||
15215 | { | ||
15216 | if (updateGroupInfo.AgentData.SessionID != SessionId || | ||
15217 | updateGroupInfo.AgentData.AgentID != AgentId) | ||
15218 | break; | ||
15219 | } | ||
15220 | #endregion | ||
15221 | |||
15222 | if (m_GroupsModule != null) | ||
15223 | { | ||
15224 | m_GroupsModule.UpdateGroupInfo(this, | ||
15225 | updateGroupInfo.GroupData.GroupID, | ||
15226 | Utils.BytesToString(updateGroupInfo.GroupData.Charter), | ||
15227 | updateGroupInfo.GroupData.ShowInList, | ||
15228 | updateGroupInfo.GroupData.InsigniaID, | ||
15229 | updateGroupInfo.GroupData.MembershipFee, | ||
15230 | updateGroupInfo.GroupData.OpenEnrollment, | ||
15231 | updateGroupInfo.GroupData.AllowPublish, | ||
15232 | updateGroupInfo.GroupData.MaturePublish); | ||
15233 | } | ||
15234 | |||
15235 | break; | ||
15236 | |||
15237 | case PacketType.SetGroupAcceptNotices: | ||
15238 | SetGroupAcceptNoticesPacket setGroupAcceptNotices = | ||
15239 | (SetGroupAcceptNoticesPacket)Pack; | ||
15240 | |||
15241 | #region Packet Session and User Check | ||
15242 | if (m_checkPackets) | ||
15243 | { | ||
15244 | if (setGroupAcceptNotices.AgentData.SessionID != SessionId || | ||
15245 | setGroupAcceptNotices.AgentData.AgentID != AgentId) | ||
15246 | break; | ||
15247 | } | ||
15248 | #endregion | ||
15249 | |||
15250 | if (m_GroupsModule != null) | ||
15251 | { | ||
15252 | m_GroupsModule.SetGroupAcceptNotices(this, | ||
15253 | setGroupAcceptNotices.Data.GroupID, | ||
15254 | setGroupAcceptNotices.Data.AcceptNotices, | ||
15255 | setGroupAcceptNotices.NewData.ListInProfile); | ||
15256 | } | ||
15257 | |||
15258 | break; | ||
15259 | |||
15260 | case PacketType.GroupTitleUpdate: | ||
15261 | GroupTitleUpdatePacket groupTitleUpdate = | ||
15262 | (GroupTitleUpdatePacket)Pack; | ||
15263 | |||
15264 | #region Packet Session and User Check | ||
15265 | if (m_checkPackets) | ||
15266 | { | ||
15267 | if (groupTitleUpdate.AgentData.SessionID != SessionId || | ||
15268 | groupTitleUpdate.AgentData.AgentID != AgentId) | ||
15269 | break; | ||
15270 | } | ||
15271 | #endregion | ||
15272 | |||
15273 | if (m_GroupsModule != null) | ||
15274 | { | ||
15275 | m_GroupsModule.GroupTitleUpdate(this, | ||
15276 | groupTitleUpdate.AgentData.GroupID, | ||
15277 | groupTitleUpdate.AgentData.TitleRoleID); | ||
15278 | } | ||
15279 | |||
15280 | break; | ||
15281 | |||
15282 | |||
15283 | case PacketType.ParcelDeedToGroup: | ||
15284 | ParcelDeedToGroupPacket parcelDeedToGroup = (ParcelDeedToGroupPacket)Pack; | ||
15285 | if (m_GroupsModule != null) | ||
15286 | { | ||
15287 | ParcelDeedToGroup handlerParcelDeedToGroup = OnParcelDeedToGroup; | ||
15288 | if (handlerParcelDeedToGroup != null) | ||
15289 | { | ||
15290 | handlerParcelDeedToGroup(parcelDeedToGroup.Data.LocalID, parcelDeedToGroup.Data.GroupID, this); | ||
15291 | |||
15292 | } | ||
15293 | } | ||
15294 | |||
15295 | break; | ||
15296 | |||
15297 | |||
15298 | case PacketType.GroupNoticesListRequest: | ||
15299 | GroupNoticesListRequestPacket groupNoticesListRequest = | ||
15300 | (GroupNoticesListRequestPacket)Pack; | ||
15301 | |||
15302 | #region Packet Session and User Check | ||
15303 | if (m_checkPackets) | ||
15304 | { | ||
15305 | if (groupNoticesListRequest.AgentData.SessionID != SessionId || | ||
15306 | groupNoticesListRequest.AgentData.AgentID != AgentId) | ||
15307 | break; | ||
15308 | } | ||
15309 | #endregion | ||
15310 | |||
15311 | if (m_GroupsModule != null) | ||
15312 | { | ||
15313 | GroupNoticeData[] gn = | ||
15314 | m_GroupsModule.GroupNoticesListRequest(this, | ||
15315 | groupNoticesListRequest.Data.GroupID); | ||
15316 | |||
15317 | GroupNoticesListReplyPacket groupNoticesListReply = (GroupNoticesListReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupNoticesListReply); | ||
15318 | groupNoticesListReply.AgentData = | ||
15319 | new GroupNoticesListReplyPacket.AgentDataBlock(); | ||
15320 | groupNoticesListReply.AgentData.AgentID = AgentId; | ||
15321 | groupNoticesListReply.AgentData.GroupID = groupNoticesListRequest.Data.GroupID; | ||
15322 | |||
15323 | groupNoticesListReply.Data = new GroupNoticesListReplyPacket.DataBlock[gn.Length]; | ||
15324 | |||
15325 | int i = 0; | ||
15326 | foreach (GroupNoticeData g in gn) | ||
15327 | { | ||
15328 | groupNoticesListReply.Data[i] = new GroupNoticesListReplyPacket.DataBlock(); | ||
15329 | groupNoticesListReply.Data[i].NoticeID = | ||
15330 | g.NoticeID; | ||
15331 | groupNoticesListReply.Data[i].Timestamp = | ||
15332 | g.Timestamp; | ||
15333 | groupNoticesListReply.Data[i].FromName = | ||
15334 | Util.StringToBytes256(g.FromName); | ||
15335 | groupNoticesListReply.Data[i].Subject = | ||
15336 | Util.StringToBytes256(g.Subject); | ||
15337 | groupNoticesListReply.Data[i].HasAttachment = | ||
15338 | g.HasAttachment; | ||
15339 | groupNoticesListReply.Data[i].AssetType = | ||
15340 | g.AssetType; | ||
15341 | i++; | ||
15342 | } | ||
15343 | |||
15344 | OutPacket(groupNoticesListReply, ThrottleOutPacketType.Task); | ||
15345 | } | ||
15346 | |||
15347 | break; | ||
15348 | |||
15349 | case PacketType.GroupNoticeRequest: | ||
15350 | GroupNoticeRequestPacket groupNoticeRequest = | ||
15351 | (GroupNoticeRequestPacket)Pack; | ||
15352 | |||
15353 | #region Packet Session and User Check | ||
15354 | if (m_checkPackets) | ||
15355 | { | ||
15356 | if (groupNoticeRequest.AgentData.SessionID != SessionId || | ||
15357 | groupNoticeRequest.AgentData.AgentID != AgentId) | ||
15358 | break; | ||
15359 | } | ||
15360 | #endregion | ||
15361 | |||
15362 | if (m_GroupsModule != null) | ||
15363 | { | ||
15364 | m_GroupsModule.GroupNoticeRequest(this, | ||
15365 | groupNoticeRequest.Data.GroupNoticeID); | ||
15366 | } | ||
15367 | break; | ||
15368 | |||
15369 | case PacketType.GroupRoleUpdate: | ||
15370 | GroupRoleUpdatePacket groupRoleUpdate = | ||
15371 | (GroupRoleUpdatePacket)Pack; | ||
15372 | |||
15373 | #region Packet Session and User Check | ||
15374 | if (m_checkPackets) | ||
15375 | { | ||
15376 | if (groupRoleUpdate.AgentData.SessionID != SessionId || | ||
15377 | groupRoleUpdate.AgentData.AgentID != AgentId) | ||
15378 | break; | ||
15379 | } | ||
15380 | #endregion | ||
15381 | |||
15382 | if (m_GroupsModule != null) | ||
15383 | { | ||
15384 | foreach (GroupRoleUpdatePacket.RoleDataBlock d in | ||
15385 | groupRoleUpdate.RoleData) | ||
15386 | { | ||
15387 | m_GroupsModule.GroupRoleUpdate(this, | ||
15388 | groupRoleUpdate.AgentData.GroupID, | ||
15389 | d.RoleID, | ||
15390 | Utils.BytesToString(d.Name), | ||
15391 | Utils.BytesToString(d.Description), | ||
15392 | Utils.BytesToString(d.Title), | ||
15393 | d.Powers, | ||
15394 | d.UpdateType); | ||
15395 | } | ||
15396 | m_GroupsModule.NotifyChange(groupRoleUpdate.AgentData.GroupID); | ||
15397 | } | ||
15398 | break; | ||
15399 | |||
15400 | case PacketType.GroupRoleChanges: | ||
15401 | GroupRoleChangesPacket groupRoleChanges = | ||
15402 | (GroupRoleChangesPacket)Pack; | ||
15403 | |||
15404 | #region Packet Session and User Check | ||
15405 | if (m_checkPackets) | ||
15406 | { | ||
15407 | if (groupRoleChanges.AgentData.SessionID != SessionId || | ||
15408 | groupRoleChanges.AgentData.AgentID != AgentId) | ||
15409 | break; | ||
15410 | } | ||
15411 | #endregion | ||
15412 | |||
15413 | if (m_GroupsModule != null) | ||
15414 | { | ||
15415 | foreach (GroupRoleChangesPacket.RoleChangeBlock d in | ||
15416 | groupRoleChanges.RoleChange) | ||
15417 | { | ||
15418 | m_GroupsModule.GroupRoleChanges(this, | ||
15419 | groupRoleChanges.AgentData.GroupID, | ||
15420 | d.RoleID, | ||
15421 | d.MemberID, | ||
15422 | d.Change); | ||
15423 | } | ||
15424 | m_GroupsModule.NotifyChange(groupRoleChanges.AgentData.GroupID); | ||
15425 | } | ||
15426 | break; | ||
15427 | |||
15428 | case PacketType.JoinGroupRequest: | ||
15429 | JoinGroupRequestPacket joinGroupRequest = | ||
15430 | (JoinGroupRequestPacket)Pack; | ||
15431 | |||
15432 | #region Packet Session and User Check | ||
15433 | if (m_checkPackets) | ||
15434 | { | ||
15435 | if (joinGroupRequest.AgentData.SessionID != SessionId || | ||
15436 | joinGroupRequest.AgentData.AgentID != AgentId) | ||
15437 | break; | ||
15438 | } | ||
15439 | #endregion | ||
15440 | |||
15441 | if (m_GroupsModule != null) | ||
15442 | { | ||
15443 | m_GroupsModule.JoinGroupRequest(this, | ||
15444 | joinGroupRequest.GroupData.GroupID); | ||
15445 | } | ||
15446 | break; | ||
15447 | |||
15448 | case PacketType.LeaveGroupRequest: | ||
15449 | LeaveGroupRequestPacket leaveGroupRequest = | ||
15450 | (LeaveGroupRequestPacket)Pack; | ||
15451 | |||
15452 | #region Packet Session and User Check | ||
15453 | if (m_checkPackets) | ||
15454 | { | ||
15455 | if (leaveGroupRequest.AgentData.SessionID != SessionId || | ||
15456 | leaveGroupRequest.AgentData.AgentID != AgentId) | ||
15457 | break; | ||
15458 | } | ||
15459 | #endregion | ||
15460 | |||
15461 | if (m_GroupsModule != null) | ||
15462 | { | ||
15463 | m_GroupsModule.LeaveGroupRequest(this, | ||
15464 | leaveGroupRequest.GroupData.GroupID); | ||
15465 | } | ||
15466 | break; | ||
15467 | |||
15468 | case PacketType.EjectGroupMemberRequest: | ||
15469 | EjectGroupMemberRequestPacket ejectGroupMemberRequest = | ||
15470 | (EjectGroupMemberRequestPacket)Pack; | ||
15471 | |||
15472 | #region Packet Session and User Check | ||
15473 | if (m_checkPackets) | ||
15474 | { | ||
15475 | if (ejectGroupMemberRequest.AgentData.SessionID != SessionId || | ||
15476 | ejectGroupMemberRequest.AgentData.AgentID != AgentId) | ||
15477 | break; | ||
15478 | } | ||
15479 | #endregion | ||
15480 | |||
15481 | if (m_GroupsModule != null) | ||
15482 | { | ||
15483 | foreach (EjectGroupMemberRequestPacket.EjectDataBlock e | ||
15484 | in ejectGroupMemberRequest.EjectData) | ||
15485 | { | ||
15486 | m_GroupsModule.EjectGroupMemberRequest(this, | ||
15487 | ejectGroupMemberRequest.GroupData.GroupID, | ||
15488 | e.EjecteeID); | ||
15489 | } | ||
15490 | } | ||
15491 | break; | ||
15492 | |||
15493 | case PacketType.InviteGroupRequest: | ||
15494 | InviteGroupRequestPacket inviteGroupRequest = | ||
15495 | (InviteGroupRequestPacket)Pack; | ||
15496 | |||
15497 | #region Packet Session and User Check | ||
15498 | if (m_checkPackets) | ||
15499 | { | ||
15500 | if (inviteGroupRequest.AgentData.SessionID != SessionId || | ||
15501 | inviteGroupRequest.AgentData.AgentID != AgentId) | ||
15502 | break; | ||
15503 | } | ||
15504 | #endregion | ||
15505 | |||
15506 | if (m_GroupsModule != null) | ||
15507 | { | ||
15508 | foreach (InviteGroupRequestPacket.InviteDataBlock b in | ||
15509 | inviteGroupRequest.InviteData) | ||
15510 | { | ||
15511 | m_GroupsModule.InviteGroupRequest(this, | ||
15512 | inviteGroupRequest.GroupData.GroupID, | ||
15513 | b.InviteeID, | ||
15514 | b.RoleID); | ||
15515 | } | ||
15516 | } | ||
15517 | break; | ||
15518 | |||
15519 | //#endregion | ||
15520 | |||
15521 | case PacketType.StartLure: | ||
15522 | StartLurePacket startLureRequest = (StartLurePacket)Pack; | ||
15523 | |||
15524 | #region Packet Session and User Check | ||
15525 | if (m_checkPackets) | ||
15526 | { | ||
15527 | if (startLureRequest.AgentData.SessionID != SessionId || | ||
15528 | startLureRequest.AgentData.AgentID != AgentId) | ||
15529 | break; | ||
15530 | } | ||
15531 | #endregion | ||
15532 | |||
15533 | StartLure handlerStartLure = OnStartLure; | ||
15534 | if (handlerStartLure != null) | ||
15535 | handlerStartLure(startLureRequest.Info.LureType, | ||
15536 | Utils.BytesToString( | ||
15537 | startLureRequest.Info.Message), | ||
15538 | startLureRequest.TargetData[0].TargetID, | ||
15539 | this); | ||
15540 | break; | ||
15541 | |||
15542 | case PacketType.TeleportLureRequest: | ||
15543 | TeleportLureRequestPacket teleportLureRequest = | ||
15544 | (TeleportLureRequestPacket)Pack; | ||
15545 | |||
15546 | #region Packet Session and User Check | ||
15547 | if (m_checkPackets) | ||
15548 | { | ||
15549 | if (teleportLureRequest.Info.SessionID != SessionId || | ||
15550 | teleportLureRequest.Info.AgentID != AgentId) | ||
15551 | break; | ||
15552 | } | ||
15553 | #endregion | ||
15554 | |||
15555 | TeleportLureRequest handlerTeleportLureRequest = OnTeleportLureRequest; | ||
15556 | if (handlerTeleportLureRequest != null) | ||
15557 | handlerTeleportLureRequest( | ||
15558 | teleportLureRequest.Info.LureID, | ||
15559 | teleportLureRequest.Info.TeleportFlags, | ||
15560 | this); | ||
15561 | break; | ||
15562 | |||
15563 | case PacketType.ClassifiedInfoRequest: | ||
15564 | ClassifiedInfoRequestPacket classifiedInfoRequest = | ||
15565 | (ClassifiedInfoRequestPacket)Pack; | ||
15566 | |||
15567 | #region Packet Session and User Check | ||
15568 | if (m_checkPackets) | ||
15569 | { | ||
15570 | if (classifiedInfoRequest.AgentData.SessionID != SessionId || | ||
15571 | classifiedInfoRequest.AgentData.AgentID != AgentId) | ||
15572 | break; | ||
15573 | } | ||
15574 | #endregion | ||
15575 | |||
15576 | ClassifiedInfoRequest handlerClassifiedInfoRequest = OnClassifiedInfoRequest; | ||
15577 | if (handlerClassifiedInfoRequest != null) | ||
15578 | handlerClassifiedInfoRequest( | ||
15579 | classifiedInfoRequest.Data.ClassifiedID, | ||
15580 | this); | ||
15581 | break; | ||
15582 | |||
15583 | case PacketType.ClassifiedInfoUpdate: | ||
15584 | ClassifiedInfoUpdatePacket classifiedInfoUpdate = | ||
15585 | (ClassifiedInfoUpdatePacket)Pack; | ||
15586 | |||
15587 | #region Packet Session and User Check | ||
15588 | if (m_checkPackets) | ||
15589 | { | ||
15590 | if (classifiedInfoUpdate.AgentData.SessionID != SessionId || | ||
15591 | classifiedInfoUpdate.AgentData.AgentID != AgentId) | ||
15592 | break; | ||
15593 | } | ||
15594 | #endregion | ||
15595 | |||
15596 | ClassifiedInfoUpdate handlerClassifiedInfoUpdate = OnClassifiedInfoUpdate; | ||
15597 | if (handlerClassifiedInfoUpdate != null) | ||
15598 | handlerClassifiedInfoUpdate( | ||
15599 | classifiedInfoUpdate.Data.ClassifiedID, | ||
15600 | classifiedInfoUpdate.Data.Category, | ||
15601 | Utils.BytesToString( | ||
15602 | classifiedInfoUpdate.Data.Name), | ||
15603 | Utils.BytesToString( | ||
15604 | classifiedInfoUpdate.Data.Desc), | ||
15605 | classifiedInfoUpdate.Data.ParcelID, | ||
15606 | classifiedInfoUpdate.Data.ParentEstate, | ||
15607 | classifiedInfoUpdate.Data.SnapshotID, | ||
15608 | new Vector3( | ||
15609 | classifiedInfoUpdate.Data.PosGlobal), | ||
15610 | classifiedInfoUpdate.Data.ClassifiedFlags, | ||
15611 | classifiedInfoUpdate.Data.PriceForListing, | ||
15612 | this); | ||
15613 | break; | ||
15614 | |||
15615 | case PacketType.ClassifiedDelete: | ||
15616 | ClassifiedDeletePacket classifiedDelete = | ||
15617 | (ClassifiedDeletePacket)Pack; | ||
15618 | |||
15619 | #region Packet Session and User Check | ||
15620 | if (m_checkPackets) | ||
15621 | { | ||
15622 | if (classifiedDelete.AgentData.SessionID != SessionId || | ||
15623 | classifiedDelete.AgentData.AgentID != AgentId) | ||
15624 | break; | ||
15625 | } | ||
15626 | #endregion | ||
15627 | |||
15628 | ClassifiedDelete handlerClassifiedDelete = OnClassifiedDelete; | ||
15629 | if (handlerClassifiedDelete != null) | ||
15630 | handlerClassifiedDelete( | ||
15631 | classifiedDelete.Data.ClassifiedID, | ||
15632 | this); | ||
15633 | break; | ||
15634 | |||
15635 | case PacketType.ClassifiedGodDelete: | ||
15636 | ClassifiedGodDeletePacket classifiedGodDelete = | ||
15637 | (ClassifiedGodDeletePacket)Pack; | ||
15638 | |||
15639 | #region Packet Session and User Check | ||
15640 | if (m_checkPackets) | ||
15641 | { | ||
15642 | if (classifiedGodDelete.AgentData.SessionID != SessionId || | ||
15643 | classifiedGodDelete.AgentData.AgentID != AgentId) | ||
15644 | break; | ||
15645 | } | ||
15646 | #endregion | ||
15647 | |||
15648 | ClassifiedDelete handlerClassifiedGodDelete = OnClassifiedGodDelete; | ||
15649 | if (handlerClassifiedGodDelete != null) | ||
15650 | handlerClassifiedGodDelete( | ||
15651 | classifiedGodDelete.Data.ClassifiedID, | ||
15652 | this); | ||
15653 | break; | ||
15654 | |||
15655 | case PacketType.EventGodDelete: | ||
15656 | EventGodDeletePacket eventGodDelete = | ||
15657 | (EventGodDeletePacket)Pack; | ||
15658 | |||
15659 | #region Packet Session and User Check | ||
15660 | if (m_checkPackets) | ||
15661 | { | ||
15662 | if (eventGodDelete.AgentData.SessionID != SessionId || | ||
15663 | eventGodDelete.AgentData.AgentID != AgentId) | ||
15664 | break; | ||
15665 | } | ||
15666 | #endregion | ||
15667 | |||
15668 | EventGodDelete handlerEventGodDelete = OnEventGodDelete; | ||
15669 | if (handlerEventGodDelete != null) | ||
15670 | handlerEventGodDelete( | ||
15671 | eventGodDelete.EventData.EventID, | ||
15672 | eventGodDelete.QueryData.QueryID, | ||
15673 | Utils.BytesToString( | ||
15674 | eventGodDelete.QueryData.QueryText), | ||
15675 | eventGodDelete.QueryData.QueryFlags, | ||
15676 | eventGodDelete.QueryData.QueryStart, | ||
15677 | this); | ||
15678 | break; | ||
15679 | |||
15680 | case PacketType.EventNotificationAddRequest: | ||
15681 | EventNotificationAddRequestPacket eventNotificationAdd = | ||
15682 | (EventNotificationAddRequestPacket)Pack; | ||
15683 | |||
15684 | #region Packet Session and User Check | ||
15685 | if (m_checkPackets) | ||
15686 | { | ||
15687 | if (eventNotificationAdd.AgentData.SessionID != SessionId || | ||
15688 | eventNotificationAdd.AgentData.AgentID != AgentId) | ||
15689 | break; | ||
15690 | } | ||
15691 | #endregion | ||
15692 | |||
15693 | EventNotificationAddRequest handlerEventNotificationAddRequest = OnEventNotificationAddRequest; | ||
15694 | if (handlerEventNotificationAddRequest != null) | ||
15695 | handlerEventNotificationAddRequest( | ||
15696 | eventNotificationAdd.EventData.EventID, this); | ||
15697 | break; | ||
15698 | |||
15699 | case PacketType.EventNotificationRemoveRequest: | ||
15700 | EventNotificationRemoveRequestPacket eventNotificationRemove = | ||
15701 | (EventNotificationRemoveRequestPacket)Pack; | ||
15702 | |||
15703 | #region Packet Session and User Check | ||
15704 | if (m_checkPackets) | ||
15705 | { | ||
15706 | if (eventNotificationRemove.AgentData.SessionID != SessionId || | ||
15707 | eventNotificationRemove.AgentData.AgentID != AgentId) | ||
15708 | break; | ||
15709 | } | ||
15710 | #endregion | ||
15711 | |||
15712 | EventNotificationRemoveRequest handlerEventNotificationRemoveRequest = OnEventNotificationRemoveRequest; | ||
15713 | if (handlerEventNotificationRemoveRequest != null) | ||
15714 | handlerEventNotificationRemoveRequest( | ||
15715 | eventNotificationRemove.EventData.EventID, this); | ||
15716 | break; | ||
15717 | |||
15718 | case PacketType.RetrieveInstantMessages: | ||
15719 | RetrieveInstantMessagesPacket rimpInstantMessagePack = (RetrieveInstantMessagesPacket)Pack; | ||
15720 | |||
15721 | #region Packet Session and User Check | ||
15722 | if (m_checkPackets) | ||
15723 | { | ||
15724 | if (rimpInstantMessagePack.AgentData.SessionID != SessionId || | ||
15725 | rimpInstantMessagePack.AgentData.AgentID != AgentId) | ||
15726 | break; | ||
15727 | } | ||
15728 | #endregion | ||
15729 | |||
15730 | RetrieveInstantMessages handlerRetrieveInstantMessages = OnRetrieveInstantMessages; | ||
15731 | if (handlerRetrieveInstantMessages != null) | ||
15732 | handlerRetrieveInstantMessages(this); | ||
15733 | break; | ||
15734 | |||
15735 | case PacketType.PickDelete: | ||
15736 | PickDeletePacket pickDelete = | ||
15737 | (PickDeletePacket)Pack; | ||
15738 | |||
15739 | #region Packet Session and User Check | ||
15740 | if (m_checkPackets) | ||
15741 | { | ||
15742 | if (pickDelete.AgentData.SessionID != SessionId || | ||
15743 | pickDelete.AgentData.AgentID != AgentId) | ||
15744 | break; | ||
15745 | } | ||
15746 | #endregion | ||
15747 | |||
15748 | PickDelete handlerPickDelete = OnPickDelete; | ||
15749 | if (handlerPickDelete != null) | ||
15750 | handlerPickDelete(this, pickDelete.Data.PickID); | ||
15751 | break; | ||
15752 | |||
15753 | case PacketType.PickGodDelete: | ||
15754 | PickGodDeletePacket pickGodDelete = | ||
15755 | (PickGodDeletePacket)Pack; | ||
15756 | |||
15757 | #region Packet Session and User Check | ||
15758 | if (m_checkPackets) | ||
15759 | { | ||
15760 | if (pickGodDelete.AgentData.SessionID != SessionId || | ||
15761 | pickGodDelete.AgentData.AgentID != AgentId) | ||
15762 | break; | ||
15763 | } | ||
15764 | #endregion | ||
15765 | |||
15766 | PickGodDelete handlerPickGodDelete = OnPickGodDelete; | ||
15767 | if (handlerPickGodDelete != null) | ||
15768 | handlerPickGodDelete(this, | ||
15769 | pickGodDelete.AgentData.AgentID, | ||
15770 | pickGodDelete.Data.PickID, | ||
15771 | pickGodDelete.Data.QueryID); | ||
15772 | break; | ||
15773 | |||
15774 | case PacketType.PickInfoUpdate: | ||
15775 | PickInfoUpdatePacket pickInfoUpdate = | ||
15776 | (PickInfoUpdatePacket)Pack; | ||
15777 | |||
15778 | #region Packet Session and User Check | ||
15779 | if (m_checkPackets) | ||
15780 | { | ||
15781 | if (pickInfoUpdate.AgentData.SessionID != SessionId || | ||
15782 | pickInfoUpdate.AgentData.AgentID != AgentId) | ||
15783 | break; | ||
15784 | } | ||
15785 | #endregion | ||
15786 | |||
15787 | PickInfoUpdate handlerPickInfoUpdate = OnPickInfoUpdate; | ||
15788 | if (handlerPickInfoUpdate != null) | ||
15789 | handlerPickInfoUpdate(this, | ||
15790 | pickInfoUpdate.Data.PickID, | ||
15791 | pickInfoUpdate.Data.CreatorID, | ||
15792 | pickInfoUpdate.Data.TopPick, | ||
15793 | Utils.BytesToString(pickInfoUpdate.Data.Name), | ||
15794 | Utils.BytesToString(pickInfoUpdate.Data.Desc), | ||
15795 | pickInfoUpdate.Data.SnapshotID, | ||
15796 | pickInfoUpdate.Data.SortOrder, | ||
15797 | pickInfoUpdate.Data.Enabled); | ||
15798 | break; | ||
15799 | |||
15800 | case PacketType.AvatarNotesUpdate: | ||
15801 | AvatarNotesUpdatePacket avatarNotesUpdate = | ||
15802 | (AvatarNotesUpdatePacket)Pack; | ||
15803 | |||
15804 | #region Packet Session and User Check | ||
15805 | if (m_checkPackets) | ||
15806 | { | ||
15807 | if (avatarNotesUpdate.AgentData.SessionID != SessionId || | ||
15808 | avatarNotesUpdate.AgentData.AgentID != AgentId) | ||
15809 | break; | ||
15810 | } | ||
15811 | #endregion | ||
15812 | |||
15813 | AvatarNotesUpdate handlerAvatarNotesUpdate = OnAvatarNotesUpdate; | ||
15814 | if (handlerAvatarNotesUpdate != null) | ||
15815 | handlerAvatarNotesUpdate(this, | ||
15816 | avatarNotesUpdate.Data.TargetID, | ||
15817 | Utils.BytesToString(avatarNotesUpdate.Data.Notes)); | ||
15818 | break; | ||
15819 | |||
15820 | case PacketType.AvatarInterestsUpdate: | ||
15821 | AvatarInterestsUpdatePacket avatarInterestUpdate = | ||
15822 | (AvatarInterestsUpdatePacket)Pack; | ||
15823 | |||
15824 | #region Packet Session and User Check | ||
15825 | if (m_checkPackets) | ||
15826 | { | ||
15827 | if (avatarInterestUpdate.AgentData.SessionID != SessionId || | ||
15828 | avatarInterestUpdate.AgentData.AgentID != AgentId) | ||
15829 | break; | ||
15830 | } | ||
15831 | #endregion | ||
15832 | 11040 | ||
15833 | AvatarInterestUpdate handlerAvatarInterestUpdate = OnAvatarInterestUpdate; | 11041 | if (!ProcessPacketMethod(Pack)) |
15834 | if (handlerAvatarInterestUpdate != null) | 11042 | m_log.Warn("[CLIENT]: unhandled packet " + Pack); |
15835 | handlerAvatarInterestUpdate(this, | ||
15836 | avatarInterestUpdate.PropertiesData.WantToMask, | ||
15837 | Utils.BytesToString(avatarInterestUpdate.PropertiesData.WantToText), | ||
15838 | avatarInterestUpdate.PropertiesData.SkillsMask, | ||
15839 | Utils.BytesToString(avatarInterestUpdate.PropertiesData.SkillsText), | ||
15840 | Utils.BytesToString(avatarInterestUpdate.PropertiesData.LanguagesText)); | ||
15841 | break; | ||
15842 | |||
15843 | case PacketType.GrantUserRights: | ||
15844 | GrantUserRightsPacket GrantUserRights = | ||
15845 | (GrantUserRightsPacket)Pack; | ||
15846 | #region Packet Session and User Check | ||
15847 | if (m_checkPackets) | ||
15848 | { | ||
15849 | if (GrantUserRights.AgentData.SessionID != SessionId || | ||
15850 | GrantUserRights.AgentData.AgentID != AgentId) | ||
15851 | break; | ||
15852 | } | ||
15853 | #endregion | ||
15854 | GrantUserFriendRights GrantUserRightsHandler = OnGrantUserRights; | ||
15855 | if (GrantUserRightsHandler != null) | ||
15856 | GrantUserRightsHandler(this, | ||
15857 | GrantUserRights.AgentData.AgentID, | ||
15858 | GrantUserRights.Rights[0].AgentRelated, | ||
15859 | GrantUserRights.Rights[0].RelatedRights); | ||
15860 | break; | ||
15861 | |||
15862 | case PacketType.PlacesQuery: | ||
15863 | PlacesQueryPacket placesQueryPacket = | ||
15864 | (PlacesQueryPacket)Pack; | ||
15865 | |||
15866 | PlacesQuery handlerPlacesQuery = OnPlacesQuery; | ||
15867 | |||
15868 | if (handlerPlacesQuery != null) | ||
15869 | handlerPlacesQuery(placesQueryPacket.AgentData.QueryID, | ||
15870 | placesQueryPacket.TransactionData.TransactionID, | ||
15871 | Utils.BytesToString( | ||
15872 | placesQueryPacket.QueryData.QueryText), | ||
15873 | placesQueryPacket.QueryData.QueryFlags, | ||
15874 | (byte)placesQueryPacket.QueryData.Category, | ||
15875 | Utils.BytesToString( | ||
15876 | placesQueryPacket.QueryData.SimName), | ||
15877 | this); | ||
15878 | break; | ||
15879 | */ | ||
15880 | #endregion | ||
15881 | default: | ||
15882 | m_log.Warn("[CLIENT]: unhandled packet " + Pack); | ||
15883 | break; | ||
15884 | } | ||
15885 | 11043 | ||
15886 | PacketPool.Instance.ReturnPacket(Pack); | 11044 | PacketPool.Instance.ReturnPacket(Pack); |
15887 | |||
15888 | } | 11045 | } |
15889 | 11046 | ||
15890 | private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) | 11047 | private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) |
diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs index 1903eb9..b1b7b27 100644 --- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs | |||
@@ -330,7 +330,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
330 | //m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); | 330 | //m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); |
331 | 331 | ||
332 | if (name != Name) | 332 | if (name != Name) |
333 | return; | 333 | return; |
334 | 334 | ||
335 | long maxSize = DefaultMaxSize; | 335 | long maxSize = DefaultMaxSize; |
336 | int maxCount = DefaultMaxCount; | 336 | int maxCount = DefaultMaxCount; |
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 9216e0b..967c0a1 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -69,7 +69,7 @@ namespace Flotsam.RegionModules.AssetCache | |||
69 | 69 | ||
70 | private readonly List<char> m_InvalidChars = new List<char>(); | 70 | private readonly List<char> m_InvalidChars = new List<char>(); |
71 | 71 | ||
72 | private int m_LogLevel = 1; | 72 | private int m_LogLevel = 0; |
73 | private ulong m_HitRateDisplay = 1; // How often to display hit statistics, given in requests | 73 | private ulong m_HitRateDisplay = 1; // How often to display hit statistics, given in requests |
74 | 74 | ||
75 | private static ulong m_Requests; | 75 | private static ulong m_Requests; |
@@ -156,7 +156,7 @@ namespace Flotsam.RegionModules.AssetCache | |||
156 | m_WaitOnInprogressTimeout = assetConfig.GetInt("WaitOnInprogressTimeout", 3000); | 156 | m_WaitOnInprogressTimeout = assetConfig.GetInt("WaitOnInprogressTimeout", 3000); |
157 | #endif | 157 | #endif |
158 | 158 | ||
159 | m_LogLevel = assetConfig.GetInt("LogLevel", 1); | 159 | m_LogLevel = assetConfig.GetInt("LogLevel", 0); |
160 | m_HitRateDisplay = (ulong)assetConfig.GetInt("HitRateDisplay", 1000); | 160 | m_HitRateDisplay = (ulong)assetConfig.GetInt("HitRateDisplay", 1000); |
161 | 161 | ||
162 | m_FileExpiration = TimeSpan.FromHours(assetConfig.GetDouble("FileCacheTimeout", m_DefaultFileExpiration)); | 162 | m_FileExpiration = TimeSpan.FromHours(assetConfig.GetDouble("FileCacheTimeout", m_DefaultFileExpiration)); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index 0bd68dd..3614915 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs | |||
@@ -159,7 +159,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule | |||
159 | avatar.Invulnerable = true; | 159 | avatar.Invulnerable = true; |
160 | } | 160 | } |
161 | } | 161 | } |
162 | catch (Exception ex) | 162 | catch (Exception) |
163 | { | 163 | { |
164 | } | 164 | } |
165 | } | 165 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index b055f8b..71b3062 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -131,7 +131,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
131 | { | 131 | { |
132 | if (CheckPresence(userInfo.PrincipalID)) | 132 | if (CheckPresence(userInfo.PrincipalID)) |
133 | { | 133 | { |
134 | new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(); | 134 | try |
135 | { | ||
136 | new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(); | ||
137 | } | ||
138 | catch (EntryPointNotFoundException e) | ||
139 | { | ||
140 | m_log.ErrorFormat( | ||
141 | "[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream." | ||
142 | + "If you've manually installed Mono, have you appropriately updated zlib1g as well?"); | ||
143 | m_log.Error(e); | ||
144 | |||
145 | return false; | ||
146 | } | ||
147 | |||
135 | return true; | 148 | return true; |
136 | } | 149 | } |
137 | else | 150 | else |
@@ -156,7 +169,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
156 | { | 169 | { |
157 | if (CheckPresence(userInfo.PrincipalID)) | 170 | if (CheckPresence(userInfo.PrincipalID)) |
158 | { | 171 | { |
159 | new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(); | 172 | try |
173 | { | ||
174 | new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(); | ||
175 | } | ||
176 | catch (EntryPointNotFoundException e) | ||
177 | { | ||
178 | m_log.ErrorFormat( | ||
179 | "[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream." | ||
180 | + "If you've manually installed Mono, have you appropriately updated zlib1g as well?"); | ||
181 | m_log.Error(e); | ||
182 | |||
183 | return false; | ||
184 | } | ||
185 | |||
160 | return true; | 186 | return true; |
161 | } | 187 | } |
162 | else | 188 | else |
@@ -181,8 +207,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
181 | { | 207 | { |
182 | if (CheckPresence(userInfo.PrincipalID)) | 208 | if (CheckPresence(userInfo.PrincipalID)) |
183 | { | 209 | { |
184 | InventoryArchiveReadRequest request = | 210 | InventoryArchiveReadRequest request; |
185 | new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream); | 211 | |
212 | try | ||
213 | { | ||
214 | request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream); | ||
215 | } | ||
216 | catch (EntryPointNotFoundException e) | ||
217 | { | ||
218 | m_log.ErrorFormat( | ||
219 | "[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream." | ||
220 | + "If you've manually installed Mono, have you appropriately updated zlib1g as well?"); | ||
221 | m_log.Error(e); | ||
222 | |||
223 | return false; | ||
224 | } | ||
225 | |||
186 | UpdateClientWithLoadedNodes(userInfo, request.Execute()); | 226 | UpdateClientWithLoadedNodes(userInfo, request.Execute()); |
187 | 227 | ||
188 | return true; | 228 | return true; |
@@ -209,8 +249,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
209 | { | 249 | { |
210 | if (CheckPresence(userInfo.PrincipalID)) | 250 | if (CheckPresence(userInfo.PrincipalID)) |
211 | { | 251 | { |
212 | InventoryArchiveReadRequest request = | 252 | InventoryArchiveReadRequest request; |
213 | new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath); | 253 | |
254 | try | ||
255 | { | ||
256 | request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath); | ||
257 | } | ||
258 | catch (EntryPointNotFoundException e) | ||
259 | { | ||
260 | m_log.ErrorFormat( | ||
261 | "[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream." | ||
262 | + "If you've manually installed Mono, have you appropriately updated zlib1g as well?"); | ||
263 | m_log.Error(e); | ||
264 | |||
265 | return false; | ||
266 | } | ||
267 | |||
214 | UpdateClientWithLoadedNodes(userInfo, request.Execute()); | 268 | UpdateClientWithLoadedNodes(userInfo, request.Execute()); |
215 | 269 | ||
216 | return true; | 270 | return true; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs index 2f21e6d..50348da 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | |||
@@ -224,7 +224,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
224 | m_Cache.Cache(a); | 224 | m_Cache.Cache(a); |
225 | 225 | ||
226 | // if (null == a) | 226 | // if (null == a) |
227 | // m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not asynchronously find asset with id {0}", id); | 227 | // m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not asynchronously find asset with id {0}", id); |
228 | 228 | ||
229 | Util.FireAndForget(delegate { handler(assetID, s, a); }); | 229 | Util.FireAndForget(delegate { handler(assetID, s, a); }); |
230 | }); | 230 | }); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs index 2ca90f8..95d8737 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
56 | config.AddConfig("GridService"); | 56 | config.AddConfig("GridService"); |
57 | config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); | 57 | config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); |
58 | config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService"); | 58 | config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService"); |
59 | config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData"); | 59 | config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); |
60 | 60 | ||
61 | m_LocalConnector = new LocalGridServicesConnector(config); | 61 | m_LocalConnector = new LocalGridServicesConnector(config); |
62 | } | 62 | } |
@@ -92,7 +92,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
92 | r2.HttpPort = 9002; | 92 | r2.HttpPort = 9002; |
93 | r2.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); | 93 | r2.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); |
94 | s = new Scene(new RegionInfo()); | 94 | s = new Scene(new RegionInfo()); |
95 | s.RegionInfo.RegionID = r1.RegionID; | 95 | s.RegionInfo.RegionID = r2.RegionID; |
96 | m_LocalConnector.AddRegion(s); | 96 | m_LocalConnector.AddRegion(s); |
97 | 97 | ||
98 | GridRegion r3 = new GridRegion(); | 98 | GridRegion r3 = new GridRegion(); |
@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
104 | r3.HttpPort = 9003; | 104 | r3.HttpPort = 9003; |
105 | r3.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); | 105 | r3.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); |
106 | s = new Scene(new RegionInfo()); | 106 | s = new Scene(new RegionInfo()); |
107 | s.RegionInfo.RegionID = r1.RegionID; | 107 | s.RegionInfo.RegionID = r3.RegionID; |
108 | m_LocalConnector.AddRegion(s); | 108 | m_LocalConnector.AddRegion(s); |
109 | 109 | ||
110 | m_LocalConnector.RegisterRegion(UUID.Zero, r1); | 110 | m_LocalConnector.RegisterRegion(UUID.Zero, r1); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 54e62e2..e97d21f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -314,7 +314,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
314 | item = m_InventoryService.GetItem(item); | 314 | item = m_InventoryService.GetItem(item); |
315 | 315 | ||
316 | if (null == item) | 316 | if (null == item) |
317 | m_log.ErrorFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find item with id {0}"); | 317 | m_log.ErrorFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find item with id {0}", item.ID); |
318 | 318 | ||
319 | return item; | 319 | return item; |
320 | } | 320 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs index 9ba1bdc..ca42461 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests | |||
56 | config.AddConfig("PresenceService"); | 56 | config.AddConfig("PresenceService"); |
57 | config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector"); | 57 | config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector"); |
58 | config.Configs["PresenceService"].Set("LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService"); | 58 | config.Configs["PresenceService"].Set("LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService"); |
59 | config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullPresenceData"); | 59 | config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); |
60 | 60 | ||
61 | m_LocalConnector = new LocalPresenceServicesConnector(config); | 61 | m_LocalConnector = new LocalPresenceServicesConnector(config); |
62 | } | 62 | } |
diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs index 127469e..c355b13 100644 --- a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs +++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs | |||
@@ -108,7 +108,7 @@ namespace OpenSim.Region.CoreModules.World | |||
108 | { | 108 | { |
109 | foreach (Scene s in m_SceneList) | 109 | foreach (Scene s in m_SceneList) |
110 | { | 110 | { |
111 | if(!ProcessCommand(s, cmd)) | 111 | if (!ProcessCommand(s, cmd)) |
112 | break; | 112 | break; |
113 | } | 113 | } |
114 | } | 114 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index c4b1817..f5eda3a 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -74,7 +74,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
74 | public ArchiveReadRequest(Scene scene, string loadPath, bool merge, Guid requestId) | 74 | public ArchiveReadRequest(Scene scene, string loadPath, bool merge, Guid requestId) |
75 | { | 75 | { |
76 | m_scene = scene; | 76 | m_scene = scene; |
77 | m_loadStream = new GZipStream(GetStream(loadPath), CompressionMode.Decompress); | 77 | |
78 | try | ||
79 | { | ||
80 | m_loadStream = new GZipStream(GetStream(loadPath), CompressionMode.Decompress); | ||
81 | } | ||
82 | catch (EntryPointNotFoundException e) | ||
83 | { | ||
84 | m_log.ErrorFormat( | ||
85 | "[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream." | ||
86 | + "If you've manually installed Mono, have you appropriately updated zlib1g as well?"); | ||
87 | m_log.Error(e); | ||
88 | } | ||
89 | |||
78 | m_errorMessage = String.Empty; | 90 | m_errorMessage = String.Empty; |
79 | m_merge = merge; | 91 | m_merge = merge; |
80 | m_requestId = requestId; | 92 | m_requestId = requestId; |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index 71bfe57..b61b341 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -65,7 +65,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
65 | public ArchiveWriteRequestPreparation(Scene scene, string savePath, Guid requestId) | 65 | public ArchiveWriteRequestPreparation(Scene scene, string savePath, Guid requestId) |
66 | { | 66 | { |
67 | m_scene = scene; | 67 | m_scene = scene; |
68 | m_saveStream = new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress); | 68 | |
69 | try | ||
70 | { | ||
71 | m_saveStream = new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress); | ||
72 | } | ||
73 | catch (EntryPointNotFoundException e) | ||
74 | { | ||
75 | m_log.ErrorFormat( | ||
76 | "[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream." | ||
77 | + "If you've manually installed Mono, have you appropriately updated zlib1g as well?"); | ||
78 | m_log.Error(e); | ||
79 | } | ||
80 | |||
69 | m_requestId = requestId; | 81 | m_requestId = requestId; |
70 | } | 82 | } |
71 | 83 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index d986274..de16d89 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
63 | SerialiserModule serialiserModule = new SerialiserModule(); | 63 | SerialiserModule serialiserModule = new SerialiserModule(); |
64 | TerrainModule terrainModule = new TerrainModule(); | 64 | TerrainModule terrainModule = new TerrainModule(); |
65 | 65 | ||
66 | m_scene = SceneSetupHelpers.SetupScene("scene1"); | 66 | m_scene = SceneSetupHelpers.SetupScene("useraccounts"); |
67 | SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); | 67 | SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); |
68 | } | 68 | } |
69 | 69 | ||
@@ -99,7 +99,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
99 | Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); | 99 | Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); |
100 | Vector3 offsetPosition = new Vector3(5, 10, 15); | 100 | Vector3 offsetPosition = new Vector3(5, 10, 15); |
101 | 101 | ||
102 | return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; | 102 | return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; |
103 | } | 103 | } |
104 | 104 | ||
105 | protected SceneObjectPart CreateSceneObjectPart2() | 105 | protected SceneObjectPart CreateSceneObjectPart2() |
@@ -112,7 +112,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
112 | Vector3 offsetPosition = new Vector3(20, 25, 30); | 112 | Vector3 offsetPosition = new Vector3(20, 25, 30); |
113 | 113 | ||
114 | return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; | 114 | return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; |
115 | } | 115 | } |
116 | 116 | ||
117 | /// <summary> | 117 | /// <summary> |
118 | /// Test saving a V0.2 OpenSim Region Archive. | 118 | /// Test saving a V0.2 OpenSim Region Archive. |
@@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
231 | foreach (string name in names) | 231 | foreach (string name in names) |
232 | { | 232 | { |
233 | if (name.EndsWith(".Resources.test-sound.wav")) | 233 | if (name.EndsWith(".Resources.test-sound.wav")) |
234 | soundDataResourceName = name; | 234 | soundDataResourceName = name; |
235 | } | 235 | } |
236 | Assert.That(soundDataResourceName, Is.Not.Null); | 236 | Assert.That(soundDataResourceName, Is.Not.Null); |
237 | 237 | ||
@@ -259,7 +259,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
259 | = new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid, Name = soundItemName }; | 259 | = new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid, Name = soundItemName }; |
260 | part1.Inventory.AddInventoryItem(item1, true); | 260 | part1.Inventory.AddInventoryItem(item1, true); |
261 | } | 261 | } |
262 | } | 262 | } |
263 | 263 | ||
264 | m_scene.AddNewSceneObject(object1, false); | 264 | m_scene.AddNewSceneObject(object1, false); |
265 | 265 | ||
@@ -306,15 +306,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
306 | /// Test loading the region settings of a V0.2 OpenSim Region Archive. | 306 | /// Test loading the region settings of a V0.2 OpenSim Region Archive. |
307 | /// </summary> | 307 | /// </summary> |
308 | [Test] | 308 | [Test] |
309 | public void TestLoadOarV0_2RegionSettings() | 309 | public void TestLoadOarV0_2RegionSettings() |
310 | { | 310 | { |
311 | TestHelper.InMethod(); | 311 | TestHelper.InMethod(); |
312 | //log4net.Config.XmlConfigurator.Configure(); | 312 | //log4net.Config.XmlConfigurator.Configure(); |
313 | 313 | ||
314 | MemoryStream archiveWriteStream = new MemoryStream(); | 314 | MemoryStream archiveWriteStream = new MemoryStream(); |
315 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); | 315 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); |
316 | 316 | ||
317 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); | 317 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); |
318 | tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); | 318 | tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); |
319 | 319 | ||
320 | RegionSettings rs = new RegionSettings(); | 320 | RegionSettings rs = new RegionSettings(); |
@@ -329,11 +329,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
329 | rs.DisablePhysics = true; | 329 | rs.DisablePhysics = true; |
330 | rs.DisableScripts = true; | 330 | rs.DisableScripts = true; |
331 | rs.Elevation1NW = 15.9; | 331 | rs.Elevation1NW = 15.9; |
332 | rs.Elevation1NE = 45.3; | 332 | rs.Elevation1NE = 45.3; |
333 | rs.Elevation1SE = 49; | 333 | rs.Elevation1SE = 49; |
334 | rs.Elevation1SW = 1.9; | 334 | rs.Elevation1SW = 1.9; |
335 | rs.Elevation2NW = 4.5; | 335 | rs.Elevation2NW = 4.5; |
336 | rs.Elevation2NE = 19.2; | 336 | rs.Elevation2NE = 19.2; |
337 | rs.Elevation2SE = 9.2; | 337 | rs.Elevation2SE = 9.2; |
338 | rs.Elevation2SW = 2.1; | 338 | rs.Elevation2SW = 2.1; |
339 | rs.FixedSun = true; | 339 | rs.FixedSun = true; |
@@ -411,7 +411,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
411 | // Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90); | 411 | // Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90); |
412 | // Vector3 part2OffsetPosition = new Vector3(20, 25, 30); | 412 | // Vector3 part2OffsetPosition = new Vector3(20, 25, 30); |
413 | 413 | ||
414 | SceneObjectPart part2 = CreateSceneObjectPart2(); | 414 | SceneObjectPart part2 = CreateSceneObjectPart2(); |
415 | 415 | ||
416 | // Create an oar file that we can use for the merge | 416 | // Create an oar file that we can use for the merge |
417 | { | 417 | { |
@@ -420,9 +420,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
420 | TerrainModule terrainModule = new TerrainModule(); | 420 | TerrainModule terrainModule = new TerrainModule(); |
421 | 421 | ||
422 | Scene scene = SceneSetupHelpers.SetupScene(); | 422 | Scene scene = SceneSetupHelpers.SetupScene(); |
423 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); | 423 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); |
424 | 424 | ||
425 | m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); | 425 | m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); |
426 | 426 | ||
427 | // Write out this scene | 427 | // Write out this scene |
428 | scene.EventManager.OnOarFileSaved += SaveCompleted; | 428 | scene.EventManager.OnOarFileSaved += SaveCompleted; |
diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs index c289cdb..8954513 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs | |||
@@ -65,7 +65,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
65 | /// The UUID of the texture updater, not the texture UUID. If you need the texture UUID then you will need | 65 | /// The UUID of the texture updater, not the texture UUID. If you need the texture UUID then you will need |
66 | /// to obtain it directly from the SceneObjectPart. For instance, if ALL_SIDES is set then this texture | 66 | /// to obtain it directly from the SceneObjectPart. For instance, if ALL_SIDES is set then this texture |
67 | /// can be obtained as SceneObjectPart.Shape.Textures.DefaultTexture.TextureID | 67 | /// can be obtained as SceneObjectPart.Shape.Textures.DefaultTexture.TextureID |
68 | /// </returns> | 68 | /// </returns> |
69 | UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, | 69 | UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, |
70 | int updateTimer, bool SetBlending, byte AlphaValue); | 70 | int updateTimer, bool SetBlending, byte AlphaValue); |
71 | 71 | ||
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index fa9bf19..f58904f 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | |||
@@ -150,7 +150,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
150 | /// <returns> | 150 | /// <returns> |
151 | /// A list of inventory items with that name. | 151 | /// A list of inventory items with that name. |
152 | /// If no inventory item has that name then an empty list is returned. | 152 | /// If no inventory item has that name then an empty list is returned. |
153 | /// </returns> | 153 | /// </returns> |
154 | IList<TaskInventoryItem> GetInventoryItems(string name); | 154 | IList<TaskInventoryItem> GetInventoryItems(string name); |
155 | 155 | ||
156 | /// <summary> | 156 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs index 948b9dc..8da99a0 100644 --- a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs +++ b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
62 | /// <param name="name">name to filter on</param> | 62 | /// <param name="name">name to filter on</param> |
63 | /// <param name="id">key to filter on (user given, could be totally faked)</param> | 63 | /// <param name="id">key to filter on (user given, could be totally faked)</param> |
64 | /// <param name="msg">msg to filter on</param> | 64 | /// <param name="msg">msg to filter on</param> |
65 | /// <returns>number of the scripts handle</returns> | 65 | /// <returns>number of the scripts handle</returns> |
66 | int Listen(uint LocalID, UUID itemID, UUID hostID, int channel, string name, UUID id, string msg); | 66 | int Listen(uint LocalID, UUID itemID, UUID hostID, int channel, string name, UUID id, string msg); |
67 | 67 | ||
68 | /// <summary> | 68 | /// <summary> |
@@ -77,19 +77,19 @@ namespace OpenSim.Region.Framework.Interfaces | |||
77 | /// <param name="channel">channel to sent on</param> | 77 | /// <param name="channel">channel to sent on</param> |
78 | /// <param name="name">name of sender (object or avatar)</param> | 78 | /// <param name="name">name of sender (object or avatar)</param> |
79 | /// <param name="id">key of sender (object or avatar)</param> | 79 | /// <param name="id">key of sender (object or avatar)</param> |
80 | /// <param name="msg">msg to sent</param> | 80 | /// <param name="msg">msg to sent</param> |
81 | void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg); | 81 | void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg); |
82 | 82 | ||
83 | /// <summary> | 83 | /// <summary> |
84 | /// Are there any listen events ready to be dispatched? | 84 | /// Are there any listen events ready to be dispatched? |
85 | /// </summary> | 85 | /// </summary> |
86 | /// <returns>boolean indication</returns> | 86 | /// <returns>boolean indication</returns> |
87 | bool HasMessages(); | 87 | bool HasMessages(); |
88 | 88 | ||
89 | /// <summary> | 89 | /// <summary> |
90 | /// Pop the first availlable listen event from the queue | 90 | /// Pop the first availlable listen event from the queue |
91 | /// </summary> | 91 | /// </summary> |
92 | /// <returns>ListenerInfo with filter filled in</returns> | 92 | /// <returns>ListenerInfo with filter filled in</returns> |
93 | IWorldCommListenerInfo GetNextMessage(); | 93 | IWorldCommListenerInfo GetNextMessage(); |
94 | 94 | ||
95 | void ListenControl(UUID itemID, int handle, int active); | 95 | void ListenControl(UUID itemID, int handle, int active); |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 9f74b2a..57e1c37 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -209,7 +209,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
209 | /// Triggered when an object or attachment enters a scene | 209 | /// Triggered when an object or attachment enters a scene |
210 | /// </summary> | 210 | /// </summary> |
211 | public event OnIncomingSceneObjectDelegate OnIncomingSceneObject; | 211 | public event OnIncomingSceneObjectDelegate OnIncomingSceneObject; |
212 | public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so); | 212 | public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so); |
213 | 213 | ||
214 | public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel); | 214 | public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel); |
215 | 215 | ||
@@ -413,7 +413,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
413 | } | 413 | } |
414 | } | 414 | } |
415 | } | 415 | } |
416 | } | 416 | } |
417 | 417 | ||
418 | public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) | 418 | public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) |
419 | { | 419 | { |
@@ -433,7 +433,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
433 | e.Message, e.StackTrace); | 433 | e.Message, e.StackTrace); |
434 | } | 434 | } |
435 | } | 435 | } |
436 | } | 436 | } |
437 | } | 437 | } |
438 | 438 | ||
439 | public void TriggerOnScriptChangedEvent(uint localID, uint change) | 439 | public void TriggerOnScriptChangedEvent(uint localID, uint change) |
@@ -454,7 +454,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
454 | e.Message, e.StackTrace); | 454 | e.Message, e.StackTrace); |
455 | } | 455 | } |
456 | } | 456 | } |
457 | } | 457 | } |
458 | } | 458 | } |
459 | 459 | ||
460 | public void TriggerOnClientMovement(ScenePresence avatar) | 460 | public void TriggerOnClientMovement(ScenePresence avatar) |
@@ -475,7 +475,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
475 | e.Message, e.StackTrace); | 475 | e.Message, e.StackTrace); |
476 | } | 476 | } |
477 | } | 477 | } |
478 | } | 478 | } |
479 | } | 479 | } |
480 | 480 | ||
481 | public void TriggerPermissionError(UUID user, string reason) | 481 | public void TriggerPermissionError(UUID user, string reason) |
@@ -496,7 +496,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
496 | e.Message, e.StackTrace); | 496 | e.Message, e.StackTrace); |
497 | } | 497 | } |
498 | } | 498 | } |
499 | } | 499 | } |
500 | } | 500 | } |
501 | 501 | ||
502 | public void TriggerOnPluginConsole(string[] args) | 502 | public void TriggerOnPluginConsole(string[] args) |
@@ -517,7 +517,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
517 | e.Message, e.StackTrace); | 517 | e.Message, e.StackTrace); |
518 | } | 518 | } |
519 | } | 519 | } |
520 | } | 520 | } |
521 | } | 521 | } |
522 | 522 | ||
523 | public void TriggerOnFrame() | 523 | public void TriggerOnFrame() |
@@ -538,11 +538,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
538 | e.Message, e.StackTrace); | 538 | e.Message, e.StackTrace); |
539 | } | 539 | } |
540 | } | 540 | } |
541 | } | 541 | } |
542 | } | 542 | } |
543 | 543 | ||
544 | public void TriggerOnNewClient(IClientAPI client) | 544 | public void TriggerOnNewClient(IClientAPI client) |
545 | { | 545 | { |
546 | OnNewClientDelegate handlerNewClient = OnNewClient; | 546 | OnNewClientDelegate handlerNewClient = OnNewClient; |
547 | if (handlerNewClient != null) | 547 | if (handlerNewClient != null) |
548 | { | 548 | { |
@@ -559,10 +559,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
559 | e.Message, e.StackTrace); | 559 | e.Message, e.StackTrace); |
560 | } | 560 | } |
561 | } | 561 | } |
562 | } | 562 | } |
563 | 563 | ||
564 | if (client is IClientCore) | 564 | if (client is IClientCore) |
565 | { | 565 | { |
566 | OnClientConnectCoreDelegate handlerClientConnect = OnClientConnect; | 566 | OnClientConnectCoreDelegate handlerClientConnect = OnClientConnect; |
567 | if (handlerClientConnect != null) | 567 | if (handlerClientConnect != null) |
568 | { | 568 | { |
@@ -579,7 +579,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
579 | e.Message, e.StackTrace); | 579 | e.Message, e.StackTrace); |
580 | } | 580 | } |
581 | } | 581 | } |
582 | } | 582 | } |
583 | } | 583 | } |
584 | } | 584 | } |
585 | 585 | ||
@@ -601,11 +601,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
601 | e.Message, e.StackTrace); | 601 | e.Message, e.StackTrace); |
602 | } | 602 | } |
603 | } | 603 | } |
604 | } | 604 | } |
605 | } | 605 | } |
606 | 606 | ||
607 | public void TriggerOnRemovePresence(UUID agentId) | 607 | public void TriggerOnRemovePresence(UUID agentId) |
608 | { | 608 | { |
609 | OnRemovePresenceDelegate handlerRemovePresence = OnRemovePresence; | 609 | OnRemovePresenceDelegate handlerRemovePresence = OnRemovePresence; |
610 | if (handlerRemovePresence != null) | 610 | if (handlerRemovePresence != null) |
611 | { | 611 | { |
@@ -622,11 +622,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
622 | e.Message, e.StackTrace); | 622 | e.Message, e.StackTrace); |
623 | } | 623 | } |
624 | } | 624 | } |
625 | } | 625 | } |
626 | } | 626 | } |
627 | 627 | ||
628 | public void TriggerOnBackup(IRegionDataStore dstore) | 628 | public void TriggerOnBackup(IRegionDataStore dstore) |
629 | { | 629 | { |
630 | OnBackupDelegate handlerOnAttach = OnBackup; | 630 | OnBackupDelegate handlerOnAttach = OnBackup; |
631 | if (handlerOnAttach != null) | 631 | if (handlerOnAttach != null) |
632 | { | 632 | { |
@@ -643,7 +643,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
643 | e.Message, e.StackTrace); | 643 | e.Message, e.StackTrace); |
644 | } | 644 | } |
645 | } | 645 | } |
646 | } | 646 | } |
647 | } | 647 | } |
648 | 648 | ||
649 | public void TriggerParcelPrimCountUpdate() | 649 | public void TriggerParcelPrimCountUpdate() |
@@ -664,7 +664,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
664 | e.Message, e.StackTrace); | 664 | e.Message, e.StackTrace); |
665 | } | 665 | } |
666 | } | 666 | } |
667 | } | 667 | } |
668 | } | 668 | } |
669 | 669 | ||
670 | public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs args) | 670 | public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs args) |
@@ -685,7 +685,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
685 | e.Message, e.StackTrace); | 685 | e.Message, e.StackTrace); |
686 | } | 686 | } |
687 | } | 687 | } |
688 | } | 688 | } |
689 | } | 689 | } |
690 | 690 | ||
691 | public void TriggerTerrainTick() | 691 | public void TriggerTerrainTick() |
@@ -706,7 +706,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
706 | e.Message, e.StackTrace); | 706 | e.Message, e.StackTrace); |
707 | } | 707 | } |
708 | } | 708 | } |
709 | } | 709 | } |
710 | } | 710 | } |
711 | 711 | ||
712 | public void TriggerParcelPrimCountAdd(SceneObjectGroup obj) | 712 | public void TriggerParcelPrimCountAdd(SceneObjectGroup obj) |
@@ -727,7 +727,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
727 | e.Message, e.StackTrace); | 727 | e.Message, e.StackTrace); |
728 | } | 728 | } |
729 | } | 729 | } |
730 | } | 730 | } |
731 | } | 731 | } |
732 | 732 | ||
733 | public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj) | 733 | public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj) |
@@ -748,11 +748,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
748 | e.Message, e.StackTrace); | 748 | e.Message, e.StackTrace); |
749 | } | 749 | } |
750 | } | 750 | } |
751 | } | 751 | } |
752 | } | 752 | } |
753 | 753 | ||
754 | public void TriggerShutdown() | 754 | public void TriggerShutdown() |
755 | { | 755 | { |
756 | OnShutdownDelegate handlerShutdown = OnShutdown; | 756 | OnShutdownDelegate handlerShutdown = OnShutdown; |
757 | if (handlerShutdown != null) | 757 | if (handlerShutdown != null) |
758 | { | 758 | { |
@@ -769,11 +769,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
769 | e.Message, e.StackTrace); | 769 | e.Message, e.StackTrace); |
770 | } | 770 | } |
771 | } | 771 | } |
772 | } | 772 | } |
773 | } | 773 | } |
774 | 774 | ||
775 | public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) | 775 | public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) |
776 | { | 776 | { |
777 | ObjectGrabDelegate handlerObjectGrab = OnObjectGrab; | 777 | ObjectGrabDelegate handlerObjectGrab = OnObjectGrab; |
778 | if (handlerObjectGrab != null) | 778 | if (handlerObjectGrab != null) |
779 | { | 779 | { |
@@ -790,11 +790,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
790 | e.Message, e.StackTrace); | 790 | e.Message, e.StackTrace); |
791 | } | 791 | } |
792 | } | 792 | } |
793 | } | 793 | } |
794 | } | 794 | } |
795 | 795 | ||
796 | public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) | 796 | public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) |
797 | { | 797 | { |
798 | ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing; | 798 | ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing; |
799 | if (handlerObjectGrabbing != null) | 799 | if (handlerObjectGrabbing != null) |
800 | { | 800 | { |
@@ -811,11 +811,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
811 | e.Message, e.StackTrace); | 811 | e.Message, e.StackTrace); |
812 | } | 812 | } |
813 | } | 813 | } |
814 | } | 814 | } |
815 | } | 815 | } |
816 | 816 | ||
817 | public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) | 817 | public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) |
818 | { | 818 | { |
819 | ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab; | 819 | ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab; |
820 | if (handlerObjectDeGrab != null) | 820 | if (handlerObjectDeGrab != null) |
821 | { | 821 | { |
@@ -832,11 +832,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
832 | e.Message, e.StackTrace); | 832 | e.Message, e.StackTrace); |
833 | } | 833 | } |
834 | } | 834 | } |
835 | } | 835 | } |
836 | } | 836 | } |
837 | 837 | ||
838 | public void TriggerScriptReset(uint localID, UUID itemID) | 838 | public void TriggerScriptReset(uint localID, UUID itemID) |
839 | { | 839 | { |
840 | ScriptResetDelegate handlerScriptReset = OnScriptReset; | 840 | ScriptResetDelegate handlerScriptReset = OnScriptReset; |
841 | if (handlerScriptReset != null) | 841 | if (handlerScriptReset != null) |
842 | { | 842 | { |
@@ -853,11 +853,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
853 | e.Message, e.StackTrace); | 853 | e.Message, e.StackTrace); |
854 | } | 854 | } |
855 | } | 855 | } |
856 | } | 856 | } |
857 | } | 857 | } |
858 | 858 | ||
859 | public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource) | 859 | public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource) |
860 | { | 860 | { |
861 | NewRezScript handlerRezScript = OnRezScript; | 861 | NewRezScript handlerRezScript = OnRezScript; |
862 | if (handlerRezScript != null) | 862 | if (handlerRezScript != null) |
863 | { | 863 | { |
@@ -874,7 +874,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
874 | e.Message, e.StackTrace); | 874 | e.Message, e.StackTrace); |
875 | } | 875 | } |
876 | } | 876 | } |
877 | } | 877 | } |
878 | } | 878 | } |
879 | 879 | ||
880 | public void TriggerStartScript(uint localID, UUID itemID) | 880 | public void TriggerStartScript(uint localID, UUID itemID) |
@@ -895,7 +895,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
895 | e.Message, e.StackTrace); | 895 | e.Message, e.StackTrace); |
896 | } | 896 | } |
897 | } | 897 | } |
898 | } | 898 | } |
899 | } | 899 | } |
900 | 900 | ||
901 | public void TriggerStopScript(uint localID, UUID itemID) | 901 | public void TriggerStopScript(uint localID, UUID itemID) |
@@ -916,11 +916,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
916 | e.Message, e.StackTrace); | 916 | e.Message, e.StackTrace); |
917 | } | 917 | } |
918 | } | 918 | } |
919 | } | 919 | } |
920 | } | 920 | } |
921 | 921 | ||
922 | public void TriggerRemoveScript(uint localID, UUID itemID) | 922 | public void TriggerRemoveScript(uint localID, UUID itemID) |
923 | { | 923 | { |
924 | RemoveScript handlerRemoveScript = OnRemoveScript; | 924 | RemoveScript handlerRemoveScript = OnRemoveScript; |
925 | if (handlerRemoveScript != null) | 925 | if (handlerRemoveScript != null) |
926 | { | 926 | { |
@@ -937,7 +937,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
937 | e.Message, e.StackTrace); | 937 | e.Message, e.StackTrace); |
938 | } | 938 | } |
939 | } | 939 | } |
940 | } | 940 | } |
941 | } | 941 | } |
942 | 942 | ||
943 | public bool TriggerGroupMove(UUID groupID, Vector3 delta) | 943 | public bool TriggerGroupMove(UUID groupID, Vector3 delta) |
@@ -1036,7 +1036,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1036 | e.Message, e.StackTrace); | 1036 | e.Message, e.StackTrace); |
1037 | } | 1037 | } |
1038 | } | 1038 | } |
1039 | } | 1039 | } |
1040 | } | 1040 | } |
1041 | 1041 | ||
1042 | public void TriggerLandObjectAdded(ILandObject newParcel) | 1042 | public void TriggerLandObjectAdded(ILandObject newParcel) |
@@ -1057,7 +1057,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1057 | e.Message, e.StackTrace); | 1057 | e.Message, e.StackTrace); |
1058 | } | 1058 | } |
1059 | } | 1059 | } |
1060 | } | 1060 | } |
1061 | } | 1061 | } |
1062 | 1062 | ||
1063 | public void TriggerLandObjectRemoved(UUID globalID) | 1063 | public void TriggerLandObjectRemoved(UUID globalID) |
@@ -1078,7 +1078,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1078 | e.Message, e.StackTrace); | 1078 | e.Message, e.StackTrace); |
1079 | } | 1079 | } |
1080 | } | 1080 | } |
1081 | } | 1081 | } |
1082 | } | 1082 | } |
1083 | 1083 | ||
1084 | public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel) | 1084 | public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel) |
@@ -1104,7 +1104,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1104 | e.Message, e.StackTrace); | 1104 | e.Message, e.StackTrace); |
1105 | } | 1105 | } |
1106 | } | 1106 | } |
1107 | } | 1107 | } |
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | public void TriggerIncomingInstantMessage(GridInstantMessage message) | 1110 | public void TriggerIncomingInstantMessage(GridInstantMessage message) |
@@ -1125,7 +1125,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1125 | e.Message, e.StackTrace); | 1125 | e.Message, e.StackTrace); |
1126 | } | 1126 | } |
1127 | } | 1127 | } |
1128 | } | 1128 | } |
1129 | } | 1129 | } |
1130 | 1130 | ||
1131 | public void TriggerUnhandledInstantMessage(GridInstantMessage message) | 1131 | public void TriggerUnhandledInstantMessage(GridInstantMessage message) |
@@ -1146,7 +1146,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1146 | e.Message, e.StackTrace); | 1146 | e.Message, e.StackTrace); |
1147 | } | 1147 | } |
1148 | } | 1148 | } |
1149 | } | 1149 | } |
1150 | } | 1150 | } |
1151 | 1151 | ||
1152 | public void TriggerClientClosed(UUID ClientID, Scene scene) | 1152 | public void TriggerClientClosed(UUID ClientID, Scene scene) |
@@ -1167,7 +1167,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1167 | e.Message, e.StackTrace); | 1167 | e.Message, e.StackTrace); |
1168 | } | 1168 | } |
1169 | } | 1169 | } |
1170 | } | 1170 | } |
1171 | } | 1171 | } |
1172 | 1172 | ||
1173 | public void TriggerOnMakeChildAgent(ScenePresence presence) | 1173 | public void TriggerOnMakeChildAgent(ScenePresence presence) |
@@ -1188,7 +1188,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1188 | e.Message, e.StackTrace); | 1188 | e.Message, e.StackTrace); |
1189 | } | 1189 | } |
1190 | } | 1190 | } |
1191 | } | 1191 | } |
1192 | } | 1192 | } |
1193 | 1193 | ||
1194 | public void TriggerOnMakeRootAgent(ScenePresence presence) | 1194 | public void TriggerOnMakeRootAgent(ScenePresence presence) |
@@ -1209,7 +1209,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1209 | e.Message, e.StackTrace); | 1209 | e.Message, e.StackTrace); |
1210 | } | 1210 | } |
1211 | } | 1211 | } |
1212 | } | 1212 | } |
1213 | } | 1213 | } |
1214 | 1214 | ||
1215 | public void TriggerOnIncomingSceneObject(SceneObjectGroup so) | 1215 | public void TriggerOnIncomingSceneObject(SceneObjectGroup so) |
@@ -1229,12 +1229,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1229 | "[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing. {0} {1}", | 1229 | "[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing. {0} {1}", |
1230 | e.Message, e.StackTrace); | 1230 | e.Message, e.StackTrace); |
1231 | } | 1231 | } |
1232 | } | 1232 | } |
1233 | } | 1233 | } |
1234 | } | 1234 | } |
1235 | 1235 | ||
1236 | public void TriggerOnRegisterCaps(UUID agentID, Caps caps) | 1236 | public void TriggerOnRegisterCaps(UUID agentID, Caps caps) |
1237 | { | 1237 | { |
1238 | RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps; | 1238 | RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps; |
1239 | if (handlerRegisterCaps != null) | 1239 | if (handlerRegisterCaps != null) |
1240 | { | 1240 | { |
@@ -1251,7 +1251,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1251 | e.Message, e.StackTrace); | 1251 | e.Message, e.StackTrace); |
1252 | } | 1252 | } |
1253 | } | 1253 | } |
1254 | } | 1254 | } |
1255 | } | 1255 | } |
1256 | 1256 | ||
1257 | public void TriggerOnDeregisterCaps(UUID agentID, Caps caps) | 1257 | public void TriggerOnDeregisterCaps(UUID agentID, Caps caps) |
@@ -1272,7 +1272,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1272 | e.Message, e.StackTrace); | 1272 | e.Message, e.StackTrace); |
1273 | } | 1273 | } |
1274 | } | 1274 | } |
1275 | } | 1275 | } |
1276 | } | 1276 | } |
1277 | 1277 | ||
1278 | public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel) | 1278 | public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel) |
@@ -1293,7 +1293,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1293 | e.Message, e.StackTrace); | 1293 | e.Message, e.StackTrace); |
1294 | } | 1294 | } |
1295 | } | 1295 | } |
1296 | } | 1296 | } |
1297 | } | 1297 | } |
1298 | 1298 | ||
1299 | public void TriggerLandBuy(Object sender, LandBuyArgs args) | 1299 | public void TriggerLandBuy(Object sender, LandBuyArgs args) |
@@ -1314,7 +1314,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1314 | e.Message, e.StackTrace); | 1314 | e.Message, e.StackTrace); |
1315 | } | 1315 | } |
1316 | } | 1316 | } |
1317 | } | 1317 | } |
1318 | } | 1318 | } |
1319 | 1319 | ||
1320 | public void TriggerValidateLandBuy(Object sender, LandBuyArgs args) | 1320 | public void TriggerValidateLandBuy(Object sender, LandBuyArgs args) |
@@ -1335,11 +1335,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1335 | e.Message, e.StackTrace); | 1335 | e.Message, e.StackTrace); |
1336 | } | 1336 | } |
1337 | } | 1337 | } |
1338 | } | 1338 | } |
1339 | } | 1339 | } |
1340 | 1340 | ||
1341 | public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos) | 1341 | public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos) |
1342 | { | 1342 | { |
1343 | ScriptAtTargetEvent handlerScriptAtTargetEvent = OnScriptAtTargetEvent; | 1343 | ScriptAtTargetEvent handlerScriptAtTargetEvent = OnScriptAtTargetEvent; |
1344 | if (handlerScriptAtTargetEvent != null) | 1344 | if (handlerScriptAtTargetEvent != null) |
1345 | { | 1345 | { |
@@ -1356,7 +1356,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1356 | e.Message, e.StackTrace); | 1356 | e.Message, e.StackTrace); |
1357 | } | 1357 | } |
1358 | } | 1358 | } |
1359 | } | 1359 | } |
1360 | } | 1360 | } |
1361 | 1361 | ||
1362 | public void TriggerNotAtTargetEvent(uint localID) | 1362 | public void TriggerNotAtTargetEvent(uint localID) |
@@ -1377,11 +1377,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1377 | e.Message, e.StackTrace); | 1377 | e.Message, e.StackTrace); |
1378 | } | 1378 | } |
1379 | } | 1379 | } |
1380 | } | 1380 | } |
1381 | } | 1381 | } |
1382 | 1382 | ||
1383 | public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot) | 1383 | public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot) |
1384 | { | 1384 | { |
1385 | ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent; | 1385 | ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent; |
1386 | if (handlerScriptAtRotTargetEvent != null) | 1386 | if (handlerScriptAtRotTargetEvent != null) |
1387 | { | 1387 | { |
@@ -1398,7 +1398,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1398 | e.Message, e.StackTrace); | 1398 | e.Message, e.StackTrace); |
1399 | } | 1399 | } |
1400 | } | 1400 | } |
1401 | } | 1401 | } |
1402 | } | 1402 | } |
1403 | 1403 | ||
1404 | public void TriggerNotAtRotTargetEvent(uint localID) | 1404 | public void TriggerNotAtRotTargetEvent(uint localID) |
@@ -1419,7 +1419,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1419 | e.Message, e.StackTrace); | 1419 | e.Message, e.StackTrace); |
1420 | } | 1420 | } |
1421 | } | 1421 | } |
1422 | } | 1422 | } |
1423 | } | 1423 | } |
1424 | 1424 | ||
1425 | public void TriggerRequestChangeWaterHeight(float height) | 1425 | public void TriggerRequestChangeWaterHeight(float height) |
@@ -1440,7 +1440,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1440 | e.Message, e.StackTrace); | 1440 | e.Message, e.StackTrace); |
1441 | } | 1441 | } |
1442 | } | 1442 | } |
1443 | } | 1443 | } |
1444 | } | 1444 | } |
1445 | 1445 | ||
1446 | public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) | 1446 | public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) |
@@ -1461,7 +1461,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1461 | e.Message, e.StackTrace); | 1461 | e.Message, e.StackTrace); |
1462 | } | 1462 | } |
1463 | } | 1463 | } |
1464 | } | 1464 | } |
1465 | } | 1465 | } |
1466 | 1466 | ||
1467 | public void TriggerSignificantClientMovement(IClientAPI client) | 1467 | public void TriggerSignificantClientMovement(IClientAPI client) |
@@ -1482,7 +1482,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1482 | e.Message, e.StackTrace); | 1482 | e.Message, e.StackTrace); |
1483 | } | 1483 | } |
1484 | } | 1484 | } |
1485 | } | 1485 | } |
1486 | } | 1486 | } |
1487 | 1487 | ||
1488 | public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat) | 1488 | public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat) |
@@ -1503,7 +1503,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1503 | e.Message, e.StackTrace); | 1503 | e.Message, e.StackTrace); |
1504 | } | 1504 | } |
1505 | } | 1505 | } |
1506 | } | 1506 | } |
1507 | } | 1507 | } |
1508 | 1508 | ||
1509 | public void TriggerOnChatFromClient(Object sender, OSChatMessage chat) | 1509 | public void TriggerOnChatFromClient(Object sender, OSChatMessage chat) |
@@ -1524,7 +1524,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1524 | e.Message, e.StackTrace); | 1524 | e.Message, e.StackTrace); |
1525 | } | 1525 | } |
1526 | } | 1526 | } |
1527 | } | 1527 | } |
1528 | } | 1528 | } |
1529 | 1529 | ||
1530 | public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) | 1530 | public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) |
@@ -1545,7 +1545,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1545 | e.Message, e.StackTrace); | 1545 | e.Message, e.StackTrace); |
1546 | } | 1546 | } |
1547 | } | 1547 | } |
1548 | } | 1548 | } |
1549 | } | 1549 | } |
1550 | 1550 | ||
1551 | internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed) | 1551 | internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed) |
@@ -1566,7 +1566,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1566 | e.Message, e.StackTrace); | 1566 | e.Message, e.StackTrace); |
1567 | } | 1567 | } |
1568 | } | 1568 | } |
1569 | } | 1569 | } |
1570 | } | 1570 | } |
1571 | 1571 | ||
1572 | public void TriggerNoticeNoLandDataFromStorage() | 1572 | public void TriggerNoticeNoLandDataFromStorage() |
@@ -1587,7 +1587,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1587 | e.Message, e.StackTrace); | 1587 | e.Message, e.StackTrace); |
1588 | } | 1588 | } |
1589 | } | 1589 | } |
1590 | } | 1590 | } |
1591 | } | 1591 | } |
1592 | 1592 | ||
1593 | public void TriggerIncomingLandDataFromStorage(List<LandData> landData) | 1593 | public void TriggerIncomingLandDataFromStorage(List<LandData> landData) |
@@ -1608,7 +1608,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1608 | e.Message, e.StackTrace); | 1608 | e.Message, e.StackTrace); |
1609 | } | 1609 | } |
1610 | } | 1610 | } |
1611 | } | 1611 | } |
1612 | } | 1612 | } |
1613 | 1613 | ||
1614 | public void TriggerSetAllowForcefulBan(bool allow) | 1614 | public void TriggerSetAllowForcefulBan(bool allow) |
@@ -1629,7 +1629,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1629 | e.Message, e.StackTrace); | 1629 | e.Message, e.StackTrace); |
1630 | } | 1630 | } |
1631 | } | 1631 | } |
1632 | } | 1632 | } |
1633 | } | 1633 | } |
1634 | 1634 | ||
1635 | public void TriggerRequestParcelPrimCountUpdate() | 1635 | public void TriggerRequestParcelPrimCountUpdate() |
@@ -1650,7 +1650,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1650 | e.Message, e.StackTrace); | 1650 | e.Message, e.StackTrace); |
1651 | } | 1651 | } |
1652 | } | 1652 | } |
1653 | } | 1653 | } |
1654 | } | 1654 | } |
1655 | 1655 | ||
1656 | public void TriggerParcelPrimCountTainted() | 1656 | public void TriggerParcelPrimCountTainted() |
@@ -1671,7 +1671,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1671 | e.Message, e.StackTrace); | 1671 | e.Message, e.StackTrace); |
1672 | } | 1672 | } |
1673 | } | 1673 | } |
1674 | } | 1674 | } |
1675 | } | 1675 | } |
1676 | 1676 | ||
1677 | // this lets us keep track of nasty script events like timer, etc. | 1677 | // this lets us keep track of nasty script events like timer, etc. |
@@ -1710,7 +1710,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1710 | e.Message, e.StackTrace); | 1710 | e.Message, e.StackTrace); |
1711 | } | 1711 | } |
1712 | } | 1712 | } |
1713 | } | 1713 | } |
1714 | } | 1714 | } |
1715 | 1715 | ||
1716 | public float GetCurrentTimeAsSunLindenHour() | 1716 | public float GetCurrentTimeAsSunLindenHour() |
@@ -1737,7 +1737,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1737 | } | 1737 | } |
1738 | 1738 | ||
1739 | public void TriggerOarFileLoaded(Guid requestId, string message) | 1739 | public void TriggerOarFileLoaded(Guid requestId, string message) |
1740 | { | 1740 | { |
1741 | OarFileLoaded handlerOarFileLoaded = OnOarFileLoaded; | 1741 | OarFileLoaded handlerOarFileLoaded = OnOarFileLoaded; |
1742 | if (handlerOarFileLoaded != null) | 1742 | if (handlerOarFileLoaded != null) |
1743 | { | 1743 | { |
@@ -1754,7 +1754,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1754 | e.Message, e.StackTrace); | 1754 | e.Message, e.StackTrace); |
1755 | } | 1755 | } |
1756 | } | 1756 | } |
1757 | } | 1757 | } |
1758 | } | 1758 | } |
1759 | 1759 | ||
1760 | public void TriggerOarFileSaved(Guid requestId, string message) | 1760 | public void TriggerOarFileSaved(Guid requestId, string message) |
@@ -1775,7 +1775,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1775 | e.Message, e.StackTrace); | 1775 | e.Message, e.StackTrace); |
1776 | } | 1776 | } |
1777 | } | 1777 | } |
1778 | } | 1778 | } |
1779 | } | 1779 | } |
1780 | 1780 | ||
1781 | public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message) | 1781 | public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message) |
@@ -1796,7 +1796,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1796 | e.Message, e.StackTrace); | 1796 | e.Message, e.StackTrace); |
1797 | } | 1797 | } |
1798 | } | 1798 | } |
1799 | } | 1799 | } |
1800 | } | 1800 | } |
1801 | 1801 | ||
1802 | public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders) | 1802 | public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders) |
@@ -1817,7 +1817,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1817 | e.Message, e.StackTrace); | 1817 | e.Message, e.StackTrace); |
1818 | } | 1818 | } |
1819 | } | 1819 | } |
1820 | } | 1820 | } |
1821 | } | 1821 | } |
1822 | 1822 | ||
1823 | public void TriggerScriptColliding(uint localId, ColliderArgs colliders) | 1823 | public void TriggerScriptColliding(uint localId, ColliderArgs colliders) |
@@ -1838,7 +1838,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1838 | e.Message, e.StackTrace); | 1838 | e.Message, e.StackTrace); |
1839 | } | 1839 | } |
1840 | } | 1840 | } |
1841 | } | 1841 | } |
1842 | } | 1842 | } |
1843 | 1843 | ||
1844 | public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) | 1844 | public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) |
@@ -1859,7 +1859,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1859 | e.Message, e.StackTrace); | 1859 | e.Message, e.StackTrace); |
1860 | } | 1860 | } |
1861 | } | 1861 | } |
1862 | } | 1862 | } |
1863 | } | 1863 | } |
1864 | 1864 | ||
1865 | public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders) | 1865 | public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders) |
@@ -1880,7 +1880,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1880 | e.Message, e.StackTrace); | 1880 | e.Message, e.StackTrace); |
1881 | } | 1881 | } |
1882 | } | 1882 | } |
1883 | } | 1883 | } |
1884 | } | 1884 | } |
1885 | 1885 | ||
1886 | public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders) | 1886 | public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders) |
@@ -1901,7 +1901,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1901 | e.Message, e.StackTrace); | 1901 | e.Message, e.StackTrace); |
1902 | } | 1902 | } |
1903 | } | 1903 | } |
1904 | } | 1904 | } |
1905 | } | 1905 | } |
1906 | 1906 | ||
1907 | public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders) | 1907 | public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders) |
@@ -1922,11 +1922,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1922 | e.Message, e.StackTrace); | 1922 | e.Message, e.StackTrace); |
1923 | } | 1923 | } |
1924 | } | 1924 | } |
1925 | } | 1925 | } |
1926 | } | 1926 | } |
1927 | 1927 | ||
1928 | public void TriggerSetRootAgentScene(UUID agentID, Scene scene) | 1928 | public void TriggerSetRootAgentScene(UUID agentID, Scene scene) |
1929 | { | 1929 | { |
1930 | OnSetRootAgentSceneDelegate handlerSetRootAgentScene = OnSetRootAgentScene; | 1930 | OnSetRootAgentSceneDelegate handlerSetRootAgentScene = OnSetRootAgentScene; |
1931 | if (handlerSetRootAgentScene != null) | 1931 | if (handlerSetRootAgentScene != null) |
1932 | { | 1932 | { |
@@ -1943,7 +1943,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1943 | e.Message, e.StackTrace); | 1943 | e.Message, e.StackTrace); |
1944 | } | 1944 | } |
1945 | } | 1945 | } |
1946 | } | 1946 | } |
1947 | } | 1947 | } |
1948 | 1948 | ||
1949 | public void TriggerOnRegionUp(GridRegion otherRegion) | 1949 | public void TriggerOnRegionUp(GridRegion otherRegion) |
@@ -1964,7 +1964,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1964 | e.Message, e.StackTrace); | 1964 | e.Message, e.StackTrace); |
1965 | } | 1965 | } |
1966 | } | 1966 | } |
1967 | } | 1967 | } |
1968 | } | 1968 | } |
1969 | } | 1969 | } |
1970 | } \ No newline at end of file | 1970 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d5ceda8..b9b16ad 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2384,7 +2384,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2384 | AttachObject( | 2384 | AttachObject( |
2385 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); | 2385 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); |
2386 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2386 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2387 | grp.SendGroupFullUpdate(); | 2387 | grp.SendGroupFullUpdate(); |
2388 | } | 2388 | } |
2389 | else | 2389 | else |
2390 | { | 2390 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index aed8640..4f6e824 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -262,7 +262,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
262 | /// Returns a new unallocated local ID | 262 | /// Returns a new unallocated local ID |
263 | /// </summary> | 263 | /// </summary> |
264 | /// <returns>A brand new local ID</returns> | 264 | /// <returns>A brand new local ID</returns> |
265 | protected internal uint AllocateLocalId() | 265 | public uint AllocateLocalId() |
266 | { | 266 | { |
267 | uint myID; | 267 | uint myID; |
268 | 268 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 0132252..369552f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -642,7 +642,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
642 | // it get cleaned up | 642 | // it get cleaned up |
643 | // | 643 | // |
644 | group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); | 644 | group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); |
645 | group.HasGroupChanged = false; | 645 | group.HasGroupChanged = false; |
646 | } | 646 | } |
647 | else | 647 | else |
648 | { | 648 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index fe9dd9b..c5a6171 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -546,7 +546,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
546 | 546 | ||
547 | if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0) | 547 | if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0) |
548 | m_rootPart.ParentID = 0; | 548 | m_rootPart.ParentID = 0; |
549 | if (m_rootPart.LocalId==0) | 549 | if (m_rootPart.LocalId == 0) |
550 | m_rootPart.LocalId = m_scene.AllocateLocalId(); | 550 | m_rootPart.LocalId = m_scene.AllocateLocalId(); |
551 | 551 | ||
552 | // No need to lock here since the object isn't yet in a scene | 552 | // No need to lock here since the object isn't yet in a scene |
@@ -1505,6 +1505,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1505 | /// <param name="part"></param> | 1505 | /// <param name="part"></param> |
1506 | internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags) | 1506 | internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags) |
1507 | { | 1507 | { |
1508 | // m_log.DebugFormat( | ||
1509 | // "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); | ||
1510 | |||
1508 | if (m_rootPart.UUID == part.UUID) | 1511 | if (m_rootPart.UUID == part.UUID) |
1509 | { | 1512 | { |
1510 | if (IsAttachment) | 1513 | if (IsAttachment) |
@@ -2297,7 +2300,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2297 | 2300 | ||
2298 | AttachToBackup(); | 2301 | AttachToBackup(); |
2299 | 2302 | ||
2300 | |||
2301 | // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the | 2303 | // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the |
2302 | // position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and | 2304 | // position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and |
2303 | // unmoved prims! | 2305 | // unmoved prims! |
@@ -2312,9 +2314,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2312 | /// an independent SceneObjectGroup. | 2314 | /// an independent SceneObjectGroup. |
2313 | /// </summary> | 2315 | /// </summary> |
2314 | /// <param name="partID"></param> | 2316 | /// <param name="partID"></param> |
2315 | public void DelinkFromGroup(uint partID) | 2317 | /// <returns>The object group of the newly delinked prim. Null if part could not be found</returns> |
2318 | public SceneObjectGroup DelinkFromGroup(uint partID) | ||
2316 | { | 2319 | { |
2317 | DelinkFromGroup(partID, true); | 2320 | return DelinkFromGroup(partID, true); |
2318 | } | 2321 | } |
2319 | 2322 | ||
2320 | /// <summary> | 2323 | /// <summary> |
@@ -2323,28 +2326,39 @@ namespace OpenSim.Region.Framework.Scenes | |||
2323 | /// </summary> | 2326 | /// </summary> |
2324 | /// <param name="partID"></param> | 2327 | /// <param name="partID"></param> |
2325 | /// <param name="sendEvents"></param> | 2328 | /// <param name="sendEvents"></param> |
2326 | public void DelinkFromGroup(uint partID, bool sendEvents) | 2329 | /// <returns>The object group of the newly delinked prim. Null if part could not be found</returns> |
2330 | public SceneObjectGroup DelinkFromGroup(uint partID, bool sendEvents) | ||
2327 | { | 2331 | { |
2328 | SceneObjectPart linkPart = GetChildPart(partID); | 2332 | SceneObjectPart linkPart = GetChildPart(partID); |
2329 | 2333 | ||
2330 | if (linkPart != null) | 2334 | if (linkPart != null) |
2331 | { | 2335 | { |
2332 | DelinkFromGroup(linkPart, sendEvents); | 2336 | return DelinkFromGroup(linkPart, sendEvents); |
2333 | } | 2337 | } |
2334 | else | 2338 | else |
2335 | { | 2339 | { |
2336 | m_log.InfoFormat("[SCENE OBJECT GROUP]: " + | 2340 | m_log.WarnFormat("[SCENE OBJECT GROUP]: " + |
2337 | "DelinkFromGroup(): Child prim {0} not found in object {1}, {2}", | 2341 | "DelinkFromGroup(): Child prim {0} not found in object {1}, {2}", |
2338 | partID, LocalId, UUID); | 2342 | partID, LocalId, UUID); |
2343 | |||
2344 | return null; | ||
2339 | } | 2345 | } |
2340 | } | 2346 | } |
2341 | 2347 | ||
2342 | public void DelinkFromGroup(SceneObjectPart linkPart, bool sendEvents) | 2348 | /// <summary> |
2349 | /// Delink the given prim from this group. The delinked prim is established as | ||
2350 | /// an independent SceneObjectGroup. | ||
2351 | /// </summary> | ||
2352 | /// <param name="partID"></param> | ||
2353 | /// <param name="sendEvents"></param> | ||
2354 | /// <returns>The object group of the newly delinked prim.</returns> | ||
2355 | public SceneObjectGroup DelinkFromGroup(SceneObjectPart linkPart, bool sendEvents) | ||
2343 | { | 2356 | { |
2344 | linkPart.ClearUndoState(); | ||
2345 | // m_log.DebugFormat( | 2357 | // m_log.DebugFormat( |
2346 | // "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}", | 2358 | // "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}", |
2347 | // linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID); | 2359 | // linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID); |
2360 | |||
2361 | linkPart.ClearUndoState(); | ||
2348 | 2362 | ||
2349 | Quaternion worldRot = linkPart.GetWorldRotation(); | 2363 | Quaternion worldRot = linkPart.GetWorldRotation(); |
2350 | 2364 | ||
@@ -2397,6 +2411,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2397 | 2411 | ||
2398 | //HasGroupChanged = true; | 2412 | //HasGroupChanged = true; |
2399 | //ScheduleGroupForFullUpdate(); | 2413 | //ScheduleGroupForFullUpdate(); |
2414 | |||
2415 | return objectGroup; | ||
2400 | } | 2416 | } |
2401 | 2417 | ||
2402 | /// <summary> | 2418 | /// <summary> |
@@ -2435,7 +2451,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2435 | 2451 | ||
2436 | part.LinkNum = linkNum; | 2452 | part.LinkNum = linkNum; |
2437 | 2453 | ||
2438 | |||
2439 | part.OffsetPosition = part.GroupPosition - AbsolutePosition; | 2454 | part.OffsetPosition = part.GroupPosition - AbsolutePosition; |
2440 | 2455 | ||
2441 | Quaternion rootRotation = m_rootPart.RotationOffset; | 2456 | Quaternion rootRotation = m_rootPart.RotationOffset; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index d339208..5c283bc 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -4531,7 +4531,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4531 | else | 4531 | else |
4532 | { | 4532 | { |
4533 | // m_log.DebugFormat( | 4533 | // m_log.DebugFormat( |
4534 | // "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId); | 4534 | // "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId); |
4535 | ScheduleFullUpdate(); | 4535 | ScheduleFullUpdate(); |
4536 | } | 4536 | } |
4537 | } | 4537 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index d0de513..04e3221 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -313,7 +313,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
313 | } | 313 | } |
314 | ); | 314 | ); |
315 | } | 315 | } |
316 | } | 316 | } |
317 | 317 | ||
318 | private void RestoreSavedScriptState(UUID oldID, UUID newID) | 318 | private void RestoreSavedScriptState(UUID oldID, UUID newID) |
319 | { | 319 | { |
@@ -578,7 +578,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
578 | m_items.TryGetValue(itemId, out item); | 578 | m_items.TryGetValue(itemId, out item); |
579 | 579 | ||
580 | return item; | 580 | return item; |
581 | } | 581 | } |
582 | 582 | ||
583 | /// <summary> | 583 | /// <summary> |
584 | /// Get inventory items by name. | 584 | /// Get inventory items by name. |
@@ -587,7 +587,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
587 | /// <returns> | 587 | /// <returns> |
588 | /// A list of inventory items with that name. | 588 | /// A list of inventory items with that name. |
589 | /// If no inventory item has that name then an empty list is returned. | 589 | /// If no inventory item has that name then an empty list is returned. |
590 | /// </returns> | 590 | /// </returns> |
591 | public IList<TaskInventoryItem> GetInventoryItems(string name) | 591 | public IList<TaskInventoryItem> GetInventoryItems(string name) |
592 | { | 592 | { |
593 | IList<TaskInventoryItem> items = new List<TaskInventoryItem>(); | 593 | IList<TaskInventoryItem> items = new List<TaskInventoryItem>(); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6b6fa7c..af9afa6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -650,7 +650,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
650 | #region Constructor(s) | 650 | #region Constructor(s) |
651 | 651 | ||
652 | public ScenePresence() | 652 | public ScenePresence() |
653 | { | 653 | { |
654 | m_sendCourseLocationsMethod = SendCoarseLocationsDefault; | 654 | m_sendCourseLocationsMethod = SendCoarseLocationsDefault; |
655 | CreateSceneViewer(); | 655 | CreateSceneViewer(); |
656 | m_animator = new ScenePresenceAnimator(this); | 656 | m_animator = new ScenePresenceAnimator(this); |
@@ -1241,14 +1241,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1241 | } | 1241 | } |
1242 | else | 1242 | else |
1243 | { | 1243 | { |
1244 | if (m_pos.X < 0) | ||
1245 | m_pos.X = 128; | ||
1246 | if (m_pos.Y < 0) | ||
1247 | m_pos.Y = 128; | ||
1248 | if (m_pos.X > Scene.WestBorders[0].BorderLine.X) | ||
1249 | m_pos.X = 128; | ||
1250 | if (m_pos.Y > Scene.NorthBorders[0].BorderLine.Y) | ||
1251 | m_pos.Y = 128; | ||
1252 | m_LastFinitePos = m_pos; | 1244 | m_LastFinitePos = m_pos; |
1253 | } | 1245 | } |
1254 | 1246 | ||
@@ -2818,16 +2810,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
2818 | { | 2810 | { |
2819 | if (!needsTransit) | 2811 | if (!needsTransit) |
2820 | { | 2812 | { |
2821 | Vector3 pos = AbsolutePosition; | 2813 | if (m_requestedSitTargetUUID == UUID.Zero) |
2822 | if (AbsolutePosition.X < 0) | 2814 | { |
2823 | pos.X += Velocity.Y; | 2815 | Vector3 pos = AbsolutePosition; |
2824 | else if (AbsolutePosition.X > Constants.RegionSize) | 2816 | if (AbsolutePosition.X < 0) |
2825 | pos.X -= Velocity.Y; | 2817 | pos.X += Velocity.X; |
2826 | if (AbsolutePosition.Y < 0) | 2818 | else if (AbsolutePosition.X > Constants.RegionSize) |
2827 | pos.Y += Velocity.Y; | 2819 | pos.X -= Velocity.X; |
2828 | else if (AbsolutePosition.Y > Constants.RegionSize) | 2820 | if (AbsolutePosition.Y < 0) |
2829 | pos.Y -= Velocity.Y; | 2821 | pos.Y += Velocity.Y; |
2830 | AbsolutePosition = pos; | 2822 | else if (AbsolutePosition.Y > Constants.RegionSize) |
2823 | pos.Y -= Velocity.Y; | ||
2824 | AbsolutePosition = pos; | ||
2825 | } | ||
2831 | } | 2826 | } |
2832 | } | 2827 | } |
2833 | else if (neighbor > 0) | 2828 | else if (neighbor > 0) |
@@ -3292,7 +3287,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3292 | m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; | 3287 | m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; |
3293 | m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong | 3288 | m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong |
3294 | m_physicsActor.SubscribeEvents(500); | 3289 | m_physicsActor.SubscribeEvents(500); |
3295 | m_physicsActor.LocalID = LocalId; | 3290 | m_physicsActor.LocalID = LocalId; |
3296 | } | 3291 | } |
3297 | 3292 | ||
3298 | private void OutOfBoundsCall(Vector3 pos) | 3293 | private void OutOfBoundsCall(Vector3 pos) |
@@ -3384,7 +3379,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3384 | } | 3379 | } |
3385 | if (m_health <= 0) | 3380 | if (m_health <= 0) |
3386 | m_scene.EventManager.TriggerAvatarKill(killerObj, this); | 3381 | m_scene.EventManager.TriggerAvatarKill(killerObj, this); |
3387 | } | 3382 | } |
3388 | } | 3383 | } |
3389 | 3384 | ||
3390 | public void setHealthWithUpdate(float health) | 3385 | public void setHealthWithUpdate(float health) |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index 51341de..242bc3f 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | |||
@@ -50,7 +50,6 @@ using OpenSim.Region.Framework.Scenes; | |||
50 | using Caps = OpenSim.Framework.Capabilities.Caps; | 50 | using Caps = OpenSim.Framework.Capabilities.Caps; |
51 | using System.Text.RegularExpressions; | 51 | using System.Text.RegularExpressions; |
52 | 52 | ||
53 | |||
54 | namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | 53 | namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice |
55 | { | 54 | { |
56 | public class FreeSwitchVoiceModule : IRegionModule, IVoiceModule | 55 | public class FreeSwitchVoiceModule : IRegionModule, IVoiceModule |
@@ -76,7 +75,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
76 | // SLVoice client will do a GET on this prefix | 75 | // SLVoice client will do a GET on this prefix |
77 | private static string m_freeSwitchAPIPrefix; | 76 | private static string m_freeSwitchAPIPrefix; |
78 | 77 | ||
79 | // We need to return some information to SLVoice | 78 | // We need to return some information to SLVoice |
80 | // figured those out via curl | 79 | // figured those out via curl |
81 | // http://vd1.vivox.com/api2/viv_get_prelogin.php | 80 | // http://vd1.vivox.com/api2/viv_get_prelogin.php |
82 | // | 81 | // |
@@ -102,9 +101,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
102 | 101 | ||
103 | private readonly Dictionary<string, string> m_UUIDName = new Dictionary<string, string>(); | 102 | private readonly Dictionary<string, string> m_UUIDName = new Dictionary<string, string>(); |
104 | private Dictionary<string, string> m_ParcelAddress = new Dictionary<string, string>(); | 103 | private Dictionary<string, string> m_ParcelAddress = new Dictionary<string, string>(); |
105 | 104 | ||
106 | private Scene m_scene; | 105 | private Scene m_scene; |
107 | 106 | ||
108 | 107 | ||
109 | private IConfig m_config; | 108 | private IConfig m_config; |
110 | 109 | ||
@@ -136,9 +135,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
136 | m_freeSwitchServerUser = m_config.GetString("freeswitch_server_user", String.Empty); | 135 | m_freeSwitchServerUser = m_config.GetString("freeswitch_server_user", String.Empty); |
137 | m_freeSwitchServerPass = m_config.GetString("freeswitch_server_pass", String.Empty); | 136 | m_freeSwitchServerPass = m_config.GetString("freeswitch_server_pass", String.Empty); |
138 | m_freeSwitchAPIPrefix = m_config.GetString("freeswitch_api_prefix", String.Empty); | 137 | m_freeSwitchAPIPrefix = m_config.GetString("freeswitch_api_prefix", String.Empty); |
139 | 138 | ||
140 | // XXX: get IP address of HTTP server. (This can be this OpenSim server or another, or could be a dedicated grid service or may live on the freeswitch server) | 139 | // XXX: get IP address of HTTP server. (This can be this OpenSim server or another, or could be a dedicated grid service or may live on the freeswitch server) |
141 | 140 | ||
142 | string serviceIP = m_config.GetString("freeswitch_service_server", String.Empty); | 141 | string serviceIP = m_config.GetString("freeswitch_service_server", String.Empty); |
143 | int servicePort = m_config.GetInt("freeswitch_service_port", 80); | 142 | int servicePort = m_config.GetInt("freeswitch_service_port", 80); |
144 | IPAddress serviceIPAddress = IPAddress.Parse(serviceIP); | 143 | IPAddress serviceIPAddress = IPAddress.Parse(serviceIP); |
@@ -156,7 +155,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
156 | // m_freeSwitchSubscribeRetry = m_config.GetInt("freeswitch_subscribe_retry", 120); | 155 | // m_freeSwitchSubscribeRetry = m_config.GetInt("freeswitch_subscribe_retry", 120); |
157 | m_freeSwitchUrlResetPassword = m_config.GetString("freeswitch_password_reset_url", String.Empty); | 156 | m_freeSwitchUrlResetPassword = m_config.GetString("freeswitch_password_reset_url", String.Empty); |
158 | m_freeSwitchContext = m_config.GetString("freeswitch_context", "default"); | 157 | m_freeSwitchContext = m_config.GetString("freeswitch_context", "default"); |
159 | 158 | ||
160 | if (String.IsNullOrEmpty(m_freeSwitchServerUser) || | 159 | if (String.IsNullOrEmpty(m_freeSwitchServerUser) || |
161 | String.IsNullOrEmpty(m_freeSwitchServerPass) || | 160 | String.IsNullOrEmpty(m_freeSwitchServerPass) || |
162 | String.IsNullOrEmpty(m_freeSwitchRealm) || | 161 | String.IsNullOrEmpty(m_freeSwitchRealm) || |
@@ -182,9 +181,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
182 | { | 181 | { |
183 | MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), | 182 | MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), |
184 | FreeSwitchSLVoiceGetPreloginHTTPHandler); | 183 | FreeSwitchSLVoiceGetPreloginHTTPHandler); |
185 | 184 | ||
186 | // RestStreamHandler h = new | 185 | // RestStreamHandler h = new |
187 | // RestStreamHandler("GET", | 186 | // RestStreamHandler("GET", |
188 | // String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), FreeSwitchSLVoiceGetPreloginHTTPHandler); | 187 | // String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), FreeSwitchSLVoiceGetPreloginHTTPHandler); |
189 | // MainServer.Instance.AddStreamHandler(h); | 188 | // MainServer.Instance.AddStreamHandler(h); |
190 | 189 | ||
@@ -202,13 +201,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
202 | MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix), | 201 | MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix), |
203 | FreeSwitchSLVoiceBuddyHTTPHandler); | 202 | FreeSwitchSLVoiceBuddyHTTPHandler); |
204 | } | 203 | } |
205 | |||
206 | |||
207 | |||
208 | 204 | ||
209 | |||
210 | m_log.InfoFormat("[FreeSwitchVoice] using FreeSwitch server {0}", m_freeSwitchRealm); | 205 | m_log.InfoFormat("[FreeSwitchVoice] using FreeSwitch server {0}", m_freeSwitchRealm); |
211 | 206 | ||
212 | m_FreeSwitchDirectory = new FreeSwitchDirectory(); | 207 | m_FreeSwitchDirectory = new FreeSwitchDirectory(); |
213 | m_FreeSwitchDialplan = new FreeSwitchDialplan(); | 208 | m_FreeSwitchDialplan = new FreeSwitchDialplan(); |
214 | 209 | ||
@@ -225,7 +220,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
225 | } | 220 | } |
226 | } | 221 | } |
227 | 222 | ||
228 | if (m_pluginEnabled) | 223 | if (m_pluginEnabled) |
229 | { | 224 | { |
230 | // we need to capture scene in an anonymous method | 225 | // we need to capture scene in an anonymous method |
231 | // here as we need it later in the callbacks | 226 | // here as we need it later in the callbacks |
@@ -233,8 +228,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
233 | { | 228 | { |
234 | OnRegisterCaps(scene, agentID, caps); | 229 | OnRegisterCaps(scene, agentID, caps); |
235 | }; | 230 | }; |
236 | |||
237 | |||
238 | 231 | ||
239 | try | 232 | try |
240 | { | 233 | { |
@@ -254,16 +247,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
254 | m_log.Error("[FreeSwitchVoice]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions."); | 247 | m_log.Error("[FreeSwitchVoice]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions."); |
255 | } | 248 | } |
256 | } | 249 | } |
257 | |||
258 | } | 250 | } |
259 | } | 251 | } |
260 | 252 | ||
261 | public void PostInitialise() | 253 | public void PostInitialise() |
262 | { | 254 | { |
263 | if (m_pluginEnabled) | 255 | if (m_pluginEnabled) |
264 | { | 256 | { |
265 | m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene"); | 257 | m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene"); |
266 | 258 | ||
267 | // register the voice interface for this module, so the script engine can call us | 259 | // register the voice interface for this module, so the script engine can call us |
268 | m_scene.RegisterModuleInterface<IVoiceModule>(this); | 260 | m_scene.RegisterModuleInterface<IVoiceModule>(this); |
269 | } | 261 | } |
@@ -282,15 +274,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
282 | { | 274 | { |
283 | get { return true; } | 275 | get { return true; } |
284 | } | 276 | } |
285 | 277 | ||
286 | // <summary> | 278 | // <summary> |
287 | // implementation of IVoiceModule, called by osSetParcelSIPAddress script function | 279 | // implementation of IVoiceModule, called by osSetParcelSIPAddress script function |
288 | // </summary> | 280 | // </summary> |
289 | public void setLandSIPAddress(string SIPAddress,UUID GlobalID) | 281 | public void setLandSIPAddress(string SIPAddress,UUID GlobalID) |
290 | { | 282 | { |
291 | m_log.DebugFormat("[FreeSwitchVoice]: setLandSIPAddress parcel id {0}: setting sip address {1}", | 283 | m_log.DebugFormat("[FreeSwitchVoice]: setLandSIPAddress parcel id {0}: setting sip address {1}", |
292 | GlobalID, SIPAddress); | 284 | GlobalID, SIPAddress); |
293 | 285 | ||
294 | lock (m_ParcelAddress) | 286 | lock (m_ParcelAddress) |
295 | { | 287 | { |
296 | if (m_ParcelAddress.ContainsKey(GlobalID.ToString())) | 288 | if (m_ParcelAddress.ContainsKey(GlobalID.ToString())) |
@@ -303,18 +295,18 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
303 | } | 295 | } |
304 | } | 296 | } |
305 | } | 297 | } |
306 | 298 | ||
307 | // <summary> | 299 | // <summary> |
308 | // OnRegisterCaps is invoked via the scene.EventManager | 300 | // OnRegisterCaps is invoked via the scene.EventManager |
309 | // everytime OpenSim hands out capabilities to a client | 301 | // everytime OpenSim hands out capabilities to a client |
310 | // (login, region crossing). We contribute two capabilities to | 302 | // (login, region crossing). We contribute two capabilities to |
311 | // the set of capabilities handed back to the client: | 303 | // the set of capabilities handed back to the client: |
312 | // ProvisionVoiceAccountRequest and ParcelVoiceInfoRequest. | 304 | // ProvisionVoiceAccountRequest and ParcelVoiceInfoRequest. |
313 | // | 305 | // |
314 | // ProvisionVoiceAccountRequest allows the client to obtain | 306 | // ProvisionVoiceAccountRequest allows the client to obtain |
315 | // the voice account credentials for the avatar it is | 307 | // the voice account credentials for the avatar it is |
316 | // controlling (e.g., user name, password, etc). | 308 | // controlling (e.g., user name, password, etc). |
317 | // | 309 | // |
318 | // ParcelVoiceInfoRequest is invoked whenever the client | 310 | // ParcelVoiceInfoRequest is invoked whenever the client |
319 | // changes from one region or parcel to another. | 311 | // changes from one region or parcel to another. |
320 | // | 312 | // |
@@ -371,7 +363,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
371 | { | 363 | { |
372 | System.Threading.Thread.Sleep(2000); | 364 | System.Threading.Thread.Sleep(2000); |
373 | avatar = scene.GetScenePresence(agentID); | 365 | avatar = scene.GetScenePresence(agentID); |
374 | 366 | ||
375 | if (avatar == null) | 367 | if (avatar == null) |
376 | return "<llsd>undef</llsd>"; | 368 | return "<llsd>undef</llsd>"; |
377 | } | 369 | } |
@@ -407,8 +399,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
407 | // new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm, "http://etsvc02.hursley.ibm.com/api"); | 399 | // new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm, "http://etsvc02.hursley.ibm.com/api"); |
408 | LLSDVoiceAccountResponse voiceAccountResponse = | 400 | LLSDVoiceAccountResponse voiceAccountResponse = |
409 | new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm, | 401 | new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm, |
410 | String.Format("http://{0}:{1}{2}/", m_openSimWellKnownHTTPAddress, | 402 | String.Format("http://{0}:{1}{2}/", m_openSimWellKnownHTTPAddress, |
411 | m_freeSwitchServicePort, m_freeSwitchAPIPrefix)); | 403 | m_freeSwitchServicePort, m_freeSwitchAPIPrefix)); |
412 | 404 | ||
413 | string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); | 405 | string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); |
414 | 406 | ||
@@ -442,7 +434,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
442 | string avatarName = avatar.Name; | 434 | string avatarName = avatar.Name; |
443 | 435 | ||
444 | // - check whether we have a region channel in our cache | 436 | // - check whether we have a region channel in our cache |
445 | // - if not: | 437 | // - if not: |
446 | // create it and cache it | 438 | // create it and cache it |
447 | // - send it to the client | 439 | // - send it to the client |
448 | // - send channel_uri: as "sip:regionID@m_sipDomain" | 440 | // - send channel_uri: as "sip:regionID@m_sipDomain" |
@@ -451,12 +443,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
451 | LLSDParcelVoiceInfoResponse parcelVoiceInfo; | 443 | LLSDParcelVoiceInfoResponse parcelVoiceInfo; |
452 | string channelUri; | 444 | string channelUri; |
453 | 445 | ||
454 | if (null == scene.LandChannel) | 446 | if (null == scene.LandChannel) |
455 | throw new Exception(String.Format("region \"{0}\": avatar \"{1}\": land data not yet available", | 447 | throw new Exception(String.Format("region \"{0}\": avatar \"{1}\": land data not yet available", |
456 | scene.RegionInfo.RegionName, avatarName)); | 448 | scene.RegionInfo.RegionName, avatarName)); |
457 | 449 | ||
458 | |||
459 | |||
460 | // get channel_uri: check first whether estate | 450 | // get channel_uri: check first whether estate |
461 | // settings allow voice, then whether parcel allows | 451 | // settings allow voice, then whether parcel allows |
462 | // voice, if all do retrieve or obtain the parcel | 452 | // voice, if all do retrieve or obtain the parcel |
@@ -493,22 +483,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
493 | parcelVoiceInfo = new LLSDParcelVoiceInfoResponse(scene.RegionInfo.RegionName, land.LocalID, creds); | 483 | parcelVoiceInfo = new LLSDParcelVoiceInfoResponse(scene.RegionInfo.RegionName, land.LocalID, creds); |
494 | string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo); | 484 | string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo); |
495 | 485 | ||
496 | m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}", | 486 | m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}", |
497 | scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, r); | 487 | scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, r); |
498 | return r; | 488 | return r; |
499 | } | 489 | } |
500 | catch (Exception e) | 490 | catch (Exception e) |
501 | { | 491 | { |
502 | m_log.ErrorFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2}, retry later", | 492 | m_log.ErrorFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2}, retry later", |
503 | scene.RegionInfo.RegionName, avatarName, e.Message); | 493 | scene.RegionInfo.RegionName, avatarName, e.Message); |
504 | m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2} failed", | 494 | m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2} failed", |
505 | scene.RegionInfo.RegionName, avatarName, e.ToString()); | 495 | scene.RegionInfo.RegionName, avatarName, e.ToString()); |
506 | 496 | ||
507 | return "<llsd>undef</llsd>"; | 497 | return "<llsd>undef</llsd>"; |
508 | } | 498 | } |
509 | } | 499 | } |
510 | 500 | ||
511 | |||
512 | /// <summary> | 501 | /// <summary> |
513 | /// Callback for a client request for ChatSessionRequest | 502 | /// Callback for a client request for ChatSessionRequest |
514 | /// </summary> | 503 | /// </summary> |
@@ -550,7 +539,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
550 | string fwdresponsestr = ""; | 539 | string fwdresponsestr = ""; |
551 | int fwdresponsecode = 200; | 540 | int fwdresponsecode = 200; |
552 | string fwdresponsecontenttype = "text/xml"; | 541 | string fwdresponsecontenttype = "text/xml"; |
553 | |||
554 | 542 | ||
555 | HttpWebRequest forwardreq = (HttpWebRequest)WebRequest.Create(forwardaddress); | 543 | HttpWebRequest forwardreq = (HttpWebRequest)WebRequest.Create(forwardaddress); |
556 | forwardreq.Method = method; | 544 | forwardreq.Method = method; |
@@ -577,7 +565,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
577 | response["content_type"] = fwdresponsecontenttype; | 565 | response["content_type"] = fwdresponsecontenttype; |
578 | response["str_response_string"] = fwdresponsestr; | 566 | response["str_response_string"] = fwdresponsestr; |
579 | response["int_response_code"] = fwdresponsecode; | 567 | response["int_response_code"] = fwdresponsecode; |
580 | 568 | ||
581 | return response; | 569 | return response; |
582 | } | 570 | } |
583 | 571 | ||
@@ -585,11 +573,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
585 | public Hashtable FreeSwitchSLVoiceGetPreloginHTTPHandler(Hashtable request) | 573 | public Hashtable FreeSwitchSLVoiceGetPreloginHTTPHandler(Hashtable request) |
586 | { | 574 | { |
587 | m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler called"); | 575 | m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler called"); |
588 | 576 | ||
589 | Hashtable response = new Hashtable(); | 577 | Hashtable response = new Hashtable(); |
590 | response["content_type"] = "text/xml"; | 578 | response["content_type"] = "text/xml"; |
591 | response["keepalive"] = false; | 579 | response["keepalive"] = false; |
592 | 580 | ||
593 | response["str_response_string"] = String.Format( | 581 | response["str_response_string"] = String.Format( |
594 | "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" + | 582 | "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" + |
595 | "<VCConfiguration>\r\n"+ | 583 | "<VCConfiguration>\r\n"+ |
@@ -607,9 +595,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
607 | "</VCConfiguration>", | 595 | "</VCConfiguration>", |
608 | m_freeSwitchRealm, m_freeSwitchSIPProxy, m_freeSwitchAttemptUseSTUN, | 596 | m_freeSwitchRealm, m_freeSwitchSIPProxy, m_freeSwitchAttemptUseSTUN, |
609 | m_freeSwitchEchoServer, m_freeSwitchEchoPort, | 597 | m_freeSwitchEchoServer, m_freeSwitchEchoPort, |
610 | m_freeSwitchDefaultWellKnownIP, m_freeSwitchDefaultTimeout, | 598 | m_freeSwitchDefaultWellKnownIP, m_freeSwitchDefaultTimeout, |
611 | m_freeSwitchUrlResetPassword, ""); | 599 | m_freeSwitchUrlResetPassword, ""); |
612 | 600 | ||
613 | response["int_response_code"] = 200; | 601 | response["int_response_code"] = 200; |
614 | 602 | ||
615 | m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler return {0}",response["str_response_string"]); | 603 | m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler return {0}",response["str_response_string"]); |
@@ -624,7 +612,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
624 | response["content-type"] = "text/xml"; | 612 | response["content-type"] = "text/xml"; |
625 | 613 | ||
626 | Hashtable requestBody = parseRequestBody((string)request["body"]); | 614 | Hashtable requestBody = parseRequestBody((string)request["body"]); |
627 | 615 | ||
628 | if (!requestBody.ContainsKey("auth_token")) | 616 | if (!requestBody.ContainsKey("auth_token")) |
629 | return response; | 617 | return response; |
630 | 618 | ||
@@ -632,7 +620,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
632 | //string[] auth_tokenvals = auth_token.Split(':'); | 620 | //string[] auth_tokenvals = auth_token.Split(':'); |
633 | //string username = auth_tokenvals[0]; | 621 | //string username = auth_tokenvals[0]; |
634 | int strcount = 0; | 622 | int strcount = 0; |
635 | 623 | ||
636 | string[] ids = new string[strcount]; | 624 | string[] ids = new string[strcount]; |
637 | 625 | ||
638 | int iter = -1; | 626 | int iter = -1; |
@@ -648,7 +636,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
648 | } | 636 | } |
649 | StringBuilder resp = new StringBuilder(); | 637 | StringBuilder resp = new StringBuilder(); |
650 | resp.Append("<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?><response xmlns=\"http://www.vivox.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation= \"/xsd/buddy_list.xsd\">"); | 638 | resp.Append("<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?><response xmlns=\"http://www.vivox.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation= \"/xsd/buddy_list.xsd\">"); |
651 | 639 | ||
652 | resp.Append(string.Format(@"<level0> | 640 | resp.Append(string.Format(@"<level0> |
653 | <status>OK</status> | 641 | <status>OK</status> |
654 | <cookie_name>lib_session</cookie_name> | 642 | <cookie_name>lib_session</cookie_name> |
@@ -678,7 +666,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
678 | <b2g_group_id></b2g_group_id> | 666 | <b2g_group_id></b2g_group_id> |
679 | </level3>", ids[i],i,m_freeSwitchRealm,dt)); | 667 | </level3>", ids[i],i,m_freeSwitchRealm,dt)); |
680 | } | 668 | } |
681 | 669 | ||
682 | resp.Append("</buddies><groups></groups></body></level0></response>"); | 670 | resp.Append("</buddies><groups></groups></body></level0></response>"); |
683 | 671 | ||
684 | response["str_response_string"] = resp.ToString(); | 672 | response["str_response_string"] = resp.ToString(); |
@@ -694,7 +682,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
694 | string requestbody = (string)request["body"]; | 682 | string requestbody = (string)request["body"]; |
695 | string uri = (string)request["uri"]; | 683 | string uri = (string)request["uri"]; |
696 | string contenttype = (string)request["content-type"]; | 684 | string contenttype = (string)request["content-type"]; |
697 | 685 | ||
698 | Hashtable requestBody = parseRequestBody((string)request["body"]); | 686 | Hashtable requestBody = parseRequestBody((string)request["body"]); |
699 | 687 | ||
700 | //string pwd = (string) requestBody["pwd"]; | 688 | //string pwd = (string) requestBody["pwd"]; |
@@ -712,7 +700,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
712 | pos++; | 700 | pos++; |
713 | if (s == userid) | 701 | if (s == userid) |
714 | break; | 702 | break; |
715 | |||
716 | } | 703 | } |
717 | } | 704 | } |
718 | } | 705 | } |
@@ -735,7 +722,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
735 | </body> | 722 | </body> |
736 | </level0> | 723 | </level0> |
737 | </response>", userid, pos, avatarName); | 724 | </response>", userid, pos, avatarName); |
738 | 725 | ||
739 | response["int_response_code"] = 200; | 726 | response["int_response_code"] = 200; |
740 | return response; | 727 | return response; |
741 | /* | 728 | /* |
@@ -752,13 +739,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
752 | public Hashtable FreeSwitchConfigHTTPHandler(Hashtable request) | 739 | public Hashtable FreeSwitchConfigHTTPHandler(Hashtable request) |
753 | { | 740 | { |
754 | m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchConfigHTTPHandler called with {0}", (string)request["body"]); | 741 | m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchConfigHTTPHandler called with {0}", (string)request["body"]); |
755 | 742 | ||
756 | Hashtable response = new Hashtable(); | 743 | Hashtable response = new Hashtable(); |
757 | response["str_response_string"] = string.Empty; | 744 | response["str_response_string"] = string.Empty; |
758 | // all the params come as NVPs in the request body | 745 | // all the params come as NVPs in the request body |
759 | Hashtable requestBody = parseRequestBody((string) request["body"]); | 746 | Hashtable requestBody = parseRequestBody((string) request["body"]); |
760 | 747 | ||
761 | // is this a dialplan or directory request | 748 | // is this a dialplan or directory request |
762 | string section = (string) requestBody["section"]; | 749 | string section = (string) requestBody["section"]; |
763 | 750 | ||
764 | if (section == "directory") | 751 | if (section == "directory") |
@@ -767,40 +754,39 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
767 | response = m_FreeSwitchDialplan.HandleDialplanRequest(m_freeSwitchContext, m_freeSwitchRealm, requestBody); | 754 | response = m_FreeSwitchDialplan.HandleDialplanRequest(m_freeSwitchContext, m_freeSwitchRealm, requestBody); |
768 | else | 755 | else |
769 | m_log.WarnFormat("[FreeSwitchVoice]: section was {0}", section); | 756 | m_log.WarnFormat("[FreeSwitchVoice]: section was {0}", section); |
770 | 757 | ||
771 | // XXX: re-generate dialplan: | 758 | // XXX: re-generate dialplan: |
772 | // - conf == region UUID | 759 | // - conf == region UUID |
773 | // - conf number = region port | 760 | // - conf number = region port |
774 | // -> TODO Initialise(): keep track of regions via events | 761 | // -> TODO Initialise(): keep track of regions via events |
775 | // re-generate accounts for all avatars | 762 | // re-generate accounts for all avatars |
776 | // -> TODO Initialise(): keep track of avatars via events | 763 | // -> TODO Initialise(): keep track of avatars via events |
777 | Regex normalizeEndLines = new Regex(@"\r\n", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); | 764 | Regex normalizeEndLines = new Regex(@"\r\n", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); |
778 | 765 | ||
779 | m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchConfigHTTPHandler return {0}",normalizeEndLines.Replace(((string)response["str_response_string"]), "")); | 766 | m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchConfigHTTPHandler return {0}",normalizeEndLines.Replace(((string)response["str_response_string"]), "")); |
780 | return response; | 767 | return response; |
781 | } | 768 | } |
782 | 769 | ||
783 | public Hashtable parseRequestBody(string body) | 770 | public Hashtable parseRequestBody(string body) |
784 | { | 771 | { |
785 | Hashtable bodyParams = new Hashtable(); | 772 | Hashtable bodyParams = new Hashtable(); |
786 | // split string | 773 | // split string |
787 | string [] nvps = body.Split(new Char [] {'&'}); | 774 | string [] nvps = body.Split(new Char [] {'&'}); |
788 | 775 | ||
789 | foreach (string s in nvps) { | 776 | foreach (string s in nvps) |
790 | 777 | { | |
791 | if (s.Trim() != "") | 778 | if (s.Trim() != "") |
792 | { | 779 | { |
793 | string [] nvp = s.Split(new Char [] {'='}); | 780 | string [] nvp = s.Split(new Char [] {'='}); |
794 | bodyParams.Add(HttpUtility.UrlDecode(nvp[0]), HttpUtility.UrlDecode(nvp[1])); | 781 | bodyParams.Add(HttpUtility.UrlDecode(nvp[0]), HttpUtility.UrlDecode(nvp[1])); |
795 | } | 782 | } |
796 | } | 783 | } |
797 | 784 | ||
798 | return bodyParams; | 785 | return bodyParams; |
799 | } | 786 | } |
800 | 787 | ||
801 | private string ChannelUri(Scene scene, LandData land) | 788 | private string ChannelUri(Scene scene, LandData land) |
802 | { | 789 | { |
803 | |||
804 | string channelUri = null; | 790 | string channelUri = null; |
805 | 791 | ||
806 | string landUUID; | 792 | string landUUID; |
@@ -808,12 +794,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
808 | 794 | ||
809 | // Create parcel voice channel. If no parcel exists, then the voice channel ID is the same | 795 | // Create parcel voice channel. If no parcel exists, then the voice channel ID is the same |
810 | // as the directory ID. Otherwise, it reflects the parcel's ID. | 796 | // as the directory ID. Otherwise, it reflects the parcel's ID. |
811 | 797 | ||
812 | lock (m_ParcelAddress) | 798 | lock (m_ParcelAddress) |
813 | { | 799 | { |
814 | if (m_ParcelAddress.ContainsKey(land.GlobalID.ToString())) | 800 | if (m_ParcelAddress.ContainsKey(land.GlobalID.ToString())) |
815 | { | 801 | { |
816 | m_log.DebugFormat("[FreeSwitchVoice]: parcel id {0}: using sip address {1}", | 802 | m_log.DebugFormat("[FreeSwitchVoice]: parcel id {0}: using sip address {1}", |
817 | land.GlobalID, m_ParcelAddress[land.GlobalID.ToString()]); | 803 | land.GlobalID, m_ParcelAddress[land.GlobalID.ToString()]); |
818 | return m_ParcelAddress[land.GlobalID.ToString()]; | 804 | return m_ParcelAddress[land.GlobalID.ToString()]; |
819 | } | 805 | } |
@@ -823,22 +809,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
823 | { | 809 | { |
824 | landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, land.Name); | 810 | landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, land.Name); |
825 | landUUID = land.GlobalID.ToString(); | 811 | landUUID = land.GlobalID.ToString(); |
826 | m_log.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", | 812 | m_log.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", |
827 | landName, land.LocalID, landUUID); | 813 | landName, land.LocalID, landUUID); |
828 | } | 814 | } |
829 | else | 815 | else |
830 | { | 816 | { |
831 | landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, scene.RegionInfo.RegionName); | 817 | landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, scene.RegionInfo.RegionName); |
832 | landUUID = scene.RegionInfo.RegionID.ToString(); | 818 | landUUID = scene.RegionInfo.RegionID.ToString(); |
833 | m_log.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", | 819 | m_log.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", |
834 | landName, land.LocalID, landUUID); | 820 | landName, land.LocalID, landUUID); |
835 | } | 821 | } |
836 | System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); | 822 | System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); |
837 | 823 | ||
838 | // slvoice handles the sip address differently if it begins with confctl, hiding it from the user in the friends list. however it also disables | 824 | // slvoice handles the sip address differently if it begins with confctl, hiding it from the user in the friends list. however it also disables |
839 | // the personal speech indicators as well unless some siren14-3d codec magic happens. we dont have siren143d so we'll settle for the personal speech indicator. | 825 | // the personal speech indicators as well unless some siren14-3d codec magic happens. we dont have siren143d so we'll settle for the personal speech indicator. |
840 | channelUri = String.Format("sip:conf-{0}@{1}", "x" + Convert.ToBase64String(encoding.GetBytes(landUUID)), m_freeSwitchRealm); | 826 | channelUri = String.Format("sip:conf-{0}@{1}", "x" + Convert.ToBase64String(encoding.GetBytes(landUUID)), m_freeSwitchRealm); |
841 | 827 | ||
842 | lock (m_ParcelAddress) | 828 | lock (m_ParcelAddress) |
843 | { | 829 | { |
844 | if (!m_ParcelAddress.ContainsKey(land.GlobalID.ToString())) | 830 | if (!m_ParcelAddress.ContainsKey(land.GlobalID.ToString())) |
@@ -849,14 +835,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
849 | 835 | ||
850 | return channelUri; | 836 | return channelUri; |
851 | } | 837 | } |
852 | 838 | ||
853 | private static bool CustomCertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error) | 839 | private static bool CustomCertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error) |
854 | { | 840 | { |
855 | |||
856 | return true; | 841 | return true; |
857 | |||
858 | } | 842 | } |
859 | } | 843 | } |
844 | |||
860 | public class MonoCert : ICertificatePolicy | 845 | public class MonoCert : ICertificatePolicy |
861 | { | 846 | { |
862 | #region ICertificatePolicy Members | 847 | #region ICertificatePolicy Members |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatar.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatar.cs index 03c1e95..3d49732 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatar.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatar.cs | |||
@@ -34,6 +34,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
34 | { | 34 | { |
35 | public interface IAvatar : IEntity | 35 | public interface IAvatar : IEntity |
36 | { | 36 | { |
37 | |||
38 | bool IsChildAgent { get; } | ||
39 | |||
37 | //// <value> | 40 | //// <value> |
38 | /// Array of worn attachments, empty but not null, if no attachments are worn | 41 | /// Array of worn attachments, empty but not null, if no attachments are worn |
39 | /// </value> | 42 | /// </value> |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs index 4427426..0786bd9 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs | |||
@@ -70,6 +70,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
70 | set { GetSP().TeleportWithMomentum(value); } | 70 | set { GetSP().TeleportWithMomentum(value); } |
71 | } | 71 | } |
72 | 72 | ||
73 | public bool IsChildAgent | ||
74 | { | ||
75 | get { return GetSP().IsChildAgent; } | ||
76 | } | ||
77 | |||
73 | #region IAvatar implementation | 78 | #region IAvatar implementation |
74 | public IAvatarAttachment[] Attachments | 79 | public IAvatarAttachment[] Attachments |
75 | { | 80 | { |
diff --git a/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs b/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs index 3490a8b..ccdea14 100644 --- a/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs +++ b/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs | |||
@@ -121,19 +121,19 @@ namespace OpenSim.Region.Modules.SvnSerialiser | |||
121 | { | 121 | { |
122 | serialiser.LoadPrimsFromXml2( | 122 | serialiser.LoadPrimsFromXml2( |
123 | scene, | 123 | scene, |
124 | m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID | 124 | m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID |
125 | + Slash.DirectorySeparatorChar + "objects.xml"); | 125 | + Slash.DirectorySeparatorChar + "objects.xml"); |
126 | 126 | ||
127 | scene.RequestModuleInterface<ITerrainModule>().LoadFromFile( | 127 | scene.RequestModuleInterface<ITerrainModule>().LoadFromFile( |
128 | m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID | 128 | m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID |
129 | + Slash.DirectorySeparatorChar + "heightmap.r32"); | 129 | + Slash.DirectorySeparatorChar + "heightmap.r32"); |
130 | 130 | ||
131 | m_log.Info("[SVNBACKUP]: Region load successful (" + scene.RegionInfo.RegionName + ")."); | 131 | m_log.Info("[SVNBACKUP]: Region load successful (" + scene.RegionInfo.RegionName + ")."); |
132 | } | 132 | } |
133 | else | 133 | else |
134 | { | 134 | { |
135 | m_log.ErrorFormat( | 135 | m_log.ErrorFormat( |
136 | "[SVNBACKUP]: Region load of {0} failed - no serialisation module available", | 136 | "[SVNBACKUP]: Region load of {0} failed - no serialisation module available", |
137 | scene.RegionInfo.RegionName); | 137 | scene.RegionInfo.RegionName); |
138 | } | 138 | } |
139 | } | 139 | } |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs b/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs index 6ae0c8a..9beeabb 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs | |||
@@ -72,23 +72,23 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
72 | 72 | ||
73 | 73 | ||
74 | // Vehicle properties | 74 | // Vehicle properties |
75 | private Vehicle m_type = Vehicle.TYPE_NONE; // If a 'VEHICLE', and what kind | 75 | private Vehicle m_type = Vehicle.TYPE_NONE; // If a 'VEHICLE', and what kind |
76 | // private Quaternion m_referenceFrame = Quaternion.Identity; // Axis modifier | 76 | // private Quaternion m_referenceFrame = Quaternion.Identity; // Axis modifier |
77 | private VehicleFlag m_flags = (VehicleFlag) 0; // Boolean settings: | 77 | private VehicleFlag m_flags = (VehicleFlag) 0; // Boolean settings: |
78 | // HOVER_TERRAIN_ONLY | 78 | // HOVER_TERRAIN_ONLY |
79 | // HOVER_GLOBAL_HEIGHT | 79 | // HOVER_GLOBAL_HEIGHT |
80 | // NO_DEFLECTION_UP | 80 | // NO_DEFLECTION_UP |
81 | // HOVER_WATER_ONLY | 81 | // HOVER_WATER_ONLY |
82 | // HOVER_UP_ONLY | 82 | // HOVER_UP_ONLY |
83 | // LIMIT_MOTOR_UP | 83 | // LIMIT_MOTOR_UP |
84 | // LIMIT_ROLL_ONLY | 84 | // LIMIT_ROLL_ONLY |
85 | private VehicleFlag m_Hoverflags = (VehicleFlag)0; | 85 | private VehicleFlag m_Hoverflags = (VehicleFlag)0; |
86 | private Vector3 m_BlockingEndPoint = Vector3.Zero; | 86 | private Vector3 m_BlockingEndPoint = Vector3.Zero; |
87 | private Quaternion m_RollreferenceFrame = Quaternion.Identity; | 87 | private Quaternion m_RollreferenceFrame = Quaternion.Identity; |
88 | // Linear properties | 88 | // Linear properties |
89 | private Vector3 m_linearMotorDirection = Vector3.Zero; // velocity requested by LSL, decayed by time | 89 | private Vector3 m_linearMotorDirection = Vector3.Zero; // velocity requested by LSL, decayed by time |
90 | private Vector3 m_linearMotorDirectionLASTSET = Vector3.Zero; // velocity requested by LSL | 90 | private Vector3 m_linearMotorDirectionLASTSET = Vector3.Zero; // velocity requested by LSL |
91 | private Vector3 m_dir = Vector3.Zero; // velocity applied to body | 91 | private Vector3 m_dir = Vector3.Zero; // velocity applied to body |
92 | private Vector3 m_linearFrictionTimescale = Vector3.Zero; | 92 | private Vector3 m_linearFrictionTimescale = Vector3.Zero; |
93 | private float m_linearMotorDecayTimescale = 0; | 93 | private float m_linearMotorDecayTimescale = 0; |
94 | private float m_linearMotorTimescale = 0; | 94 | private float m_linearMotorTimescale = 0; |
@@ -98,14 +98,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
98 | // private Vector3 m_linearMotorOffset = Vector3.Zero; | 98 | // private Vector3 m_linearMotorOffset = Vector3.Zero; |
99 | 99 | ||
100 | //Angular properties | 100 | //Angular properties |
101 | private Vector3 m_angularMotorDirection = Vector3.Zero; // angular velocity requested by LSL motor | 101 | private Vector3 m_angularMotorDirection = Vector3.Zero; // angular velocity requested by LSL motor |
102 | private int m_angularMotorApply = 0; // application frame counter | 102 | private int m_angularMotorApply = 0; // application frame counter |
103 | private Vector3 m_angularMotorVelocity = Vector3.Zero; // current angular motor velocity | 103 | private Vector3 m_angularMotorVelocity = Vector3.Zero; // current angular motor velocity |
104 | private float m_angularMotorTimescale = 0; // motor angular velocity ramp up rate | 104 | private float m_angularMotorTimescale = 0; // motor angular velocity ramp up rate |
105 | private float m_angularMotorDecayTimescale = 0; // motor angular velocity decay rate | 105 | private float m_angularMotorDecayTimescale = 0; // motor angular velocity decay rate |
106 | private Vector3 m_angularFrictionTimescale = Vector3.Zero; // body angular velocity decay rate | 106 | private Vector3 m_angularFrictionTimescale = Vector3.Zero; // body angular velocity decay rate |
107 | private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body | 107 | private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body |
108 | // private Vector3 m_lastVertAttractor = Vector3.Zero; // what VA was last applied to body | 108 | // private Vector3 m_lastVertAttractor = Vector3.Zero; // what VA was last applied to body |
109 | 109 | ||
110 | //Deflection properties | 110 | //Deflection properties |
111 | // private float m_angularDeflectionEfficiency = 0; | 111 | // private float m_angularDeflectionEfficiency = 0; |
@@ -123,14 +123,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
123 | // private float m_VhoverEfficiency = 0f; | 123 | // private float m_VhoverEfficiency = 0f; |
124 | private float m_VhoverTimescale = 0f; | 124 | private float m_VhoverTimescale = 0f; |
125 | private float m_VhoverTargetHeight = -1.0f; // if <0 then no hover, else its the current target height | 125 | private float m_VhoverTargetHeight = -1.0f; // if <0 then no hover, else its the current target height |
126 | private float m_VehicleBuoyancy = 0f; //KF: m_VehicleBuoyancy is set by VEHICLE_BUOYANCY for a vehicle. | 126 | private float m_VehicleBuoyancy = 0f; //KF: m_VehicleBuoyancy is set by VEHICLE_BUOYANCY for a vehicle. |
127 | // Modifies gravity. Slider between -1 (double-gravity) and 1 (full anti-gravity) | 127 | // Modifies gravity. Slider between -1 (double-gravity) and 1 (full anti-gravity) |
128 | // KF: So far I have found no good method to combine a script-requested .Z velocity and gravity. | 128 | // KF: So far I have found no good method to combine a script-requested .Z velocity and gravity. |
129 | // Therefore only m_VehicleBuoyancy=1 (0g) will use the script-requested .Z velocity. | 129 | // Therefore only m_VehicleBuoyancy=1 (0g) will use the script-requested .Z velocity. |
130 | 130 | ||
131 | //Attractor properties | 131 | //Attractor properties |
132 | private float m_verticalAttractionEfficiency = 1.0f; // damped | 132 | private float m_verticalAttractionEfficiency = 1.0f; // damped |
133 | private float m_verticalAttractionTimescale = 500f; // Timescale > 300 means no vert attractor. | 133 | private float m_verticalAttractionTimescale = 500f; // Timescale > 300 means no vert attractor. |
134 | 134 | ||
135 | internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue) | 135 | internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue) |
136 | { | 136 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a421484..dc4249c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -8192,38 +8192,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8192 | { | 8192 | { |
8193 | m_host.AddScriptLPS(1); | 8193 | m_host.AddScriptLPS(1); |
8194 | if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false)) | 8194 | if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false)) |
8195 | { | 8195 | { |
8196 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) | 8196 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) |
8197 | { | 8197 | { |
8198 | lock (m_host.TaskInventory) | 8198 | lock (m_host.TaskInventory) |
8199 | { | 8199 | { |
8200 | foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) | 8200 | foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) |
8201 | { | 8201 | { |
8202 | if (inv.Value.Name == item) | 8202 | if (inv.Value.Name == item) |
8203 | { | 8203 | { |
8204 | switch (mask) | 8204 | switch (mask) |
8205 | { | 8205 | { |
8206 | case 0: | 8206 | case 0: |
8207 | inv.Value.BasePermissions = (uint)value; | 8207 | inv.Value.BasePermissions = (uint)value; |
8208 | break; | 8208 | break; |
8209 | case 1: | 8209 | case 1: |
8210 | inv.Value.CurrentPermissions = (uint)value; | 8210 | inv.Value.CurrentPermissions = (uint)value; |
8211 | break; | 8211 | break; |
8212 | case 2: | 8212 | case 2: |
8213 | inv.Value.GroupPermissions = (uint)value; | 8213 | inv.Value.GroupPermissions = (uint)value; |
8214 | break; | 8214 | break; |
8215 | case 3: | 8215 | case 3: |
8216 | inv.Value.EveryonePermissions = (uint)value; | 8216 | inv.Value.EveryonePermissions = (uint)value; |
8217 | break; | 8217 | break; |
8218 | case 4: | 8218 | case 4: |
8219 | inv.Value.NextPermissions = (uint)value; | 8219 | inv.Value.NextPermissions = (uint)value; |
8220 | break; | 8220 | break; |
8221 | } | 8221 | } |
8222 | } | 8222 | } |
8223 | } | 8223 | } |
8224 | } | 8224 | } |
8225 | } | 8225 | } |
8226 | } | 8226 | } |
8227 | } | 8227 | } |
8228 | 8228 | ||
8229 | public LSL_String llGetInventoryCreator(string item) | 8229 | public LSL_String llGetInventoryCreator(string item) |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index c552b92..98e77c0 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -841,7 +841,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
841 | ObjectRemoved handlerObjectRemoved = OnObjectRemoved; | 841 | ObjectRemoved handlerObjectRemoved = OnObjectRemoved; |
842 | if (handlerObjectRemoved != null) | 842 | if (handlerObjectRemoved != null) |
843 | { | 843 | { |
844 | SceneObjectPart part = m_Scene.GetSceneObjectPart(localID); | 844 | SceneObjectPart part = m_Scene.GetSceneObjectPart(localID); |
845 | handlerObjectRemoved(part.UUID); | 845 | handlerObjectRemoved(part.UUID); |
846 | } | 846 | } |
847 | 847 | ||