29 using System.Collections;
30 using System.Collections.Generic;
32 using System.Reflection;
34 using System.Threading;
40 using OpenMetaverse.Packets;
41 using OpenMetaverse.Messages.Linden;
42 using OpenMetaverse.StructuredData;
44 using OpenSim.Framework;
45 using OpenSim.Framework.Client;
46 using OpenSim.Framework.Monitoring;
47 using OpenSim.Region.Framework.Interfaces;
48 using OpenSim.Region.Framework.Scenes;
49 using OpenSim.Services.Interfaces;
57 namespace OpenSim.
Region.ClientStack.LindenUDP
70 public int DebugPacketLevel {
get; set; }
295 #pragma warning disable 0067
307 #pragma warning restore 0067
311 #region Class Members
314 public delegate
void BinaryGenericMessage(Object sender,
string method, byte[][] args);
317 private const float m_sunPainDaHalfOrbitalCutoff = 4.712388980384689858f;
319 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
320 private static string LogHeader =
"[LLCLIENTVIEW]";
321 protected static Dictionary<PacketType, PacketMethod> PacketHandlers =
new Dictionary<PacketType, PacketMethod>();
330 private readonly
UUID m_sessionId;
331 private readonly
UUID m_secureSessionId;
333 private readonly uint m_circuitCode;
334 private readonly byte[] m_channelVersion = Utils.EmptyBytes;
337 private int m_cachedTextureSerial;
341 private bool m_disableFacelights =
false;
343 private bool m_VelocityInterpolate =
false;
344 private const uint MaxTransferBytesPerPacket = 600;
364 private bool m_deliverPackets =
true;
366 private bool m_SendLogoutPacketWhenClosing =
true;
379 protected Dictionary<PacketType, PacketProcessor> m_packetHandlers =
new Dictionary<PacketType, PacketProcessor>();
380 protected Dictionary<string, GenericMessage> m_genericPacketHandlers =
new Dictionary<string, GenericMessage>();
387 protected string m_activeGroupName = String.Empty;
389 protected Dictionary<UUID, ulong> m_groupPowers =
new Dictionary<UUID, ulong>();
394 private const bool m_checkPackets =
true;
396 #endregion Class Members
402 public IPEndPoint RemoteEndPoint {
get {
return m_udpClient.RemoteEndPoint; } }
403 public UUID SecureSessionId {
get {
return m_secureSessionId; } }
405 public UUID SessionId {
get {
return m_sessionId; } }
406 public Vector3 StartPos
408 get {
return m_startpos; }
409 set { m_startpos = value; }
411 public bool DeliverPackets
413 get {
return m_deliverPackets; }
415 m_deliverPackets = value;
416 m_udpClient.m_deliverPackets = value;
419 public UUID AgentId {
get {
return m_agentId; } }
421 public UUID ActiveGroupId {
get {
return m_activeGroupID; }
private set { m_activeGroupID = value; } }
422 public string ActiveGroupName {
get {
return m_activeGroupName; }
private set { m_activeGroupName = value; } }
423 public ulong ActiveGroupPowers {
get {
return m_activeGroupPowers; }
private set { m_activeGroupPowers = value; } }
424 public bool IsGroupMember(UUID groupID) {
return m_groupPowers.ContainsKey(groupID); }
426 public int PingTimeMS
430 if (UDPClient != null)
431 return UDPClient.PingTimeMS;
444 public string FirstName {
get {
return m_firstName; } }
449 public string LastName {
get {
return m_lastName; } }
454 public string Name {
get {
return FirstName +
" " + LastName; } }
456 public uint CircuitCode {
get {
return m_circuitCode; } }
457 public int NextAnimationSequenceNumber
459 get {
return m_udpServer.NextAnimationSequenceNumber; }
466 public bool IsActive {
get; set; }
471 public Object CloseSyncLock {
get;
private set; }
473 public bool IsLoggingOut {
get; set; }
475 public bool DisableFacelights
477 get {
return m_disableFacelights; }
478 set { m_disableFacelights = value; }
481 public List<uint> SelectedObjects {
get;
private set;}
483 public bool SendLogoutPacketWhenClosing { set { m_SendLogoutPacketWhenClosing = value; } }
486 #endregion Properties
497 UUID agentId, UUID sessionId, uint circuitCode)
501 CloseSyncLock =
new Object();
502 SelectedObjects =
new List<uint>();
504 RegisterInterface<IClientIM>(
this);
505 RegisterInterface<IClientInventory>(
this);
506 RegisterInterface<IClientChat>(
this);
511 m_fullUpdateDataBlocksBuilder =
new List<ObjectUpdatePacket.ObjectDataBlock>();
515 m_assetService = m_scene.RequestModuleInterface<
IAssetService>();
516 m_GroupsModule = scene.RequestModuleInterface<
IGroupsModule>();
518 m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion());
520 m_sessionId = sessionId;
521 m_secureSessionId = sessionInfo.LoginInfo.SecureSession;
522 m_circuitCode = circuitCode;
523 m_firstName = sessionInfo.LoginInfo.First;
524 m_lastName = sessionInfo.LoginInfo.Last;
525 m_startpos = sessionInfo.LoginInfo.StartPos;
527 m_udpServer = udpServer;
528 m_udpClient = udpClient;
529 m_udpClient.OnQueueEmpty += HandleQueueEmpty;
530 m_udpClient.HasUpdates += HandleHasUpdates;
531 m_udpClient.OnPacketStats += PopulateStats;
535 RegisterLocalPacketHandlers();
540 #region Client Methods
551 public void Close(
bool sendStop,
bool force)
559 if (!IsActive && !force)
561 m_log.DebugFormat(
"{0} Not attempting to close inactive client {1} in {2} since force flag is not set",
562 LogHeader, Name, m_scene.Name);
568 CloseWithoutChecks(sendStop);
584 "[CLIENT]: Close has been called for {0} attached to scene {1}",
585 Name, m_scene.RegionInfo.RegionName);
595 ImageManager.Close();
598 if (OnConnectionClosed != null)
599 OnConnectionClosed(
this);
602 if (m_udpServer != null)
603 m_udpServer.Flush(m_udpClient);
606 m_scene.RemoveClient(AgentId,
true);
614 m_udpClient.Shutdown();
622 public void Kick(
string message)
624 if (!SceneAgent.IsChildAgent)
627 kupack.UserInfo.AgentID = AgentId;
628 kupack.UserInfo.SessionID = SessionId;
629 kupack.TargetBlock.TargetIP = 0;
630 kupack.TargetBlock.TargetPort = 0;
631 kupack.UserInfo.Reason = Util.StringToBytes256(message);
643 #endregion Client Methods
645 #region Packet Handling
649 NetworkStats handlerNetworkStatsUpdate = OnNetworkStatsUpdate;
650 if (handlerNetworkStatsUpdate != null)
652 handlerNetworkStatsUpdate(inPackets, outPackets, unAckedBytes);
659 lock (PacketHandlers)
661 if (!PacketHandlers.ContainsKey(packetType))
663 PacketHandlers.Add(packetType, handler);
682 return AddLocalPacketHandler(packetType, handler,
true);
698 return AddLocalPacketHandler(packetType, handler, doAsync,
false);
722 lock (m_packetHandlers)
724 if (!m_packetHandlers.ContainsKey(packetType))
726 m_packetHandlers.Add(
727 packetType,
new PacketProcessor() { method = handler, Async = doAsync, InEngine = inEngine });
737 MethodName = MethodName.ToLower().Trim();
740 lock (m_genericPacketHandlers)
742 if (!m_genericPacketHandlers.ContainsKey(MethodName))
744 m_genericPacketHandlers.Add(MethodName, handler);
760 if (m_packetHandlers.TryGetValue(packet.Type, out pprocessor))
765 if (pprocessor.Async)
767 if (!cinfo.
AsyncRequests.ContainsKey(packet.Type.ToString()))
768 cinfo.AsyncRequests[packet.Type.ToString()] = 0;
769 cinfo.AsyncRequests[packet.Type.ToString()]++;
773 if (pprocessor.InEngine)
774 m_udpServer.IpahEngine.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj));
776 Util.FireAndForget(ProcessSpecificPacketAsync, obj, packet.Type.ToString());
782 if (!cinfo.
SyncRequests.ContainsKey(packet.Type.ToString()))
783 cinfo.SyncRequests[packet.Type.ToString()] = 0;
784 cinfo.SyncRequests[packet.Type.ToString()]++;
786 result = pprocessor.method(
this, packet);
792 PacketMethod method = null;
794 lock (PacketHandlers)
796 found = PacketHandlers.TryGetValue(packet.Type, out method);
802 cinfo.GenericRequests[packet.Type.ToString()] = 0;
803 cinfo.GenericRequests[packet.Type.ToString()]++;
805 result = method(
this, packet);
817 packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack);
824 "[LLCLIENTVIEW]: Caught exception while processing {0} for {1} ", packetObject.Pack, Name),
829 #endregion Packet Handling
835 m_scene.AddNewAgent(
this, PresenceType.User);
837 RefreshGroupMembership();
851 public void SoundTrigger(UUID soundId, UUID owerid, UUID Objectid, UUID ParentId,
float Gain, Vector3 Position, UInt64 Handle)
855 #region Scene/Avatar to Client
860 handshake.RegionInfo =
new RegionHandshakePacket.RegionInfoBlock();
861 handshake.RegionInfo.BillableFactor = args.billableFactor;
862 handshake.RegionInfo.IsEstateManager = args.isEstateManager;
863 handshake.RegionInfo.TerrainHeightRange00 = args.terrainHeightRange0;
864 handshake.RegionInfo.TerrainHeightRange01 = args.terrainHeightRange1;
865 handshake.RegionInfo.TerrainHeightRange10 = args.terrainHeightRange2;
866 handshake.RegionInfo.TerrainHeightRange11 = args.terrainHeightRange3;
867 handshake.RegionInfo.TerrainStartHeight00 = args.terrainStartHeight0;
868 handshake.RegionInfo.TerrainStartHeight01 = args.terrainStartHeight1;
869 handshake.RegionInfo.TerrainStartHeight10 = args.terrainStartHeight2;
870 handshake.RegionInfo.TerrainStartHeight11 = args.terrainStartHeight3;
871 handshake.RegionInfo.SimAccess = args.simAccess;
872 handshake.RegionInfo.WaterHeight = args.waterHeight;
874 handshake.RegionInfo.RegionFlags = args.regionFlags;
875 handshake.RegionInfo.SimName = Util.StringToBytes256(args.regionName);
876 handshake.RegionInfo.SimOwner = args.SimOwner;
877 handshake.RegionInfo.TerrainBase0 = args.terrainBase0;
878 handshake.RegionInfo.TerrainBase1 = args.terrainBase1;
879 handshake.RegionInfo.TerrainBase2 = args.terrainBase2;
880 handshake.RegionInfo.TerrainBase3 = args.terrainBase3;
881 handshake.RegionInfo.TerrainDetail0 = args.terrainDetail0;
882 handshake.RegionInfo.TerrainDetail1 = args.terrainDetail1;
883 handshake.RegionInfo.TerrainDetail2 = args.terrainDetail2;
884 handshake.RegionInfo.TerrainDetail3 = args.terrainDetail3;
885 handshake.RegionInfo.CacheID = UUID.Random();
886 handshake.RegionInfo2 =
new RegionHandshakePacket.RegionInfo2Block();
887 handshake.RegionInfo2.RegionID = regionInfo.RegionID;
889 handshake.RegionInfo3 =
new RegionHandshakePacket.RegionInfo3Block();
890 handshake.RegionInfo3.CPUClassID = 9;
891 handshake.RegionInfo3.CPURatio = 1;
893 handshake.RegionInfo3.ColoName = Utils.EmptyBytes;
894 handshake.RegionInfo3.ProductName = Util.StringToBytes256(regionInfo.RegionType);
895 handshake.RegionInfo3.ProductSKU = Utils.EmptyBytes;
897 handshake.RegionInfo4 =
new RegionHandshakePacket.RegionInfo4Block[1];
898 handshake.RegionInfo4[0] =
new RegionHandshakePacket.RegionInfo4Block();
899 handshake.RegionInfo4[0].RegionFlagsExtended = args.regionFlags;
900 handshake.RegionInfo4[0].RegionProtocols = 0;
908 m_thisAgentUpdateArgs.CameraAtAxis.X = float.MinValue;
909 m_thisAgentUpdateArgs.ControlFlags = uint.MaxValue;
912 mov.SimData.ChannelVersion = m_channelVersion;
913 mov.AgentData.SessionID = m_sessionId;
914 mov.AgentData.AgentID = AgentId;
915 mov.Data.RegionHandle = regInfo.RegionHandle;
916 mov.Data.Timestamp = (uint)Util.UnixTimeSinceEpoch();
918 if ((pos.X == 0) && (pos.Y == 0) && (pos.Z == 0))
920 mov.Data.Position = m_startpos;
924 mov.Data.Position = pos;
926 mov.Data.LookAt = look;
933 string message, byte type, Vector3 fromPos,
string fromName,
934 UUID fromAgentID, UUID ownerID, byte source, byte audible)
937 reply.ChatData.Audible = audible;
938 reply.ChatData.Message = Util.StringToBytes1024(message);
939 reply.ChatData.ChatType = type;
940 reply.ChatData.SourceType = source;
941 reply.ChatData.Position = fromPos;
942 reply.ChatData.FromName = Util.StringToBytes256(fromName);
943 reply.ChatData.OwnerID = ownerID;
944 reply.ChatData.SourceID = fromAgentID;
958 ImprovedInstantMessagePacket msg
962 msg.AgentData.SessionID = UUID.Zero;
963 msg.MessageBlock.FromAgentName = Util.StringToBytes256(im.fromAgentName);
964 msg.MessageBlock.Dialog = im.dialog;
965 msg.MessageBlock.FromGroup = im.fromGroup;
970 msg.MessageBlock.Offline = im.offline;
971 msg.MessageBlock.ParentEstateID = im.ParentEstateID;
972 msg.MessageBlock.Position = im.Position;
974 msg.MessageBlock.Timestamp = im.timestamp;
976 msg.MessageBlock.Message = Util.StringToBytes1024(im.message);
977 msg.MessageBlock.BinaryBucket = im.binaryBucket;
985 GenericMessagePacket gmp =
new GenericMessagePacket();
987 gmp.AgentData.AgentID = AgentId;
988 gmp.AgentData.SessionID = m_sessionId;
989 gmp.AgentData.TransactionID = invoice;
991 gmp.MethodData.Method = Util.StringToBytes256(method);
992 gmp.ParamList =
new GenericMessagePacket.ParamListBlock[message.Count];
994 foreach (
string val
in message)
996 gmp.ParamList[i] =
new GenericMessagePacket.ParamListBlock();
997 gmp.ParamList[i++].Parameter = Util.StringToBytes256(val);
1005 GenericMessagePacket gmp =
new GenericMessagePacket();
1007 gmp.AgentData.AgentID = AgentId;
1008 gmp.AgentData.SessionID = m_sessionId;
1009 gmp.AgentData.TransactionID = invoice;
1011 gmp.MethodData.Method = Util.StringToBytes256(method);
1012 gmp.ParamList =
new GenericMessagePacket.ParamListBlock[message.Count];
1014 foreach (byte[] val
in message)
1016 gmp.ParamList[i] =
new GenericMessagePacket.ParamListBlock();
1017 gmp.ParamList[i++].Parameter = val;
1028 GroupActiveProposalItemReplyPacket GAPIRP =
new GroupActiveProposalItemReplyPacket();
1030 GAPIRP.AgentData.AgentID = AgentId;
1031 GAPIRP.AgentData.GroupID = groupID;
1032 GAPIRP.TransactionData.TransactionID = transactionID;
1033 GAPIRP.TransactionData.TotalNumItems = ((uint)i+1);
1034 GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData =
new GroupActiveProposalItemReplyPacket.ProposalDataBlock();
1035 GAPIRP.ProposalData =
new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1];
1036 ProposalData.VoteCast = Utils.StringToBytes(
"false");
1037 ProposalData.VoteID =
new UUID(Proposal.
VoteID);
1039 ProposalData.Majority = (float)Convert.ToInt32(Proposal.
Majority);
1040 ProposalData.Quorum = Convert.ToInt32(Proposal.Quorum);
1041 ProposalData.TerseDateID = Utils.StringToBytes(Proposal.TerseDateID);
1042 ProposalData.StartDateTime = Utils.StringToBytes(Proposal.StartDateTime);
1043 ProposalData.EndDateTime = Utils.StringToBytes(Proposal.EndDateTime);
1044 ProposalData.ProposalText = Utils.StringToBytes(Proposal.ProposalText);
1045 ProposalData.AlreadyVoted =
false;
1046 GAPIRP.ProposalData[i] = ProposalData;
1050 if (Proposals.Length == 0)
1052 GroupActiveProposalItemReplyPacket GAPIRP =
new GroupActiveProposalItemReplyPacket();
1054 GAPIRP.AgentData.AgentID = AgentId;
1055 GAPIRP.AgentData.GroupID = groupID;
1056 GAPIRP.TransactionData.TransactionID = transactionID;
1057 GAPIRP.TransactionData.TotalNumItems = 1;
1058 GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData =
new GroupActiveProposalItemReplyPacket.ProposalDataBlock();
1059 GAPIRP.ProposalData =
new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1];
1060 ProposalData.VoteCast = Utils.StringToBytes(
"false");
1061 ProposalData.VoteID = UUID.Zero;
1062 ProposalData.VoteInitiator = UUID.Zero;
1063 ProposalData.Majority = 0;
1064 ProposalData.Quorum = 0;
1065 ProposalData.TerseDateID = Utils.StringToBytes(
"");
1066 ProposalData.StartDateTime = Utils.StringToBytes(
"");
1067 ProposalData.EndDateTime = Utils.StringToBytes(
"");
1068 ProposalData.ProposalText = Utils.StringToBytes(
"");
1069 ProposalData.AlreadyVoted =
false;
1070 GAPIRP.ProposalData[0] = ProposalData;
1080 GroupVoteHistoryItemReplyPacket GVHIRP =
new GroupVoteHistoryItemReplyPacket();
1082 GVHIRP.AgentData.AgentID = AgentId;
1083 GVHIRP.AgentData.GroupID = groupID;
1084 GVHIRP.TransactionData.TransactionID = transactionID;
1085 GVHIRP.TransactionData.TotalNumItems = ((uint)i+1);
1086 GVHIRP.HistoryItemData.VoteID =
new UUID(Vote.
VoteID);
1088 GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Vote.
Majority);
1089 GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Vote.Quorum);
1090 GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(Vote.TerseDateID);
1091 GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(Vote.StartDateTime);
1092 GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(Vote.EndDateTime);
1093 GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(Vote.VoteType);
1094 GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(Vote.VoteResult);
1095 GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(Vote.ProposalText);
1096 GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem =
new GroupVoteHistoryItemReplyPacket.VoteItemBlock();
1097 GVHIRP.VoteItem =
new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1];
1098 VoteItem.CandidateID = UUID.Zero;
1099 VoteItem.NumVotes = 0;
1100 VoteItem.VoteCast = Utils.StringToBytes(
"Yes");
1101 GVHIRP.VoteItem[i] = VoteItem;
1105 if (Votes.Length == 0)
1107 GroupVoteHistoryItemReplyPacket GVHIRP =
new GroupVoteHistoryItemReplyPacket();
1109 GVHIRP.AgentData.AgentID = AgentId;
1110 GVHIRP.AgentData.GroupID = groupID;
1111 GVHIRP.TransactionData.TransactionID = transactionID;
1112 GVHIRP.TransactionData.TotalNumItems = 0;
1113 GVHIRP.HistoryItemData.VoteID = UUID.Zero;
1114 GVHIRP.HistoryItemData.VoteInitiator = UUID.Zero;
1115 GVHIRP.HistoryItemData.Majority = 0;
1116 GVHIRP.HistoryItemData.Quorum = 0;
1117 GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(
"");
1118 GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(
"");
1119 GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(
"");
1120 GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(
"");
1121 GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(
"");
1122 GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(
"");
1123 GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem =
new GroupVoteHistoryItemReplyPacket.VoteItemBlock();
1124 GVHIRP.VoteItem =
new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1];
1125 VoteItem.CandidateID = UUID.Zero;
1126 VoteItem.NumVotes = 0;
1127 VoteItem.VoteCast = Utils.StringToBytes(
"No");
1128 GVHIRP.VoteItem[0] = VoteItem;
1135 GroupAccountDetailsReplyPacket GADRP =
new GroupAccountDetailsReplyPacket();
1136 GADRP.AgentData =
new GroupAccountDetailsReplyPacket.AgentDataBlock();
1137 GADRP.AgentData.AgentID = sender.AgentId;
1138 GADRP.AgentData.GroupID = groupID;
1139 GADRP.HistoryData =
new GroupAccountDetailsReplyPacket.HistoryDataBlock[1];
1140 GroupAccountDetailsReplyPacket.HistoryDataBlock History =
new GroupAccountDetailsReplyPacket.HistoryDataBlock();
1141 GADRP.MoneyData =
new GroupAccountDetailsReplyPacket.MoneyDataBlock();
1142 GADRP.MoneyData.CurrentInterval = 0;
1143 GADRP.MoneyData.IntervalDays = 7;
1144 GADRP.MoneyData.RequestID = transactionID;
1145 GADRP.MoneyData.StartDate = Utils.StringToBytes(DateTime.Today.ToString());
1146 History.Amount = amt;
1147 History.Description = Utils.StringToBytes(
"");
1148 GADRP.HistoryData[0] = History;
1154 GroupAccountSummaryReplyPacket GASRP =
1156 PacketType.GroupAccountSummaryReply);
1158 GASRP.AgentData =
new GroupAccountSummaryReplyPacket.AgentDataBlock();
1159 GASRP.AgentData.AgentID = sender.AgentId;
1160 GASRP.AgentData.GroupID = groupID;
1161 GASRP.MoneyData =
new GroupAccountSummaryReplyPacket.MoneyDataBlock();
1162 GASRP.MoneyData.Balance = (int)moneyAmt;
1163 GASRP.MoneyData.TotalCredits = totalTier;
1164 GASRP.MoneyData.TotalDebits = usedTier;
1165 GASRP.MoneyData.StartDate =
new byte[1];
1166 GASRP.MoneyData.CurrentInterval = 1;
1167 GASRP.MoneyData.GroupTaxCurrent = 0;
1168 GASRP.MoneyData.GroupTaxEstimate = 0;
1169 GASRP.MoneyData.IntervalDays = 0;
1170 GASRP.MoneyData.LandTaxCurrent = 0;
1171 GASRP.MoneyData.LandTaxEstimate = 0;
1172 GASRP.MoneyData.LastTaxDate =
new byte[1];
1173 GASRP.MoneyData.LightTaxCurrent = 0;
1174 GASRP.MoneyData.TaxDate =
new byte[1];
1175 GASRP.MoneyData.RequestID = sender.AgentId;
1176 GASRP.MoneyData.ParcelDirFeeEstimate = 0;
1177 GASRP.MoneyData.ParcelDirFeeCurrent = 0;
1178 GASRP.MoneyData.ObjectTaxEstimate = 0;
1179 GASRP.MoneyData.NonExemptMembers = 0;
1180 GASRP.MoneyData.ObjectTaxCurrent = 0;
1181 GASRP.MoneyData.LightTaxEstimate = 0;
1187 GroupAccountTransactionsReplyPacket GATRP =
1189 PacketType.GroupAccountTransactionsReply);
1191 GATRP.AgentData =
new GroupAccountTransactionsReplyPacket.AgentDataBlock();
1192 GATRP.AgentData.AgentID = sender.AgentId;
1193 GATRP.AgentData.GroupID = groupID;
1194 GATRP.MoneyData =
new GroupAccountTransactionsReplyPacket.MoneyDataBlock();
1195 GATRP.MoneyData.CurrentInterval = 0;
1196 GATRP.MoneyData.IntervalDays = 7;
1197 GATRP.MoneyData.RequestID = transactionID;
1198 GATRP.MoneyData.StartDate = Utils.StringToBytes(DateTime.Today.ToString());
1199 GATRP.HistoryData =
new GroupAccountTransactionsReplyPacket.HistoryDataBlock[1];
1200 GroupAccountTransactionsReplyPacket.HistoryDataBlock History =
new GroupAccountTransactionsReplyPacket.HistoryDataBlock();
1202 History.Item = Utils.StringToBytes(
"");
1203 History.Time = Utils.StringToBytes(
"");
1205 History.User = Utils.StringToBytes(
"");
1206 GATRP.HistoryData[0] = History;
1213 int n = m_udpClient.GetPacketsQueuedCount(ThrottleOutPacketType.Land);
1228 Util.FireAndForget(DoSendLayerData, m_scene.Heightmap.GetTerrainData(),
"LLClientView.DoSendLayerData");
1239 private void DoSendLayerData(
object o)
1259 m_log.Error(
"[CLIENT]: SendLayerData() Failed with exception: " + e.Message, e);
1263 private void SendLayerTopRight(
TerrainData map,
int x1,
int y1,
int x2,
int y2)
1266 for (
int i = x1; i <= x2; i++)
1267 SendLayerData(i, y1, map);
1270 for (
int j = y1 + 1; j <= y2; j++)
1271 SendLayerData(x2, j, map);
1273 if (x2 - x1 > 0 && y2 - y1 > 0)
1274 SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2);
1277 void SendLayerBottomLeft(
TerrainData map,
int x1,
int y1,
int x2,
int y2)
1280 for (
int i = x2; i >= x1; i--)
1281 SendLayerData(i, y2, map);
1284 for (
int j = y2 - 1; j >= y1; j--)
1285 SendLayerData(x1, j, map);
1287 if (x2 - x1 > 0 && y2 - y1 > 0)
1288 SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1);
1304 SendLayerData(px, py, m_scene.Heightmap.GetTerrainData());
1308 int numPatches = -px;
1309 int[] xPatches =
new int[numPatches];
1310 int[] yPatches =
new int[numPatches];
1311 for (
int pp = 0; pp < numPatches; pp++)
1313 xPatches[pp] = (int)map[pp * 2];
1314 yPatches[pp] = (int)map[pp * 2 + 1];
1319 SendLayerData(xPatches, yPatches, m_scene.Heightmap.GetTerrainData());
1323 private void DebugSendingPatches(
string pWho,
int[] pX,
int[] pY)
1325 if (m_log.IsDebugEnabled)
1327 int numPatches = pX.Length;
1330 for (
int pp = 0; pp < numPatches; pp++)
1332 Xs += String.Format(
"{0}", (int)pX[pp]) +
",";
1333 Ys += String.Format(
"{0}", (int)pY[pp]) +
",";
1335 m_log.DebugFormat(
"{0} {1}: numPatches={2}, X={3}, Y={4}", LogHeader, pWho, numPatches, Xs, Ys);
1350 int[] xPatches =
new[] { px };
1351 int[] yPatches =
new[] { py };
1352 SendLayerData(xPatches, yPatches, terrData);
1355 private void SendLayerData(
int[] px,
int[] py,
TerrainData terrData)
1359 byte landPacketType;
1361 landPacketType = (byte)TerrainPatch.LayerType.LandExtended;
1363 landPacketType = (byte)TerrainPatch.LayerType.Land;
1365 List<LayerDataPacket> packets = OpenSimTerrainCompressor.CreateLayerDataPackets(terrData, px, py, landPacketType);
1366 foreach(LayerDataPacket pkt
in packets)
1371 m_log.Error(
"[CLIENT]: SendLayerData() Failed with exception: " + e.Message, e);
1381 Util.FireAndForget(DoSendWindData, windSpeeds,
"LLClientView.SendWindData");
1390 Util.FireAndForget(DoSendCloudData, cloudDensity,
"LLClientView.SendCloudData");
1397 private void DoSendWindData(
object o)
1399 Vector2[] windSpeeds = (Vector2[])o;
1400 TerrainPatch[] patches =
new TerrainPatch[2];
1401 patches[0] =
new TerrainPatch { Data =
new float[16 * 16] };
1402 patches[1] =
new TerrainPatch { Data =
new float[16 * 16] };
1404 for (
int x = 0; x < 16 * 16; x++)
1406 patches[0].Data[x] = windSpeeds[x].X;
1407 patches[1].Data[x] = windSpeeds[x].Y;
1411 byte layerType = (byte)TerrainPatch.LayerType.Wind;
1413 LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLayerDataPacketStandardSize(patches, layerType);
1414 layerpack.Header.Zerocoded =
true;
1422 private void DoSendCloudData(
object o)
1424 float[] cloudCover = (
float[])o;
1425 TerrainPatch[] patches =
new TerrainPatch[1];
1426 patches[0] =
new TerrainPatch();
1427 patches[0].Data =
new float[16 * 16];
1429 for (
int y = 0; y < 16; y++)
1431 for (
int x = 0; x < 16; x++)
1433 patches[0].Data[y * 16 + x] = cloudCover[y * 16 + x];
1437 byte layerType = (byte)TerrainPatch.LayerType.Cloud;
1439 LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLayerDataPacketStandardSize(patches, layerType);
1440 layerpack.Header.Zerocoded =
true;
1449 IPAddress neighbourIP = neighbourEndPoint.Address;
1450 ushort neighbourPort = (ushort)neighbourEndPoint.Port;
1452 EnableSimulatorPacket enablesimpacket = (EnableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.EnableSimulator);
1454 enablesimpacket.SimulatorInfo =
new EnableSimulatorPacket.SimulatorInfoBlock();
1455 enablesimpacket.SimulatorInfo.Handle = neighbourHandle;
1457 byte[] byteIP = neighbourIP.GetAddressBytes();
1458 enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24;
1459 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16;
1460 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
1461 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
1462 enablesimpacket.SimulatorInfo.Port = neighbourPort;
1464 enablesimpacket.Header.Reliable =
true;
1472 agentData.AgentID = AgentId;
1473 agentData.SessionID = m_sessionId;
1474 agentData.SecureSessionID = SecureSessionId;
1475 agentData.circuitcode = m_circuitCode;
1476 agentData.child =
false;
1477 agentData.firstname = m_firstName;
1478 agentData.lastname = m_lastName;
1482 if (capsModule == null)
1485 agentData.CapsPath = capsModule.GetCapsPath(m_agentId);
1486 agentData.ChildrenCapSeeds =
new Dictionary<ulong, string>(capsModule.GetChildrenSeeds(m_agentId));
1491 public virtual void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt, IPEndPoint externalIPEndPoint,
1494 Vector3 look =
new Vector3(lookAt.X * 10, lookAt.Y * 10, lookAt.Z * 10);
1497 CrossedRegionPacket newSimPack =
new CrossedRegionPacket();
1499 newSimPack.AgentData =
new CrossedRegionPacket.AgentDataBlock();
1500 newSimPack.AgentData.AgentID = AgentId;
1501 newSimPack.AgentData.SessionID = m_sessionId;
1502 newSimPack.Info =
new CrossedRegionPacket.InfoBlock();
1503 newSimPack.Info.Position = pos;
1504 newSimPack.Info.LookAt = look;
1505 newSimPack.RegionData =
new CrossedRegionPacket.RegionDataBlock();
1506 newSimPack.RegionData.RegionHandle = newRegionHandle;
1507 byte[] byteIP = externalIPEndPoint.Address.GetAddressBytes();
1508 newSimPack.RegionData.SimIP = (uint)byteIP[3] << 24;
1509 newSimPack.RegionData.SimIP += (uint)byteIP[2] << 16;
1510 newSimPack.RegionData.SimIP += (uint)byteIP[1] << 8;
1511 newSimPack.RegionData.SimIP += (uint)byteIP[0];
1512 newSimPack.RegionData.SimPort = (ushort)externalIPEndPoint.Port;
1513 newSimPack.RegionData.SeedCapability = Util.StringToBytes256(capsURL);
1519 internal void SendMapBlockSplit(List<MapBlockData> mapBlocks, uint flag)
1526 mapReply.AgentData.AgentID = AgentId;
1527 mapReply.Data =
new MapBlockReplyPacket.DataBlock[mapBlocks2.Length];
1528 mapReply.Size =
new MapBlockReplyPacket.SizeBlock[mapBlocks2.Length];
1529 mapReply.AgentData.Flags = flag;
1531 for (
int i = 0; i < mapBlocks2.Length; i++)
1533 mapReply.Data[i] =
new MapBlockReplyPacket.DataBlock();
1534 mapReply.Data[i].MapImageID = mapBlocks2[i].MapImageId;
1536 mapReply.Data[i].X = mapBlocks2[i].X;
1537 mapReply.Data[i].Y = mapBlocks2[i].Y;
1538 mapReply.Data[i].WaterHeight = mapBlocks2[i].WaterHeight;
1539 mapReply.Data[i].Name = Utils.StringToBytes(mapBlocks2[i].Name);
1541 mapReply.Data[i].Access = mapBlocks2[i].Access;
1542 mapReply.Data[i].Agents = mapBlocks2[i].Agents;
1544 mapReply.Size[i] =
new MapBlockReplyPacket.SizeBlock();
1545 mapReply.Size[i].SizeX = mapBlocks2[i].SizeX;
1546 mapReply.Size[i].SizeY = mapBlocks2[i].SizeY;
1559 List<MapBlockData> sendingBlocks =
new List<MapBlockData>();
1561 for (
int i = 0; i < mapBlocks2.Length; i++)
1563 sendingBlocks.Add(mapBlocks2[i]);
1564 if (((i + 1) == mapBlocks2.Length) || (((i + 1) % maxsend) == 0))
1566 SendMapBlockSplit(sendingBlocks, flag);
1567 sendingBlocks =
new List<MapBlockData>();
1575 tpLocal.Info.AgentID = AgentId;
1576 tpLocal.Info.TeleportFlags = flags;
1577 tpLocal.Info.LocationID = 2;
1578 tpLocal.Info.LookAt = lookAt;
1579 tpLocal.Info.Position = position;
1585 public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID,
1586 uint flags,
string capsURL)
1590 TeleportFinishPacket teleport =
new TeleportFinishPacket();
1591 teleport.Info.AgentID = AgentId;
1592 teleport.Info.RegionHandle = regionHandle;
1593 teleport.Info.SimAccess = simAccess;
1595 teleport.Info.SeedCapability = Util.StringToBytes256(capsURL);
1597 IPAddress oIP = newRegionEndPoint.Address;
1598 byte[] byteIP = oIP.GetAddressBytes();
1599 uint ip = (uint)byteIP[3] << 24;
1600 ip += (uint)byteIP[2] << 16;
1601 ip += (uint)byteIP[1] << 8;
1602 ip += (uint)byteIP[0];
1604 teleport.Info.SimIP = ip;
1605 teleport.Info.SimPort = (ushort)newRegionEndPoint.Port;
1606 teleport.Info.LocationID = 4;
1607 teleport.Info.TeleportFlags = 1 << 4;
1619 tpFailed.Info.AgentID = AgentId;
1620 tpFailed.Info.Reason = Util.StringToBytes256(reason);
1621 tpFailed.AlertInfo =
new TeleportFailedPacket.AlertInfoBlock[0];
1634 tpStart.Info.TeleportFlags = flags;
1643 tpProgress.AgentData.AgentID = this.AgentId;
1644 tpProgress.Info.TeleportFlags = flags;
1645 tpProgress.Info.Message = Util.StringToBytes256(message);
1651 public void SendMoneyBalance(UUID transaction,
bool success, byte[] description,
int balance,
int transactionType, UUID sourceID,
bool sourceIsGroup, UUID destID,
bool destIsGroup,
int amount,
string item)
1654 money.MoneyData.AgentID = AgentId;
1655 money.MoneyData.TransactionID = transaction;
1656 money.MoneyData.TransactionSuccess = success;
1657 money.MoneyData.Description = description;
1658 money.MoneyData.MoneyBalance = balance;
1659 money.TransactionInfo.TransactionType = transactionType;
1660 money.TransactionInfo.SourceID = sourceID;
1661 money.TransactionInfo.IsSourceGroup = sourceIsGroup;
1662 money.TransactionInfo.DestID = destID;
1663 money.TransactionInfo.IsDestGroup = destIsGroup;
1664 money.TransactionInfo.Amount = amount;
1665 money.TransactionInfo.ItemDescription = Util.StringToBytes256(item);
1672 if (payPrice[0] == 0 &&
1680 payPriceReply.ObjectData.ObjectID = objectID;
1681 payPriceReply.ObjectData.DefaultPayPrice = payPrice[0];
1683 payPriceReply.ButtonData =
new PayPriceReplyPacket.ButtonDataBlock[4];
1684 payPriceReply.ButtonData[0] =
new PayPriceReplyPacket.ButtonDataBlock();
1685 payPriceReply.ButtonData[0].PayButton = payPrice[1];
1686 payPriceReply.ButtonData[1] =
new PayPriceReplyPacket.ButtonDataBlock();
1687 payPriceReply.ButtonData[1].PayButton = payPrice[2];
1688 payPriceReply.ButtonData[2] =
new PayPriceReplyPacket.ButtonDataBlock();
1689 payPriceReply.ButtonData[2].PayButton = payPrice[3];
1690 payPriceReply.ButtonData[3] =
new PayPriceReplyPacket.ButtonDataBlock();
1691 payPriceReply.ButtonData[3].PayButton = payPrice[4];
1699 pc.Header.Reliable =
false;
1701 pc.PingID.PingID = seq;
1703 pc.PingID.OldestUnacked = 0;
1706 UDPClient.m_lastStartpingTimeMS = Util.EnvironmentTickCount();
1716 lock (m_entityProps.SyncRoot)
1717 m_entityProps.Remove(localIDs);
1718 lock (m_entityUpdates.SyncRoot)
1719 m_entityUpdates.Remove(localIDs);
1723 kill.ObjectData =
new KillObjectPacket.ObjectDataBlock[localIDs.Count];
1724 for (
int i = 0 ; i < localIDs.Count ; i++ )
1726 kill.ObjectData[i] =
new KillObjectPacket.ObjectDataBlock();
1727 kill.ObjectData[i].ID = localIDs[i];
1729 kill.Header.Reliable =
true;
1730 kill.Header.Zerocoded =
true;
1748 List<InventoryFolderBase> folders,
int version,
1749 bool fetchFolders,
bool fetchItems)
1761 int MAX_ITEMS_PER_PACKET = 5;
1762 int MAX_FOLDERS_PER_PACKET = 6;
1764 int totalItems = fetchItems ? items.Count : 0;
1765 int totalFolders = fetchFolders ? folders.Count : 0;
1767 int foldersSent = 0;
1768 int foldersToSend = 0;
1769 int itemsToSend = 0;
1771 InventoryDescendentsPacket currentPacket = null;
1775 if (totalItems == 0 && totalFolders == 0)
1776 currentPacket = CreateInventoryDescendentsPacket(ownerID, folderID, version, items.Count + folders.Count, 0, 0);
1780 while (itemsSent < totalItems || foldersSent < totalFolders)
1782 if (currentPacket == null)
1784 foldersToSend = totalFolders - foldersSent;
1785 if (foldersToSend > MAX_FOLDERS_PER_PACKET)
1786 foldersToSend = MAX_FOLDERS_PER_PACKET;
1788 if (foldersToSend == 0)
1790 itemsToSend = totalItems - itemsSent;
1791 if (itemsToSend > MAX_ITEMS_PER_PACKET)
1792 itemsToSend = MAX_ITEMS_PER_PACKET;
1795 currentPacket = CreateInventoryDescendentsPacket(ownerID, folderID, version, items.Count + folders.Count, foldersToSend, itemsToSend);
1798 if (foldersToSend-- > 0)
1799 currentPacket.FolderData[foldersSent % MAX_FOLDERS_PER_PACKET] = CreateFolderDataBlock(folders[foldersSent++]);
1800 else if (itemsToSend-- > 0)
1801 currentPacket.ItemData[itemsSent % MAX_ITEMS_PER_PACKET] = CreateItemDataBlock(items[itemsSent++]);
1807 currentPacket = null;
1811 if (currentPacket != null)
1819 private InventoryDescendentsPacket.FolderDataBlock CreateFolderDataBlock(
InventoryFolderBase folder)
1821 InventoryDescendentsPacket.FolderDataBlock newBlock =
new InventoryDescendentsPacket.FolderDataBlock();
1822 newBlock.FolderID = folder.ID;
1823 newBlock.Name = Util.StringToBytes256(folder.Name);
1824 newBlock.ParentID = folder.ParentID;
1825 newBlock.Type = (sbyte)folder.
Type;
1832 private InventoryDescendentsPacket.ItemDataBlock CreateItemDataBlock(
InventoryItemBase item)
1834 InventoryDescendentsPacket.ItemDataBlock newBlock =
new InventoryDescendentsPacket.ItemDataBlock();
1835 newBlock.ItemID = item.ID;
1836 newBlock.AssetID = item.AssetID;
1837 newBlock.CreatorID = item.CreatorIdAsUuid;
1838 newBlock.BaseMask = item.BasePermissions;
1839 newBlock.Description = Util.StringToBytes256(item.Description);
1840 newBlock.EveryoneMask = item.EveryOnePermissions;
1841 newBlock.OwnerMask = item.CurrentPermissions;
1842 newBlock.FolderID = item.Folder;
1843 newBlock.InvType = (sbyte)item.
InvType;
1844 newBlock.Name = Util.StringToBytes256(item.
Name);
1845 newBlock.NextOwnerMask = item.NextPermissions;
1846 newBlock.OwnerID = item.Owner;
1849 newBlock.GroupID = item.
GroupID;
1855 newBlock.Flags = item.
Flags & 0x2000ff;
1858 Helpers.InventoryCRC(newBlock.CreationDate, newBlock.SaleType,
1859 newBlock.InvType, newBlock.Type,
1860 newBlock.AssetID, newBlock.GroupID,
1862 newBlock.OwnerID, newBlock.CreatorID,
1863 newBlock.ItemID, newBlock.FolderID,
1864 newBlock.EveryoneMask,
1865 newBlock.Flags, newBlock.OwnerMask,
1866 newBlock.GroupMask, newBlock.NextOwnerMask);
1871 private void AddNullFolderBlockToDecendentsPacket(ref InventoryDescendentsPacket packet)
1873 packet.FolderData =
new InventoryDescendentsPacket.FolderDataBlock[1];
1874 packet.FolderData[0] =
new InventoryDescendentsPacket.FolderDataBlock();
1875 packet.FolderData[0].FolderID = UUID.Zero;
1876 packet.FolderData[0].ParentID = UUID.Zero;
1877 packet.FolderData[0].Type = -1;
1878 packet.FolderData[0].Name =
new byte[0];
1881 private void AddNullItemBlockToDescendentsPacket(ref InventoryDescendentsPacket packet)
1883 packet.ItemData =
new InventoryDescendentsPacket.ItemDataBlock[1];
1884 packet.ItemData[0] =
new InventoryDescendentsPacket.ItemDataBlock();
1885 packet.ItemData[0].ItemID = UUID.Zero;
1886 packet.ItemData[0].AssetID = UUID.Zero;
1887 packet.ItemData[0].CreatorID = UUID.Zero;
1888 packet.ItemData[0].BaseMask = 0;
1889 packet.ItemData[0].Description =
new byte[0];
1890 packet.ItemData[0].EveryoneMask = 0;
1891 packet.ItemData[0].OwnerMask = 0;
1892 packet.ItemData[0].FolderID = UUID.Zero;
1893 packet.ItemData[0].InvType = (sbyte)0;
1894 packet.ItemData[0].Name =
new byte[0];
1895 packet.ItemData[0].NextOwnerMask = 0;
1896 packet.ItemData[0].OwnerID = UUID.Zero;
1897 packet.ItemData[0].Type = -1;
1899 packet.ItemData[0].GroupID = UUID.Zero;
1900 packet.ItemData[0].GroupOwned =
false;
1901 packet.ItemData[0].GroupMask = 0;
1902 packet.ItemData[0].CreationDate = 0;
1903 packet.ItemData[0].SalePrice = 0;
1904 packet.ItemData[0].SaleType = 0;
1905 packet.ItemData[0].Flags = 0;
1910 private InventoryDescendentsPacket CreateInventoryDescendentsPacket(UUID ownerID, UUID folderID,
int version,
int descendents,
int folders,
int items)
1912 InventoryDescendentsPacket descend = (InventoryDescendentsPacket)PacketPool.Instance.GetPacket(PacketType.InventoryDescendents);
1913 descend.Header.Zerocoded =
true;
1914 descend.AgentData.AgentID = AgentId;
1915 descend.AgentData.OwnerID = ownerID;
1916 descend.AgentData.FolderID = folderID;
1917 descend.AgentData.Version = version;
1918 descend.AgentData.Descendents = descendents;
1921 descend.FolderData =
new InventoryDescendentsPacket.FolderDataBlock[folders];
1923 AddNullFolderBlockToDecendentsPacket(ref descend);
1926 descend.ItemData =
new InventoryDescendentsPacket.ItemDataBlock[items];
1928 AddNullItemBlockToDescendentsPacket(ref descend);
1936 const uint FULL_MASK_PERMISSIONS = (uint)0x7fffffff;
1938 FetchInventoryReplyPacket inventoryReply = (FetchInventoryReplyPacket)
PacketPool.
Instance.
GetPacket(PacketType.FetchInventoryReply);
1940 inventoryReply.AgentData.AgentID = AgentId;
1941 inventoryReply.InventoryData =
new FetchInventoryReplyPacket.InventoryDataBlock[1];
1942 inventoryReply.InventoryData[0] =
new FetchInventoryReplyPacket.InventoryDataBlock();
1943 inventoryReply.InventoryData[0].ItemID = item.ID;
1944 inventoryReply.InventoryData[0].AssetID = item.AssetID;
1945 inventoryReply.InventoryData[0].CreatorID = item.CreatorIdAsUuid;
1946 inventoryReply.InventoryData[0].BaseMask = item.BasePermissions;
1947 inventoryReply.InventoryData[0].CreationDate = item.CreationDate;
1949 inventoryReply.InventoryData[0].Description = Util.StringToBytes256(item.Description);
1950 inventoryReply.InventoryData[0].EveryoneMask = item.EveryOnePermissions;
1951 inventoryReply.InventoryData[0].FolderID = item.Folder;
1952 inventoryReply.InventoryData[0].InvType = (sbyte)item.
InvType;
1953 inventoryReply.InventoryData[0].Name = Util.StringToBytes256(item.
Name);
1954 inventoryReply.InventoryData[0].NextOwnerMask = item.NextPermissions;
1955 inventoryReply.InventoryData[0].OwnerID = item.Owner;
1956 inventoryReply.InventoryData[0].OwnerMask = item.CurrentPermissions;
1957 inventoryReply.InventoryData[0].Type = (sbyte)item.
AssetType;
1959 inventoryReply.InventoryData[0].GroupID = item.
GroupID;
1960 inventoryReply.InventoryData[0].GroupOwned = item.
GroupOwned;
1962 inventoryReply.InventoryData[0].Flags = item.
Flags;
1963 inventoryReply.InventoryData[0].SalePrice = item.
SalePrice;
1964 inventoryReply.InventoryData[0].SaleType = item.
SaleType;
1966 inventoryReply.InventoryData[0].CRC =
1967 Helpers.InventoryCRC(
1968 1000, 0, inventoryReply.InventoryData[0].InvType,
1969 inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID,
1970 inventoryReply.InventoryData[0].GroupID, 100,
1971 inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID,
1972 inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID,
1973 FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS,
1974 FULL_MASK_PERMISSIONS);
1975 inventoryReply.Header.Zerocoded =
true;
1982 UUID transactionId = UUID.Random();
1984 List<BulkUpdateInventoryPacket.FolderDataBlock> folderDataBlocks
1985 =
new List<BulkUpdateInventoryPacket.FolderDataBlock>();
1987 SendBulkUpdateInventoryFolderRecursive(folderBase, ref folderDataBlocks, transactionId);
1989 if (folderDataBlocks.Count > 0)
1993 BulkUpdateInventoryPacket bulkUpdate
1995 bulkUpdate.Header.Zerocoded =
true;
1997 bulkUpdate.AgentData.AgentID = AgentId;
1998 bulkUpdate.AgentData.TransactionID = transactionId;
1999 bulkUpdate.FolderData = folderDataBlocks.ToArray();
2000 List<BulkUpdateInventoryPacket.ItemDataBlock> foo =
new List<BulkUpdateInventoryPacket.ItemDataBlock>();
2001 bulkUpdate.ItemData = foo.ToArray();
2014 private void SendBulkUpdateInventoryFolderRecursive(
2015 InventoryFolderBase folder, ref List<BulkUpdateInventoryPacket.FolderDataBlock> folderDataBlocks,
2018 folderDataBlocks.Add(GenerateBulkUpdateFolderDataBlock(folder));
2020 const int MAX_ITEMS_PER_PACKET = 5;
2027 List<InventoryItemBase> items = contents.Items;
2028 while (items.Count > 0)
2030 BulkUpdateInventoryPacket bulkUpdate
2032 bulkUpdate.Header.Zerocoded =
true;
2034 bulkUpdate.AgentData.AgentID = AgentId;
2035 bulkUpdate.AgentData.TransactionID = transactionId;
2036 bulkUpdate.FolderData = folderDataBlocks.ToArray();
2038 int itemsToSend = (items.Count > MAX_ITEMS_PER_PACKET ? MAX_ITEMS_PER_PACKET : items.Count);
2039 bulkUpdate.ItemData =
new BulkUpdateInventoryPacket.ItemDataBlock[itemsToSend];
2041 for (
int i = 0; i < itemsToSend; i++)
2044 bulkUpdate.ItemData[i] = GenerateBulkUpdateItemDataBlock(items[items.Count - 1]);
2045 items.RemoveAt(items.Count - 1);
2051 folderDataBlocks =
new List<BulkUpdateInventoryPacket.FolderDataBlock>();
2055 if (items.Count > 0)
2056 folderDataBlocks.Add(GenerateBulkUpdateFolderDataBlock(folder));
2059 List<InventoryFolderBase> subFolders = contents.Folders;
2062 SendBulkUpdateInventoryFolderRecursive(subFolder, ref folderDataBlocks, transactionId);
2071 private BulkUpdateInventoryPacket.FolderDataBlock GenerateBulkUpdateFolderDataBlock(
InventoryFolderBase folder)
2073 BulkUpdateInventoryPacket.FolderDataBlock folderBlock =
new BulkUpdateInventoryPacket.FolderDataBlock();
2075 folderBlock.FolderID = folder.ID;
2076 folderBlock.ParentID = folder.ParentID;
2077 folderBlock.Type = (sbyte)folder.
Type;
2081 folderBlock.Name = Util.StringToBytes256(folder.
Name);
2091 private BulkUpdateInventoryPacket.ItemDataBlock GenerateBulkUpdateItemDataBlock(
InventoryItemBase item)
2093 BulkUpdateInventoryPacket.ItemDataBlock itemBlock =
new BulkUpdateInventoryPacket.ItemDataBlock();
2095 itemBlock.ItemID = item.ID;
2096 itemBlock.AssetID = item.AssetID;
2097 itemBlock.CreatorID = item.CreatorIdAsUuid;
2098 itemBlock.BaseMask = item.BasePermissions;
2099 itemBlock.Description = Util.StringToBytes256(item.Description);
2100 itemBlock.EveryoneMask = item.EveryOnePermissions;
2101 itemBlock.FolderID = item.Folder;
2102 itemBlock.InvType = (sbyte)item.
InvType;
2103 itemBlock.Name = Util.StringToBytes256(item.
Name);
2104 itemBlock.NextOwnerMask = item.NextPermissions;
2105 itemBlock.OwnerID = item.Owner;
2106 itemBlock.OwnerMask = item.CurrentPermissions;
2108 itemBlock.GroupID = item.
GroupID;
2111 itemBlock.Flags = item.
Flags & 0x2000ff;
2113 itemBlock.SaleType = item.
SaleType;
2117 Helpers.InventoryCRC(
2118 1000, 0, itemBlock.InvType,
2119 itemBlock.Type, itemBlock.AssetID,
2120 itemBlock.GroupID, 100,
2121 itemBlock.OwnerID, itemBlock.CreatorID,
2122 itemBlock.ItemID, itemBlock.FolderID,
2132 SendBulkUpdateInventoryItem((InventoryItemBase)node);
2134 SendBulkUpdateInventoryFolder((InventoryFolderBase)node);
2135 else if (node != null)
2136 m_log.ErrorFormat(
"[CLIENT]: {0} sent unknown inventory node named {1}", Name, node.Name);
2138 m_log.ErrorFormat(
"[CLIENT]: {0} sent null inventory node", Name);
2143 const uint FULL_MASK_PERMISSIONS = (uint)0x7ffffff;
2145 BulkUpdateInventoryPacket bulkUpdate
2148 bulkUpdate.AgentData.AgentID = AgentId;
2149 bulkUpdate.AgentData.TransactionID = UUID.Random();
2151 bulkUpdate.FolderData =
new BulkUpdateInventoryPacket.FolderDataBlock[1];
2152 bulkUpdate.FolderData[0] =
new BulkUpdateInventoryPacket.FolderDataBlock();
2153 bulkUpdate.FolderData[0].FolderID = UUID.Zero;
2154 bulkUpdate.FolderData[0].ParentID = UUID.Zero;
2155 bulkUpdate.FolderData[0].Type = -1;
2156 bulkUpdate.FolderData[0].Name =
new byte[0];
2158 bulkUpdate.ItemData =
new BulkUpdateInventoryPacket.ItemDataBlock[1];
2159 bulkUpdate.ItemData[0] =
new BulkUpdateInventoryPacket.ItemDataBlock();
2160 bulkUpdate.ItemData[0].ItemID = item.ID;
2161 bulkUpdate.ItemData[0].AssetID = item.AssetID;
2162 bulkUpdate.ItemData[0].CreatorID = item.CreatorIdAsUuid;
2163 bulkUpdate.ItemData[0].BaseMask = item.BasePermissions;
2164 bulkUpdate.ItemData[0].CreationDate = item.CreationDate;
2165 bulkUpdate.ItemData[0].Description = Util.StringToBytes256(item.Description);
2166 bulkUpdate.ItemData[0].EveryoneMask = item.EveryOnePermissions;
2167 bulkUpdate.ItemData[0].FolderID = item.Folder;
2168 bulkUpdate.ItemData[0].InvType = (sbyte)item.
InvType;
2169 bulkUpdate.ItemData[0].Name = Util.StringToBytes256(item.
Name);
2170 bulkUpdate.ItemData[0].NextOwnerMask = item.NextPermissions;
2171 bulkUpdate.ItemData[0].OwnerID = item.Owner;
2172 bulkUpdate.ItemData[0].OwnerMask = item.CurrentPermissions;
2173 bulkUpdate.ItemData[0].Type = (sbyte)item.
AssetType;
2175 bulkUpdate.ItemData[0].GroupID = item.
GroupID;
2176 bulkUpdate.ItemData[0].GroupOwned = item.
GroupOwned;
2178 bulkUpdate.ItemData[0].Flags = item.
Flags & 0x2000ff;
2179 bulkUpdate.ItemData[0].SalePrice = item.
SalePrice;
2180 bulkUpdate.ItemData[0].SaleType = item.
SaleType;
2182 bulkUpdate.ItemData[0].CRC =
2183 Helpers.InventoryCRC(1000, 0, bulkUpdate.ItemData[0].InvType,
2184 bulkUpdate.ItemData[0].Type, bulkUpdate.ItemData[0].AssetID,
2185 bulkUpdate.ItemData[0].GroupID, 100,
2186 bulkUpdate.ItemData[0].OwnerID, bulkUpdate.ItemData[0].CreatorID,
2187 bulkUpdate.ItemData[0].ItemID, bulkUpdate.ItemData[0].FolderID,
2188 FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS,
2189 FULL_MASK_PERMISSIONS);
2190 bulkUpdate.Header.Zerocoded =
true;
2196 SendInventoryItemCreateUpdate(Item,
UUID.Zero, callbackId);
2202 const uint FULL_MASK_PERMISSIONS = (uint)0x7fffffff;
2204 UpdateCreateInventoryItemPacket InventoryReply
2206 PacketType.UpdateCreateInventoryItem);
2209 InventoryReply.AgentData.AgentID = AgentId;
2210 InventoryReply.AgentData.SimApproved =
true;
2211 InventoryReply.AgentData.TransactionID = transactionID;
2212 InventoryReply.InventoryData =
new UpdateCreateInventoryItemPacket.InventoryDataBlock[1];
2213 InventoryReply.InventoryData[0] =
new UpdateCreateInventoryItemPacket.InventoryDataBlock();
2214 InventoryReply.InventoryData[0].ItemID = Item.ID;
2215 InventoryReply.InventoryData[0].AssetID = Item.AssetID;
2216 InventoryReply.InventoryData[0].CreatorID = Item.CreatorIdAsUuid;
2217 InventoryReply.InventoryData[0].BaseMask = Item.BasePermissions;
2218 InventoryReply.InventoryData[0].Description = Util.StringToBytes256(Item.Description);
2219 InventoryReply.InventoryData[0].EveryoneMask = Item.EveryOnePermissions;
2220 InventoryReply.InventoryData[0].FolderID = Item.Folder;
2221 InventoryReply.InventoryData[0].InvType = (sbyte)Item.
InvType;
2222 InventoryReply.InventoryData[0].Name = Util.StringToBytes256(Item.
Name);
2223 InventoryReply.InventoryData[0].NextOwnerMask = Item.NextPermissions;
2224 InventoryReply.InventoryData[0].OwnerID = Item.Owner;
2225 InventoryReply.InventoryData[0].OwnerMask = Item.CurrentPermissions;
2226 InventoryReply.InventoryData[0].Type = (sbyte)Item.
AssetType;
2227 InventoryReply.InventoryData[0].CallbackID = callbackId;
2229 InventoryReply.InventoryData[0].GroupID = Item.
GroupID;
2230 InventoryReply.InventoryData[0].GroupOwned = Item.
GroupOwned;
2232 InventoryReply.InventoryData[0].Flags = Item.
Flags & 0x2000ff;
2233 InventoryReply.InventoryData[0].SalePrice = Item.
SalePrice;
2234 InventoryReply.InventoryData[0].SaleType = Item.
SaleType;
2235 InventoryReply.InventoryData[0].CreationDate = Item.
CreationDate;
2237 InventoryReply.InventoryData[0].CRC =
2238 Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType,
2239 InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID,
2240 InventoryReply.InventoryData[0].GroupID, 100,
2241 InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID,
2242 InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID,
2243 FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS,
2244 FULL_MASK_PERMISSIONS);
2245 InventoryReply.Header.Zerocoded =
true;
2253 remove.AgentData.AgentID = AgentId;
2254 remove.AgentData.SessionID = m_sessionId;
2255 remove.InventoryData =
new RemoveInventoryItemPacket.InventoryDataBlock[1];
2256 remove.InventoryData[0] =
new RemoveInventoryItemPacket.InventoryDataBlock();
2257 remove.InventoryData[0].ItemID = itemID;
2258 remove.Header.Zerocoded =
true;
2264 ScriptControlChangePacket scriptcontrol = (ScriptControlChangePacket)
PacketPool.
Instance.
GetPacket(PacketType.ScriptControlChange);
2265 ScriptControlChangePacket.DataBlock[] data =
new ScriptControlChangePacket.DataBlock[1];
2266 ScriptControlChangePacket.DataBlock ddata =
new ScriptControlChangePacket.DataBlock();
2267 ddata.Controls = (uint)controls;
2268 ddata.PassToAgent = passToAgent;
2269 ddata.TakeControls = TakeControls;
2271 scriptcontrol.Data = data;
2278 replytask.InventoryData.TaskID = taskID;
2279 replytask.InventoryData.Serial = serial;
2280 replytask.InventoryData.Filename = fileName;
2284 public void SendXferPacket(ulong xferID, uint packet, byte[] data,
bool isTaskInventory)
2287 if (isTaskInventory)
2288 type = ThrottleOutPacketType.Task;
2291 sendXfer.XferID.ID = xferID;
2292 sendXfer.XferID.Packet = packet;
2293 sendXfer.DataPacket.Data = data;
2294 OutPacket(sendXfer, type);
2300 xferItem.XferID.ID = xferID;
2304 public void SendEconomyData(
float EnergyEfficiency,
int ObjectCapacity,
int ObjectCount,
int PriceEnergyUnit,
2305 int PriceGroupCreate,
int PriceObjectClaim,
float PriceObjectRent,
float PriceObjectScaleFactor,
2306 int PriceParcelClaim,
float PriceParcelClaimFactor,
int PriceParcelRent,
int PricePublicObjectDecay,
2307 int PricePublicObjectDelete,
int PriceRentLight,
int PriceUpload,
int TeleportMinPrice,
float TeleportPriceExponent)
2310 economyData.Info.EnergyEfficiency = EnergyEfficiency;
2311 economyData.Info.ObjectCapacity = ObjectCapacity;
2312 economyData.Info.ObjectCount = ObjectCount;
2313 economyData.Info.PriceEnergyUnit = PriceEnergyUnit;
2314 economyData.Info.PriceGroupCreate = PriceGroupCreate;
2315 economyData.Info.PriceObjectClaim = PriceObjectClaim;
2316 economyData.Info.PriceObjectRent = PriceObjectRent;
2317 economyData.Info.PriceObjectScaleFactor = PriceObjectScaleFactor;
2318 economyData.Info.PriceParcelClaim = PriceParcelClaim;
2319 economyData.Info.PriceParcelClaimFactor = PriceParcelClaimFactor;
2320 economyData.Info.PriceParcelRent = PriceParcelRent;
2321 economyData.Info.PricePublicObjectDecay = PricePublicObjectDecay;
2322 economyData.Info.PricePublicObjectDelete = PricePublicObjectDelete;
2323 economyData.Info.PriceRentLight = PriceRentLight;
2324 economyData.Info.PriceUpload = PriceUpload;
2325 economyData.Info.TeleportMinPrice = TeleportMinPrice;
2326 economyData.Info.TeleportPriceExponent = TeleportPriceExponent;
2327 economyData.Header.Reliable =
true;
2334 AvatarPickerReplyPacket replyPacket =
new AvatarPickerReplyPacket();
2335 replyPacket.AgentData.AgentID = AgentData.AgentID;
2336 replyPacket.AgentData.QueryID = AgentData.QueryID;
2338 List<AvatarPickerReplyPacket.DataBlock> data_block =
new List<AvatarPickerReplyPacket.DataBlock>();
2341 AvatarPickerReplyPacket.DataBlock db =
new AvatarPickerReplyPacket.DataBlock();
2342 db.AvatarID = arg.AvatarID;
2343 db.FirstName = arg.FirstName;
2344 db.LastName = arg.LastName;
2347 replyPacket.Data = data_block.ToArray();
2351 public void SendAgentDataUpdate(UUID agentid, UUID activegroupid,
string firstname,
string lastname, ulong grouppowers,
string groupname,
string grouptitle)
2353 if (agentid == AgentId)
2355 ActiveGroupId = activegroupid;
2356 ActiveGroupName = groupname;
2357 ActiveGroupPowers = grouppowers;
2361 sendAgentDataUpdate.AgentData.ActiveGroupID = activegroupid;
2362 sendAgentDataUpdate.AgentData.AgentID = agentid;
2363 sendAgentDataUpdate.AgentData.FirstName = Util.StringToBytes256(firstname);
2364 sendAgentDataUpdate.AgentData.GroupName = Util.StringToBytes256(groupname);
2365 sendAgentDataUpdate.AgentData.GroupPowers = grouppowers;
2366 sendAgentDataUpdate.AgentData.GroupTitle = Util.StringToBytes256(grouptitle);
2367 sendAgentDataUpdate.AgentData.LastName = Util.StringToBytes256(lastname);
2379 alertPack.AlertData =
new AlertMessagePacket.AlertDataBlock();
2380 alertPack.AlertData.Message = Util.StringToBytes256(message);
2381 alertPack.AlertInfo =
new AlertMessagePacket.AlertInfoBlock[0];
2408 if (!modal && !message.StartsWith(
"ALERT: ") && !message.StartsWith(
"NOTIFY: ") && message !=
"Home position set." && message !=
"You died and have been teleported to your home location")
2409 message =
"/" + message;
2411 alertPack.AgentData.AgentID = AgentId;
2412 alertPack.AlertData.Message = Util.StringToBytes256(message);
2413 alertPack.AlertData.Modal = modal;
2418 public void SendLoadURL(
string objectname, UUID objectID, UUID ownerID,
bool groupOwned,
string message,
2422 loadURL.Data.ObjectName = Util.StringToBytes256(objectname);
2423 loadURL.Data.ObjectID = objectID;
2424 loadURL.Data.OwnerID = ownerID;
2425 loadURL.Data.OwnerIsGroup = groupOwned;
2426 loadURL.Data.Message = Util.StringToBytes256(message);
2427 loadURL.Data.URL = Util.StringToBytes256(url);
2432 string objectname, UUID objectID, UUID ownerID,
string ownerFirstName,
string ownerLastName,
string msg,
2433 UUID textureID,
int ch,
string[] buttonlabels)
2436 dialog.Data.ObjectID = objectID;
2437 dialog.Data.ObjectName = Util.StringToBytes256(objectname);
2439 dialog.Data.FirstName = Util.StringToBytes256(ownerFirstName);
2440 dialog.Data.LastName = Util.StringToBytes256(ownerLastName);
2441 dialog.Data.Message = Util.StringToBytes(msg,512);
2442 dialog.Data.ImageID = textureID;
2443 dialog.Data.ChatChannel = ch;
2444 ScriptDialogPacket.ButtonsBlock[] buttons =
new ScriptDialogPacket.ButtonsBlock[buttonlabels.Length];
2445 for (
int i = 0; i < buttonlabels.Length; i++)
2447 buttons[i] =
new ScriptDialogPacket.ButtonsBlock();
2448 buttons[i].ButtonLabel = Util.StringToBytes(buttonlabels[i],24);
2450 dialog.Buttons = buttons;
2452 dialog.OwnerData =
new ScriptDialogPacket.OwnerDataBlock[1];
2453 dialog.OwnerData[0] =
new ScriptDialogPacket.OwnerDataBlock();
2454 dialog.OwnerData[0].OwnerID = ownerID;
2463 preSound.DataBlock =
new PreloadSoundPacket.DataBlockBlock[1];
2464 preSound.DataBlock[0] =
new PreloadSoundPacket.DataBlockBlock();
2465 preSound.DataBlock[0].ObjectID = objectID;
2466 preSound.DataBlock[0].OwnerID = ownerID;
2467 preSound.DataBlock[0].SoundID = soundID;
2468 preSound.Header.Zerocoded =
true;
2475 sound.DataBlock.SoundID = soundID;
2476 sound.DataBlock.ObjectID = objectID;
2477 sound.DataBlock.OwnerID = ownerID;
2478 sound.DataBlock.Gain = gain;
2479 sound.DataBlock.Flags = flags;
2487 abort.TransferInfo.TransferID = transferRequest.TransferInfo.TransferID;
2488 abort.TransferInfo.ChannelType = transferRequest.TransferInfo.ChannelType;
2489 m_log.Debug(
"[Assets] Aborting transfer; asset request failed");
2493 public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position,
float gain)
2496 sound.SoundData.SoundID = soundID;
2497 sound.SoundData.OwnerID = ownerID;
2498 sound.SoundData.ObjectID = objectID;
2499 sound.SoundData.ParentID = parentID;
2500 sound.SoundData.Handle = handle;
2501 sound.SoundData.Position = position;
2502 sound.SoundData.Gain = gain;
2509 AttachedSoundGainChangePacket sound = (AttachedSoundGainChangePacket)
PacketPool.
Instance.
GetPacket(PacketType.AttachedSoundGainChange);
2510 sound.DataBlock.ObjectID = objectID;
2511 sound.DataBlock.Gain = gain;
2516 public void SendSunPos(Vector3 Position, Vector3 Velocity, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear,
float OrbitalPosition)
2522 if (OrbitalPosition > m_sunPainDaHalfOrbitalCutoff)
2524 OrbitalPosition = (OrbitalPosition - m_sunPainDaHalfOrbitalCutoff) * 0.6666666667f + m_sunPainDaHalfOrbitalCutoff;
2527 SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket)
PacketPool.
Instance.
GetPacket(PacketType.SimulatorViewerTimeMessage);
2528 viewertime.TimeInfo.SunDirection = Position;
2529 viewertime.TimeInfo.SunAngVelocity = Velocity;
2534 viewertime.TimeInfo.UsecSinceStart = CurrentTime + 21600;
2536 viewertime.TimeInfo.SecPerDay = SecondsPerSunCycle;
2537 viewertime.TimeInfo.SecPerYear = SecondsPerYear;
2538 viewertime.TimeInfo.SunPhase = OrbitalPosition;
2539 viewertime.Header.Reliable =
false;
2540 viewertime.Header.Zerocoded =
true;
2599 packet.Header.Reliable =
false;
2600 packet.Header.Zerocoded =
true;
2602 packet.AgentData.AgentID = AgentId;
2603 packet.AgentData.SessionID = SessionId;
2605 packet.Effect = effectBlocks;
2612 string flAbout, uint flags, UUID flImageID, UUID imageID,
string profileURL,
2615 AvatarPropertiesReplyPacket avatarReply = (AvatarPropertiesReplyPacket)
PacketPool.
Instance.
GetPacket(PacketType.AvatarPropertiesReply);
2616 avatarReply.AgentData.AgentID = AgentId;
2617 avatarReply.AgentData.AvatarID = avatarID;
2618 if (aboutText != null)
2619 avatarReply.PropertiesData.AboutText = Util.StringToBytes1024(aboutText);
2621 avatarReply.PropertiesData.AboutText = Utils.EmptyBytes;
2622 avatarReply.PropertiesData.BornOn = Util.StringToBytes256(bornOn);
2623 avatarReply.PropertiesData.CharterMember = charterMember;
2624 if (flAbout != null)
2625 avatarReply.PropertiesData.FLAboutText = Util.StringToBytes256(flAbout);
2627 avatarReply.PropertiesData.FLAboutText = Utils.EmptyBytes;
2628 avatarReply.PropertiesData.Flags = flags;
2629 avatarReply.PropertiesData.FLImageID = flImageID;
2630 avatarReply.PropertiesData.ImageID = imageID;
2631 avatarReply.PropertiesData.ProfileURL = Util.StringToBytes256(profileURL);
2632 avatarReply.PropertiesData.PartnerID = partnerID;
2645 if (!SceneAgent.IsChildAgent)
2646 SendInstantMessage(
new GridInstantMessage(null, FromAvatarID, FromAvatarName, AgentId, 1, Message,
false,
new Vector3()));
2658 if (m_SendLogoutPacketWhenClosing)
2662 logReply.AgentData.AgentID = AgentId;
2663 logReply.AgentData.SessionID = SessionId;
2664 logReply.InventoryData =
new LogoutReplyPacket.InventoryDataBlock[1];
2665 logReply.InventoryData[0] =
new LogoutReplyPacket.InventoryDataBlock();
2666 logReply.InventoryData[0].ItemID = UUID.Zero;
2675 healthpacket.HealthData.Health = health;
2681 OnlineNotificationPacket onp =
new OnlineNotificationPacket();
2682 OnlineNotificationPacket.AgentBlockBlock[] onpb =
new OnlineNotificationPacket.AgentBlockBlock[agentIDs.Length];
2683 for (
int i = 0; i < agentIDs.Length; i++)
2685 OnlineNotificationPacket.AgentBlockBlock onpbl =
new OnlineNotificationPacket.AgentBlockBlock();
2686 onpbl.AgentID = agentIDs[i];
2689 onp.AgentBlock = onpb;
2690 onp.Header.Reliable =
true;
2696 OfflineNotificationPacket offp =
new OfflineNotificationPacket();
2697 OfflineNotificationPacket.AgentBlockBlock[] offpb =
new OfflineNotificationPacket.AgentBlockBlock[agentIDs.Length];
2698 for (
int i = 0; i < agentIDs.Length; i++)
2700 OfflineNotificationPacket.AgentBlockBlock onpbl =
new OfflineNotificationPacket.AgentBlockBlock();
2701 onpbl.AgentID = agentIDs[i];
2704 offp.AgentBlock = offpb;
2705 offp.Header.Reliable =
true;
2709 public void SendFindAgent(UUID HunterID, UUID PreyID,
double GlobalX,
double GlobalY)
2711 FindAgentPacket fap =
new FindAgentPacket();
2712 fap.AgentBlock.Hunter = HunterID;
2713 fap.AgentBlock.Prey = PreyID;
2714 fap.AgentBlock.SpaceIP = 0;
2716 fap.LocationBlock =
new FindAgentPacket.LocationBlockBlock[1];
2717 fap.LocationBlock[0] =
new FindAgentPacket.LocationBlockBlock();
2718 fap.LocationBlock[0].GlobalX = GlobalX;
2719 fap.LocationBlock[0].GlobalY = GlobalY;
2725 Quaternion SitOrientation,
bool autopilot,
2726 Vector3 CameraAtOffset, Vector3 CameraEyeOffset,
bool ForceMouseLook)
2728 AvatarSitResponsePacket avatarSitResponse =
new AvatarSitResponsePacket();
2729 avatarSitResponse.SitObject.ID = TargetID;
2730 avatarSitResponse.SitTransform.CameraAtOffset = CameraAtOffset;
2731 avatarSitResponse.SitTransform.CameraEyeOffset = CameraEyeOffset;
2732 avatarSitResponse.SitTransform.ForceMouselook = ForceMouseLook;
2733 avatarSitResponse.SitTransform.AutoPilot = autopilot;
2734 avatarSitResponse.SitTransform.SitPosition = OffsetPos;
2735 avatarSitResponse.SitTransform.SitRotation = SitOrientation;
2742 GrantGodlikePowersPacket respondPacket =
new GrantGodlikePowersPacket();
2743 GrantGodlikePowersPacket.GrantDataBlock gdb =
new GrantGodlikePowersPacket.GrantDataBlock();
2744 GrantGodlikePowersPacket.AgentDataBlock adb =
new GrantGodlikePowersPacket.AgentDataBlock();
2746 adb.AgentID = AgentId;
2747 adb.SessionID = SessionId;
2748 gdb.GodLevel = (byte)AdminLevel;
2751 respondPacket.GrantData = gdb;
2752 respondPacket.AgentData = adb;
2758 m_groupPowers.Clear();
2760 AgentGroupDataUpdatePacket Groupupdate =
new AgentGroupDataUpdatePacket();
2761 AgentGroupDataUpdatePacket.GroupDataBlock[] Groups =
new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length];
2762 for (
int i = 0; i < GroupMembership.Length; i++)
2764 m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers;
2766 AgentGroupDataUpdatePacket.GroupDataBlock
Group =
new AgentGroupDataUpdatePacket.GroupDataBlock();
2767 Group.AcceptNotices = GroupMembership[i].AcceptNotices;
2768 Group.Contribution = GroupMembership[i].Contribution;
2769 Group.GroupID = GroupMembership[i].GroupID;
2770 Group.GroupInsigniaID = GroupMembership[i].GroupPicture;
2771 Group.GroupName = Util.StringToBytes256(GroupMembership[i].GroupName);
2772 Group.GroupPowers = GroupMembership[i].GroupPowers;
2777 Groupupdate.GroupData = Groups;
2778 Groupupdate.AgentData =
new AgentGroupDataUpdatePacket.AgentDataBlock();
2779 Groupupdate.AgentData.AgentID = AgentId;
2787 eq.GroupMembership(Groupupdate, this.AgentId);
2790 catch (Exception ex)
2792 m_log.Error(
"Unable to send group membership data via eventqueue - exception: " + ex.ToString());
2793 m_log.Warn(
"sending group membership data via UDP");
2801 if (part != null && AgentId !=
UUID.Zero)
2808 uint localid = part.LocalId;
2809 byte physshapetype = part.PhysicsShapeType;
2810 float density = part.Density;
2811 float friction = part.Friction;
2812 float bounce = part.Restitution;
2813 float gravmod = part.GravityModifier;
2815 eq.partPhysicsProperties(localid, physshapetype, density, friction, bounce, gravmod,AgentId);
2818 catch (Exception ex)
2820 m_log.Error(
"Unable to send part Physics Proprieties - exception: " + ex.ToString());
2822 part.UpdatePhysRequired =
false;
2830 UUIDGroupNameReplyPacket pack =
new UUIDGroupNameReplyPacket();
2831 UUIDGroupNameReplyPacket.UUIDNameBlockBlock[] uidnameblock =
new UUIDGroupNameReplyPacket.UUIDNameBlockBlock[1];
2832 UUIDGroupNameReplyPacket.UUIDNameBlockBlock uidnamebloc =
new UUIDGroupNameReplyPacket.UUIDNameBlockBlock();
2833 uidnamebloc.ID = groupLLUID;
2834 uidnamebloc.GroupName = Util.StringToBytes256(GroupName);
2835 uidnameblock[0] = uidnamebloc;
2836 pack.UUIDNameBlock = uidnameblock;
2842 LandStatReplyPacket lsrp =
new LandStatReplyPacket();
2844 LandStatReplyPacket.ReportDataBlock[] lsrepdba =
new LandStatReplyPacket.ReportDataBlock[lsrpia.Length];
2847 lsrp.RequestData.ReportType = reportType;
2848 lsrp.RequestData.RequestFlags = requestFlags;
2849 lsrp.RequestData.TotalObjectCount = resultCount;
2850 for (
int i = 0; i < lsrpia.Length; i++)
2852 LandStatReplyPacket.ReportDataBlock lsrepdb =
new LandStatReplyPacket.ReportDataBlock();
2853 lsrepdb.LocationX = lsrpia[i].LocationX;
2854 lsrepdb.LocationY = lsrpia[i].LocationY;
2855 lsrepdb.LocationZ = lsrpia[i].LocationZ;
2856 lsrepdb.Score = lsrpia[i].Score;
2857 lsrepdb.TaskID = lsrpia[i].TaskID;
2858 lsrepdb.TaskLocalID = lsrpia[i].TaskLocalID;
2859 lsrepdb.TaskName = Util.StringToBytes256(lsrpia[i].TaskName);
2860 lsrepdb.OwnerName = Util.StringToBytes256(lsrpia[i].OwnerName);
2861 lsrepdba[i] = lsrepdb;
2863 lsrp.ReportData = lsrepdba;
2869 ScriptRunningReplyPacket scriptRunningReply =
new ScriptRunningReplyPacket();
2870 scriptRunningReply.Script.ObjectID = objectID;
2871 scriptRunningReply.Script.ItemID = itemID;
2872 scriptRunningReply.Script.Running = running;
2881 m_log.ErrorFormat(
"{0} Cannot send asset {1} ({2}), asset data is null",
2882 LogHeader, req.AssetInf.ID, req.AssetInf.Metadata.ContentType);
2885 int WearableOut = 0;
2886 bool isWearable =
false;
2891 AssetType.Bodypart || (AssetType) req.AssetInf.Type == AssetType.Clothing);
2900 TransferInfoPacket
Transfer =
new TransferInfoPacket();
2901 Transfer.TransferInfo.ChannelType = 2;
2902 Transfer.TransferInfo.Status = 0;
2903 Transfer.TransferInfo.TargetType = 0;
2906 Transfer.TransferInfo.Params =
new byte[20];
2907 Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
2908 int assType = req.AssetInf.Type;
2909 Array.Copy(Utils.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4);
2913 Transfer.TransferInfo.Params = req.Params;
2918 Transfer.TransferInfo.Size = req.AssetInf.Data.Length;
2919 Transfer.TransferInfo.TransferID = req.TransferRequestID;
2920 Transfer.Header.Zerocoded =
true;
2925 TransferPacketPacket TransferPacket =
new TransferPacketPacket();
2926 TransferPacket.TransferData.Packet = 0;
2927 TransferPacket.TransferData.ChannelType = 2;
2928 TransferPacket.TransferData.TransferID = req.TransferRequestID;
2929 TransferPacket.TransferData.Data = req.AssetInf.Data;
2930 TransferPacket.TransferData.Status = 1;
2931 TransferPacket.Header.Zerocoded =
true;
2936 int processedLength = 0;
2939 int maxChunkSize = (int) MaxTransferBytesPerPacket;
2940 int packetNumber = 0;
2944 TransferPacketPacket TransferPacket =
new TransferPacketPacket();
2945 TransferPacket.TransferData.Packet = packetNumber;
2946 TransferPacket.TransferData.ChannelType = 2;
2947 TransferPacket.TransferData.TransferID = req.TransferRequestID;
2949 int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize);
2950 byte[] chunk =
new byte[chunkSize];
2951 Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length);
2953 TransferPacket.TransferData.Data = chunk;
2956 if (req.
AssetInf.
Data.Length - processedLength > maxChunkSize)
2958 TransferPacket.TransferData.Status = 0;
2962 TransferPacket.TransferData.Status = 1;
2964 TransferPacket.Header.Zerocoded =
true;
2967 processedLength += chunkSize;
2975 TransferInfoPacket
Transfer =
new TransferInfoPacket();
2976 Transfer.TransferInfo.ChannelType = 2;
2977 Transfer.TransferInfo.Status = -2;
2978 Transfer.TransferInfo.TargetType = 0;
2979 Transfer.TransferInfo.Params = req.Params;
2980 Transfer.TransferInfo.Size = 0;
2981 Transfer.TransferInfo.TransferID = req.TransferRequestID;
2982 Transfer.Header.Zerocoded =
true;
2993 RegionIDAndHandleReplyPacket reply = (RegionIDAndHandleReplyPacket)
PacketPool.
Instance.
GetPacket(PacketType.RegionIDAndHandleReply);
2994 reply.ReplyBlock.RegionID = regionID;
2995 reply.ReplyBlock.RegionHandle = handle;
3003 if (dwellModule != null)
3004 dwell = dwellModule.GetDwell(land.GlobalID);
3006 reply.AgentData.AgentID = m_agentId;
3007 reply.Data.ParcelID = parcelID;
3008 reply.Data.OwnerID = land.OwnerID;
3009 reply.Data.Name = Utils.StringToBytes(land.Name);
3011 reply.Data.Desc = Utils.StringToBytes(land.Description.Substring(0, land.Description.Length > 254 ? 254: land.Description.Length));
3013 reply.Data.Desc =
new Byte[0];
3014 reply.Data.ActualArea = land.Area;
3015 reply.Data.BillableArea = land.Area;
3018 reply.Data.Flags = (byte)(
3020 ((land.Flags & (uint)ParcelFlags.ForSale) != 0 ? (1 << 7) : 0));
3022 Vector3 pos = land.UserLocation;
3023 if (pos.Equals(Vector3.Zero))
3025 pos = (land.AABBMax + land.AABBMin) * 0.5f;
3027 reply.Data.GlobalX = info.RegionLocX + x;
3028 reply.Data.GlobalY = info.RegionLocY + y;
3029 reply.Data.GlobalZ = pos.Z;
3030 reply.Data.SimName = Utils.StringToBytes(info.RegionName);
3031 reply.Data.SnapshotID = land.SnapshotID;
3032 reply.Data.Dwell = dwell;
3033 reply.Data.SalePrice = land.SalePrice;
3034 reply.Data.AuctionID = (int)land.
AuctionID;
3041 ScriptTeleportRequestPacket packet = (ScriptTeleportRequestPacket)
PacketPool.
Instance.
GetPacket(PacketType.ScriptTeleportRequest);
3043 packet.Data.ObjectName = Utils.StringToBytes(objName);
3044 packet.Data.SimName = Utils.StringToBytes(simName);
3045 packet.Data.SimPosition = pos;
3046 packet.Data.LookAt = lookAt;
3055 packet.AgentData =
new DirPlacesReplyPacket.AgentDataBlock();
3057 packet.QueryData =
new DirPlacesReplyPacket.QueryDataBlock[1];
3058 packet.QueryData[0] =
new DirPlacesReplyPacket.QueryDataBlock();
3060 packet.AgentData.AgentID = AgentId;
3062 packet.QueryData[0].QueryID = queryID;
3064 DirPlacesReplyPacket.QueryRepliesBlock[] replies =
3065 new DirPlacesReplyPacket.QueryRepliesBlock[0];
3066 DirPlacesReplyPacket.StatusDataBlock[] status =
3067 new DirPlacesReplyPacket.StatusDataBlock[0];
3069 packet.QueryReplies = replies;
3070 packet.StatusData = status;
3074 int idx = replies.Length;
3075 Array.Resize(ref replies, idx + 1);
3076 Array.Resize(ref status, idx + 1);
3078 replies[idx] =
new DirPlacesReplyPacket.QueryRepliesBlock();
3079 status[idx] =
new DirPlacesReplyPacket.StatusDataBlock();
3080 replies[idx].ParcelID = d.parcelID;
3081 replies[idx].Name = Utils.StringToBytes(d.name);
3082 replies[idx].ForSale = d.forSale;
3083 replies[idx].Auction = d.auction;
3084 replies[idx].Dwell = d.dwell;
3085 status[idx].Status = d.Status;
3087 packet.QueryReplies = replies;
3088 packet.StatusData = status;
3090 if (packet.Length >= 1000)
3096 packet.AgentData =
new DirPlacesReplyPacket.AgentDataBlock();
3098 packet.QueryData =
new DirPlacesReplyPacket.QueryDataBlock[1];
3099 packet.QueryData[0] =
new DirPlacesReplyPacket.QueryDataBlock();
3101 packet.AgentData.AgentID = AgentId;
3103 packet.QueryData[0].QueryID = queryID;
3105 replies =
new DirPlacesReplyPacket.QueryRepliesBlock[0];
3106 status =
new DirPlacesReplyPacket.StatusDataBlock[0];
3110 if (replies.Length > 0 || data.Length == 0)
3118 packet.AgentData =
new DirPeopleReplyPacket.AgentDataBlock();
3119 packet.AgentData.AgentID = AgentId;
3121 packet.QueryData =
new DirPeopleReplyPacket.QueryDataBlock();
3122 packet.QueryData.QueryID = queryID;
3124 packet.QueryReplies =
new DirPeopleReplyPacket.QueryRepliesBlock[
3130 packet.QueryReplies[i] =
new DirPeopleReplyPacket.QueryRepliesBlock();
3131 packet.QueryReplies[i].AgentID = d.agentID;
3132 packet.QueryReplies[i].FirstName =
3133 Utils.StringToBytes(d.firstName);
3134 packet.QueryReplies[i].LastName =
3135 Utils.StringToBytes(d.lastName);
3136 packet.QueryReplies[i].Group =
3137 Utils.StringToBytes(d.group);
3138 packet.QueryReplies[i].Online = d.online;
3139 packet.QueryReplies[i].Reputation = d.reputation;
3150 packet.AgentData =
new DirEventsReplyPacket.AgentDataBlock();
3151 packet.AgentData.AgentID = AgentId;
3153 packet.QueryData =
new DirEventsReplyPacket.QueryDataBlock();
3154 packet.QueryData.QueryID = queryID;
3156 packet.QueryReplies =
new DirEventsReplyPacket.QueryRepliesBlock[
3159 packet.StatusData =
new DirEventsReplyPacket.StatusDataBlock[
3165 packet.QueryReplies[i] =
new DirEventsReplyPacket.QueryRepliesBlock();
3166 packet.StatusData[i] =
new DirEventsReplyPacket.StatusDataBlock();
3167 packet.QueryReplies[i].OwnerID = d.ownerID;
3168 packet.QueryReplies[i].Name =
3169 Utils.StringToBytes(d.name);
3170 packet.QueryReplies[i].EventID = d.eventID;
3171 packet.QueryReplies[i].Date =
3172 Utils.StringToBytes(d.date);
3173 packet.QueryReplies[i].UnixTime = d.unixTime;
3174 packet.QueryReplies[i].EventFlags = d.eventFlags;
3175 packet.StatusData[i].Status = d.Status;
3186 packet.AgentData =
new DirGroupsReplyPacket.AgentDataBlock();
3187 packet.AgentData.AgentID = AgentId;
3189 packet.QueryData =
new DirGroupsReplyPacket.QueryDataBlock();
3190 packet.QueryData.QueryID = queryID;
3192 packet.QueryReplies =
new DirGroupsReplyPacket.QueryRepliesBlock[
3198 packet.QueryReplies[i] =
new DirGroupsReplyPacket.QueryRepliesBlock();
3199 packet.QueryReplies[i].GroupID = d.groupID;
3200 packet.QueryReplies[i].GroupName =
3201 Utils.StringToBytes(d.groupName);
3202 packet.QueryReplies[i].Members = d.members;
3203 packet.QueryReplies[i].SearchOrder = d.searchOrder;
3214 packet.AgentData =
new DirClassifiedReplyPacket.AgentDataBlock();
3215 packet.AgentData.AgentID = AgentId;
3217 packet.QueryData =
new DirClassifiedReplyPacket.QueryDataBlock();
3218 packet.QueryData.QueryID = queryID;
3220 packet.QueryReplies =
new DirClassifiedReplyPacket.QueryRepliesBlock[
3222 packet.StatusData =
new DirClassifiedReplyPacket.StatusDataBlock[
3228 packet.QueryReplies[i] =
new DirClassifiedReplyPacket.QueryRepliesBlock();
3229 packet.StatusData[i] =
new DirClassifiedReplyPacket.StatusDataBlock();
3230 packet.QueryReplies[i].ClassifiedID = d.classifiedID;
3231 packet.QueryReplies[i].Name =
3232 Utils.StringToBytes(d.name);
3233 packet.QueryReplies[i].ClassifiedFlags = d.classifiedFlags;
3234 packet.QueryReplies[i].CreationDate = d.creationDate;
3235 packet.QueryReplies[i].ExpirationDate = d.expirationDate;
3236 packet.QueryReplies[i].PriceForListing = d.price;
3237 packet.StatusData[i].Status = d.Status;
3248 packet.AgentData =
new DirLandReplyPacket.AgentDataBlock();
3249 packet.AgentData.AgentID = AgentId;
3251 packet.QueryData =
new DirLandReplyPacket.QueryDataBlock();
3252 packet.QueryData.QueryID = queryID;
3254 packet.QueryReplies =
new DirLandReplyPacket.QueryRepliesBlock[
3260 packet.QueryReplies[i] =
new DirLandReplyPacket.QueryRepliesBlock();
3261 packet.QueryReplies[i].ParcelID = d.parcelID;
3262 packet.QueryReplies[i].Name =
3263 Utils.StringToBytes(d.name);
3264 packet.QueryReplies[i].Auction = d.auction;
3265 packet.QueryReplies[i].ForSale = d.forSale;
3266 packet.QueryReplies[i].SalePrice = d.salePrice;
3267 packet.QueryReplies[i].ActualArea = d.actualArea;
3278 packet.AgentData =
new DirPopularReplyPacket.AgentDataBlock();
3279 packet.AgentData.AgentID = AgentId;
3281 packet.QueryData =
new DirPopularReplyPacket.QueryDataBlock();
3282 packet.QueryData.QueryID = queryID;
3284 packet.QueryReplies =
new DirPopularReplyPacket.QueryRepliesBlock[
3290 packet.QueryReplies[i] =
new DirPopularReplyPacket.QueryRepliesBlock();
3291 packet.QueryReplies[i].ParcelID = d.parcelID;
3292 packet.QueryReplies[i].Name =
3293 Utils.StringToBytes(d.name);
3294 packet.QueryReplies[i].Dwell = d.dwell;
3305 packet.AgentData =
new EventInfoReplyPacket.AgentDataBlock();
3306 packet.AgentData.AgentID = AgentId;
3308 packet.EventData =
new EventInfoReplyPacket.EventDataBlock();
3309 packet.EventData.EventID = data.eventID;
3310 packet.EventData.Creator = Utils.StringToBytes(data.creator);
3311 packet.EventData.Name = Utils.StringToBytes(data.name);
3312 packet.EventData.Category = Utils.StringToBytes(data.category);
3313 packet.EventData.Desc = Utils.StringToBytes(data.description);
3314 packet.EventData.Date = Utils.StringToBytes(data.date);
3315 packet.EventData.DateUTC = data.dateUTC;
3316 packet.EventData.Duration = data.duration;
3317 packet.EventData.Cover = data.cover;
3318 packet.EventData.Amount = data.amount;
3319 packet.EventData.SimName = Utils.StringToBytes(data.simName);
3320 packet.EventData.GlobalPos =
new Vector3d(data.
globalPos);
3321 packet.EventData.EventFlags = data.eventFlags;
3328 MapItemReplyPacket mirplk =
new MapItemReplyPacket();
3329 mirplk.AgentData.AgentID = AgentId;
3330 mirplk.RequestData.ItemType = mapitemtype;
3331 mirplk.Data =
new MapItemReplyPacket.DataBlock[replies.Length];
3332 for (
int i = 0; i < replies.Length; i++)
3334 MapItemReplyPacket.DataBlock mrdata =
new MapItemReplyPacket.DataBlock();
3335 mrdata.X = replies[i].x;
3336 mrdata.Y = replies[i].y;
3337 mrdata.ID = replies[i].id;
3338 mrdata.Extra = replies[i].Extra;
3339 mrdata.Extra2 = replies[i].Extra2;
3340 mrdata.Name = Utils.StringToBytes(replies[i].name);
3341 mirplk.Data[i] = mrdata;
3353 p.AgentData.AgentID = srcID;
3354 p.AgentData.SessionID = UUID.Zero;
3355 p.AgentBlock.DestID = AgentId;
3356 p.AgentBlock.TransactionID = transactionID;
3363 p.AgentData.AgentID = AgentId;
3364 p.AgentData.SessionID = UUID.Zero;
3365 p.FolderData =
new AcceptCallingCardPacket.FolderDataBlock[1];
3366 p.FolderData[0] =
new AcceptCallingCardPacket.FolderDataBlock();
3367 p.FolderData[0].FolderID = UUID.Zero;
3374 p.AgentData.AgentID = AgentId;
3375 p.AgentData.SessionID = UUID.Zero;
3376 p.TransactionBlock.TransactionID = transactionID;
3383 p.AgentData.AgentID = AgentId;
3384 p.AgentData.SessionID = SessionId;
3385 p.ExBlock.OtherID = exFriendID;
3394 AgentDataMap.Add(
"AgentID", OSD.FromUUID(this.AgentId));
3395 AgentDataMap.Add(
"AvatarID", OSD.FromUUID(avatarID));
3396 AgentData.Add(AgentDataMap);
3397 llsd.Add(
"AgentData", AgentData);
3404 GroupDataMap.Add(
"GroupPowers", OSD.FromULong(m.GroupPowers));
3405 GroupDataMap.Add(
"AcceptNotices", OSD.FromBoolean(m.AcceptNotices));
3406 GroupDataMap.Add(
"GroupTitle", OSD.FromString(m.GroupTitle));
3407 GroupDataMap.Add(
"GroupID", OSD.FromUUID(m.GroupID));
3408 GroupDataMap.Add(
"GroupName", OSD.FromString(m.GroupName));
3409 GroupDataMap.Add(
"GroupInsigniaID", OSD.FromUUID(m.GroupPicture));
3411 GroupData.Add(GroupDataMap);
3414 llsd.Add(
"GroupData", GroupData);
3420 eq.Enqueue(BuildEvent(
"AvatarGroupsReply", llsd), this.AgentId);
3431 SendGroupMembership(data);
3437 AgentDataMap.Add(
"AgentID", OSD.FromUUID(this.AgentId));
3438 AgentDataMap.Add(
"AvatarID", OSD.FromUUID(avatarID));
3439 AgentData.Add(AgentDataMap);
3440 llsd.Add(
"AgentData", AgentData);
3447 GroupDataMap.Add(
"GroupPowers", OSD.FromULong(m.GroupPowers));
3448 GroupDataMap.Add(
"AcceptNotices", OSD.FromBoolean(m.AcceptNotices));
3449 GroupDataMap.Add(
"GroupTitle", OSD.FromString(m.GroupTitle));
3450 GroupDataMap.Add(
"GroupID", OSD.FromUUID(m.GroupID));
3451 GroupDataMap.Add(
"GroupName", OSD.FromString(m.GroupName));
3452 GroupDataMap.Add(
"GroupInsigniaID", OSD.FromUUID(m.GroupPicture));
3453 NewGroupDataMap.Add(
"ListInProfile", OSD.FromBoolean(m.ListInProfile));
3454 GroupData.Add(GroupDataMap);
3455 NewGroupData.Add(NewGroupDataMap);
3457 llsd.Add(
"GroupData", GroupData);
3458 llsd.Add(
"NewGroupData", NewGroupData);
3460 eq.Enqueue(BuildEvent(
"AgentGroupDataUpdate", llsd), this.AgentId);
3467 p.AgentData =
new JoinGroupReplyPacket.AgentDataBlock();
3468 p.AgentData.AgentID = AgentId;
3470 p.GroupData =
new JoinGroupReplyPacket.GroupDataBlock();
3471 p.GroupData.GroupID = groupID;
3472 p.GroupData.Success = success;
3481 p.AgentData =
new EjectGroupMemberReplyPacket.AgentDataBlock();
3482 p.AgentData.AgentID = agentID;
3484 p.GroupData =
new EjectGroupMemberReplyPacket.GroupDataBlock();
3485 p.GroupData.GroupID = groupID;
3487 p.EjectData =
new EjectGroupMemberReplyPacket.EjectDataBlock();
3488 p.EjectData.Success = success;
3497 p.AgentData =
new LeaveGroupReplyPacket.AgentDataBlock();
3498 p.AgentData.AgentID = AgentId;
3500 p.GroupData =
new LeaveGroupReplyPacket.GroupDataBlock();
3501 p.GroupData.GroupID = groupID;
3502 p.GroupData.Success = success;
3509 if (classifiedID.Length != name.Length)
3512 AvatarClassifiedReplyPacket ac =
3514 PacketType.AvatarClassifiedReply);
3516 ac.AgentData =
new AvatarClassifiedReplyPacket.AgentDataBlock();
3517 ac.AgentData.AgentID = AgentId;
3518 ac.AgentData.TargetID = targetID;
3520 ac.Data =
new AvatarClassifiedReplyPacket.DataBlock[classifiedID.Length];
3522 for (i = 0; i < classifiedID.Length; i++)
3524 ac.Data[i].ClassifiedID = classifiedID[i];
3525 ac.Data[i].Name = Utils.StringToBytes(name[i]);
3531 public void SendClassifiedInfoReply(UUID classifiedID, UUID creatorID, uint creationDate, uint expirationDate, uint category,
string name,
string description, UUID parcelID, uint parentEstate, UUID snapshotID,
string simName, Vector3 globalPos,
string parcelName, byte classifiedFlags,
int price)
3533 ClassifiedInfoReplyPacket cr =
3535 PacketType.ClassifiedInfoReply);
3537 cr.AgentData =
new ClassifiedInfoReplyPacket.AgentDataBlock();
3538 cr.AgentData.AgentID = AgentId;
3540 cr.Data =
new ClassifiedInfoReplyPacket.DataBlock();
3541 cr.Data.ClassifiedID = classifiedID;
3542 cr.Data.CreatorID = creatorID;
3543 cr.Data.CreationDate = creationDate;
3544 cr.Data.ExpirationDate = expirationDate;
3545 cr.Data.Category = category;
3546 cr.Data.Name = Utils.StringToBytes(name);
3547 cr.Data.Desc = Utils.StringToBytes(description);
3548 cr.Data.ParcelID = parcelID;
3549 cr.Data.ParentEstate = parentEstate;
3550 cr.Data.SnapshotID = snapshotID;
3551 cr.Data.SimName = Utils.StringToBytes(simName);
3552 cr.Data.PosGlobal =
new Vector3d(globalPos);
3553 cr.Data.ParcelName = Utils.StringToBytes(parcelName);
3554 cr.Data.ClassifiedFlags = classifiedFlags;
3555 cr.Data.PriceForListing = price;
3562 AgentDropGroupPacket dg =
3564 PacketType.AgentDropGroup);
3566 dg.AgentData =
new AgentDropGroupPacket.AgentDataBlock();
3567 dg.AgentData.AgentID = AgentId;
3568 dg.AgentData.GroupID = groupID;
3575 AvatarNotesReplyPacket an =
3577 PacketType.AvatarNotesReply);
3579 an.AgentData =
new AvatarNotesReplyPacket.AgentDataBlock();
3580 an.AgentData.AgentID = AgentId;
3582 an.Data =
new AvatarNotesReplyPacket.DataBlock();
3583 an.Data.TargetID = targetID;
3584 an.Data.Notes = Utils.StringToBytes(text);
3591 AvatarPicksReplyPacket ap =
3593 PacketType.AvatarPicksReply);
3595 ap.AgentData =
new AvatarPicksReplyPacket.AgentDataBlock();
3596 ap.AgentData.AgentID = AgentId;
3597 ap.AgentData.TargetID = targetID;
3599 ap.Data =
new AvatarPicksReplyPacket.DataBlock[picks.Count];
3602 foreach (KeyValuePair<UUID, string> pick
in picks)
3604 ap.Data[i] =
new AvatarPicksReplyPacket.DataBlock();
3605 ap.Data[i].PickID = pick.Key;
3606 ap.Data[i].PickName = Utils.StringToBytes(pick.Value);
3615 AvatarClassifiedReplyPacket ac =
3617 PacketType.AvatarClassifiedReply);
3619 ac.AgentData =
new AvatarClassifiedReplyPacket.AgentDataBlock();
3620 ac.AgentData.AgentID = AgentId;
3621 ac.AgentData.TargetID = targetID;
3623 ac.Data =
new AvatarClassifiedReplyPacket.DataBlock[classifieds.Count];
3626 foreach (KeyValuePair<UUID, string> classified
in classifieds)
3628 ac.Data[i] =
new AvatarClassifiedReplyPacket.DataBlock();
3629 ac.Data[i].ClassifiedID = classified.Key;
3630 ac.Data[i].Name = Utils.StringToBytes(classified.Value);
3639 ParcelDwellReplyPacket pd =
3641 PacketType.ParcelDwellReply);
3643 pd.AgentData =
new ParcelDwellReplyPacket.AgentDataBlock();
3644 pd.AgentData.AgentID = AgentId;
3646 pd.Data =
new ParcelDwellReplyPacket.DataBlock();
3647 pd.Data.LocalID = localID;
3648 pd.Data.ParcelID = parcelID;
3649 pd.Data.Dwell = dwell;
3656 UserInfoReplyPacket ur =
3658 PacketType.UserInfoReply);
3660 string Visible =
"hidden";
3662 Visible =
"default";
3664 ur.AgentData =
new UserInfoReplyPacket.AgentDataBlock();
3665 ur.AgentData.AgentID = AgentId;
3667 ur.UserData =
new UserInfoReplyPacket.UserDataBlock();
3668 ur.UserData.IMViaEMail = imViaEmail;
3669 ur.UserData.DirectoryVisibility = Utils.StringToBytes(Visible);
3670 ur.UserData.EMail = Utils.StringToBytes(email);
3679 createGroupReply.AgentData =
3680 new CreateGroupReplyPacket.AgentDataBlock();
3681 createGroupReply.ReplyData =
3682 new CreateGroupReplyPacket.ReplyDataBlock();
3684 createGroupReply.AgentData.AgentID = AgentId;
3685 createGroupReply.ReplyData.GroupID = groupID;
3687 createGroupReply.ReplyData.Success = success;
3688 createGroupReply.ReplyData.Message = Utils.StringToBytes(message);
3696 useCachedMuteList.AgentData =
new UseCachedMuteListPacket.AgentDataBlock();
3697 useCachedMuteList.AgentData.AgentID = AgentId;
3706 muteListUpdate.MuteData =
new MuteListUpdatePacket.MuteDataBlock();
3707 muteListUpdate.MuteData.AgentID = AgentId;
3708 muteListUpdate.MuteData.Filename = Utils.StringToBytes(filename);
3713 public void SendPickInfoReply(UUID pickID, UUID creatorID,
bool topPick, UUID parcelID,
string name,
string desc, UUID snapshotID,
string user,
string originalName,
string simName, Vector3 posGlobal,
int sortOrder,
bool enabled)
3717 pickInfoReply.AgentData =
new PickInfoReplyPacket.AgentDataBlock();
3718 pickInfoReply.AgentData.AgentID = AgentId;
3720 pickInfoReply.Data =
new PickInfoReplyPacket.DataBlock();
3721 pickInfoReply.Data.PickID = pickID;
3722 pickInfoReply.Data.CreatorID = creatorID;
3723 pickInfoReply.Data.TopPick = topPick;
3724 pickInfoReply.Data.ParcelID = parcelID;
3725 pickInfoReply.Data.Name = Utils.StringToBytes(name);
3726 pickInfoReply.Data.Desc = Utils.StringToBytes(desc);
3727 pickInfoReply.Data.SnapshotID = snapshotID;
3728 pickInfoReply.Data.User = Utils.StringToBytes(user);
3729 pickInfoReply.Data.OriginalName = Utils.StringToBytes(originalName);
3730 pickInfoReply.Data.SimName = Utils.StringToBytes(simName);
3731 pickInfoReply.Data.PosGlobal =
new Vector3d(posGlobal);
3732 pickInfoReply.Data.SortOrder = sortOrder;
3733 pickInfoReply.Data.Enabled = enabled;
3738 #endregion Scene/Avatar to Client
3742 #region Appearance/ Wearables Methods
3747 aw.AgentData.AgentID = AgentId;
3748 aw.AgentData.SerialNum = (uint)serial;
3749 aw.AgentData.SessionID = m_sessionId;
3752 for (
int i = 0; i < wearables.Length; i++)
3753 count += wearables[i].Count;
3756 aw.WearableData =
new AgentWearablesUpdatePacket.WearableDataBlock[count];
3757 AgentWearablesUpdatePacket.WearableDataBlock awb;
3760 for (
int i = 0; i < wearables.Length; i++)
3762 for (
int j = 0; j < wearables[i].Count; j++)
3764 awb =
new AgentWearablesUpdatePacket.WearableDataBlock();
3765 awb.WearableType = (byte) i;
3766 awb.AssetID = wearables[i][j].AssetID;
3767 awb.ItemID = wearables[i][j].ItemID;
3768 aw.WearableData[idx] = awb;
3788 avp.VisualParam =
new AvatarAppearancePacket.VisualParamBlock[visualParams.Length];
3789 avp.ObjectData.TextureEntry = textureEntry;
3791 AvatarAppearancePacket.VisualParamBlock avblock = null;
3792 for (
int i = 0; i < visualParams.Length; i++)
3794 avblock =
new AvatarAppearancePacket.VisualParamBlock();
3795 avblock.ParamValue = visualParams[i];
3796 avp.VisualParam[i] = avblock;
3799 avp.Sender.IsTrial =
false;
3800 avp.Sender.ID = agentID;
3801 avp.AppearanceData =
new AvatarAppearancePacket.AppearanceDataBlock[0];
3802 avp.AppearanceHover =
new AvatarAppearancePacket.AppearanceHoverBlock[0];
3812 public void SendAnimations(UUID[] animations,
int[] seqs, UUID sourceAgentId, UUID[] objectIDs)
3818 ani.AnimationSourceList =
new AvatarAnimationPacket.AnimationSourceListBlock[animations.Length];
3819 ani.Sender =
new AvatarAnimationPacket.SenderBlock();
3820 ani.Sender.ID = sourceAgentId;
3821 ani.AnimationList =
new AvatarAnimationPacket.AnimationListBlock[animations.Length];
3822 ani.PhysicalAvatarEventList =
new AvatarAnimationPacket.PhysicalAvatarEventListBlock[0];
3824 for (
int i = 0; i < animations.Length; ++i)
3826 ani.AnimationList[i] =
new AvatarAnimationPacket.AnimationListBlock();
3827 ani.AnimationList[i].AnimID = animations[i];
3828 ani.AnimationList[i].AnimSequenceID = seqs[i];
3830 ani.AnimationSourceList[i] =
new AvatarAnimationPacket.AnimationSourceListBlock();
3831 if (objectIDs[i].Equals(sourceAgentId))
3832 ani.AnimationSourceList[i].ObjectID =
UUID.Zero;
3834 ani.AnimationSourceList[i].ObjectID = objectIDs[i];
3836 ani.Header.Reliable =
false;
3842 #region Avatar Packet/Data Sending Methods
3854 if (presence == null)
3858 objupdate.Header.Zerocoded =
true;
3860 objupdate.RegionData.RegionHandle = presence.RegionHandle;
3862 objupdate.RegionData.TimeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f);
3863 objupdate.ObjectData =
new ObjectUpdatePacket.ObjectDataBlock[1];
3864 objupdate.ObjectData[0] = CreateAvatarUpdateBlock(presence);
3879 loc.Header.Reliable =
false;
3883 int total = Math.Min(CoarseLocations.Count, 60);
3885 CoarseLocationUpdatePacket.IndexBlock ib =
new CoarseLocationUpdatePacket.IndexBlock();
3887 loc.Location =
new CoarseLocationUpdatePacket.LocationBlock[total];
3888 loc.AgentData =
new CoarseLocationUpdatePacket.AgentDataBlock[total];
3891 for (
int i = 0; i < total; i++)
3893 CoarseLocationUpdatePacket.LocationBlock lb =
3894 new CoarseLocationUpdatePacket.LocationBlock();
3896 lb.X = (byte)CoarseLocations[i].X;
3897 lb.Y = (byte)CoarseLocations[i].Y;
3899 lb.Z = CoarseLocations[i].Z > 1024 ? (byte)0 : (byte)(CoarseLocations[i].Z * 0.25f);
3900 loc.Location[i] = lb;
3901 loc.AgentData[i] =
new CoarseLocationUpdatePacket.AgentDataBlock();
3902 loc.AgentData[i].AgentID = users[i];
3903 if (users[i] == AgentId)
3907 ib.You = (short)selfindex;
3914 #endregion Avatar Packet/Data Sending Methods
3916 #region Primitive Packet/Data Sending Methods
3941 SceneObjectPart e = (SceneObjectPart)entity;
3948 uint priority = m_prioritizer.GetUpdatePriority(
this, entity);
3950 lock (m_entityUpdates.SyncRoot)
3951 m_entityUpdates.Enqueue(priority,
new EntityUpdate(entity, updateFlags, m_scene.TimeDilation));
3964 uint priority = m_prioritizer.GetUpdatePriority(
this, update.Entity);
3966 lock (m_entityUpdates.SyncRoot)
3967 m_entityUpdates.Enqueue(priority, update);
3983 m_udpClient.NeedAcks.Remove(oPacket.SequenceNumber);
3986 Interlocked.Increment(ref m_udpClient.PacketsResent);
3990 m_udpServer.PacketsResentCount++;
3993 ResendPrimUpdate(update);
3996 private void ProcessEntityUpdates(
int maxUpdates)
3998 OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks =
new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>();
3999 OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>> compressedUpdateBlocks =
new OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>>();
4000 OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseUpdateBlocks =
new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>();
4001 OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseAgentUpdateBlocks =
new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>();
4003 OpenSim.Framework.Lazy<List<EntityUpdate>> objectUpdates =
new OpenSim.Framework.Lazy<List<EntityUpdate>>();
4004 OpenSim.Framework.Lazy<List<EntityUpdate>> compressedUpdates =
new OpenSim.Framework.Lazy<List<EntityUpdate>>();
4005 OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates =
new OpenSim.Framework.Lazy<List<EntityUpdate>>();
4006 OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates =
new OpenSim.Framework.Lazy<List<EntityUpdate>>();
4009 if (maxUpdates <= 0)
4011 maxUpdates = Int32.MaxValue;
4014 int updatesThisCall = 0;
4022 while (updatesThisCall < maxUpdates)
4024 lock (m_entityUpdates.SyncRoot)
4025 if (!m_entityUpdates.TryDequeue(out iupdate, out timeinqueue))
4034 SceneObjectPart part = (SceneObjectPart)update.
Entity;
4046 if (!m_scene.TryGetScenePresence(part.
OwnerID, out sp))
4049 List<SceneObjectGroup> atts = sp.GetAttachments();
4070 if (sp.IsChildAgent)
4078 part.ParentGroup.RootPart.Shape.State != (byte)
AttachmentPoint.RightHand)
4080 part.Shape.LightEntry =
false;
4086 part.Shape.ProfileBegin = 12500;
4087 part.Shape.ProfileEnd = 0;
4088 part.Shape.ProfileHollow = 27500;
4095 part.Shape.ProfileBegin = 12500;
4096 part.Shape.ProfileEnd = 0;
4097 part.Shape.ProfileHollow = 27500;
4102 ScenePresence presence = (ScenePresence)update.
Entity;
4116 #region UpdateFlags to packet type conversion
4120 bool canUseCompressed =
true;
4121 bool canUseImproved =
true;
4124 if (!(update.
Entity is SceneObjectPart))
4126 canUseCompressed =
false;
4131 canUseCompressed =
false;
4132 canUseImproved =
false;
4137 updateFlags.HasFlag(PrimUpdateFlags.Acceleration) ||
4139 updateFlags.HasFlag(PrimUpdateFlags.Joint))
4141 canUseCompressed =
false;
4145 updateFlags.HasFlag(PrimUpdateFlags.ParentID) ||
4147 updateFlags.HasFlag(PrimUpdateFlags.PrimData) ||
4149 updateFlags.HasFlag(PrimUpdateFlags.NameValue) ||
4151 updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) ||
4153 updateFlags.HasFlag(PrimUpdateFlags.Particles) ||
4155 updateFlags.HasFlag(PrimUpdateFlags.ClickAction) ||
4157 updateFlags.HasFlag(PrimUpdateFlags.Joint))
4159 canUseImproved =
false;
4163 #endregion UpdateFlags to packet type conversion
4165 #region Block Construction
4168 canUseCompressed =
false;
4170 if (!canUseImproved && !canUseCompressed)
4172 if (update.
Entity is ScenePresence)
4174 objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.
Entity));
4178 objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.
Entity,
this.m_agentId));
4181 else if (!canUseImproved)
4183 compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.
Entity, updateFlags));
4187 if (update.
Entity is ScenePresence)
4189 terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.
Entity, updateFlags.HasFlag(
PrimUpdateFlags.Textures)));
4192 terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.
Entity, updateFlags.HasFlag(
PrimUpdateFlags.Textures)));
4195 #endregion Block Construction
4198 #region Packet Sending
4201 ushort timeDilation;
4207 timeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f);
4209 if (terseAgentUpdateBlocks.IsValueCreated)
4211 List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value;
4213 ImprovedTerseObjectUpdatePacket packet
4214 = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate);
4215 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
4216 packet.RegionData.TimeDilation = timeDilation;
4217 packet.ObjectData =
new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
4219 for (
int i = 0; i < blocks.Count; i++)
4220 packet.ObjectData[i] = blocks[i];
4222 OutPacket(packet,
ThrottleOutPacketType.Unknown,
true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); });
4225 if (objectUpdateBlocks.IsValueCreated)
4227 List<ObjectUpdatePacket.ObjectDataBlock> blocks = objectUpdateBlocks.Value;
4229 ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
4230 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
4231 packet.RegionData.TimeDilation = timeDilation;
4232 packet.ObjectData =
new ObjectUpdatePacket.ObjectDataBlock[blocks.Count];
4234 for (
int i = 0; i < blocks.Count; i++)
4235 packet.ObjectData[i] = blocks[i];
4240 if (compressedUpdateBlocks.IsValueCreated)
4242 List<ObjectUpdateCompressedPacket.ObjectDataBlock> blocks = compressedUpdateBlocks.Value;
4244 ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed);
4245 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
4246 packet.RegionData.TimeDilation = timeDilation;
4247 packet.ObjectData =
new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count];
4249 for (
int i = 0; i < blocks.Count; i++)
4250 packet.ObjectData[i] = blocks[i];
4255 if (terseUpdateBlocks.IsValueCreated)
4257 List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value;
4259 ImprovedTerseObjectUpdatePacket packet
4260 = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(
4261 PacketType.ImprovedTerseObjectUpdate);
4262 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
4263 packet.RegionData.TimeDilation = timeDilation;
4264 packet.ObjectData =
new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
4266 for (
int i = 0; i < blocks.Count; i++)
4267 packet.ObjectData[i] = blocks[i];
4269 OutPacket(packet,
ThrottleOutPacketType.Task,
true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); });
4272 #endregion Packet Sending
4278 if (ent is SceneObjectPart)
4280 SceneObjectPart part = (SceneObjectPart)ent;
4282 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
4283 packet.RegionData.TimeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f);
4284 packet.ObjectData =
new ObjectUpdatePacket.ObjectDataBlock[1];
4286 ObjectUpdatePacket.ObjectDataBlock blk = CreatePrimUpdateBlock(part, this.m_agentId);
4287 if (parentID.HasValue)
4289 blk.ParentID = parentID.Value;
4292 packet.ObjectData[0] = blk;
4305 lock (m_entityUpdates.SyncRoot)
4306 m_entityUpdates.Reprioritize(UpdatePriorityHandler);
4309 private bool UpdatePriorityHandler(ref uint priority,
ISceneEntity entity)
4313 priority = m_prioritizer.GetUpdatePriority(
this, entity);
4322 m_log.WarnFormat(
"[CLIENT]: Flushing prim updates to " + m_firstName +
" " + m_lastName);
4324 while (m_entityUpdates.Count > 0)
4325 ProcessEntityUpdates(-1);
4328 #endregion Primitive Packet/Data Sending Methods
4334 private Int32 m_LastQueueFill = 0;
4335 private Int32 m_maxUpdates = 0;
4347 if (m_maxUpdates == 0 || m_LastQueueFill == 0)
4349 m_maxUpdates = m_udpServer.PrimUpdatesPerCallback;
4353 if (Util.EnvironmentTickCountSubtract(m_LastQueueFill) < 200)
4356 m_maxUpdates = m_maxUpdates >> 1;
4358 m_maxUpdates = Util.Clamp<Int32>(m_maxUpdates,10,500);
4359 m_LastQueueFill = Util.EnvironmentTickCount();
4361 if (m_entityUpdates.Count > 0)
4362 ProcessEntityUpdates(m_maxUpdates);
4364 if (m_entityProps.Count > 0)
4365 ProcessEntityPropertyRequests(m_maxUpdates);
4369 ImageManager.ProcessImageQueue(m_udpServer.TextureSendLimit);
4374 bool hasUpdates =
false;
4378 if (m_entityUpdates.Count > 0)
4380 else if (m_entityProps.Count > 0)
4386 if (ImageManager.HasUpdates())
4395 AssetUploadCompletePacket newPack =
new AssetUploadCompletePacket();
4396 newPack.AssetBlock.Type = AssetType;
4397 newPack.AssetBlock.Success = Success;
4398 newPack.AssetBlock.UUID = AssetFullID;
4399 newPack.Header.Zerocoded =
true;
4403 public void SendXferRequest(ulong XferID,
short AssetType, UUID vFileID, byte FilePath, byte[] FileName)
4405 RequestXferPacket newPack =
new RequestXferPacket();
4406 newPack.XferID.ID = XferID;
4407 newPack.XferID.VFileType = AssetType;
4408 newPack.XferID.VFileID = vFileID;
4409 newPack.XferID.FilePath = FilePath;
4410 newPack.XferID.Filename = FileName;
4411 newPack.Header.Zerocoded =
true;
4417 ConfirmXferPacketPacket newPack =
new ConfirmXferPacketPacket();
4418 newPack.XferID.ID = xferID;
4419 newPack.XferID.Packet = PacketID;
4420 newPack.Header.Zerocoded =
true;
4426 InitiateDownloadPacket newPack =
new InitiateDownloadPacket();
4427 newPack.AgentData.AgentID = AgentId;
4428 newPack.FileData.SimFilename = Utils.StringToBytes(simFileName);
4429 newPack.FileData.ViewerFilename = Utils.StringToBytes(clientFileName);
4434 ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
4436 ImageDataPacket im =
new ImageDataPacket();
4437 im.Header.Reliable =
false;
4438 im.ImageID.Packets = numParts;
4439 im.ImageID.ID = ImageUUID;
4442 im.ImageID.Size = ImageSize;
4444 im.ImageData.Data = ImageData;
4445 im.ImageID.Codec = imageCodec;
4446 im.Header.Zerocoded =
true;
4452 ImagePacketPacket im =
new ImagePacketPacket();
4453 im.Header.Reliable =
false;
4454 im.ImageID.Packet = partNumber;
4455 im.ImageID.ID = imageUuid;
4456 im.ImageData.Data = imageData;
4463 ImageNotInDatabasePacket notFoundPacket
4466 notFoundPacket.ImageID.ID = imageid;
4478 SimStatsPacket pack =
new SimStatsPacket();
4479 pack.Region =
new SimStatsPacket.RegionBlock();
4480 pack.Region.RegionX = stats.RegionX;
4481 pack.Region.RegionY = stats.RegionY;
4483 pack.Region.ObjectCapacity = stats.ObjectCapacity;
4485 pack.Stat = stats.StatsBlock;
4487 pack.Header.Reliable =
false;
4488 pack.RegionInfo =
new SimStatsPacket.RegionInfoBlock[0];
4494 internal bool SendFamilyProps;
4495 internal bool SendObjectProps;
4497 public ObjectPropertyUpdate(
ISceneEntity entity, uint flags,
bool sendfam,
bool sendobj)
4498 : base(entity,flags)
4500 SendFamilyProps = sendfam;
4501 SendObjectProps = sendobj;
4503 public void Update(ObjectPropertyUpdate update)
4505 SendFamilyProps = SendFamilyProps || update.SendFamilyProps;
4506 SendObjectProps = SendObjectProps || update.SendObjectProps;
4508 base.Update(update);
4515 lock (m_entityProps.SyncRoot)
4516 m_entityProps.Enqueue(priority,
new ObjectPropertyUpdate(entity,requestFlags,
true,
false));
4519 private void ResendPropertyUpdate(ObjectPropertyUpdate update)
4522 lock (m_entityProps.SyncRoot)
4523 m_entityProps.Enqueue(priority, update);
4526 private
void ResendPropertyUpdates(List<ObjectPropertyUpdate> updates,
OutgoingPacket oPacket)
4533 m_udpClient.NeedAcks.Remove(oPacket.SequenceNumber);
4536 Interlocked.Increment(ref m_udpClient.PacketsResent);
4540 m_udpServer.PacketsResentCount++;
4542 foreach (ObjectPropertyUpdate update
in updates)
4543 ResendPropertyUpdate(update);
4549 lock (m_entityProps.SyncRoot)
4550 m_entityProps.Enqueue(priority,
new ObjectPropertyUpdate(entity,0,
false,
true));
4553 private void ProcessEntityPropertyRequests(
int maxUpdates)
4555 OpenSim.Framework.Lazy<List<ObjectPropertiesFamilyPacket.ObjectDataBlock>> objectFamilyBlocks =
4556 new OpenSim.Framework.Lazy<List<ObjectPropertiesFamilyPacket.ObjectDataBlock>>();
4558 OpenSim.Framework.Lazy<List<ObjectPropertiesPacket.ObjectDataBlock>> objectPropertiesBlocks =
4559 new OpenSim.Framework.Lazy<List<ObjectPropertiesPacket.ObjectDataBlock>>();
4561 OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> familyUpdates =
4562 new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>();
4564 OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> propertyUpdates =
4565 new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>();
4570 int updatesThisCall = 0;
4571 while (updatesThisCall < m_maxUpdates)
4573 lock (m_entityProps.SyncRoot)
4574 if (!m_entityProps.TryDequeue(out iupdate, out timeinqueue))
4577 ObjectPropertyUpdate update = (ObjectPropertyUpdate)iupdate;
4578 if (update.SendFamilyProps)
4580 if (update.Entity is SceneObjectPart)
4582 SceneObjectPart sop = (SceneObjectPart)update.Entity;
4583 ObjectPropertiesFamilyPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesFamilyBlock(sop,update.Flags);
4584 objectFamilyBlocks.Value.Add(objPropDB);
4585 familyUpdates.Value.Add(update);
4589 if (update.SendObjectProps)
4591 if (update.Entity is SceneObjectPart)
4593 SceneObjectPart sop = (SceneObjectPart)update.Entity;
4594 ObjectPropertiesPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesBlock(sop);
4595 objectPropertiesBlocks.Value.Add(objPropDB);
4596 propertyUpdates.Value.Add(update);
4607 if (objectPropertiesBlocks.IsValueCreated)
4609 List<ObjectPropertiesPacket.ObjectDataBlock> blocks = objectPropertiesBlocks.Value;
4610 List<ObjectPropertyUpdate> updates = propertyUpdates.Value;
4612 ObjectPropertiesPacket packet = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties);
4613 packet.ObjectData =
new ObjectPropertiesPacket.ObjectDataBlock[blocks.Count];
4614 for (
int i = 0; i < blocks.Count; i++)
4615 packet.ObjectData[i] = blocks[i];
4617 packet.Header.Zerocoded =
true;
4636 if (objectFamilyBlocks.IsValueCreated)
4638 List<ObjectPropertiesFamilyPacket.ObjectDataBlock> blocks = objectFamilyBlocks.Value;
4641 for (
int i = 0; i < blocks.Count; i++)
4643 ObjectPropertiesFamilyPacket packet =
4644 (ObjectPropertiesFamilyPacket)PacketPool.Instance.GetPacket(PacketType.ObjectPropertiesFamily);
4646 packet.ObjectData = blocks[i];
4647 packet.Header.Zerocoded =
true;
4651 List<ObjectPropertyUpdate> updates =
new List<ObjectPropertyUpdate>();
4652 updates.Add(familyUpdates.Value[i]);
4671 private ObjectPropertiesFamilyPacket.ObjectDataBlock CreateObjectPropertiesFamilyBlock(SceneObjectPart sop, uint requestFlags)
4673 ObjectPropertiesFamilyPacket.ObjectDataBlock block =
new ObjectPropertiesFamilyPacket.ObjectDataBlock();
4675 block.RequestFlags = requestFlags;
4676 block.ObjectID = sop.UUID;
4678 block.OwnerID = UUID.Zero;
4680 block.OwnerID = sop.OwnerID;
4681 block.GroupID = sop.GroupID;
4682 block.BaseMask = sop.BaseMask;
4683 block.OwnerMask = sop.OwnerMask;
4684 block.GroupMask = sop.GroupMask;
4685 block.EveryoneMask = sop.EveryoneMask;
4686 block.NextOwnerMask = sop.NextOwnerMask;
4689 block.OwnershipCost = sop.OwnershipCost;
4690 block.SaleType = sop.ObjectSaleType;
4691 block.SalePrice = sop.SalePrice;
4692 block.Category = sop.Category;
4693 block.LastOwnerID = sop.CreatorID;
4694 block.Name = Util.StringToBytes256(sop.Name);
4695 block.Description = Util.StringToBytes256(sop.Description);
4700 private ObjectPropertiesPacket.ObjectDataBlock CreateObjectPropertiesBlock(SceneObjectPart sop)
4705 ObjectPropertiesPacket.ObjectDataBlock block =
4706 new ObjectPropertiesPacket.ObjectDataBlock();
4708 block.ObjectID = sop.UUID;
4709 block.Name = Util.StringToBytes256(sop.Name);
4710 block.Description = Util.StringToBytes256(sop.Description);
4712 block.CreationDate = (ulong)sop.
CreationDate * 1000000;
4717 block.OwnerID = UUID.Zero;
4719 block.OwnerID = sop.OwnerID;
4721 block.ItemID = sop.FromUserInventoryItemID;
4722 block.FolderID = UUID.Zero;
4723 block.FromTaskID = UUID.Zero;
4728 block.
TouchName = Util.StringToBytes256(root.TouchName);
4755 block.TextureID =
new byte[0];
4756 block.SitName = Util.StringToBytes256(root.SitName);
4757 block.OwnerMask = root.OwnerMask;
4758 block.NextOwnerMask = root.NextOwnerMask;
4759 block.GroupMask = root.GroupMask;
4760 block.EveryoneMask = root.EveryoneMask;
4761 block.BaseMask = root.BaseMask;
4762 block.SaleType = root.ObjectSaleType;
4763 block.SalePrice = root.SalePrice;
4768 #region Estate Data Sending Methods
4770 private static bool convertParamStringToBool(byte[] field)
4772 string s = Utils.BytesToString(field);
4773 if (s ==
"1" || s.ToLower() ==
"y" || s.ToLower() ==
"yes" || s.ToLower() ==
"t" || s.ToLower() ==
"true")
4783 EstateOwnerMessagePacket packet =
new EstateOwnerMessagePacket();
4784 packet.AgentData.TransactionID = UUID.Random();
4785 packet.AgentData.AgentID = AgentId;
4786 packet.AgentData.SessionID = SessionId;
4787 packet.MethodData.Invoice = invoice;
4788 packet.MethodData.Method = Utils.StringToBytes(
"setaccess");
4790 EstateOwnerMessagePacket.ParamListBlock[] returnblock =
new EstateOwnerMessagePacket.ParamListBlock[6 + Data.Length];
4792 for (
int i = 0; i < (6 + Data.Length); i++)
4794 returnblock[i] =
new EstateOwnerMessagePacket.ParamListBlock();
4798 returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++;
4799 returnblock[j].Parameter = Utils.StringToBytes(code.ToString()); j++;
4800 returnblock[j].Parameter = Utils.StringToBytes(
"0"); j++;
4801 returnblock[j].Parameter = Utils.StringToBytes(
"0"); j++;
4802 returnblock[j].Parameter = Utils.StringToBytes(
"0"); j++;
4803 returnblock[j].Parameter = Utils.StringToBytes(
"0"); j++;
4806 if ((code & 2) != 0)
4808 if ((code & 8) != 0)
4811 returnblock[j].Parameter = Utils.StringToBytes(Data.Length.ToString());
4814 for (
int i = 0; i < Data.Length; i++)
4816 returnblock[j].Parameter = Data[i].GetBytes(); j++;
4818 packet.ParamList = returnblock;
4819 packet.Header.Reliable =
true;
4825 List<UUID> BannedUsers =
new List<UUID>();
4827 for (
int i = 0; i < bl.Length; i++)
4831 if (bl[i].BannedUserID ==
UUID.Zero)
4833 BannedUsers.Add(bl[i].BannedUserID);
4835 if (BannedUsers.Count >= 50 || (i == (bl.Length - 1) && BannedUsers.Count > 0))
4837 EstateOwnerMessagePacket packet =
new EstateOwnerMessagePacket();
4838 packet.AgentData.TransactionID = UUID.Random();
4839 packet.AgentData.AgentID = AgentId;
4840 packet.AgentData.SessionID = SessionId;
4841 packet.MethodData.Invoice = invoice;
4842 packet.MethodData.Method = Utils.StringToBytes(
"setaccess");
4844 EstateOwnerMessagePacket.ParamListBlock[] returnblock =
new EstateOwnerMessagePacket.ParamListBlock[6 + BannedUsers.Count];
4847 for (j = 0; j < (6 + BannedUsers.Count); j++)
4849 returnblock[j] =
new EstateOwnerMessagePacket.ParamListBlock();
4853 returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++;
4855 returnblock[j].Parameter = Utils.StringToBytes(
"0"); j++;
4856 returnblock[j].Parameter = Utils.StringToBytes(
"0"); j++;
4857 returnblock[j].Parameter = Utils.StringToBytes(BannedUsers.Count.ToString()); j++;
4858 returnblock[j].Parameter = Utils.StringToBytes(
"0"); j++;
4860 foreach (
UUID banned
in BannedUsers)
4862 returnblock[j].Parameter = banned.GetBytes(); j++;
4864 packet.ParamList = returnblock;
4865 packet.Header.Reliable =
true;
4868 BannedUsers.Clear();
4876 RegionInfoPacket rinfopack =
new RegionInfoPacket();
4877 RegionInfoPacket.RegionInfoBlock rinfoblk =
new RegionInfoPacket.RegionInfoBlock();
4878 rinfopack.AgentData.AgentID = AgentId;
4879 rinfopack.AgentData.SessionID = SessionId;
4880 rinfoblk.BillableFactor = args.billableFactor;
4881 rinfoblk.EstateID = args.estateID;
4882 rinfoblk.MaxAgents = args.maxAgents;
4883 rinfoblk.ObjectBonusFactor = args.objectBonusFactor;
4884 rinfoblk.ParentEstateID = args.parentEstateID;
4885 rinfoblk.PricePerMeter = args.pricePerMeter;
4886 rinfoblk.RedirectGridX = args.redirectGridX;
4887 rinfoblk.RedirectGridY = args.redirectGridY;
4888 rinfoblk.RegionFlags = args.regionFlags;
4889 rinfoblk.SimAccess = args.simAccess;
4890 rinfoblk.SunHour = args.sunHour;
4891 rinfoblk.TerrainLowerLimit = args.terrainLowerLimit;
4892 rinfoblk.TerrainRaiseLimit = args.terrainRaiseLimit;
4893 rinfoblk.UseEstateSun = args.useEstateSun;
4894 rinfoblk.WaterHeight = args.waterHeight;
4895 rinfoblk.SimName = Utils.StringToBytes(args.simName);
4897 rinfopack.RegionInfo2 =
new RegionInfoPacket.RegionInfo2Block();
4898 rinfopack.RegionInfo2.HardMaxAgents = uint.MaxValue;
4899 rinfopack.RegionInfo2.HardMaxObjects = uint.MaxValue;
4900 rinfopack.RegionInfo2.MaxAgents32 = uint.MaxValue;
4901 rinfopack.RegionInfo2.ProductName = Util.StringToBytes256(args.regionType);
4902 rinfopack.RegionInfo2.ProductSKU = Utils.EmptyBytes;
4904 rinfopack.HasVariableBlocks =
true;
4905 rinfopack.RegionInfo = rinfoblk;
4906 rinfopack.AgentData =
new RegionInfoPacket.AgentDataBlock();
4907 rinfopack.AgentData.AgentID = AgentId;
4908 rinfopack.AgentData.SessionID = SessionId;
4909 rinfopack.RegionInfo3 =
new RegionInfoPacket.RegionInfo3Block[0];
4918 EstateCovenantReplyPacket einfopack =
new EstateCovenantReplyPacket();
4919 EstateCovenantReplyPacket.DataBlock edata =
new EstateCovenantReplyPacket.DataBlock();
4920 edata.CovenantID = covenant;
4921 edata.CovenantTimestamp = (uint) m_scene.RegionInfo.RegionSettings.CovenantChangedDateTime;
4922 edata.EstateOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
4923 edata.EstateName =
Utils.StringToBytes(m_scene.RegionInfo.EstateSettings.EstateName);
4924 einfopack.Data = edata;
4929 UUID invoice,
string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition,
4930 UUID covenant, uint covenantChanged,
string abuseEmail, UUID estateOwner)
4935 EstateOwnerMessagePacket packet =
new EstateOwnerMessagePacket();
4936 packet.MethodData.Invoice = invoice;
4937 packet.AgentData.TransactionID = UUID.Random();
4938 packet.MethodData.Method = Utils.StringToBytes(
"estateupdateinfo");
4939 EstateOwnerMessagePacket.ParamListBlock[] returnblock =
new EstateOwnerMessagePacket.ParamListBlock[10];
4941 for (
int i = 0; i < 10; i++)
4943 returnblock[i] =
new EstateOwnerMessagePacket.ParamListBlock();
4947 returnblock[0].Parameter = Utils.StringToBytes(estateName);
4948 returnblock[1].Parameter = Utils.StringToBytes(estateOwner.ToString());
4949 returnblock[2].Parameter = Utils.StringToBytes(estateID.ToString());
4951 returnblock[3].Parameter = Utils.StringToBytes(estateFlags.ToString());
4952 returnblock[4].Parameter = Utils.StringToBytes(sunPosition.ToString());
4953 returnblock[5].Parameter = Utils.StringToBytes(parentEstate.ToString());
4954 returnblock[6].Parameter = Utils.StringToBytes(covenant.ToString());
4955 returnblock[7].Parameter = Utils.StringToBytes(covenantChanged.ToString());
4956 returnblock[8].Parameter = Utils.StringToBytes(
"1");
4957 returnblock[9].Parameter = Utils.StringToBytes(abuseEmail);
4959 packet.ParamList = returnblock;
4960 packet.Header.Reliable =
false;
4968 packet.TelehubBlock.ObjectID = ObjectID;
4969 packet.TelehubBlock.ObjectName = Utils.StringToBytes(ObjectName);
4970 packet.TelehubBlock.TelehubPos = ObjectPos;
4971 packet.TelehubBlock.TelehubRot = ObjectRot;
4973 packet.SpawnPointBlock =
new TelehubInfoPacket.SpawnPointBlockBlock[SpawnPoint.Count];
4974 for (
int n = 0; n < SpawnPoint.Count; n++)
4976 packet.SpawnPointBlock[n] =
new TelehubInfoPacket.SpawnPointBlockBlock{SpawnPointPos = SpawnPoint[n]};
4984 #region Land Data Sending Methods
4989 packet.ParcelData.Data = data;
4990 packet.ParcelData.SequenceID = sequence_id;
4991 packet.Header.Zerocoded =
true;
4997 int sequence_id,
bool snap_selection,
int request_result,
ILandObject lo,
4998 float simObjectBonusFactor,
int parcelObjectCapacity,
int simObjectCapacity, uint regionFlags)
5004 ParcelPropertiesMessage updateMessage =
new ParcelPropertiesMessage();
5006 updateMessage.AABBMax = landData.AABBMax;
5007 updateMessage.AABBMin = landData.AABBMin;
5008 updateMessage.Area = landData.Area;
5009 updateMessage.AuctionID = landData.AuctionID;
5010 updateMessage.AuthBuyerID = landData.AuthBuyerID;
5011 updateMessage.Bitmap = landData.Bitmap;
5012 updateMessage.Desc = landData.Description;
5013 updateMessage.Category = landData.Category;
5014 updateMessage.ClaimDate = Util.ToDateTime(landData.ClaimDate);
5015 updateMessage.ClaimPrice = landData.ClaimPrice;
5016 updateMessage.GroupID = landData.GroupID;
5017 updateMessage.IsGroupOwned = landData.IsGroupOwned;
5018 updateMessage.LandingType = (LandingType) landData.
LandingType;
5019 updateMessage.LocalID = landData.
LocalID;
5021 if (landData.
Area > 0)
5023 updateMessage.MaxPrims = parcelObjectCapacity;
5027 updateMessage.MaxPrims = 0;
5030 updateMessage.MediaAutoScale = Convert.ToBoolean(landData.MediaAutoScale);
5031 updateMessage.MediaID = landData.MediaID;
5032 updateMessage.MediaURL = landData.MediaURL;
5033 updateMessage.MusicURL = landData.MusicURL;
5034 updateMessage.Name = landData.Name;
5035 updateMessage.OtherCleanTime = landData.OtherCleanTime;
5036 updateMessage.OtherCount = 0;
5037 updateMessage.OwnerID = landData.OwnerID;
5038 updateMessage.ParcelFlags = (ParcelFlags) landData.
Flags;
5039 updateMessage.ParcelPrimBonus = simObjectBonusFactor;
5040 updateMessage.PassHours = landData.
PassHours;
5041 updateMessage.PassPrice = landData.
PassPrice;
5042 updateMessage.PublicCount = 0;
5044 updateMessage.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0;
5045 updateMessage.RegionDenyAnonymous = (regionFlags & (uint)
RegionFlags.DenyAnonymous) > 0;
5050 updateMessage.RentPrice = 0;
5051 updateMessage.RequestResult = (ParcelResult) request_result;
5052 updateMessage.SalePrice = landData.SalePrice;
5053 updateMessage.SelfCount = 0;
5054 updateMessage.SequenceID = sequence_id;
5058 int simulatorCapacity = (int)((
long)landData.SimwideArea * (long)m_scene.RegionInfo.ObjectCapacity * (
long)m_scene.RegionInfo.RegionSettings.ObjectBonus / 65536L);
5060 if (simulatorCapacity > m_scene.RegionInfo.ObjectCapacity)
5061 simulatorCapacity = m_scene.RegionInfo.ObjectCapacity;
5062 updateMessage.SimWideMaxPrims = simulatorCapacity;
5066 updateMessage.SimWideMaxPrims = 0;
5069 updateMessage.SnapSelection = snap_selection;
5070 updateMessage.SnapshotID = landData.SnapshotID;
5071 updateMessage.Status = (ParcelStatus) landData.
Status;
5073 updateMessage.UserLookAt = landData.
UserLookAt;
5075 updateMessage.MediaType = landData.
MediaType;
5077 updateMessage.MediaWidth = landData.
MediaWidth;
5079 updateMessage.MediaLoop = landData.
MediaLoop;
5084 updateMessage.OwnerPrims = pc.
Owner;
5085 updateMessage.GroupPrims = pc.Group;
5086 updateMessage.OtherPrims = pc.Others;
5087 updateMessage.SelectedPrims = pc.Selected;
5088 updateMessage.TotalPrims = pc.Total;
5089 updateMessage.SimWideTotalPrims = pc.Simulator;
5097 OSD message_body = updateMessage.Serialize();
5102 parcelData[
"SeeAVs"] = OSD.FromBoolean(landData.SeeAVs);
5103 parcelData[
"AnyAVSounds"] = OSD.FromBoolean(landData.AnyAVSounds);
5104 parcelData[
"GroupAVSounds"] = OSD.FromBoolean(landData.GroupAVSounds);
5106 message.Add(
"message", OSD.FromString(
"ParcelProperties"));
5107 message.Add(
"body", message_body);
5109 eq.Enqueue (message, this.AgentId);
5115 m_log.Warn(
"[LLCLIENTVIEW]: No EQ Interface when sending parcel data.");
5118 catch (Exception ex)
5120 m_log.Error(
"[LLCLIENTVIEW]: Unable to send parcel data via eventqueue - exception: " + ex.ToString());
5126 ParcelAccessListReplyPacket replyPacket = (ParcelAccessListReplyPacket)
PacketPool.
Instance.
GetPacket(PacketType.ParcelAccessListReply);
5127 replyPacket.Data.AgentID = AgentId;
5128 replyPacket.Data.Flags = accessFlag;
5129 replyPacket.Data.LocalID = localLandID;
5130 replyPacket.Data.SequenceID = 0;
5132 List<ParcelAccessListReplyPacket.ListBlock> list =
new List<ParcelAccessListReplyPacket.ListBlock>();
5135 ParcelAccessListReplyPacket.ListBlock block =
new ParcelAccessListReplyPacket.ListBlock();
5136 block.Flags = accessFlag;
5137 block.ID = entry.AgentID;
5138 block.Time = entry.Expires;
5142 replyPacket.List = list.ToArray();
5143 replyPacket.Header.Zerocoded =
true;
5151 bool firstCall =
true;
5152 const int MAX_OBJECTS_PER_PACKET = 251;
5154 ForceObjectSelectPacket.DataBlock[] data;
5155 while (ObjectIDs.Count > 0)
5159 pack._Header.ResetList =
true;
5164 pack._Header.ResetList =
false;
5167 if (ObjectIDs.Count > MAX_OBJECTS_PER_PACKET)
5169 data =
new ForceObjectSelectPacket.DataBlock[MAX_OBJECTS_PER_PACKET];
5173 data =
new ForceObjectSelectPacket.DataBlock[ObjectIDs.Count];
5177 for (i = 0; i < MAX_OBJECTS_PER_PACKET && ObjectIDs.Count > 0; i++)
5179 data[i] =
new ForceObjectSelectPacket.DataBlock();
5180 data[i].LocalID = Convert.ToUInt32(ObjectIDs[0]);
5181 ObjectIDs.RemoveAt(0);
5184 pack.Header.Zerocoded =
true;
5192 cpack.CameraCollidePlane =
new CameraConstraintPacket.CameraCollidePlaneBlock();
5193 cpack.CameraCollidePlane.Plane = ConstraintPlane;
5200 int notifyCount = ownersAndCount.Count;
5201 ParcelObjectOwnersReplyPacket pack = (ParcelObjectOwnersReplyPacket)
PacketPool.
Instance.
GetPacket(PacketType.ParcelObjectOwnersReply);
5203 if (notifyCount > 0)
5214 ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock
5215 =
new ParcelObjectOwnersReplyPacket.DataBlock[notifyCount];
5218 foreach (
UUID owner
in ownersAndCount.Keys)
5220 dataBlock[num] =
new ParcelObjectOwnersReplyPacket.DataBlock();
5221 dataBlock[num].Count = ownersAndCount[owner];
5223 if (land.
GroupID == owner || groups.Contains(owner))
5224 dataBlock[num].IsGroupOwned =
true;
5226 dataBlock[num].OnlineStatus =
true;
5227 dataBlock[num].OwnerID = owner;
5231 if (num >= notifyCount)
5237 pack.Data = dataBlock;
5241 pack.Data =
new ParcelObjectOwnersReplyPacket.DataBlock[0];
5243 pack.Header.Zerocoded =
true;
5244 this.OutPacket(pack, ThrottleOutPacketType.Task);
5249 #region Helper Methods
5253 #region ScenePresence/SOP Handling
5255 bool avatar = (entity is ScenePresence);
5256 uint localID = entity.LocalId;
5258 Vector4 collisionPlane;
5259 Vector3 position, velocity, acceleration, angularVelocity;
5261 byte[] textureEntry;
5263 if (entity is ScenePresence)
5265 ScenePresence presence = (ScenePresence)entity;
5267 position = presence.OffsetPosition;
5268 rotation = presence.Rotation;
5269 angularVelocity = presence.AngularVelocity;
5270 rotation = presence.Rotation;
5277 collisionPlane = presence.CollisionPlane;
5278 velocity = presence.Velocity;
5279 acceleration = Vector3.Zero;
5283 textureEntry = presence.Appearance.Texture.GetBytes();
5286 textureEntry = null;
5290 SceneObjectPart part = (SceneObjectPart)entity;
5292 attachPoint = part.ParentGroup.AttachmentPoint;
5293 attachPoint = ((attachPoint % 16) * 16 + (attachPoint / 16));
5298 collisionPlane = Vector4.Zero;
5299 position = part.RelativePosition;
5300 velocity = part.Velocity;
5301 acceleration = part.Acceleration;
5302 angularVelocity = part.AngularVelocity;
5303 rotation = part.RotationOffset;
5306 textureEntry = part.Shape.TextureEntry;
5308 textureEntry = null;
5311 #endregion ScenePresence/SOP Handling
5314 byte[] data =
new byte[(avatar ? 60 : 44)];
5317 Utils.UIntToBytes(localID, data, pos);
5321 data[pos++] = (byte) attachPoint;
5326 if (collisionPlane == Vector4.Zero)
5327 collisionPlane = Vector4.UnitW;
5329 collisionPlane.ToBytes(data, pos);
5338 position.ToBytes(data, pos);
5342 Utils.UInt16ToBytes(Utils.FloatToUInt16(velocity.X, -128.0f, 128.0f), data, pos); pos += 2;
5343 Utils.UInt16ToBytes(Utils.FloatToUInt16(velocity.Y, -128.0f, 128.0f), data, pos); pos += 2;
5344 Utils.UInt16ToBytes(Utils.FloatToUInt16(velocity.Z, -128.0f, 128.0f), data, pos); pos += 2;
5347 Utils.UInt16ToBytes(Utils.FloatToUInt16(acceleration.X, -64.0f, 64.0f), data, pos); pos += 2;
5348 Utils.UInt16ToBytes(Utils.FloatToUInt16(acceleration.Y, -64.0f, 64.0f), data, pos); pos += 2;
5349 Utils.UInt16ToBytes(Utils.FloatToUInt16(acceleration.Z, -64.0f, 64.0f), data, pos); pos += 2;
5352 Utils.UInt16ToBytes(Utils.FloatToUInt16(rotation.X, -1.0f, 1.0f), data, pos); pos += 2;
5353 Utils.UInt16ToBytes(Utils.FloatToUInt16(rotation.Y, -1.0f, 1.0f), data, pos); pos += 2;
5354 Utils.UInt16ToBytes(Utils.FloatToUInt16(rotation.Z, -1.0f, 1.0f), data, pos); pos += 2;
5355 Utils.UInt16ToBytes(Utils.FloatToUInt16(rotation.W, -1.0f, 1.0f), data, pos); pos += 2;
5358 Utils.UInt16ToBytes(Utils.FloatToUInt16(angularVelocity.X, -64.0f, 64.0f), data, pos); pos += 2;
5359 Utils.UInt16ToBytes(Utils.FloatToUInt16(angularVelocity.Y, -64.0f, 64.0f), data, pos); pos += 2;
5360 Utils.UInt16ToBytes(Utils.FloatToUInt16(angularVelocity.Z, -64.0f, 64.0f), data, pos); pos += 2;
5362 ImprovedTerseObjectUpdatePacket.ObjectDataBlock block
5363 = PacketPool.Instance.GetDataBlock<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
5367 if (textureEntry != null && textureEntry.Length > 0)
5369 byte[] teBytesFinal =
new byte[textureEntry.Length + 4];
5372 Utils.IntToBytes(textureEntry.Length, textureEntry, 0);
5374 Buffer.BlockCopy(textureEntry, 0, teBytesFinal, 4, textureEntry.Length);
5376 block.TextureEntry = teBytesFinal;
5380 block.TextureEntry = Utils.EmptyBytes;
5388 Vector3 offsetPosition = data.OffsetPosition;
5389 Quaternion
rotation = data.Rotation;
5390 uint parentID = data.ParentID;
5395 byte[] objectData =
new byte[76];
5397 Vector3 velocity =
new Vector3(0, 0, 0);
5398 Vector3 acceleration =
new Vector3(0, 0, 0);
5399 rotation.Normalize();
5401 data.CollisionPlane.ToBytes(objectData, 0);
5402 offsetPosition.ToBytes(objectData, 16);
5403 velocity.ToBytes(objectData, 28);
5404 acceleration.ToBytes(objectData, 40);
5405 rotation.ToBytes(objectData, 52);
5406 data.AngularVelocity.ToBytes(objectData, 64);
5408 ObjectUpdatePacket.ObjectDataBlock update =
new ObjectUpdatePacket.ObjectDataBlock();
5410 update.Data = Utils.EmptyBytes;
5411 update.ExtraParams =
new byte[1];
5412 update.FullID = data.UUID;
5413 update.ID = data.LocalId;
5414 update.Material = (byte)
Material.Flesh;
5415 update.MediaURL =
Utils.EmptyBytes;
5416 update.NameValue =
Utils.StringToBytes(
"FirstName STRING RW SV " + data.
Firstname +
"\nLastName STRING RW SV " +
5418 update.ObjectData = objectData;
5420 SceneObjectPart parentPart = data.ParentPart;
5421 if (parentPart != null)
5422 update.ParentID = parentPart.ParentGroup.LocalId;
5424 update.ParentID = 0;
5426 update.PathCurve = 16;
5427 update.PathScaleX = 100;
5428 update.PathScaleY = 100;
5429 update.PCode = (byte)PCode.Avatar;
5430 update.ProfileCurve = 1;
5431 update.PSBlock =
Utils.EmptyBytes;
5435 update.Text =
Utils.EmptyBytes;
5436 update.TextColor =
new byte[4];
5439 update.TextureAnim =
Utils.EmptyBytes;
5442 update.TextureEntry =
Utils.EmptyBytes;
5451 update.UpdateFlags = 0;
5458 byte[] objectData =
new byte[60];
5459 data.RelativePosition.ToBytes(objectData, 0);
5460 data.Velocity.ToBytes(objectData, 12);
5461 data.Acceleration.ToBytes(objectData, 24);
5463 Quaternion
rotation = data.RotationOffset;
5464 rotation.Normalize();
5465 rotation.ToBytes(objectData, 36);
5466 data.AngularVelocity.ToBytes(objectData, 48);
5468 ObjectUpdatePacket.ObjectDataBlock update =
new ObjectUpdatePacket.ObjectDataBlock();
5472 update.FullID = data.
UUID;
5478 update.MediaURL =
Utils.EmptyBytes;
5510 update.NameValue = Util.StringToBytes256(
"AttachItemID STRING RW SV " + data.ParentGroup.FromItemID);
5513 update.NameValue = Utils.EmptyBytes;
5516 update.State = (byte)(((st & 0xf0) >> 4) + ((st & 0x0f) << 4)); ;
5520 update.NameValue = Utils.EmptyBytes;
5521 update.State = data.Shape.State;
5525 update.ObjectData = objectData;
5526 update.ParentID = data.ParentID;
5527 update.PathBegin = data.Shape.PathBegin;
5528 update.PathCurve = data.Shape.PathCurve;
5529 update.PathEnd = data.Shape.PathEnd;
5530 update.PathRadiusOffset = data.Shape.PathRadiusOffset;
5531 update.PathRevolutions = data.Shape.PathRevolutions;
5532 update.PathScaleX = data.Shape.PathScaleX;
5533 update.PathScaleY = data.Shape.PathScaleY;
5534 update.PathShearX = data.Shape.PathShearX;
5535 update.PathShearY = data.Shape.PathShearY;
5536 update.PathSkew = data.Shape.PathSkew;
5537 update.PathTaperX = data.Shape.PathTaperX;
5538 update.PathTaperY = data.Shape.PathTaperY;
5539 update.PathTwist = data.Shape.PathTwist;
5540 update.PathTwistBegin = data.Shape.PathTwistBegin;
5541 update.PCode = data.Shape.PCode;
5542 update.ProfileBegin = data.Shape.ProfileBegin;
5543 update.ProfileCurve = data.Shape.ProfileCurve;
5544 update.ProfileEnd = data.Shape.ProfileEnd;
5545 update.ProfileHollow = data.Shape.ProfileHollow;
5546 update.PSBlock = data.ParticleSystem ?? Utils.EmptyBytes;
5547 update.TextColor = data.GetTextColor().GetBytes(
false);
5548 update.TextureAnim = data.TextureAnimation ?? Utils.EmptyBytes;
5549 update.TextureEntry = data.Shape.TextureEntry ?? Utils.EmptyBytes;
5550 update.Scale = data.Shape.Scale;
5551 update.Text = Util.StringToBytes256(data.Text);
5552 update.MediaURL = Util.StringToBytes256(data.MediaUrl);
5561 if (recipientID == data.
OwnerID)
5566 flags |= PrimFlags.CreateSelected;
5567 data.CreateSelected =
false;
5575 update.UpdateFlags = (uint)flags;
5577 #endregion PrimFlags
5581 update.Sound = data.Sound;
5582 update.OwnerID = data.OwnerID;
5584 update.Radius = (
float)data.SoundRadius;
5585 update.Flags = data.SoundFlags;
5588 switch ((PCode)data.Shape.PCode)
5593 update.Data =
new byte[] { data.Shape.State };
5596 update.Data = Utils.EmptyBytes;
5613 packet.UUIDNameBlock =
new UUIDNameReplyPacket.UUIDNameBlockBlock[1];
5614 packet.UUIDNameBlock[0] =
new UUIDNameReplyPacket.UUIDNameBlockBlock();
5615 packet.UUIDNameBlock[0].ID = profileId;
5616 packet.UUIDNameBlock[0].FirstName = Util.StringToBytes256(firstname);
5617 packet.UUIDNameBlock[0].LastName = Util.StringToBytes256(lastname);
5624 if (groupID == ActiveGroupId)
5625 return ActiveGroupPowers;
5627 if (m_groupPowers.ContainsKey(groupID))
5628 return m_groupPowers[groupID];
5640 AddLocalPacketHandler(PacketType.LogoutRequest, HandleLogout);
5644 AddLocalPacketHandler(PacketType.AgentUpdate, HandleAgentUpdate,
false);
5646 AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect,
false);
5647 AddLocalPacketHandler(PacketType.VelocityInterpolateOff, HandleVelocityInterpolateOff,
false);
5648 AddLocalPacketHandler(PacketType.VelocityInterpolateOn, HandleVelocityInterpolateOn,
false);
5649 AddLocalPacketHandler(PacketType.AgentCachedTexture, HandleAgentTextureCached,
false);
5650 AddLocalPacketHandler(PacketType.MultipleObjectUpdate, HandleMultipleObjUpdate,
false);
5651 AddLocalPacketHandler(PacketType.MoneyTransferRequest, HandleMoneyTransferRequest,
false);
5652 AddLocalPacketHandler(PacketType.ParcelBuy, HandleParcelBuyRequest,
false);
5653 AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest);
5654 AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest);
5655 AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage,
true,
true);
5656 AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest,
true,
true);
5657 AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
5658 AddLocalPacketHandler(PacketType.AvatarPropertiesUpdate, HandlerAvatarPropertiesUpdate,
true,
true);
5659 AddLocalPacketHandler(PacketType.ScriptDialogReply, HandlerScriptDialogReply);
5660 AddLocalPacketHandler(PacketType.ImprovedInstantMessage, HandlerImprovedInstantMessage);
5661 AddLocalPacketHandler(PacketType.AcceptFriendship, HandlerAcceptFriendship);
5662 AddLocalPacketHandler(PacketType.DeclineFriendship, HandlerDeclineFriendship);
5663 AddLocalPacketHandler(PacketType.TerminateFriendship, HandlerTerminateFriendship);
5664 AddLocalPacketHandler(PacketType.RezObject, HandlerRezObject);
5665 AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject);
5666 AddLocalPacketHandler(PacketType.RezRestoreToWorld, HandlerRezRestoreToWorld);
5667 AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand);
5668 AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply,
false);
5669 AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest);
5670 AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance);
5671 AddLocalPacketHandler(PacketType.AgentIsNowWearing, HandlerAgentIsNowWearing);
5672 AddLocalPacketHandler(PacketType.RezSingleAttachmentFromInv, HandlerRezSingleAttachmentFromInv);
5673 AddLocalPacketHandler(PacketType.RezMultipleAttachmentsFromInv, HandleRezMultipleAttachmentsFromInv);
5674 AddLocalPacketHandler(PacketType.DetachAttachmentIntoInv, HandleDetachAttachmentIntoInv);
5675 AddLocalPacketHandler(PacketType.ObjectAttach, HandleObjectAttach);
5676 AddLocalPacketHandler(PacketType.ObjectDetach, HandleObjectDetach);
5677 AddLocalPacketHandler(PacketType.ObjectDrop, HandleObjectDrop);
5678 AddLocalPacketHandler(PacketType.SetAlwaysRun, HandleSetAlwaysRun,
false);
5679 AddLocalPacketHandler(PacketType.CompleteAgentMovement, HandleCompleteAgentMovement);
5680 AddLocalPacketHandler(PacketType.AgentAnimation, HandleAgentAnimation,
false);
5681 AddLocalPacketHandler(PacketType.AgentRequestSit, HandleAgentRequestSit);
5682 AddLocalPacketHandler(PacketType.AgentSit, HandleAgentSit);
5683 AddLocalPacketHandler(PacketType.SoundTrigger, HandleSoundTrigger);
5684 AddLocalPacketHandler(PacketType.AvatarPickerRequest, HandleAvatarPickerRequest);
5685 AddLocalPacketHandler(PacketType.AgentDataUpdateRequest, HandleAgentDataUpdateRequest);
5686 AddLocalPacketHandler(PacketType.UserInfoRequest, HandleUserInfoRequest);
5687 AddLocalPacketHandler(PacketType.UpdateUserInfo, HandleUpdateUserInfo);
5688 AddLocalPacketHandler(PacketType.SetStartLocationRequest, HandleSetStartLocationRequest);
5689 AddLocalPacketHandler(PacketType.AgentThrottle, HandleAgentThrottle,
false);
5690 AddLocalPacketHandler(PacketType.AgentPause, HandleAgentPause,
false);
5691 AddLocalPacketHandler(PacketType.AgentResume, HandleAgentResume,
false);
5692 AddLocalPacketHandler(PacketType.ForceScriptControlRelease, HandleForceScriptControlRelease);
5693 AddLocalPacketHandler(PacketType.ObjectLink, HandleObjectLink);
5694 AddLocalPacketHandler(PacketType.ObjectDelink, HandleObjectDelink);
5695 AddLocalPacketHandler(PacketType.ObjectAdd, HandleObjectAdd);
5696 AddLocalPacketHandler(PacketType.ObjectShape, HandleObjectShape);
5697 AddLocalPacketHandler(PacketType.ObjectExtraParams, HandleObjectExtraParams);
5698 AddLocalPacketHandler(PacketType.ObjectDuplicate, HandleObjectDuplicate);
5699 AddLocalPacketHandler(PacketType.RequestMultipleObjects, HandleRequestMultipleObjects);
5700 AddLocalPacketHandler(PacketType.ObjectSelect, HandleObjectSelect);
5701 AddLocalPacketHandler(PacketType.ObjectDeselect, HandleObjectDeselect);
5702 AddLocalPacketHandler(PacketType.ObjectPosition, HandleObjectPosition);
5703 AddLocalPacketHandler(PacketType.ObjectScale, HandleObjectScale);
5704 AddLocalPacketHandler(PacketType.ObjectRotation, HandleObjectRotation);
5705 AddLocalPacketHandler(PacketType.ObjectFlagUpdate, HandleObjectFlagUpdate);
5709 AddLocalPacketHandler(PacketType.ObjectImage, HandleObjectImage,
false);
5711 AddLocalPacketHandler(PacketType.ObjectGrab, HandleObjectGrab,
false);
5712 AddLocalPacketHandler(PacketType.ObjectGrabUpdate, HandleObjectGrabUpdate,
false);
5713 AddLocalPacketHandler(PacketType.ObjectDeGrab, HandleObjectDeGrab);
5714 AddLocalPacketHandler(PacketType.ObjectSpinStart, HandleObjectSpinStart,
false);
5715 AddLocalPacketHandler(PacketType.ObjectSpinUpdate, HandleObjectSpinUpdate,
false);
5716 AddLocalPacketHandler(PacketType.ObjectSpinStop, HandleObjectSpinStop,
false);
5717 AddLocalPacketHandler(PacketType.ObjectDescription, HandleObjectDescription,
false);
5718 AddLocalPacketHandler(PacketType.ObjectName, HandleObjectName,
false);
5719 AddLocalPacketHandler(PacketType.ObjectPermissions, HandleObjectPermissions,
false);
5720 AddLocalPacketHandler(PacketType.Undo, HandleUndo,
false);
5721 AddLocalPacketHandler(PacketType.UndoLand, HandleLandUndo,
false);
5722 AddLocalPacketHandler(PacketType.Redo, HandleRedo,
false);
5723 AddLocalPacketHandler(PacketType.ObjectDuplicateOnRay, HandleObjectDuplicateOnRay);
5724 AddLocalPacketHandler(PacketType.RequestObjectPropertiesFamily, HandleRequestObjectPropertiesFamily,
false);
5725 AddLocalPacketHandler(PacketType.ObjectIncludeInSearch, HandleObjectIncludeInSearch);
5726 AddLocalPacketHandler(PacketType.ScriptAnswerYes, HandleScriptAnswerYes,
false);
5727 AddLocalPacketHandler(PacketType.ObjectClickAction, HandleObjectClickAction,
false);
5728 AddLocalPacketHandler(PacketType.ObjectMaterial, HandleObjectMaterial,
false);
5729 AddLocalPacketHandler(PacketType.RequestImage, HandleRequestImage,
false);
5730 AddLocalPacketHandler(PacketType.TransferRequest, HandleTransferRequest,
false);
5731 AddLocalPacketHandler(PacketType.AssetUploadRequest, HandleAssetUploadRequest);
5732 AddLocalPacketHandler(PacketType.RequestXfer, HandleRequestXfer);
5733 AddLocalPacketHandler(PacketType.SendXferPacket, HandleSendXferPacket);
5734 AddLocalPacketHandler(PacketType.ConfirmXferPacket, HandleConfirmXferPacket);
5735 AddLocalPacketHandler(PacketType.AbortXfer, HandleAbortXfer);
5736 AddLocalPacketHandler(PacketType.CreateInventoryFolder, HandleCreateInventoryFolder);
5737 AddLocalPacketHandler(PacketType.UpdateInventoryFolder, HandleUpdateInventoryFolder);
5738 AddLocalPacketHandler(PacketType.MoveInventoryFolder, HandleMoveInventoryFolder);
5739 AddLocalPacketHandler(PacketType.CreateInventoryItem, HandleCreateInventoryItem);
5740 AddLocalPacketHandler(PacketType.LinkInventoryItem, HandleLinkInventoryItem);
5741 AddLocalPacketHandler(PacketType.FetchInventory, HandleFetchInventory);
5742 AddLocalPacketHandler(PacketType.FetchInventoryDescendents, HandleFetchInventoryDescendents);
5743 AddLocalPacketHandler(PacketType.PurgeInventoryDescendents, HandlePurgeInventoryDescendents);
5744 AddLocalPacketHandler(PacketType.UpdateInventoryItem, HandleUpdateInventoryItem);
5745 AddLocalPacketHandler(PacketType.CopyInventoryItem, HandleCopyInventoryItem);
5746 AddLocalPacketHandler(PacketType.MoveInventoryItem, HandleMoveInventoryItem);
5747 AddLocalPacketHandler(PacketType.RemoveInventoryItem, HandleRemoveInventoryItem);
5748 AddLocalPacketHandler(PacketType.RemoveInventoryFolder, HandleRemoveInventoryFolder);
5749 AddLocalPacketHandler(PacketType.RemoveInventoryObjects, HandleRemoveInventoryObjects);
5750 AddLocalPacketHandler(PacketType.RequestTaskInventory, HandleRequestTaskInventory);
5751 AddLocalPacketHandler(PacketType.UpdateTaskInventory, HandleUpdateTaskInventory);
5752 AddLocalPacketHandler(PacketType.RemoveTaskInventory, HandleRemoveTaskInventory);
5753 AddLocalPacketHandler(PacketType.MoveTaskInventory, HandleMoveTaskInventory);
5754 AddLocalPacketHandler(PacketType.RezScript, HandleRezScript);
5755 AddLocalPacketHandler(PacketType.MapLayerRequest, HandleMapLayerRequest);
5756 AddLocalPacketHandler(PacketType.MapBlockRequest, HandleMapBlockRequest);
5757 AddLocalPacketHandler(PacketType.MapNameRequest, HandleMapNameRequest);
5758 AddLocalPacketHandler(PacketType.TeleportLandmarkRequest, HandleTeleportLandmarkRequest);
5759 AddLocalPacketHandler(PacketType.TeleportCancel, HandleTeleportCancel);
5760 AddLocalPacketHandler(PacketType.TeleportLocationRequest, HandleTeleportLocationRequest);
5761 AddLocalPacketHandler(PacketType.UUIDNameRequest, HandleUUIDNameRequest,
false);
5762 AddLocalPacketHandler(PacketType.RegionHandleRequest, HandleRegionHandleRequest,
false);
5763 AddLocalPacketHandler(PacketType.ParcelInfoRequest, HandleParcelInfoRequest);
5764 AddLocalPacketHandler(PacketType.ParcelAccessListRequest, HandleParcelAccessListRequest,
false);
5765 AddLocalPacketHandler(PacketType.ParcelAccessListUpdate, HandleParcelAccessListUpdate,
false);
5766 AddLocalPacketHandler(PacketType.ParcelPropertiesRequest, HandleParcelPropertiesRequest,
false);
5767 AddLocalPacketHandler(PacketType.ParcelDivide, HandleParcelDivide);
5768 AddLocalPacketHandler(PacketType.ParcelJoin, HandleParcelJoin);
5769 AddLocalPacketHandler(PacketType.ParcelPropertiesUpdate, HandleParcelPropertiesUpdate);
5770 AddLocalPacketHandler(PacketType.ParcelSelectObjects, HandleParcelSelectObjects);
5771 AddLocalPacketHandler(PacketType.ParcelObjectOwnersRequest, HandleParcelObjectOwnersRequest);
5772 AddLocalPacketHandler(PacketType.ParcelGodForceOwner, HandleParcelGodForceOwner);
5773 AddLocalPacketHandler(PacketType.ParcelRelease, HandleParcelRelease);
5774 AddLocalPacketHandler(PacketType.ParcelReclaim, HandleParcelReclaim);
5775 AddLocalPacketHandler(PacketType.ParcelReturnObjects, HandleParcelReturnObjects);
5776 AddLocalPacketHandler(PacketType.ParcelSetOtherCleanTime, HandleParcelSetOtherCleanTime);
5777 AddLocalPacketHandler(PacketType.LandStatRequest, HandleLandStatRequest);
5778 AddLocalPacketHandler(PacketType.ParcelDwellRequest, HandleParcelDwellRequest);
5779 AddLocalPacketHandler(PacketType.EstateOwnerMessage, HandleEstateOwnerMessage);
5780 AddLocalPacketHandler(PacketType.RequestRegionInfo, HandleRequestRegionInfo,
false);
5781 AddLocalPacketHandler(PacketType.EstateCovenantRequest, HandleEstateCovenantRequest);
5782 AddLocalPacketHandler(PacketType.RequestGodlikePowers, HandleRequestGodlikePowers);
5783 AddLocalPacketHandler(PacketType.GodKickUser, HandleGodKickUser);
5784 AddLocalPacketHandler(PacketType.MoneyBalanceRequest, HandleMoneyBalanceRequest);
5785 AddLocalPacketHandler(PacketType.EconomyDataRequest, HandleEconomyDataRequest);
5786 AddLocalPacketHandler(PacketType.RequestPayPrice, HandleRequestPayPrice);
5787 AddLocalPacketHandler(PacketType.ObjectSaleInfo, HandleObjectSaleInfo);
5788 AddLocalPacketHandler(PacketType.ObjectBuy, HandleObjectBuy);
5789 AddLocalPacketHandler(PacketType.GetScriptRunning, HandleGetScriptRunning);
5790 AddLocalPacketHandler(PacketType.SetScriptRunning, HandleSetScriptRunning);
5791 AddLocalPacketHandler(PacketType.ScriptReset, HandleScriptReset);
5792 AddLocalPacketHandler(PacketType.ActivateGestures, HandleActivateGestures);
5793 AddLocalPacketHandler(PacketType.DeactivateGestures, HandleDeactivateGestures);
5794 AddLocalPacketHandler(PacketType.ObjectOwner, HandleObjectOwner);
5795 AddLocalPacketHandler(PacketType.AgentFOV, HandleAgentFOV,
false);
5796 AddLocalPacketHandler(PacketType.ViewerStats, HandleViewerStats);
5797 AddLocalPacketHandler(PacketType.MapItemRequest, HandleMapItemRequest,
false);
5798 AddLocalPacketHandler(PacketType.TransferAbort, HandleTransferAbort,
false);
5799 AddLocalPacketHandler(PacketType.MuteListRequest, HandleMuteListRequest,
false);
5800 AddLocalPacketHandler(PacketType.UseCircuitCode, HandleUseCircuitCode);
5801 AddLocalPacketHandler(PacketType.CreateNewOutfitAttachments, HandleCreateNewOutfitAttachments);
5802 AddLocalPacketHandler(PacketType.AgentHeightWidth, HandleAgentHeightWidth,
false);
5803 AddLocalPacketHandler(PacketType.InventoryDescendents, HandleInventoryDescendents);
5804 AddLocalPacketHandler(PacketType.DirPlacesQuery, HandleDirPlacesQuery);
5805 AddLocalPacketHandler(PacketType.DirFindQuery, HandleDirFindQuery);
5806 AddLocalPacketHandler(PacketType.DirLandQuery, HandleDirLandQuery);
5807 AddLocalPacketHandler(PacketType.DirPopularQuery, HandleDirPopularQuery);
5808 AddLocalPacketHandler(PacketType.DirClassifiedQuery, HandleDirClassifiedQuery);
5809 AddLocalPacketHandler(PacketType.EventInfoRequest, HandleEventInfoRequest);
5810 AddLocalPacketHandler(PacketType.OfferCallingCard, HandleOfferCallingCard);
5811 AddLocalPacketHandler(PacketType.AcceptCallingCard, HandleAcceptCallingCard);
5812 AddLocalPacketHandler(PacketType.DeclineCallingCard, HandleDeclineCallingCard);
5813 AddLocalPacketHandler(PacketType.ActivateGroup, HandleActivateGroup);
5814 AddLocalPacketHandler(PacketType.GroupTitlesRequest, HandleGroupTitlesRequest);
5815 AddLocalPacketHandler(PacketType.GroupProfileRequest, HandleGroupProfileRequest);
5816 AddLocalPacketHandler(PacketType.GroupMembersRequest, HandleGroupMembersRequest);
5817 AddLocalPacketHandler(PacketType.GroupRoleDataRequest, HandleGroupRoleDataRequest);
5818 AddLocalPacketHandler(PacketType.GroupRoleMembersRequest, HandleGroupRoleMembersRequest);
5819 AddLocalPacketHandler(PacketType.CreateGroupRequest, HandleCreateGroupRequest);
5820 AddLocalPacketHandler(PacketType.UpdateGroupInfo, HandleUpdateGroupInfo);
5821 AddLocalPacketHandler(PacketType.SetGroupAcceptNotices, HandleSetGroupAcceptNotices);
5822 AddLocalPacketHandler(PacketType.GroupTitleUpdate, HandleGroupTitleUpdate);
5823 AddLocalPacketHandler(PacketType.ParcelDeedToGroup, HandleParcelDeedToGroup);
5824 AddLocalPacketHandler(PacketType.GroupNoticesListRequest, HandleGroupNoticesListRequest);
5825 AddLocalPacketHandler(PacketType.GroupNoticeRequest, HandleGroupNoticeRequest);
5826 AddLocalPacketHandler(PacketType.GroupRoleUpdate, HandleGroupRoleUpdate);
5827 AddLocalPacketHandler(PacketType.GroupRoleChanges, HandleGroupRoleChanges);
5828 AddLocalPacketHandler(PacketType.JoinGroupRequest, HandleJoinGroupRequest);
5829 AddLocalPacketHandler(PacketType.LeaveGroupRequest, HandleLeaveGroupRequest);
5830 AddLocalPacketHandler(PacketType.EjectGroupMemberRequest, HandleEjectGroupMemberRequest);
5831 AddLocalPacketHandler(PacketType.InviteGroupRequest, HandleInviteGroupRequest);
5832 AddLocalPacketHandler(PacketType.StartLure, HandleStartLure);
5833 AddLocalPacketHandler(PacketType.TeleportLureRequest, HandleTeleportLureRequest);
5834 AddLocalPacketHandler(PacketType.ClassifiedInfoRequest, HandleClassifiedInfoRequest);
5835 AddLocalPacketHandler(PacketType.ClassifiedInfoUpdate, HandleClassifiedInfoUpdate);
5836 AddLocalPacketHandler(PacketType.ClassifiedDelete, HandleClassifiedDelete);
5837 AddLocalPacketHandler(PacketType.ClassifiedGodDelete, HandleClassifiedGodDelete);
5838 AddLocalPacketHandler(PacketType.EventGodDelete, HandleEventGodDelete);
5839 AddLocalPacketHandler(PacketType.EventNotificationAddRequest, HandleEventNotificationAddRequest);
5840 AddLocalPacketHandler(PacketType.EventNotificationRemoveRequest, HandleEventNotificationRemoveRequest);
5841 AddLocalPacketHandler(PacketType.RetrieveInstantMessages, HandleRetrieveInstantMessages);
5842 AddLocalPacketHandler(PacketType.PickDelete, HandlePickDelete);
5843 AddLocalPacketHandler(PacketType.PickGodDelete, HandlePickGodDelete);
5844 AddLocalPacketHandler(PacketType.PickInfoUpdate, HandlePickInfoUpdate);
5845 AddLocalPacketHandler(PacketType.AvatarNotesUpdate, HandleAvatarNotesUpdate,
true,
true);
5846 AddLocalPacketHandler(PacketType.AvatarInterestsUpdate, HandleAvatarInterestsUpdate,
true,
true);
5847 AddLocalPacketHandler(PacketType.GrantUserRights, HandleGrantUserRights);
5848 AddLocalPacketHandler(PacketType.PlacesQuery, HandlePlacesQuery);
5849 AddLocalPacketHandler(PacketType.UpdateMuteListEntry, HandleUpdateMuteListEntry);
5850 AddLocalPacketHandler(PacketType.RemoveMuteListEntry, HandleRemoveMuteListEntry);
5851 AddLocalPacketHandler(PacketType.UserReport, HandleUserReport);
5852 AddLocalPacketHandler(PacketType.FindAgent, HandleFindAgent);
5853 AddLocalPacketHandler(PacketType.TrackAgent, HandleTrackAgent);
5854 AddLocalPacketHandler(PacketType.GodUpdateRegionInfo, HandleGodUpdateRegionInfoUpdate);
5855 AddLocalPacketHandler(PacketType.GodlikeMessage, HandleGodlikeMessage);
5856 AddLocalPacketHandler(PacketType.StateSave, HandleSaveStatePacket);
5857 AddLocalPacketHandler(PacketType.GroupAccountDetailsRequest, HandleGroupAccountDetailsRequest);
5858 AddLocalPacketHandler(PacketType.GroupAccountSummaryRequest, HandleGroupAccountSummaryRequest);
5859 AddLocalPacketHandler(PacketType.GroupAccountTransactionsRequest, HandleGroupTransactionsDetailsRequest);
5860 AddLocalPacketHandler(PacketType.FreezeUser, HandleFreezeUser);
5861 AddLocalPacketHandler(PacketType.EjectUser, HandleEjectUser);
5862 AddLocalPacketHandler(PacketType.ParcelBuyPass, HandleParcelBuyPass);
5863 AddLocalPacketHandler(PacketType.ParcelGodMarkAsContent, HandleParcelGodMarkAsContent);
5864 AddLocalPacketHandler(PacketType.GroupActiveProposalsRequest, HandleGroupActiveProposalsRequest);
5865 AddLocalPacketHandler(PacketType.GroupVoteHistoryRequest, HandleGroupVoteHistoryRequest);
5866 AddLocalPacketHandler(PacketType.SimWideDeletes, HandleSimWideDeletes);
5867 AddLocalPacketHandler(PacketType.SendPostcard, HandleSendPostcard);
5868 AddLocalPacketHandler(PacketType.ChangeInventoryItemFlags, HandleChangeInventoryItemFlags);
5870 AddGenericPacketHandler(
"autopilot", HandleAutopilot);
5873 #region Packet Handlers
5875 public int TotalAgentUpdates {
get; set; }
5877 #region Scene/Avatar
5881 private const float QDELTABody = 1.0f - 0.0001f;
5882 private const float QDELTAHead = 1.0f - 0.0001f;
5884 private const float VDELTA = 0.01f;
5894 return CheckAgentMovementUpdateSignificance(x) || CheckAgentCameraUpdateSignificance(x);
5903 private bool CheckAgentMovementUpdateSignificance(AgentUpdatePacket.AgentDataBlock x)
5905 float qdelta1 = Math.Abs(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation));
5908 bool movementSignificant =
5909 (x.ControlFlags != m_thisAgentUpdateArgs.ControlFlags)
5910 || (x.ControlFlags != (byte)AgentManager.ControlFlags.NONE)
5911 || (x.Flags != m_thisAgentUpdateArgs.Flags)
5912 || (x.State != m_thisAgentUpdateArgs.State)
5913 || (qdelta1 < QDELTABody)
5916 || (Math.Abs(x.Far - m_thisAgentUpdateArgs.Far) >= 32)
5925 return movementSignificant;
5934 private bool CheckAgentCameraUpdateSignificance(AgentUpdatePacket.AgentDataBlock x)
5936 float vdelta1 = Vector3.Distance(x.CameraAtAxis, m_thisAgentUpdateArgs.CameraAtAxis);
5937 float vdelta2 = Vector3.Distance(x.CameraCenter, m_thisAgentUpdateArgs.CameraCenter);
5938 float vdelta3 = Vector3.Distance(x.CameraLeftAxis, m_thisAgentUpdateArgs.CameraLeftAxis);
5939 float vdelta4 = Vector3.Distance(x.CameraUpAxis, m_thisAgentUpdateArgs.CameraUpAxis);
5941 bool cameraSignificant =
5942 (vdelta1 > VDELTA) ||
5943 (vdelta2 > VDELTA) ||
5944 (vdelta3 > VDELTA) ||
5956 return cameraSignificant;
5959 private bool HandleAgentUpdate(
IClientAPI sender, Packet packet)
5963 AgentUpdatePacket agentUpdate = (AgentUpdatePacket)packet;
5964 AgentUpdatePacket.AgentDataBlock x = agentUpdate.AgentData;
5966 if (x.AgentID != AgentId || x.SessionID != SessionId)
5968 PacketPool.Instance.ReturnPacket(packet);
5972 TotalAgentUpdates++;
5974 bool movement = CheckAgentMovementUpdateSignificance(x);
5975 bool camera = CheckAgentCameraUpdateSignificance(x);
5980 m_thisAgentUpdateArgs.BodyRotation = x.BodyRotation;
5981 m_thisAgentUpdateArgs.ControlFlags = x.ControlFlags;
5982 m_thisAgentUpdateArgs.Far = x.Far;
5983 m_thisAgentUpdateArgs.Flags = x.Flags;
5984 m_thisAgentUpdateArgs.HeadRotation = x.HeadRotation;
5986 m_thisAgentUpdateArgs.State = x.State;
5989 UpdateAgent handlerPreAgentUpdate = OnPreAgentUpdate;
5991 if (handlerPreAgentUpdate != null)
5992 OnPreAgentUpdate(
this, m_thisAgentUpdateArgs);
5994 if (handlerAgentUpdate != null)
5995 OnAgentUpdate(
this, m_thisAgentUpdateArgs);
5997 handlerAgentUpdate = null;
5998 handlerPreAgentUpdate = null;
6004 m_thisAgentUpdateArgs.CameraAtAxis = x.CameraAtAxis;
6005 m_thisAgentUpdateArgs.CameraCenter = x.CameraCenter;
6006 m_thisAgentUpdateArgs.CameraLeftAxis = x.CameraLeftAxis;
6007 m_thisAgentUpdateArgs.CameraUpAxis = x.CameraUpAxis;
6009 UpdateAgent handlerAgentCameraUpdate = OnAgentCameraUpdate;
6011 if (handlerAgentCameraUpdate != null)
6012 handlerAgentCameraUpdate(
this, m_thisAgentUpdateArgs);
6014 handlerAgentCameraUpdate = null;
6017 PacketPool.Instance.ReturnPacket(packet);
6022 private bool HandleMoneyTransferRequest(
IClientAPI sender, Packet Pack)
6024 MoneyTransferRequestPacket
money = (MoneyTransferRequestPacket)Pack;
6026 if (money.MoneyData.SourceID == sender.
AgentId && money.AgentData.AgentID == sender.
AgentId &&
6027 money.AgentData.SessionID == sender.
SessionId)
6030 if (handlerMoneyTransferRequest != null)
6032 handlerMoneyTransferRequest(money.MoneyData.SourceID, money.MoneyData.DestID,
6033 money.MoneyData.Amount, money.MoneyData.TransactionType,
6034 Util.FieldToString(money.MoneyData.Description));
6043 private bool HandleParcelGodMarkAsContent(
IClientAPI client, Packet Packet)
6045 ParcelGodMarkAsContentPacket ParcelGodMarkAsContent =
6046 (ParcelGodMarkAsContentPacket)Packet;
6048 ParcelGodMark ParcelGodMarkAsContentHandler = OnParcelGodMark;
6049 if (ParcelGodMarkAsContentHandler != null)
6051 ParcelGodMarkAsContentHandler(
this,
6052 ParcelGodMarkAsContent.AgentData.AgentID,
6053 ParcelGodMarkAsContent.ParcelData.LocalID);
6059 private bool HandleFreezeUser(
IClientAPI client, Packet Packet)
6061 FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet;
6064 if (FreezeUserHandler != null)
6066 FreezeUserHandler(
this,
6067 FreezeUser.AgentData.AgentID,
6068 FreezeUser.Data.Flags,
6069 FreezeUser.Data.TargetID);
6075 private bool HandleEjectUser(
IClientAPI client, Packet Packet)
6077 EjectUserPacket EjectUser =
6078 (EjectUserPacket)Packet;
6081 if (EjectUserHandler != null)
6083 EjectUserHandler(
this,
6084 EjectUser.AgentData.AgentID,
6085 EjectUser.Data.Flags,
6086 EjectUser.Data.TargetID);
6092 private bool HandleParcelBuyPass(
IClientAPI client, Packet Packet)
6095 (ParcelBuyPassPacket)Packet;
6097 ParcelBuyPass ParcelBuyPassHandler = OnParcelBuyPass;
6098 if (ParcelBuyPassHandler != null)
6100 ParcelBuyPassHandler(
this,
6101 ParcelBuyPass.AgentData.AgentID,
6102 ParcelBuyPass.ParcelData.LocalID);
6108 private bool HandleParcelBuyRequest(
IClientAPI sender, Packet Pack)
6110 ParcelBuyPacket parcel = (ParcelBuyPacket)Pack;
6111 if (parcel.AgentData.AgentID == AgentId && parcel.AgentData.SessionID == SessionId)
6113 ParcelBuy handlerParcelBuy = OnParcelBuy;
6114 if (handlerParcelBuy != null)
6116 handlerParcelBuy(parcel.AgentData.AgentID, parcel.Data.GroupID, parcel.Data.Final,
6117 parcel.Data.IsGroupOwned,
6118 parcel.Data.RemoveContribution, parcel.Data.LocalID, parcel.ParcelData.Area,
6119 parcel.ParcelData.Price,
6127 private bool HandleUUIDGroupNameRequest(
IClientAPI sender, Packet Pack)
6129 UUIDGroupNameRequestPacket upack = (UUIDGroupNameRequestPacket)Pack;
6132 for (
int i = 0; i < upack.UUIDNameBlock.Length; i++)
6135 if (handlerUUIDGroupNameRequest != null)
6137 handlerUUIDGroupNameRequest(upack.UUIDNameBlock[i].ID,
this);
6146 GenericMessagePacket gmpack = (GenericMessagePacket)pack;
6147 if (m_genericPacketHandlers.Count == 0)
return false;
6148 if (gmpack.AgentData.SessionID != SessionId)
return false;
6152 string method = Util.FieldToString(gmpack.MethodData.Method).ToLower().Trim();
6154 if (m_genericPacketHandlers.TryGetValue(method, out handlerGenericMessage))
6156 List<string> msg =
new List<string>();
6157 List<byte[]> msgBytes =
new List<byte[]>();
6159 if (handlerGenericMessage != null)
6161 foreach (GenericMessagePacket.ParamListBlock block in gmpack.ParamList)
6163 msg.Add(Util.FieldToString(block.Parameter));
6164 msgBytes.Add(block.Parameter);
6168 if (OnBinaryGenericMessage != null)
6170 OnBinaryGenericMessage(
this, method, msgBytes.ToArray());
6172 handlerGenericMessage(sender, method, msg);
6178 "[LLCLIENTVIEW]: Exeception when handling generic message {0}{1}", e.Message, e.StackTrace);
6189 ObjectGroupPacket ogpack = (ObjectGroupPacket)Pack;
6190 if (ogpack.AgentData.SessionID != SessionId)
return false;
6193 if (handlerObjectGroupRequest != null)
6195 for (
int i = 0; i < ogpack.ObjectData.Length; i++)
6197 handlerObjectGroupRequest(
this, ogpack.AgentData.GroupID, ogpack.ObjectData[i].ObjectLocalID,
UUID.Zero);
6203 private bool HandleViewerEffect(
IClientAPI sender, Packet Pack)
6205 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack;
6206 if (viewer.AgentData.SessionID != SessionId)
return false;
6208 if (handlerViewerEffect != null)
6210 int length = viewer.Effect.Length;
6211 List<ViewerEffectEventHandlerArg> args =
new List<ViewerEffectEventHandlerArg>(length);
6212 for (
int i = 0; i < length; i++)
6216 argument.AgentID = viewer.Effect[i].AgentID;
6217 argument.Color = viewer.Effect[i].Color;
6218 argument.Duration = viewer.Effect[i].Duration;
6219 argument.ID = viewer.Effect[i].ID;
6220 argument.Type = viewer.Effect[i].Type;
6221 argument.TypeData = viewer.Effect[i].TypeData;
6225 handlerViewerEffect(sender, args);
6231 private bool HandleVelocityInterpolateOff(
IClientAPI sender, Packet Pack)
6233 VelocityInterpolateOffPacket p = (VelocityInterpolateOffPacket)Pack;
6234 if (p.AgentData.SessionID != SessionId ||
6235 p.AgentData.AgentID != AgentId)
6238 m_VelocityInterpolate =
false;
6242 private bool HandleVelocityInterpolateOn(
IClientAPI sender, Packet Pack)
6244 VelocityInterpolateOnPacket p = (VelocityInterpolateOnPacket)Pack;
6245 if (p.AgentData.SessionID != SessionId ||
6246 p.AgentData.AgentID != AgentId)
6249 m_VelocityInterpolate =
true;
6254 private bool HandleAvatarPropertiesRequest(
IClientAPI sender, Packet Pack)
6256 AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack;
6258 #region Packet Session and User Check
6261 if (avatarProperties.AgentData.SessionID != SessionId ||
6262 avatarProperties.AgentData.AgentID != AgentId)
6268 if (handlerRequestAvatarProperties != null)
6270 handlerRequestAvatarProperties(
this, avatarProperties.AgentData.AvatarID);
6275 private bool HandleChatFromViewer(
IClientAPI sender, Packet Pack)
6277 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
6279 #region Packet Session and User Check
6282 if (inchatpack.AgentData.SessionID != SessionId ||
6283 inchatpack.AgentData.AgentID != AgentId)
6288 string fromName = String.Empty;
6289 byte[] message = inchatpack.ChatData.Message;
6290 byte type = inchatpack.ChatData.Type;
6291 Vector3 fromPos =
new Vector3();
6294 int channel = inchatpack.ChatData.Channel;
6296 if (OnChatFromClient != null)
6299 args.Channel = channel;
6300 args.From = fromName;
6301 args.Message = Utils.BytesToString(message);
6303 args.Position = fromPos;
6307 args.SenderUUID = this.AgentId;
6309 ChatMessage handlerChatFromClient = OnChatFromClient;
6310 if (handlerChatFromClient != null)
6311 handlerChatFromClient(
this, args);
6316 private bool HandlerAvatarPropertiesUpdate(
IClientAPI sender, Packet Pack)
6318 AvatarPropertiesUpdatePacket avatarProps = (AvatarPropertiesUpdatePacket)Pack;
6320 #region Packet Session and User Check
6323 if (avatarProps.AgentData.SessionID != SessionId ||
6324 avatarProps.AgentData.AgentID != AgentId)
6330 if (handlerUpdateAvatarProperties != null)
6332 AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = avatarProps.PropertiesData;
6334 UserProfile.ID = AgentId;
6335 UserProfile.AboutText = Utils.BytesToString(Properties.AboutText);
6336 UserProfile.FirstLifeAboutText = Utils.BytesToString(Properties.FLAboutText);
6337 UserProfile.FirstLifeImage = Properties.FLImageID;
6338 UserProfile.Image = Properties.ImageID;
6339 UserProfile.ProfileUrl = Utils.BytesToString(Properties.ProfileURL);
6340 UserProfile.UserFlags &= ~3;
6341 UserProfile.UserFlags |= Properties.AllowPublish ? 1 : 0;
6342 UserProfile.UserFlags |= Properties.MaturePublish ? 2 : 0;
6344 handlerUpdateAvatarProperties(
this, UserProfile);
6349 private bool HandlerScriptDialogReply(
IClientAPI sender, Packet Pack)
6351 ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack;
6355 #region Packet Session and User Check
6358 if (rdialog.AgentData.SessionID != SessionId ||
6359 rdialog.AgentData.AgentID != AgentId)
6364 int ch = rdialog.Data.ChatChannel;
6365 byte[] msg = rdialog.Data.ButtonLabel;
6366 if (OnChatFromClient != null)
6370 args.From = String.Empty;
6371 args.Message = Utils.BytesToString(msg);
6372 args.Type = ChatTypeEnum.Region;
6373 args.Position =
new Vector3();
6376 ChatMessage handlerChatFromClient2 = OnChatFromClient;
6377 if (handlerChatFromClient2 != null)
6378 handlerChatFromClient2(
this, args);
6384 private bool HandlerImprovedInstantMessage(
IClientAPI sender, Packet Pack)
6386 ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack;
6388 #region Packet Session and User Check
6391 if (msgpack.AgentData.SessionID != SessionId ||
6392 msgpack.AgentData.AgentID != AgentId)
6397 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName);
6398 string IMmessage = Utils.BytesToString(msgpack.MessageBlock.Message);
6401 if (handlerInstantMessage != null)
6404 msgpack.AgentData.AgentID,
6406 msgpack.MessageBlock.ToAgentID,
6407 msgpack.MessageBlock.Dialog,
6408 msgpack.MessageBlock.FromGroup,
6410 msgpack.MessageBlock.ID,
6411 msgpack.MessageBlock.Offline != 0 ?
true :
false,
6412 msgpack.MessageBlock.Position,
6413 msgpack.MessageBlock.BinaryBucket,
6416 handlerInstantMessage(
this, im);
6422 private bool HandlerAcceptFriendship(
IClientAPI sender, Packet Pack)
6424 AcceptFriendshipPacket afriendpack = (AcceptFriendshipPacket)Pack;
6426 #region Packet Session and User Check
6429 if (afriendpack.AgentData.SessionID != SessionId ||
6430 afriendpack.AgentData.AgentID != AgentId)
6436 List<UUID> callingCardFolders =
new List<UUID>();
6438 UUID transactionID = afriendpack.TransactionBlock.TransactionID;
6440 for (
int fi = 0; fi < afriendpack.FolderData.Length; fi++)
6442 callingCardFolders.Add(afriendpack.FolderData[fi].FolderID);
6446 if (handlerApproveFriendRequest != null)
6448 handlerApproveFriendRequest(
this, transactionID, callingCardFolders);
6454 private bool HandlerDeclineFriendship(
IClientAPI sender, Packet Pack)
6456 DeclineFriendshipPacket dfriendpack = (DeclineFriendshipPacket)Pack;
6458 #region Packet Session and User Check
6461 if (dfriendpack.AgentData.SessionID != SessionId ||
6462 dfriendpack.AgentData.AgentID != AgentId)
6467 if (OnDenyFriendRequest != null)
6469 OnDenyFriendRequest(
this,
6470 dfriendpack.TransactionBlock.TransactionID,
6476 private bool HandlerTerminateFriendship(
IClientAPI sender, Packet Pack)
6478 TerminateFriendshipPacket tfriendpack = (TerminateFriendshipPacket)Pack;
6480 #region Packet Session and User Check
6483 if (tfriendpack.AgentData.SessionID != SessionId ||
6484 tfriendpack.AgentData.AgentID != AgentId)
6489 UUID exFriendID = tfriendpack.ExBlock.OtherID;
6491 if (TerminateFriendshipHandler != null)
6493 TerminateFriendshipHandler(
this, exFriendID);
6500 private bool HandleFindAgent(
IClientAPI client, Packet Packet)
6502 FindAgentPacket FindAgent =
6503 (FindAgentPacket)Packet;
6506 if (FindAgentHandler != null)
6508 FindAgentHandler(
this,FindAgent.AgentBlock.Hunter,FindAgent.AgentBlock.Prey);
6514 private bool HandleTrackAgent(
IClientAPI client, Packet Packet)
6516 TrackAgentPacket TrackAgent =
6517 (TrackAgentPacket)Packet;
6520 if (TrackAgentHandler != null)
6522 TrackAgentHandler(
this,
6523 TrackAgent.AgentData.AgentID,
6524 TrackAgent.TargetData.PreyID);
6530 private bool HandlerRezObject(
IClientAPI sender, Packet Pack)
6532 RezObjectPacket rezPacket = (RezObjectPacket)Pack;
6534 #region Packet Session and User Check
6537 if (rezPacket.AgentData.SessionID != SessionId ||
6538 rezPacket.AgentData.AgentID != AgentId)
6543 RezObject handlerRezObject = OnRezObject;
6544 if (handlerRezObject != null)
6546 handlerRezObject(
this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd,
6547 rezPacket.RezData.RayStart, rezPacket.RezData.RayTargetID,
6548 rezPacket.RezData.BypassRaycast, rezPacket.RezData.RayEndIsIntersection,
6549 rezPacket.RezData.RezSelected, rezPacket.RezData.RemoveItem,
6550 rezPacket.RezData.FromTaskID);
6555 private bool HandlerDeRezObject(
IClientAPI sender, Packet Pack)
6557 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)Pack;
6559 #region Packet Session and User Check
6562 if (DeRezPacket.AgentData.SessionID != SessionId ||
6563 DeRezPacket.AgentData.AgentID != AgentId)
6569 if (handlerDeRezObject != null)
6571 List<uint> deRezIDs =
new List<uint>();
6573 foreach (DeRezObjectPacket.ObjectDataBlock data in
6574 DeRezPacket.ObjectData)
6576 deRezIDs.Add(data.ObjectLocalID);
6580 handlerDeRezObject(
this, deRezIDs,
6581 DeRezPacket.AgentBlock.GroupID,
6583 DeRezPacket.AgentBlock.DestinationID);
6589 private bool HandlerRezRestoreToWorld(
IClientAPI sender, Packet Pack)
6591 RezRestoreToWorldPacket restore = (RezRestoreToWorldPacket)Pack;
6593 #region Packet Session and User Check
6596 if (restore.AgentData.SessionID != SessionId ||
6597 restore.AgentData.AgentID != AgentId)
6603 if (handlerRezRestoreToWorld != null)
6604 handlerRezRestoreToWorld(
this, restore.InventoryData.ItemID);
6609 private bool HandlerModifyLand(
IClientAPI sender, Packet Pack)
6611 ModifyLandPacket modify = (ModifyLandPacket)Pack;
6613 #region Packet Session and User Check
6616 if (modify.AgentData.SessionID != SessionId ||
6617 modify.AgentData.AgentID != AgentId)
6623 if (modify.ParcelData.Length > 0)
6627 if (OnModifyTerrain != null)
6629 for (
int i = 0; i < modify.ParcelData.Length; i++)
6632 if (handlerModifyTerrain != null)
6634 handlerModifyTerrain(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds,
6635 modify.ModifyBlock.BrushSize,
6636 modify.ModifyBlock.Action, modify.ParcelData[i].North,
6637 modify.ParcelData[i].West, modify.ParcelData[i].South,
6638 modify.ParcelData[i].East, AgentId);
6647 private bool HandlerRegionHandshakeReply(
IClientAPI sender, Packet Pack)
6649 Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply;
6650 if (handlerRegionHandShakeReply != null)
6652 handlerRegionHandShakeReply(
this);
6658 private bool HandlerAgentWearablesRequest(
IClientAPI sender, Packet Pack)
6660 GenericCall1 handlerRequestWearables = OnRequestWearables;
6662 if (handlerRequestWearables != null)
6664 handlerRequestWearables(sender);
6667 Action<IClientAPI> handlerRequestAvatarsData = OnRequestAvatarsData;
6669 if (handlerRequestAvatarsData != null)
6671 handlerRequestAvatarsData(
this);
6677 private bool HandlerAgentSetAppearance(
IClientAPI sender, Packet Pack)
6679 AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack;
6681 #region Packet Session and User Check
6684 if (appear.AgentData.SessionID != SessionId ||
6685 appear.AgentData.AgentID != AgentId)
6691 if (handlerSetAppearance != null)
6696 Vector3 avSize = appear.AgentData.Size;
6699 byte[] visualparams =
new byte[appear.VisualParam.Length];
6700 for (
int i = 0; i < appear.VisualParam.Length; i++)
6701 visualparams[i] = appear.VisualParam[i].ParamValue;
6705 if (appear.ObjectData.TextureEntry.Length > 1)
6706 te =
new Primitive.TextureEntry(appear.ObjectData.TextureEntry, 0, appear.ObjectData.TextureEntry.Length);
6709 for (
int i=0; i<appear.WearableData.Length;i++)
6711 CacheId = appear.WearableData[i].CacheID,
6712 TextureIndex=Convert.ToUInt32(appear.WearableData[i].TextureIndex)
6717 handlerSetAppearance(sender, te, visualparams,avSize, cacheitems);
6722 "[CLIENT VIEW]: AgentSetApperance packet handler threw an exception, {0}",
6730 private bool HandlerAgentIsNowWearing(
IClientAPI sender, Packet Pack)
6732 if (OnAvatarNowWearing != null)
6734 AgentIsNowWearingPacket nowWearing = (AgentIsNowWearingPacket)Pack;
6736 #region Packet Session and User Check
6739 if (nowWearing.AgentData.SessionID != SessionId ||
6740 nowWearing.AgentData.AgentID != AgentId)
6746 for (
int i = 0; i < nowWearing.WearableData.Length; i++)
6751 nowWearing.WearableData[i].WearableType);
6752 wearingArgs.NowWearing.Add(wearable);
6756 if (handlerAvatarNowWearing != null)
6758 handlerAvatarNowWearing(
this, wearingArgs);
6764 private bool HandlerRezSingleAttachmentFromInv(
IClientAPI sender, Packet Pack)
6767 if (handlerRezSingleAttachment != null)
6769 RezSingleAttachmentFromInvPacket rez = (RezSingleAttachmentFromInvPacket)Pack;
6771 #region Packet Session and User Check
6774 if (rez.AgentData.SessionID != SessionId ||
6775 rez.AgentData.AgentID != AgentId)
6780 handlerRezSingleAttachment(
this, rez.ObjectData.ItemID,
6781 rez.ObjectData.AttachmentPt);
6787 private bool HandleRezMultipleAttachmentsFromInv(
IClientAPI sender, Packet Pack)
6790 if (handlerRezMultipleAttachments != null)
6792 List<KeyValuePair<UUID, uint>> rezlist =
new List<KeyValuePair<UUID, uint>>();
6793 foreach (RezMultipleAttachmentsFromInvPacket.ObjectDataBlock obj in ((RezMultipleAttachmentsFromInvPacket)Pack).ObjectData)
6794 rezlist.Add(
new KeyValuePair<UUID, uint>(obj.ItemID, obj.AttachmentPt));
6795 handlerRezMultipleAttachments(
this, rezlist);
6801 private bool HandleDetachAttachmentIntoInv(
IClientAPI sender, Packet Pack)
6803 UUIDNameRequest handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv;
6804 if (handlerDetachAttachmentIntoInv != null)
6806 DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack;
6808 #region Packet Session and User Check
6812 UUID itemID = detachtoInv.ObjectData.ItemID;
6815 handlerDetachAttachmentIntoInv(itemID,
this);
6820 private bool HandleObjectAttach(
IClientAPI sender, Packet Pack)
6822 if (OnObjectAttach != null)
6824 ObjectAttachPacket att = (ObjectAttachPacket)Pack;
6826 #region Packet Session and User Check
6829 if (att.AgentData.SessionID != SessionId ||
6830 att.AgentData.AgentID != AgentId)
6837 if (handlerObjectAttach != null)
6839 if (att.ObjectData.Length > 0)
6841 handlerObjectAttach(
this, att.ObjectData[0].ObjectLocalID, att.AgentData.AttachmentPoint,
false);
6848 private bool HandleObjectDetach(
IClientAPI sender, Packet Pack)
6850 ObjectDetachPacket dett = (ObjectDetachPacket)Pack;
6852 #region Packet Session and User Check
6855 if (dett.AgentData.SessionID != SessionId ||
6856 dett.AgentData.AgentID != AgentId)
6861 for (
int j = 0; j < dett.ObjectData.Length; j++)
6863 uint obj = dett.ObjectData[j].ObjectLocalID;
6865 if (handlerObjectDetach != null)
6867 handlerObjectDetach(obj,
this);
6874 private bool HandleObjectDrop(
IClientAPI sender, Packet Pack)
6876 ObjectDropPacket dropp = (ObjectDropPacket)Pack;
6878 #region Packet Session and User Check
6881 if (dropp.AgentData.SessionID != SessionId ||
6882 dropp.AgentData.AgentID != AgentId)
6887 for (
int j = 0; j < dropp.ObjectData.Length; j++)
6889 uint obj = dropp.ObjectData[j].ObjectLocalID;
6891 if (handlerObjectDrop != null)
6893 handlerObjectDrop(obj,
this);
6899 private bool HandleSetAlwaysRun(
IClientAPI sender, Packet Pack)
6901 SetAlwaysRunPacket run = (SetAlwaysRunPacket)Pack;
6903 #region Packet Session and User Check
6906 if (run.AgentData.SessionID != SessionId ||
6907 run.AgentData.AgentID != AgentId)
6913 if (handlerSetAlwaysRun != null)
6914 handlerSetAlwaysRun(
this, run.AgentData.AlwaysRun);
6919 private bool HandleCompleteAgentMovement(
IClientAPI sender, Packet Pack)
6921 m_log.DebugFormat(
"[LLClientView] HandleCompleteAgentMovement");
6923 Action<IClientAPI, bool> handlerCompleteMovementToRegion = OnCompleteMovementToRegion;
6924 if (handlerCompleteMovementToRegion != null)
6926 handlerCompleteMovementToRegion(sender,
true);
6929 m_log.Debug(
"HandleCompleteAgentMovement NULL handler");
6931 handlerCompleteMovementToRegion = null;
6936 private bool HandleAgentAnimation(
IClientAPI sender, Packet Pack)
6938 AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack;
6940 #region Packet Session and User Check
6943 if (AgentAni.AgentData.SessionID != SessionId ||
6944 AgentAni.AgentData.AgentID != AgentId)
6975 for (
int i = 0; i < AgentAni.AnimationList.Length; i++)
6977 handlerChangeAnim = OnChangeAnim;
6978 if (handlerChangeAnim != null)
6980 handlerChangeAnim(AgentAni.AnimationList[i].AnimID, AgentAni.AnimationList[i].StartAnim,
false);
6984 handlerChangeAnim = OnChangeAnim;
6985 if (handlerChangeAnim != null)
6987 handlerChangeAnim(
UUID.Zero,
false,
true);
6993 private bool HandleAgentRequestSit(
IClientAPI sender, Packet Pack)
6995 if (OnAgentRequestSit != null)
6997 AgentRequestSitPacket agentRequestSit = (AgentRequestSitPacket)Pack;
6999 #region Packet Session and User Check
7002 if (agentRequestSit.AgentData.SessionID != SessionId ||
7003 agentRequestSit.AgentData.AgentID != AgentId)
7008 if (SceneAgent.IsChildAgent)
7010 SendCantSitBecauseChildAgentResponse();
7016 if (handlerAgentRequestSit != null)
7017 handlerAgentRequestSit(
this, agentRequestSit.AgentData.AgentID,
7018 agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset);
7023 private bool HandleAgentSit(
IClientAPI sender, Packet Pack)
7025 if (OnAgentSit != null)
7027 AgentSitPacket agentSit = (AgentSitPacket)Pack;
7029 #region Packet Session and User Check
7032 if (agentSit.AgentData.SessionID != SessionId ||
7033 agentSit.AgentData.AgentID != AgentId)
7038 if (SceneAgent.IsChildAgent)
7040 SendCantSitBecauseChildAgentResponse();
7044 AgentSit handlerAgentSit = OnAgentSit;
7045 if (handlerAgentSit != null)
7047 OnAgentSit(
this, agentSit.AgentData.AgentID);
7056 private void SendCantSitBecauseChildAgentResponse()
7058 SendAlertMessage(
"Try moving closer. Can't sit on object because it is not in the same region as you.");
7061 private bool HandleSoundTrigger(
IClientAPI sender, Packet Pack)
7063 SoundTriggerPacket soundTriggerPacket = (SoundTriggerPacket)Pack;
7065 #region Packet Session and User Check
7073 if (handlerSoundTrigger != null)
7076 handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, AgentId,
7078 soundTriggerPacket.SoundData.Gain, soundTriggerPacket.SoundData.Position,
7079 soundTriggerPacket.SoundData.Handle, 0);
7085 private bool HandleAvatarPickerRequest(
IClientAPI sender, Packet Pack)
7087 AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack;
7089 #region Packet Session and User Check
7092 if (avRequestQuery.AgentData.SessionID != SessionId ||
7093 avRequestQuery.AgentData.AgentID != AgentId)
7098 AvatarPickerRequestPacket.AgentDataBlock Requestdata = avRequestQuery.AgentData;
7099 AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data;
7103 if (handlerAvatarPickerRequest != null)
7105 handlerAvatarPickerRequest(
this, Requestdata.AgentID, Requestdata.QueryID,
7106 Utils.BytesToString(querydata.Name));
7111 private bool HandleAgentDataUpdateRequest(
IClientAPI sender, Packet Pack)
7113 AgentDataUpdateRequestPacket avRequestDataUpdatePacket = (AgentDataUpdateRequestPacket)Pack;
7115 #region Packet Session and User Check
7118 if (avRequestDataUpdatePacket.AgentData.SessionID != SessionId ||
7119 avRequestDataUpdatePacket.AgentData.AgentID != AgentId)
7124 FetchInventory handlerAgentDataUpdateRequest = OnAgentDataUpdateRequest;
7126 if (handlerAgentDataUpdateRequest != null)
7128 handlerAgentDataUpdateRequest(
this, avRequestDataUpdatePacket.AgentData.AgentID, avRequestDataUpdatePacket.AgentData.SessionID);
7134 private bool HandleUserInfoRequest(
IClientAPI sender, Packet Pack)
7137 if (handlerUserInfoRequest != null)
7139 handlerUserInfoRequest(
this);
7143 SendUserInfoReply(
false,
true,
"");
7149 private bool HandleUpdateUserInfo(
IClientAPI sender, Packet Pack)
7151 UpdateUserInfoPacket updateUserInfo = (UpdateUserInfoPacket)Pack;
7153 #region Packet Session and User Check
7156 if (updateUserInfo.AgentData.SessionID != SessionId ||
7157 updateUserInfo.AgentData.AgentID != AgentId)
7163 if (handlerUpdateUserInfo != null)
7165 bool visible =
true;
7166 string DirectoryVisibility =
7167 Utils.BytesToString(updateUserInfo.UserData.DirectoryVisibility);
7168 if (DirectoryVisibility ==
"hidden")
7171 handlerUpdateUserInfo(
7172 updateUserInfo.UserData.IMViaEMail,
7178 private bool HandleSetStartLocationRequest(
IClientAPI sender, Packet Pack)
7180 SetStartLocationRequestPacket avSetStartLocationRequestPacket = (SetStartLocationRequestPacket)Pack;
7182 #region Packet Session and User Check
7185 if (avSetStartLocationRequestPacket.AgentData.SessionID != SessionId ||
7186 avSetStartLocationRequestPacket.AgentData.AgentID != AgentId)
7191 if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId)
7194 if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.X == 255.5f
7195 || avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y == 255.5f)
7197 ScenePresence avatar = null;
7198 if (((
Scene)m_scene).TryGetScenePresence(AgentId, out avatar))
7200 if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.X == 255.5f)
7202 avSetStartLocationRequestPacket.StartLocationData.LocationPos.X = avatar.AbsolutePosition.X;
7204 if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y == 255.5f)
7206 avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y = avatar.AbsolutePosition.Y;
7212 if (handlerSetStartLocationRequest != null)
7214 handlerSetStartLocationRequest(
this, 0, avSetStartLocationRequestPacket.StartLocationData.LocationPos,
7215 avSetStartLocationRequestPacket.StartLocationData.LocationLookAt,
7216 avSetStartLocationRequestPacket.StartLocationData.LocationID);
7222 private bool HandleAgentThrottle(
IClientAPI sender, Packet Pack)
7224 AgentThrottlePacket atpack = (AgentThrottlePacket)Pack;
7226 #region Packet Session and User Check
7229 if (atpack.AgentData.SessionID != SessionId ||
7230 atpack.AgentData.AgentID != AgentId)
7235 m_udpClient.SetThrottles(atpack.Throttle.Throttles);
7237 if (handler != null)
7244 private bool HandleAgentPause(
IClientAPI sender, Packet Pack)
7246 m_udpClient.IsPaused =
true;
7250 private bool HandleAgentResume(
IClientAPI sender, Packet Pack)
7252 m_udpClient.IsPaused =
false;
7253 SendStartPingCheck(m_udpClient.CurrentPingSequence++);
7257 private bool HandleForceScriptControlRelease(
IClientAPI sender, Packet Pack)
7260 if (handlerForceReleaseControls != null)
7262 handlerForceReleaseControls(
this, AgentId);
7267 #endregion Scene/Avatar
7269 #region Objects/m_sceneObjects
7271 private bool HandleObjectLink(
IClientAPI sender, Packet Pack)
7273 ObjectLinkPacket link = (ObjectLinkPacket)Pack;
7275 #region Packet Session and User Check
7278 if (link.AgentData.SessionID != SessionId ||
7279 link.AgentData.AgentID != AgentId)
7284 uint parentprimid = 0;
7285 List<uint> childrenprims =
new List<uint>();
7286 if (link.ObjectData.Length > 1)
7288 parentprimid = link.ObjectData[0].ObjectLocalID;
7290 for (
int i = 1; i < link.ObjectData.Length; i++)
7292 childrenprims.Add(link.ObjectData[i].ObjectLocalID);
7296 if (handlerLinkObjects != null)
7298 handlerLinkObjects(
this, parentprimid, childrenprims);
7303 private bool HandleObjectDelink(
IClientAPI sender, Packet Pack)
7305 ObjectDelinkPacket delink = (ObjectDelinkPacket)Pack;
7307 #region Packet Session and User Check
7310 if (delink.AgentData.SessionID != SessionId ||
7311 delink.AgentData.AgentID != AgentId)
7320 List<uint> prims =
new List<uint>();
7321 for (
int i = 0; i < delink.ObjectData.Length; i++)
7323 prims.Add(delink.ObjectData[i].ObjectLocalID);
7326 if (handlerDelinkObjects != null)
7328 handlerDelinkObjects(prims,
this);
7334 private bool HandleObjectAdd(
IClientAPI sender, Packet Pack)
7336 if (OnAddPrim != null)
7338 ObjectAddPacket addPacket = (ObjectAddPacket)Pack;
7340 #region Packet Session and User Check
7343 if (addPacket.AgentData.SessionID != SessionId ||
7344 addPacket.AgentData.AgentID != AgentId)
7360 if (handlerAddPrim != null)
7361 handlerAddPrim(AgentId, ActiveGroupId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection);
7366 private bool HandleObjectShape(
IClientAPI sender, Packet Pack)
7368 ObjectShapePacket shapePacket = (ObjectShapePacket)Pack;
7370 #region Packet Session and User Check
7373 if (shapePacket.AgentData.SessionID != SessionId ||
7374 shapePacket.AgentData.AgentID != AgentId)
7380 for (
int i = 0; i < shapePacket.ObjectData.Length; i++)
7382 handlerUpdatePrimShape = OnUpdatePrimShape;
7383 if (handlerUpdatePrimShape != null)
7386 shapeData.ObjectLocalID = shapePacket.ObjectData[i].ObjectLocalID;
7387 shapeData.PathBegin = shapePacket.ObjectData[i].PathBegin;
7388 shapeData.PathCurve = shapePacket.ObjectData[i].PathCurve;
7389 shapeData.PathEnd = shapePacket.ObjectData[i].PathEnd;
7390 shapeData.PathRadiusOffset = shapePacket.ObjectData[i].PathRadiusOffset;
7391 shapeData.PathRevolutions = shapePacket.ObjectData[i].PathRevolutions;
7392 shapeData.PathScaleX = shapePacket.ObjectData[i].PathScaleX;
7393 shapeData.PathScaleY = shapePacket.ObjectData[i].PathScaleY;
7394 shapeData.PathShearX = shapePacket.ObjectData[i].PathShearX;
7395 shapeData.PathShearY = shapePacket.ObjectData[i].PathShearY;
7396 shapeData.PathSkew = shapePacket.ObjectData[i].PathSkew;
7397 shapeData.PathTaperX = shapePacket.ObjectData[i].PathTaperX;
7398 shapeData.PathTaperY = shapePacket.ObjectData[i].PathTaperY;
7399 shapeData.PathTwist = shapePacket.ObjectData[i].PathTwist;
7400 shapeData.PathTwistBegin = shapePacket.ObjectData[i].PathTwistBegin;
7401 shapeData.ProfileBegin = shapePacket.ObjectData[i].ProfileBegin;
7402 shapeData.ProfileCurve = shapePacket.ObjectData[i].ProfileCurve;
7403 shapeData.ProfileEnd = shapePacket.ObjectData[i].ProfileEnd;
7404 shapeData.ProfileHollow = shapePacket.ObjectData[i].ProfileHollow;
7406 handlerUpdatePrimShape(m_agentId, shapePacket.ObjectData[i].ObjectLocalID,
7413 private bool HandleObjectExtraParams(
IClientAPI sender, Packet Pack)
7415 ObjectExtraParamsPacket extraPar = (ObjectExtraParamsPacket)Pack;
7417 #region Packet Session and User Check
7420 if (extraPar.AgentData.SessionID != SessionId ||
7421 extraPar.AgentData.AgentID != AgentId)
7427 if (handlerUpdateExtraParams != null)
7429 for (
int i = 0; i < extraPar.ObjectData.Length; i++)
7431 handlerUpdateExtraParams(m_agentId, extraPar.ObjectData[i].ObjectLocalID,
7432 extraPar.ObjectData[i].ParamType,
7433 extraPar.ObjectData[i].ParamInUse, extraPar.ObjectData[i].ParamData);
7439 private bool HandleObjectDuplicate(
IClientAPI sender, Packet Pack)
7441 ObjectDuplicatePacket dupe = (ObjectDuplicatePacket)Pack;
7443 #region Packet Session and User Check
7446 if (dupe.AgentData.SessionID != SessionId ||
7447 dupe.AgentData.AgentID != AgentId)
7456 for (
int i = 0; i < dupe.ObjectData.Length; i++)
7458 handlerObjectDuplicate = OnObjectDuplicate;
7459 if (handlerObjectDuplicate != null)
7461 handlerObjectDuplicate(dupe.ObjectData[i].ObjectLocalID, dupe.SharedData.Offset,
7462 dupe.SharedData.DuplicateFlags, AgentId,
7470 private bool HandleRequestMultipleObjects(
IClientAPI sender, Packet Pack)
7472 RequestMultipleObjectsPacket incomingRequest = (RequestMultipleObjectsPacket)Pack;
7474 #region Packet Session and User Check
7477 if (incomingRequest.AgentData.SessionID != SessionId ||
7478 incomingRequest.AgentData.AgentID != AgentId)
7485 for (
int i = 0; i < incomingRequest.ObjectData.Length; i++)
7487 handlerObjectRequest = OnObjectRequest;
7488 if (handlerObjectRequest != null)
7490 handlerObjectRequest(incomingRequest.ObjectData[i].ID,
this);
7496 private bool HandleObjectSelect(
IClientAPI sender, Packet Pack)
7498 ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack;
7500 #region Packet Session and User Check
7503 if (incomingselect.AgentData.SessionID != SessionId ||
7504 incomingselect.AgentData.AgentID != AgentId)
7511 for (
int i = 0; i < incomingselect.ObjectData.Length; i++)
7513 if (!SelectedObjects.Contains(incomingselect.ObjectData[i].ObjectLocalID))
7514 SelectedObjects.Add(incomingselect.ObjectData[i].ObjectLocalID);
7515 handlerObjectSelect = OnObjectSelect;
7516 if (handlerObjectSelect != null)
7518 handlerObjectSelect(incomingselect.ObjectData[i].ObjectLocalID,
this);
7524 private bool HandleObjectDeselect(
IClientAPI sender, Packet Pack)
7526 ObjectDeselectPacket incomingdeselect = (ObjectDeselectPacket)Pack;
7528 #region Packet Session and User Check
7531 if (incomingdeselect.AgentData.SessionID != SessionId ||
7532 incomingdeselect.AgentData.AgentID != AgentId)
7539 for (
int i = 0; i < incomingdeselect.ObjectData.Length; i++)
7541 if (!SelectedObjects.Contains(incomingdeselect.ObjectData[i].ObjectLocalID))
7542 SelectedObjects.Add(incomingdeselect.ObjectData[i].ObjectLocalID);
7543 handlerObjectDeselect = OnObjectDeselect;
7544 if (handlerObjectDeselect != null)
7546 OnObjectDeselect(incomingdeselect.ObjectData[i].ObjectLocalID,
this);
7552 private bool HandleObjectPosition(
IClientAPI sender, Packet Pack)
7555 ObjectPositionPacket position = (ObjectPositionPacket)Pack;
7557 #region Packet Session and User Check
7560 if (position.AgentData.SessionID != SessionId ||
7561 position.AgentData.AgentID != AgentId)
7567 for (
int i = 0; i < position.ObjectData.Length; i++)
7569 UpdateVector handlerUpdateVector = OnUpdatePrimGroupPosition;
7570 if (handlerUpdateVector != null)
7571 handlerUpdateVector(position.ObjectData[i].ObjectLocalID, position.ObjectData[i].Position,
this);
7577 private bool HandleObjectScale(
IClientAPI sender, Packet Pack)
7580 ObjectScalePacket scale = (ObjectScalePacket)Pack;
7582 #region Packet Session and User Check
7585 if (scale.AgentData.SessionID != SessionId ||
7586 scale.AgentData.AgentID != AgentId)
7591 for (
int i = 0; i < scale.ObjectData.Length; i++)
7593 UpdateVector handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale;
7594 if (handlerUpdatePrimGroupScale != null)
7595 handlerUpdatePrimGroupScale(scale.ObjectData[i].ObjectLocalID, scale.ObjectData[i].Scale,
this);
7601 private bool HandleObjectRotation(
IClientAPI sender, Packet Pack)
7604 ObjectRotationPacket
rotation = (ObjectRotationPacket)Pack;
7606 #region Packet Session and User Check
7609 if (rotation.AgentData.SessionID != SessionId ||
7610 rotation.AgentData.AgentID != AgentId)
7615 for (
int i = 0; i < rotation.ObjectData.Length; i++)
7618 if (handlerUpdatePrimRotation != null)
7619 handlerUpdatePrimRotation(rotation.ObjectData[i].ObjectLocalID, rotation.ObjectData[i].Rotation,
this);
7625 private bool HandleObjectFlagUpdate(
IClientAPI sender, Packet Pack)
7627 ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack;
7629 #region Packet Session and User Check
7632 if (flags.AgentData.SessionID != SessionId ||
7633 flags.AgentData.AgentID != AgentId)
7640 if (handlerUpdatePrimFlags != null)
7652 bool UsePhysics = flags.AgentData.UsePhysics;
7653 bool IsPhantom = flags.AgentData.IsPhantom;
7654 bool IsTemporary = flags.AgentData.IsTemporary;
7655 ObjectFlagUpdatePacket.ExtraPhysicsBlock[] blocks = flags.ExtraPhysics;
7658 if (blocks == null || blocks.Length == 0)
7660 physdata.PhysShapeType = PhysShapeType.invalid;
7664 ObjectFlagUpdatePacket.ExtraPhysicsBlock phsblock = blocks[0];
7665 physdata.PhysShapeType = (
PhysShapeType)phsblock.PhysicsShapeType;
7666 physdata.
Bounce = phsblock.Restitution;
7667 physdata.
Density = phsblock.Density;
7668 physdata.
Friction = phsblock.Friction;
7672 handlerUpdatePrimFlags(flags.AgentData.ObjectLocalID, UsePhysics, IsTemporary, IsPhantom, physdata,
this);
7677 private bool HandleObjectImage(
IClientAPI sender, Packet Pack)
7679 ObjectImagePacket imagePack = (ObjectImagePacket)Pack;
7682 for (
int i = 0; i < imagePack.ObjectData.Length; i++)
7684 handlerUpdatePrimTexture = OnUpdatePrimTexture;
7685 if (handlerUpdatePrimTexture != null)
7687 handlerUpdatePrimTexture(imagePack.ObjectData[i].ObjectLocalID,
7688 imagePack.ObjectData[i].TextureEntry,
this);
7694 private bool HandleObjectGrab(
IClientAPI sender, Packet Pack)
7696 ObjectGrabPacket grab = (ObjectGrabPacket)Pack;
7698 #region Packet Session and User Check
7701 if (grab.AgentData.SessionID != SessionId ||
7702 grab.AgentData.AgentID != AgentId)
7709 if (handlerGrabObject != null)
7711 List<SurfaceTouchEventArgs> touchArgs =
new List<SurfaceTouchEventArgs>();
7712 if ((grab.SurfaceInfo != null) && (grab.SurfaceInfo.Length > 0))
7714 foreach (ObjectGrabPacket.SurfaceInfoBlock surfaceInfo in grab.SurfaceInfo)
7717 arg.Binormal = surfaceInfo.Binormal;
7718 arg.FaceIndex = surfaceInfo.FaceIndex;
7719 arg.Normal = surfaceInfo.Normal;
7720 arg.Position = surfaceInfo.Position;
7721 arg.STCoord = surfaceInfo.STCoord;
7722 arg.UVCoord = surfaceInfo.UVCoord;
7726 handlerGrabObject(grab.ObjectData.LocalID, grab.ObjectData.GrabOffset,
this, touchArgs);
7731 private bool HandleObjectGrabUpdate(
IClientAPI sender, Packet Pack)
7733 ObjectGrabUpdatePacket grabUpdate = (ObjectGrabUpdatePacket)Pack;
7735 #region Packet Session and User Check
7738 if (grabUpdate.AgentData.SessionID != SessionId ||
7739 grabUpdate.AgentData.AgentID != AgentId)
7746 if (handlerGrabUpdate != null)
7748 List<SurfaceTouchEventArgs> touchArgs =
new List<SurfaceTouchEventArgs>();
7749 if ((grabUpdate.SurfaceInfo != null) && (grabUpdate.SurfaceInfo.Length > 0))
7751 foreach (ObjectGrabUpdatePacket.SurfaceInfoBlock surfaceInfo in grabUpdate.SurfaceInfo)
7754 arg.Binormal = surfaceInfo.Binormal;
7755 arg.FaceIndex = surfaceInfo.FaceIndex;
7756 arg.Normal = surfaceInfo.Normal;
7757 arg.Position = surfaceInfo.Position;
7758 arg.STCoord = surfaceInfo.STCoord;
7759 arg.UVCoord = surfaceInfo.UVCoord;
7763 handlerGrabUpdate(grabUpdate.ObjectData.ObjectID, grabUpdate.ObjectData.GrabOffsetInitial,
7764 grabUpdate.ObjectData.GrabPosition,
this, touchArgs);
7769 private bool HandleObjectDeGrab(
IClientAPI sender, Packet Pack)
7771 ObjectDeGrabPacket deGrab = (ObjectDeGrabPacket)Pack;
7773 #region Packet Session and User Check
7776 if (deGrab.AgentData.SessionID != SessionId ||
7777 deGrab.AgentData.AgentID != AgentId)
7783 if (handlerDeGrabObject != null)
7785 List<SurfaceTouchEventArgs> touchArgs =
new List<SurfaceTouchEventArgs>();
7786 if ((deGrab.SurfaceInfo != null) && (deGrab.SurfaceInfo.Length > 0))
7788 foreach (ObjectDeGrabPacket.SurfaceInfoBlock surfaceInfo in deGrab.SurfaceInfo)
7791 arg.Binormal = surfaceInfo.Binormal;
7792 arg.FaceIndex = surfaceInfo.FaceIndex;
7793 arg.Normal = surfaceInfo.Normal;
7794 arg.Position = surfaceInfo.Position;
7795 arg.STCoord = surfaceInfo.STCoord;
7796 arg.UVCoord = surfaceInfo.UVCoord;
7800 handlerDeGrabObject(deGrab.ObjectData.LocalID,
this, touchArgs);
7805 private bool HandleObjectSpinStart(
IClientAPI sender, Packet Pack)
7808 ObjectSpinStartPacket spinStart = (ObjectSpinStartPacket)Pack;
7810 #region Packet Session and User Check
7813 if (spinStart.AgentData.SessionID != SessionId ||
7814 spinStart.AgentData.AgentID != AgentId)
7819 SpinStart handlerSpinStart = OnSpinStart;
7820 if (handlerSpinStart != null)
7822 handlerSpinStart(spinStart.ObjectData.ObjectID,
this);
7827 private bool HandleObjectSpinUpdate(
IClientAPI sender, Packet Pack)
7830 ObjectSpinUpdatePacket spinUpdate = (ObjectSpinUpdatePacket)Pack;
7832 #region Packet Session and User Check
7835 if (spinUpdate.AgentData.SessionID != SessionId ||
7836 spinUpdate.AgentData.AgentID != AgentId)
7843 spinUpdate.ObjectData.Rotation.GetAxisAngle(out axis, out angle);
7847 if (handlerSpinUpdate != null)
7849 handlerSpinUpdate(spinUpdate.ObjectData.ObjectID, spinUpdate.ObjectData.Rotation,
this);
7854 private bool HandleObjectSpinStop(
IClientAPI sender, Packet Pack)
7857 ObjectSpinStopPacket spinStop = (ObjectSpinStopPacket)Pack;
7859 #region Packet Session and User Check
7862 if (spinStop.AgentData.SessionID != SessionId ||
7863 spinStop.AgentData.AgentID != AgentId)
7868 SpinStop handlerSpinStop = OnSpinStop;
7869 if (handlerSpinStop != null)
7871 handlerSpinStop(spinStop.ObjectData.ObjectID,
this);
7876 private bool HandleObjectDescription(
IClientAPI sender, Packet Pack)
7878 ObjectDescriptionPacket objDes = (ObjectDescriptionPacket)Pack;
7880 #region Packet Session and User Check
7883 if (objDes.AgentData.SessionID != SessionId ||
7884 objDes.AgentData.AgentID != AgentId)
7891 for (
int i = 0; i < objDes.ObjectData.Length; i++)
7893 handlerObjectDescription = OnObjectDescription;
7894 if (handlerObjectDescription != null)
7896 handlerObjectDescription(
this, objDes.ObjectData[i].LocalID,
7897 Util.FieldToString(objDes.ObjectData[i].Description));
7903 private bool HandleObjectName(
IClientAPI sender, Packet Pack)
7905 ObjectNamePacket objName = (ObjectNamePacket)Pack;
7907 #region Packet Session and User Check
7910 if (objName.AgentData.SessionID != SessionId ||
7911 objName.AgentData.AgentID != AgentId)
7917 for (
int i = 0; i < objName.ObjectData.Length; i++)
7919 handlerObjectName = OnObjectName;
7920 if (handlerObjectName != null)
7922 handlerObjectName(
this, objName.ObjectData[i].LocalID,
7923 Util.FieldToString(objName.ObjectData[i].Name));
7929 private bool HandleObjectPermissions(
IClientAPI sender, Packet Pack)
7931 if (OnObjectPermissions != null)
7933 ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket)Pack;
7935 #region Packet Session and User Check
7938 if (newobjPerms.AgentData.SessionID != SessionId ||
7939 newobjPerms.AgentData.AgentID != AgentId)
7944 UUID AgentID = newobjPerms.AgentData.AgentID;
7945 UUID SessionID = newobjPerms.AgentData.SessionID;
7949 for (
int i = 0; i < newobjPerms.ObjectData.Length; i++)
7951 ObjectPermissionsPacket.ObjectDataBlock permChanges = newobjPerms.ObjectData[i];
7953 byte field = permChanges.Field;
7954 uint localID = permChanges.ObjectLocalID;
7955 uint mask = permChanges.Mask;
7956 byte set = permChanges.Set;
7958 handlerObjectPermissions = OnObjectPermissions;
7960 if (handlerObjectPermissions != null)
7961 handlerObjectPermissions(
this, AgentID, SessionID, field, localID, mask, set);
7980 private bool HandleUndo(
IClientAPI sender, Packet Pack)
7982 UndoPacket undoitem = (UndoPacket)Pack;
7984 #region Packet Session and User Check
7987 if (undoitem.AgentData.SessionID != SessionId ||
7988 undoitem.AgentData.AgentID != AgentId)
7993 if (undoitem.ObjectData.Length > 0)
7995 for (
int i = 0; i < undoitem.ObjectData.Length; i++)
7997 UUID objiD = undoitem.ObjectData[i].ObjectID;
7999 if (handlerOnUndo != null)
8001 handlerOnUndo(
this, objiD);
8009 private bool HandleLandUndo(
IClientAPI sender, Packet Pack)
8011 UndoLandPacket undolanditem = (UndoLandPacket)Pack;
8013 #region Packet Session and User Check
8016 if (undolanditem.AgentData.SessionID != SessionId ||
8017 undolanditem.AgentData.AgentID != AgentId)
8022 LandUndo handlerOnUndo = OnLandUndo;
8023 if (handlerOnUndo != null)
8025 handlerOnUndo(
this);
8030 private bool HandleRedo(
IClientAPI sender, Packet Pack)
8032 RedoPacket redoitem = (RedoPacket)Pack;
8034 #region Packet Session and User Check
8037 if (redoitem.AgentData.SessionID != SessionId ||
8038 redoitem.AgentData.AgentID != AgentId)
8043 if (redoitem.ObjectData.Length > 0)
8045 for (
int i = 0; i < redoitem.ObjectData.Length; i++)
8047 UUID objiD = redoitem.ObjectData[i].ObjectID;
8049 if (handlerOnRedo != null)
8051 handlerOnRedo(
this, objiD);
8059 private bool HandleObjectDuplicateOnRay(
IClientAPI sender, Packet Pack)
8061 ObjectDuplicateOnRayPacket dupeOnRay = (ObjectDuplicateOnRayPacket)Pack;
8063 #region Packet Session and User Check
8066 if (dupeOnRay.AgentData.SessionID != SessionId ||
8067 dupeOnRay.AgentData.AgentID != AgentId)
8074 for (
int i = 0; i < dupeOnRay.ObjectData.Length; i++)
8076 handlerObjectDuplicateOnRay = OnObjectDuplicateOnRay;
8077 if (handlerObjectDuplicateOnRay != null)
8079 handlerObjectDuplicateOnRay(dupeOnRay.ObjectData[i].ObjectLocalID, dupeOnRay.AgentData.DuplicateFlags,
8080 AgentId, ActiveGroupId, dupeOnRay.AgentData.RayTargetID, dupeOnRay.AgentData.RayEnd,
8081 dupeOnRay.AgentData.RayStart, dupeOnRay.AgentData.BypassRaycast, dupeOnRay.AgentData.RayEndIsIntersection,
8082 dupeOnRay.AgentData.CopyCenters, dupeOnRay.AgentData.CopyRotates);
8089 private bool HandleRequestObjectPropertiesFamily(
IClientAPI sender, Packet Pack)
8092 RequestObjectPropertiesFamilyPacket packToolTip = (RequestObjectPropertiesFamilyPacket)Pack;
8094 #region Packet Session and User Check
8097 if (packToolTip.AgentData.SessionID != SessionId ||
8098 packToolTip.AgentData.AgentID != AgentId)
8103 RequestObjectPropertiesFamilyPacket.ObjectDataBlock packObjBlock = packToolTip.ObjectData;
8107 if (handlerRequestObjectPropertiesFamily != null)
8109 handlerRequestObjectPropertiesFamily(
this, m_agentId, packObjBlock.RequestFlags,
8110 packObjBlock.ObjectID);
8116 private bool HandleObjectIncludeInSearch(
IClientAPI sender, Packet Pack)
8119 ObjectIncludeInSearchPacket packInSearch = (ObjectIncludeInSearchPacket)Pack;
8122 #region Packet Session and User Check
8125 if (packInSearch.AgentData.SessionID != SessionId ||
8126 packInSearch.AgentData.AgentID != AgentId)
8131 foreach (ObjectIncludeInSearchPacket.ObjectDataBlock objData in packInSearch.ObjectData)
8133 bool inSearch = objData.IncludeInSearch;
8134 uint localID = objData.ObjectLocalID;
8136 handlerObjectIncludeInSearch = OnObjectIncludeInSearch;
8138 if (handlerObjectIncludeInSearch != null)
8140 handlerObjectIncludeInSearch(
this, inSearch, localID);
8146 private bool HandleScriptAnswerYes(
IClientAPI sender, Packet Pack)
8148 ScriptAnswerYesPacket scriptAnswer = (ScriptAnswerYesPacket)Pack;
8150 #region Packet Session and User Check
8153 if (scriptAnswer.AgentData.SessionID != SessionId ||
8154 scriptAnswer.AgentData.AgentID != AgentId)
8160 if (handlerScriptAnswer != null)
8162 handlerScriptAnswer(
this, scriptAnswer.Data.TaskID, scriptAnswer.Data.ItemID, scriptAnswer.Data.Questions);
8167 private bool HandleObjectClickAction(
IClientAPI sender, Packet Pack)
8169 ObjectClickActionPacket ocpacket = (ObjectClickActionPacket)Pack;
8171 #region Packet Session and User Check
8174 if (ocpacket.AgentData.SessionID != SessionId ||
8175 ocpacket.AgentData.AgentID != AgentId)
8180 GenericCall7 handlerObjectClickAction = OnObjectClickAction;
8181 if (handlerObjectClickAction != null)
8183 foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData)
8185 byte action = odata.ClickAction;
8186 uint localID = odata.ObjectLocalID;
8187 handlerObjectClickAction(
this, localID, action.ToString());
8193 private bool HandleObjectMaterial(
IClientAPI sender, Packet Pack)
8195 ObjectMaterialPacket ompacket = (ObjectMaterialPacket)Pack;
8197 #region Packet Session and User Check
8200 if (ompacket.AgentData.SessionID != SessionId ||
8201 ompacket.AgentData.AgentID != AgentId)
8207 if (handlerObjectMaterial != null)
8209 foreach (ObjectMaterialPacket.ObjectDataBlock odata in ompacket.ObjectData)
8212 uint localID = odata.ObjectLocalID;
8213 handlerObjectMaterial(
this, localID, material.ToString());
8219 #endregion Objects/m_sceneObjects
8221 #region Inventory/Asset/Other related packets
8223 private bool HandleRequestImage(
IClientAPI sender, Packet Pack)
8225 RequestImagePacket imageRequest = (RequestImagePacket)Pack;
8228 #region Packet Session and User Check
8231 if (imageRequest.AgentData.SessionID != SessionId ||
8232 imageRequest.AgentData.AgentID != AgentId)
8238 for (
int i = 0; i < imageRequest.RequestImage.Length; i++)
8242 RequestImagePacket.RequestImageBlock block = imageRequest.RequestImage[i];
8244 args.RequestedAssetID = block.Image;
8245 args.DiscardLevel = block.DiscardLevel;
8246 args.PacketNumber = block.Packet;
8247 args.Priority = block.DownloadPriority;
8248 args.requestSequence = imageRequest.Header.Sequence;
8253 if ((ImageType)block.Type == ImageType.Baked)
8254 args.Priority *= 2.0f;
8255 int wearableout = 0;
8257 ImageManager.EnqueueReq(args);
8270 private bool HandleTransferRequest(
IClientAPI sender, Packet Pack)
8274 TransferRequestPacket transfer = (TransferRequestPacket)Pack;
8275 UUID taskID = UUID.Zero;
8276 if (transfer.TransferInfo.SourceType == (
int)SourceType.SimInventoryItem)
8278 if (!(((
Scene)m_scene).Permissions.BypassPermissions()))
8281 Util.FireAndForget(delegate
8284 HandleSimInventoryTransferRequestWithPermsCheck(sender, transfer);
8285 }, null,
"LLClientView.HandleTransferRequest");
8290 else if (transfer.TransferInfo.SourceType == (
int)SourceType.SimEstate)
8294 taskID = m_scene.RegionInfo.RegionSettings.Covenant;
8298 MakeAssetRequest(transfer, taskID);
8303 private void HandleSimInventoryTransferRequestWithPermsCheck(
IClientAPI sender, TransferRequestPacket transfer)
8305 UUID taskID =
new UUID(transfer.TransferInfo.Params, 48);
8306 UUID itemID =
new UUID(transfer.TransferInfo.Params, 64);
8307 UUID requestID =
new UUID(transfer.TransferInfo.Params, 80);
8317 if (taskID !=
UUID.Zero)
8319 SceneObjectPart part = ((
Scene)m_scene).GetSceneObjectPart(taskID);
8324 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist",
8325 Name, requestID, itemID, taskID);
8333 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item does not exist",
8334 Name, requestID, itemID, taskID);
8338 if (tii.
Type == (
int)AssetType.LSLText)
8340 if (!((
Scene)m_scene).Permissions.CanEditScript(itemID, taskID, AgentId))
8343 else if (tii.
Type == (
int)AssetType.Notecard)
8345 if (!((
Scene)m_scene).Permissions.CanEditNotecard(itemID, taskID, AgentId))
8355 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the prim is owned by {4}",
8356 Name, requestID, itemID, taskID, part.OwnerID);
8360 if ((part.
OwnerMask & (uint)PermissionMask.Modify) == 0)
8363 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set",
8364 Name, requestID, itemID, taskID);
8371 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}",
8372 Name, requestID, itemID, taskID, tii.OwnerID);
8381 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer",
8382 Name, requestID, itemID, taskID);
8389 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}",
8390 Name, requestID, itemID, taskID, tii.AssetID);
8398 if (invAccess != null)
8410 MakeAssetRequest(transfer, taskID);
8415 private bool HandleAssetUploadRequest(
IClientAPI sender, Packet Pack)
8417 AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
8421 UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId);
8425 if (handlerAssetUploadRequest != null)
8427 handlerAssetUploadRequest(
this, temp,
8428 request.AssetBlock.TransactionID, request.AssetBlock.Type,
8429 request.AssetBlock.AssetData, request.AssetBlock.StoreLocal,
8430 request.AssetBlock.Tempfile);
8435 private bool HandleRequestXfer(
IClientAPI sender, Packet Pack)
8437 RequestXferPacket xferReq = (RequestXferPacket)Pack;
8441 if (handlerRequestXfer != null)
8443 handlerRequestXfer(
this, xferReq.XferID.ID, Util.FieldToString(xferReq.XferID.Filename));
8448 private bool HandleSendXferPacket(
IClientAPI sender, Packet Pack)
8450 SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack;
8453 if (handlerXferReceive != null)
8455 handlerXferReceive(
this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data);
8460 private bool HandleConfirmXferPacket(
IClientAPI sender, Packet Pack)
8462 ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack;
8465 if (handlerConfirmXfer != null)
8467 handlerConfirmXfer(
this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet);
8472 private bool HandleAbortXfer(
IClientAPI sender, Packet Pack)
8474 AbortXferPacket abortXfer = (AbortXferPacket)Pack;
8475 AbortXfer handlerAbortXfer = OnAbortXfer;
8476 if (handlerAbortXfer != null)
8478 handlerAbortXfer(
this, abortXfer.XferID.ID);
8484 private bool HandleCreateInventoryFolder(
IClientAPI sender, Packet Pack)
8486 CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack;
8488 #region Packet Session and User Check
8491 if (invFolder.AgentData.SessionID != SessionId ||
8492 invFolder.AgentData.AgentID != AgentId)
8498 if (handlerCreateInventoryFolder != null)
8500 handlerCreateInventoryFolder(
this, invFolder.FolderData.FolderID,
8501 (ushort)invFolder.FolderData.Type,
8502 Util.FieldToString(invFolder.FolderData.Name),
8503 invFolder.FolderData.ParentID);
8508 private bool HandleUpdateInventoryFolder(
IClientAPI sender, Packet Pack)
8510 if (OnUpdateInventoryFolder != null)
8512 UpdateInventoryFolderPacket invFolderx = (UpdateInventoryFolderPacket)Pack;
8514 #region Packet Session and User Check
8517 if (invFolderx.AgentData.SessionID != SessionId ||
8518 invFolderx.AgentData.AgentID != AgentId)
8525 for (
int i = 0; i < invFolderx.FolderData.Length; i++)
8527 handlerUpdateInventoryFolder = OnUpdateInventoryFolder;
8528 if (handlerUpdateInventoryFolder != null)
8530 OnUpdateInventoryFolder(
this, invFolderx.FolderData[i].FolderID,
8531 (ushort)invFolderx.FolderData[i].Type,
8532 Util.FieldToString(invFolderx.FolderData[i].Name),
8533 invFolderx.FolderData[i].ParentID);
8540 private bool HandleMoveInventoryFolder(
IClientAPI sender, Packet Pack)
8542 if (OnMoveInventoryFolder != null)
8544 MoveInventoryFolderPacket invFoldery = (MoveInventoryFolderPacket)Pack;
8546 #region Packet Session and User Check
8549 if (invFoldery.AgentData.SessionID != SessionId ||
8550 invFoldery.AgentData.AgentID != AgentId)
8557 for (
int i = 0; i < invFoldery.InventoryData.Length; i++)
8559 handlerMoveInventoryFolder = OnMoveInventoryFolder;
8560 if (handlerMoveInventoryFolder != null)
8562 OnMoveInventoryFolder(
this, invFoldery.InventoryData[i].FolderID,
8563 invFoldery.InventoryData[i].ParentID);
8570 private bool HandleCreateInventoryItem(
IClientAPI sender, Packet Pack)
8572 CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack;
8574 #region Packet Session and User Check
8577 if (createItem.AgentData.SessionID != SessionId ||
8578 createItem.AgentData.AgentID != AgentId)
8584 if (handlerCreateNewInventoryItem != null)
8586 handlerCreateNewInventoryItem(
this, createItem.InventoryBlock.TransactionID,
8587 createItem.InventoryBlock.FolderID,
8588 createItem.InventoryBlock.CallbackID,
8589 Util.FieldToString(createItem.InventoryBlock.Description),
8590 Util.FieldToString(createItem.InventoryBlock.Name),
8591 createItem.InventoryBlock.InvType,
8592 createItem.InventoryBlock.Type,
8593 createItem.InventoryBlock.WearableType,
8594 createItem.InventoryBlock.NextOwnerMask,
8595 Util.UnixTimeSinceEpoch());
8600 private bool HandleLinkInventoryItem(
IClientAPI sender, Packet Pack)
8602 LinkInventoryItemPacket createLink = (LinkInventoryItemPacket)Pack;
8604 #region Packet Session and User Check
8607 if (createLink.AgentData.SessionID != SessionId ||
8608 createLink.AgentData.AgentID != AgentId)
8615 if (linkInventoryItem != null)
8619 createLink.InventoryBlock.TransactionID,
8620 createLink.InventoryBlock.FolderID,
8621 createLink.InventoryBlock.CallbackID,
8622 Util.FieldToString(createLink.InventoryBlock.Description),
8623 Util.FieldToString(createLink.InventoryBlock.Name),
8624 createLink.InventoryBlock.InvType,
8625 createLink.InventoryBlock.Type,
8626 createLink.InventoryBlock.OldItemID);
8632 private bool HandleFetchInventory(
IClientAPI sender, Packet Pack)
8634 if (OnFetchInventory != null)
8636 FetchInventoryPacket FetchInventoryx = (FetchInventoryPacket)Pack;
8638 #region Packet Session and User Check
8641 if (FetchInventoryx.AgentData.SessionID != SessionId ||
8642 FetchInventoryx.AgentData.AgentID != AgentId)
8649 for (
int i = 0; i < FetchInventoryx.InventoryData.Length; i++)
8651 handlerFetchInventory = OnFetchInventory;
8653 if (handlerFetchInventory != null)
8655 OnFetchInventory(
this, FetchInventoryx.InventoryData[i].ItemID,
8656 FetchInventoryx.InventoryData[i].OwnerID);
8663 private bool HandleFetchInventoryDescendents(
IClientAPI sender, Packet Pack)
8665 FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack;
8667 #region Packet Session and User Check
8670 if (Fetch.AgentData.SessionID != SessionId ||
8671 Fetch.AgentData.AgentID != AgentId)
8677 if (handlerFetchInventoryDescendents != null)
8679 handlerFetchInventoryDescendents(
this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID,
8680 Fetch.InventoryData.FetchFolders, Fetch.InventoryData.FetchItems,
8681 Fetch.InventoryData.SortOrder);
8686 private bool HandlePurgeInventoryDescendents(
IClientAPI sender, Packet Pack)
8688 PurgeInventoryDescendentsPacket Purge = (PurgeInventoryDescendentsPacket)Pack;
8690 #region Packet Session and User Check
8693 if (Purge.AgentData.SessionID != SessionId ||
8694 Purge.AgentData.AgentID != AgentId)
8700 if (handlerPurgeInventoryDescendents != null)
8702 handlerPurgeInventoryDescendents(
this, Purge.InventoryData.FolderID);
8707 private bool HandleUpdateInventoryItem(
IClientAPI sender, Packet Pack)
8709 UpdateInventoryItemPacket inventoryItemUpdate = (UpdateInventoryItemPacket)Pack;
8711 #region Packet Session and User Check
8714 if (inventoryItemUpdate.AgentData.SessionID != SessionId ||
8715 inventoryItemUpdate.AgentData.AgentID != AgentId)
8720 if (OnUpdateInventoryItem != null)
8723 for (
int i = 0; i < inventoryItemUpdate.InventoryData.Length; i++)
8725 handlerUpdateInventoryItem = OnUpdateInventoryItem;
8727 if (handlerUpdateInventoryItem != null)
8730 itemUpd.ID = inventoryItemUpdate.InventoryData[i].ItemID;
8731 itemUpd.Name = Util.FieldToString(inventoryItemUpdate.InventoryData[i].Name);
8732 itemUpd.Description = Util.FieldToString(inventoryItemUpdate.InventoryData[i].Description);
8733 itemUpd.GroupID = inventoryItemUpdate.InventoryData[i].GroupID;
8734 itemUpd.GroupOwned = inventoryItemUpdate.InventoryData[i].GroupOwned;
8735 itemUpd.GroupPermissions = inventoryItemUpdate.InventoryData[i].GroupMask;
8736 itemUpd.NextPermissions = inventoryItemUpdate.InventoryData[i].NextOwnerMask;
8737 itemUpd.EveryOnePermissions = inventoryItemUpdate.InventoryData[i].EveryoneMask;
8738 itemUpd.CreationDate = inventoryItemUpdate.InventoryData[i].CreationDate;
8739 itemUpd.Folder = inventoryItemUpdate.InventoryData[i].FolderID;
8740 itemUpd.InvType = inventoryItemUpdate.InventoryData[i].InvType;
8741 itemUpd.SalePrice = inventoryItemUpdate.InventoryData[i].SalePrice;
8742 itemUpd.SaleType = inventoryItemUpdate.InventoryData[i].SaleType;
8743 itemUpd.Flags = inventoryItemUpdate.InventoryData[i].Flags;
8745 OnUpdateInventoryItem(
this, inventoryItemUpdate.InventoryData[i].TransactionID,
8746 inventoryItemUpdate.InventoryData[i].ItemID,
8754 private bool HandleCopyInventoryItem(
IClientAPI sender, Packet Pack)
8756 CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket)Pack;
8758 #region Packet Session and User Check
8761 if (copyitem.AgentData.SessionID != SessionId ||
8762 copyitem.AgentData.AgentID != AgentId)
8768 if (OnCopyInventoryItem != null)
8770 foreach (CopyInventoryItemPacket.InventoryDataBlock datablock in copyitem.InventoryData)
8772 handlerCopyInventoryItem = OnCopyInventoryItem;
8773 if (handlerCopyInventoryItem != null)
8775 handlerCopyInventoryItem(
this, datablock.CallbackID, datablock.OldAgentID,
8776 datablock.OldItemID, datablock.NewFolderID,
8777 Util.FieldToString(datablock.NewName));
8784 private bool HandleMoveInventoryItem(
IClientAPI sender, Packet Pack)
8786 MoveInventoryItemPacket moveitem = (MoveInventoryItemPacket)Pack;
8788 #region Packet Session and User Check
8791 if (moveitem.AgentData.SessionID != SessionId ||
8792 moveitem.AgentData.AgentID != AgentId)
8797 if (OnMoveInventoryItem != null)
8801 List<InventoryItemBase> items =
new List<InventoryItemBase>();
8802 foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData)
8805 itm.Folder = datablock.FolderID;
8806 itm.Name = Util.FieldToString(datablock.NewName);
8811 handlerMoveInventoryItem = OnMoveInventoryItem;
8812 if (handlerMoveInventoryItem != null)
8814 handlerMoveInventoryItem(
this, items);
8820 private bool HandleRemoveInventoryItem(
IClientAPI sender, Packet Pack)
8822 RemoveInventoryItemPacket removeItem = (RemoveInventoryItemPacket)Pack;
8824 #region Packet Session and User Check
8827 if (removeItem.AgentData.SessionID != SessionId ||
8828 removeItem.AgentData.AgentID != AgentId)
8833 if (OnRemoveInventoryItem != null)
8836 List<UUID> uuids =
new List<UUID>();
8837 foreach (RemoveInventoryItemPacket.InventoryDataBlock datablock in removeItem.InventoryData)
8839 uuids.Add(datablock.ItemID);
8841 handlerRemoveInventoryItem = OnRemoveInventoryItem;
8842 if (handlerRemoveInventoryItem != null)
8844 handlerRemoveInventoryItem(
this, uuids);
8851 private bool HandleRemoveInventoryFolder(
IClientAPI sender, Packet Pack)
8853 RemoveInventoryFolderPacket removeFolder = (RemoveInventoryFolderPacket)Pack;
8855 #region Packet Session and User Check
8858 if (removeFolder.AgentData.SessionID != SessionId ||
8859 removeFolder.AgentData.AgentID != AgentId)
8864 if (OnRemoveInventoryFolder != null)
8867 List<UUID> uuids =
new List<UUID>();
8868 foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData)
8870 uuids.Add(datablock.FolderID);
8872 handlerRemoveInventoryFolder = OnRemoveInventoryFolder;
8873 if (handlerRemoveInventoryFolder != null)
8875 handlerRemoveInventoryFolder(
this, uuids);
8881 private bool HandleRemoveInventoryObjects(
IClientAPI sender, Packet Pack)
8883 RemoveInventoryObjectsPacket removeObject = (RemoveInventoryObjectsPacket)Pack;
8884 #region Packet Session and User Check
8887 if (removeObject.AgentData.SessionID != SessionId ||
8888 removeObject.AgentData.AgentID != AgentId)
8892 if (OnRemoveInventoryFolder != null)
8895 List<UUID> uuids =
new List<UUID>();
8896 foreach (RemoveInventoryObjectsPacket.FolderDataBlock datablock in removeObject.FolderData)
8898 uuids.Add(datablock.FolderID);
8900 handlerRemoveInventoryFolder = OnRemoveInventoryFolder;
8901 if (handlerRemoveInventoryFolder != null)
8903 handlerRemoveInventoryFolder(
this, uuids);
8907 if (OnRemoveInventoryItem != null)
8910 List<UUID> uuids =
new List<UUID>();
8911 foreach (RemoveInventoryObjectsPacket.ItemDataBlock datablock in removeObject.ItemData)
8913 uuids.Add(datablock.ItemID);
8915 handlerRemoveInventoryItem = OnRemoveInventoryItem;
8916 if (handlerRemoveInventoryItem != null)
8918 handlerRemoveInventoryItem(
this, uuids);
8924 private bool HandleRequestTaskInventory(
IClientAPI sender, Packet Pack)
8926 RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack;
8928 #region Packet Session and User Check
8931 if (requesttask.AgentData.SessionID != SessionId ||
8932 requesttask.AgentData.AgentID != AgentId)
8938 if (handlerRequestTaskInventory != null)
8940 handlerRequestTaskInventory(
this, requesttask.InventoryData.LocalID);
8945 private bool HandleUpdateTaskInventory(
IClientAPI sender, Packet Pack)
8947 UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack;
8949 #region Packet Session and User Check
8952 if (updatetask.AgentData.SessionID != SessionId ||
8953 updatetask.AgentData.AgentID != AgentId)
8958 if (OnUpdateTaskInventory != null)
8960 if (updatetask.UpdateData.Key == 0)
8963 if (handlerUpdateTaskInventory != null)
8966 newTaskItem.ItemID = updatetask.InventoryData.ItemID;
8967 newTaskItem.ParentID = updatetask.InventoryData.FolderID;
8968 newTaskItem.CreatorID = updatetask.InventoryData.CreatorID;
8969 newTaskItem.OwnerID = updatetask.InventoryData.OwnerID;
8970 newTaskItem.GroupID = updatetask.InventoryData.GroupID;
8971 newTaskItem.BasePermissions = updatetask.InventoryData.BaseMask;
8972 newTaskItem.CurrentPermissions = updatetask.InventoryData.OwnerMask;
8973 newTaskItem.GroupPermissions = updatetask.InventoryData.GroupMask;
8974 newTaskItem.EveryonePermissions = updatetask.InventoryData.EveryoneMask;
8975 newTaskItem.NextPermissions = updatetask.InventoryData.NextOwnerMask;
8980 newTaskItem.Type = updatetask.InventoryData.Type;
8981 newTaskItem.InvType = updatetask.InventoryData.InvType;
8982 newTaskItem.Flags = updatetask.InventoryData.Flags;
8985 newTaskItem.Name = Util.FieldToString(updatetask.InventoryData.Name);
8986 newTaskItem.Description = Util.FieldToString(updatetask.InventoryData.Description);
8987 newTaskItem.CreationDate = (uint)updatetask.InventoryData.CreationDate;
8988 handlerUpdateTaskInventory(
this, updatetask.InventoryData.TransactionID,
8989 newTaskItem, updatetask.UpdateData.LocalID);
8997 private bool HandleRemoveTaskInventory(
IClientAPI sender, Packet Pack)
8999 RemoveTaskInventoryPacket removeTask = (RemoveTaskInventoryPacket)Pack;
9001 #region Packet Session and User Check
9004 if (removeTask.AgentData.SessionID != SessionId ||
9005 removeTask.AgentData.AgentID != AgentId)
9012 if (handlerRemoveTaskItem != null)
9014 handlerRemoveTaskItem(
this, removeTask.InventoryData.ItemID, removeTask.InventoryData.LocalID);
9020 private bool HandleMoveTaskInventory(
IClientAPI sender, Packet Pack)
9022 MoveTaskInventoryPacket moveTaskInventoryPacket = (MoveTaskInventoryPacket)Pack;
9024 #region Packet Session and User Check
9027 if (moveTaskInventoryPacket.AgentData.SessionID != SessionId ||
9028 moveTaskInventoryPacket.AgentData.AgentID != AgentId)
9035 if (handlerMoveTaskItem != null)
9037 handlerMoveTaskItem(
9038 this, moveTaskInventoryPacket.AgentData.FolderID,
9039 moveTaskInventoryPacket.InventoryData.LocalID,
9040 moveTaskInventoryPacket.InventoryData.ItemID);
9046 private bool HandleRezScript(
IClientAPI sender, Packet Pack)
9049 RezScriptPacket rezScriptx = (RezScriptPacket)Pack;
9051 #region Packet Session and User Check
9054 if (rezScriptx.AgentData.SessionID != SessionId ||
9055 rezScriptx.AgentData.AgentID != AgentId)
9060 RezScript handlerRezScript = OnRezScript;
9062 item.ID = rezScriptx.InventoryBlock.ItemID;
9063 item.Folder = rezScriptx.InventoryBlock.FolderID;
9064 item.CreatorId = rezScriptx.InventoryBlock.CreatorID.ToString();
9065 item.Owner = rezScriptx.InventoryBlock.OwnerID;
9066 item.BasePermissions = rezScriptx.InventoryBlock.BaseMask;
9067 item.CurrentPermissions = rezScriptx.InventoryBlock.OwnerMask;
9068 item.EveryOnePermissions = rezScriptx.InventoryBlock.EveryoneMask;
9069 item.NextPermissions = rezScriptx.InventoryBlock.NextOwnerMask;
9070 item.GroupPermissions = rezScriptx.InventoryBlock.GroupMask;
9071 item.GroupOwned = rezScriptx.InventoryBlock.GroupOwned;
9072 item.GroupID = rezScriptx.InventoryBlock.GroupID;
9073 item.AssetType = rezScriptx.InventoryBlock.Type;
9074 item.InvType = rezScriptx.InventoryBlock.InvType;
9075 item.Flags = rezScriptx.InventoryBlock.Flags;
9076 item.SaleType = rezScriptx.InventoryBlock.SaleType;
9077 item.SalePrice = rezScriptx.InventoryBlock.SalePrice;
9078 item.Name = Util.FieldToString(rezScriptx.InventoryBlock.Name);
9079 item.Description = Util.FieldToString(rezScriptx.InventoryBlock.Description);
9080 item.CreationDate = rezScriptx.InventoryBlock.CreationDate;
9082 if (handlerRezScript != null)
9084 handlerRezScript(
this, item, rezScriptx.InventoryBlock.TransactionID, rezScriptx.UpdateBlock.ObjectLocalID);
9089 private bool HandleMapLayerRequest(
IClientAPI sender, Packet Pack)
9095 private bool HandleMapBlockRequest(
IClientAPI sender, Packet Pack)
9097 MapBlockRequestPacket MapRequest = (MapBlockRequestPacket)Pack;
9099 #region Packet Session and User Check
9102 if (MapRequest.AgentData.SessionID != SessionId ||
9103 MapRequest.AgentData.AgentID != AgentId)
9109 if (handlerRequestMapBlocks != null)
9111 handlerRequestMapBlocks(
this, MapRequest.PositionData.MinX, MapRequest.PositionData.MinY,
9112 MapRequest.PositionData.MaxX, MapRequest.PositionData.MaxY, MapRequest.AgentData.Flags);
9117 private bool HandleMapNameRequest(
IClientAPI sender, Packet Pack)
9119 MapNameRequestPacket map = (MapNameRequestPacket)Pack;
9121 #region Packet Session and User Check
9124 if (map.AgentData.SessionID != SessionId ||
9125 map.AgentData.AgentID != AgentId)
9130 Util.UTF8.GetString(map.NameData.Name, 0, map.NameData.Name.Length - 1);
9132 if (handlerMapNameRequest != null)
9134 handlerMapNameRequest(
this, mapName, map.AgentData.Flags);
9139 private bool HandleTeleportLandmarkRequest(
IClientAPI sender, Packet Pack)
9141 TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack;
9143 #region Packet Session and User Check
9146 if (tpReq.Info.SessionID != SessionId ||
9147 tpReq.Info.AgentID != AgentId)
9152 UUID lmid = tpReq.Info.LandmarkID;
9154 if (lmid !=
UUID.Zero)
9158 AssetBase lma = m_assetService.Get(lmid.ToString());
9165 lma = FindAssetInUserAssetServer(lmid.ToString());
9170 TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel);
9171 tpCancel.Info.SessionID = tpReq.Info.SessionID;
9172 tpCancel.Info.AgentID = tpReq.Info.AgentID;
9181 catch (NullReferenceException)
9184 TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel);
9185 tpCancel.Info.SessionID = tpReq.Info.SessionID;
9186 tpCancel.Info.AgentID = tpReq.Info.AgentID;
9195 if (handlerTeleportHomeRequest != null)
9197 handlerTeleportHomeRequest(AgentId,
this);
9203 if (handlerTeleportLandmarkRequest != null)
9205 handlerTeleportLandmarkRequest(
this, lm);
9210 TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel);
9211 tpCancel.Info.AgentID = tpReq.Info.AgentID;
9212 tpCancel.Info.SessionID = tpReq.Info.SessionID;
9219 private bool HandleTeleportCancel(
IClientAPI sender, Packet Pack)
9222 if (handlerTeleportCancel != null)
9224 handlerTeleportCancel(
this);
9229 private AssetBase FindAssetInUserAssetServer(
string id)
9232 if (aCircuit != null && aCircuit.
ServiceURLs != null && aCircuit.
ServiceURLs.ContainsKey(
"AssetServerURI"))
9234 string assetServer = aCircuit.ServiceURLs[
"AssetServerURI"].ToString();
9235 if (!
string.IsNullOrEmpty(assetServer))
9236 return ((
Scene)
Scene).AssetService.Get(assetServer +
"/" +
id);
9242 private bool HandleTeleportLocationRequest(
IClientAPI sender, Packet Pack)
9244 TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack;
9247 #region Packet Session and User Check
9250 if (tpLocReq.AgentData.SessionID != SessionId ||
9251 tpLocReq.AgentData.AgentID != AgentId)
9257 if (handlerTeleportLocationRequest != null)
9261 Util.RegionHandleToWorldLoc(tpLocReq.Info.RegionHandle, out locX, out locY);
9263 && (locX < (m_scene.RegionInfo.WorldLocX + m_scene.RegionInfo.RegionSizeX))
9264 && (locY >= m_scene.RegionInfo.WorldLocY)
9267 tpLocReq.Info.RegionHandle = m_scene.RegionInfo.RegionHandle;
9268 tpLocReq.Info.Position.X += locX - m_scene.RegionInfo.WorldLocX;
9269 tpLocReq.Info.Position.Y += locY - m_scene.RegionInfo.WorldLocY;
9272 handlerTeleportLocationRequest(
this, tpLocReq.Info.RegionHandle, tpLocReq.Info.Position,
9273 tpLocReq.Info.LookAt, 16);
9278 TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel);
9279 tpCancel.Info.SessionID = tpLocReq.AgentData.SessionID;
9280 tpCancel.Info.AgentID = tpLocReq.AgentData.AgentID;
9286 #endregion Inventory/Asset/Other related packets
9288 private bool HandleUUIDNameRequest(
IClientAPI sender, Packet Pack)
9290 UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack;
9292 foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock)
9295 if (handlerNameRequest != null)
9297 handlerNameRequest(UUIDBlock.ID,
this);
9303 #region Parcel related packets
9309 Queue<UUID> RegionHandleRequests =
new Queue<UUID>();
9310 bool RegionHandleRequestsInService =
false;
9312 private bool HandleRegionHandleRequest(
IClientAPI sender, Packet Pack)
9318 if (handlerRegionHandleRequest == null)
9321 RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
9323 lock (RegionHandleRequests)
9325 if (RegionHandleRequestsInService)
9329 RegionHandleRequests.Enqueue(rhrPack.RequestBlock.RegionID);
9334 currentUUID = rhrPack.RequestBlock.RegionID;
9335 RegionHandleRequestsInService =
true;
9340 handlerRegionHandleRequest(
this, currentUUID);
9342 lock (RegionHandleRequests)
9347 handlerRegionHandleRequest = OnRegionHandleRequest;
9349 if (RegionHandleRequests.Count == 0 || !IsActive || handlerRegionHandleRequest == null)
9351 RegionHandleRequests.Clear();
9352 RegionHandleRequestsInService =
false;
9355 currentUUID = RegionHandleRequests.Dequeue();
9362 private bool HandleParcelInfoRequest(
IClientAPI sender, Packet Pack)
9364 ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack;
9366 #region Packet Session and User Check
9369 if (pirPack.AgentData.SessionID != SessionId ||
9370 pirPack.AgentData.AgentID != AgentId)
9376 if (handlerParcelInfoRequest != null)
9378 handlerParcelInfoRequest(
this, pirPack.Data.ParcelID);
9383 private bool HandleParcelAccessListRequest(
IClientAPI sender, Packet Pack)
9385 ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack;
9387 #region Packet Session and User Check
9390 if (requestPacket.AgentData.SessionID != SessionId ||
9391 requestPacket.AgentData.AgentID != AgentId)
9398 if (handlerParcelAccessListRequest != null)
9400 handlerParcelAccessListRequest(requestPacket.AgentData.AgentID, requestPacket.AgentData.SessionID,
9401 requestPacket.Data.Flags, requestPacket.Data.SequenceID,
9402 requestPacket.Data.LocalID,
this);
9407 private bool HandleParcelAccessListUpdate(
IClientAPI sender, Packet Pack)
9409 ParcelAccessListUpdatePacket updatePacket = (ParcelAccessListUpdatePacket)Pack;
9411 #region Packet Session and User Check
9414 if (updatePacket.AgentData.SessionID != SessionId ||
9415 updatePacket.AgentData.AgentID != AgentId)
9420 List<LandAccessEntry> entries =
new List<LandAccessEntry>();
9421 foreach (ParcelAccessListUpdatePacket.ListBlock block in updatePacket.List)
9424 entry.AgentID = block.ID;
9425 entry.Flags = (AccessList)block.Flags;
9431 if (handlerParcelAccessListUpdateRequest != null)
9433 handlerParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID,
9434 updatePacket.Data.Flags,
9435 updatePacket.Data.LocalID,
9436 updatePacket.Data.TransactionID,
9437 updatePacket.Data.SequenceID,
9438 updatePacket.Data.Sections,
9444 private bool HandleParcelPropertiesRequest(
IClientAPI sender, Packet Pack)
9446 ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket)Pack;
9448 #region Packet Session and User Check
9451 if (propertiesRequest.AgentData.SessionID != SessionId ||
9452 propertiesRequest.AgentData.AgentID != AgentId)
9458 if (handlerParcelPropertiesRequest != null)
9460 handlerParcelPropertiesRequest((
int)Math.Round(propertiesRequest.ParcelData.West),
9461 (int)Math.Round(propertiesRequest.ParcelData.South),
9462 (int)Math.Round(propertiesRequest.ParcelData.East),
9463 (int)Math.Round(propertiesRequest.ParcelData.North),
9464 propertiesRequest.ParcelData.SequenceID,
9465 propertiesRequest.ParcelData.SnapSelection,
this);
9470 private bool HandleParcelDivide(
IClientAPI sender, Packet Pack)
9472 ParcelDividePacket landDivide = (ParcelDividePacket)Pack;
9474 #region Packet Session and User Check
9477 if (landDivide.AgentData.SessionID != SessionId ||
9478 landDivide.AgentData.AgentID != AgentId)
9484 if (handlerParcelDivideRequest != null)
9486 handlerParcelDivideRequest((
int)Math.Round(landDivide.ParcelData.West),
9487 (int)Math.Round(landDivide.ParcelData.South),
9488 (int)Math.Round(landDivide.ParcelData.East),
9489 (int)Math.Round(landDivide.ParcelData.North),
this);
9494 private bool HandleParcelJoin(
IClientAPI sender, Packet Pack)
9496 ParcelJoinPacket landJoin = (ParcelJoinPacket)Pack;
9498 #region Packet Session and User Check
9501 if (landJoin.AgentData.SessionID != SessionId ||
9502 landJoin.AgentData.AgentID != AgentId)
9509 if (handlerParcelJoinRequest != null)
9511 handlerParcelJoinRequest((
int)Math.Round(landJoin.ParcelData.West),
9512 (int)Math.Round(landJoin.ParcelData.South),
9513 (int)Math.Round(landJoin.ParcelData.East),
9514 (int)Math.Round(landJoin.ParcelData.North),
this);
9519 private bool HandleParcelPropertiesUpdate(
IClientAPI sender, Packet Pack)
9521 ParcelPropertiesUpdatePacket parcelPropertiesPacket = (ParcelPropertiesUpdatePacket)Pack;
9523 #region Packet Session and User Check
9526 if (parcelPropertiesPacket.AgentData.SessionID != SessionId ||
9527 parcelPropertiesPacket.AgentData.AgentID != AgentId)
9534 if (handlerParcelPropertiesUpdateRequest != null)
9538 args.AuthBuyerID = parcelPropertiesPacket.ParcelData.AuthBuyerID;
9539 args.Category = (ParcelCategory)parcelPropertiesPacket.ParcelData.Category;
9540 args.
Desc =
Utils.BytesToString(parcelPropertiesPacket.ParcelData.Desc);
9541 args.GroupID = parcelPropertiesPacket.ParcelData.GroupID;
9542 args.LandingType = parcelPropertiesPacket.ParcelData.LandingType;
9543 args.MediaAutoScale = parcelPropertiesPacket.ParcelData.MediaAutoScale;
9544 args.MediaID = parcelPropertiesPacket.ParcelData.MediaID;
9545 args.MediaURL = Utils.BytesToString(parcelPropertiesPacket.ParcelData.MediaURL);
9546 args.MusicURL = Utils.BytesToString(parcelPropertiesPacket.ParcelData.MusicURL);
9547 args.Name = Utils.BytesToString(parcelPropertiesPacket.ParcelData.Name);
9548 args.ParcelFlags = parcelPropertiesPacket.ParcelData.ParcelFlags;
9549 args.PassHours = parcelPropertiesPacket.ParcelData.PassHours;
9550 args.PassPrice = parcelPropertiesPacket.ParcelData.PassPrice;
9551 args.SalePrice = parcelPropertiesPacket.ParcelData.SalePrice;
9552 args.SnapshotID = parcelPropertiesPacket.ParcelData.SnapshotID;
9553 args.UserLocation = parcelPropertiesPacket.ParcelData.UserLocation;
9554 args.UserLookAt = parcelPropertiesPacket.ParcelData.UserLookAt;
9555 handlerParcelPropertiesUpdateRequest(args, parcelPropertiesPacket.ParcelData.LocalID,
this);
9560 private bool HandleParcelSelectObjects(
IClientAPI sender, Packet Pack)
9562 ParcelSelectObjectsPacket selectPacket = (ParcelSelectObjectsPacket)Pack;
9564 #region Packet Session and User Check
9567 if (selectPacket.AgentData.SessionID != SessionId ||
9568 selectPacket.AgentData.AgentID != AgentId)
9573 List<UUID> returnIDs =
new List<UUID>();
9575 foreach (ParcelSelectObjectsPacket.ReturnIDsBlock rb in
9576 selectPacket.ReturnIDs)
9578 returnIDs.Add(rb.ReturnID);
9583 if (handlerParcelSelectObjects != null)
9585 handlerParcelSelectObjects(selectPacket.ParcelData.LocalID,
9586 Convert.ToInt32(selectPacket.ParcelData.ReturnType), returnIDs,
this);
9591 private bool HandleParcelObjectOwnersRequest(
IClientAPI sender, Packet Pack)
9593 ParcelObjectOwnersRequestPacket reqPacket = (ParcelObjectOwnersRequestPacket)Pack;
9595 #region Packet Session and User Check
9598 if (reqPacket.AgentData.SessionID != SessionId ||
9599 reqPacket.AgentData.AgentID != AgentId)
9606 if (handlerParcelObjectOwnerRequest != null)
9608 handlerParcelObjectOwnerRequest(reqPacket.ParcelData.LocalID,
this);
9614 private bool HandleParcelGodForceOwner(
IClientAPI sender, Packet Pack)
9616 ParcelGodForceOwnerPacket godForceOwnerPacket = (ParcelGodForceOwnerPacket)Pack;
9618 #region Packet Session and User Check
9621 if (godForceOwnerPacket.AgentData.SessionID != SessionId ||
9622 godForceOwnerPacket.AgentData.AgentID != AgentId)
9628 if (handlerParcelGodForceOwner != null)
9630 handlerParcelGodForceOwner(godForceOwnerPacket.Data.LocalID, godForceOwnerPacket.Data.OwnerID,
this);
9635 private bool HandleParcelRelease(
IClientAPI sender, Packet Pack)
9637 ParcelReleasePacket releasePacket = (ParcelReleasePacket)Pack;
9639 #region Packet Session and User Check
9642 if (releasePacket.AgentData.SessionID != SessionId ||
9643 releasePacket.AgentData.AgentID != AgentId)
9649 if (handlerParcelAbandonRequest != null)
9651 handlerParcelAbandonRequest(releasePacket.Data.LocalID,
this);
9656 private bool HandleParcelReclaim(
IClientAPI sender, Packet Pack)
9658 ParcelReclaimPacket reclaimPacket = (ParcelReclaimPacket)Pack;
9660 #region Packet Session and User Check
9663 if (reclaimPacket.AgentData.SessionID != SessionId ||
9664 reclaimPacket.AgentData.AgentID != AgentId)
9670 if (handlerParcelReclaim != null)
9672 handlerParcelReclaim(reclaimPacket.Data.LocalID,
this);
9677 private bool HandleParcelReturnObjects(
IClientAPI sender, Packet Pack)
9679 ParcelReturnObjectsPacket parcelReturnObjects = (ParcelReturnObjectsPacket)Pack;
9681 #region Packet Session and User Check
9684 if (parcelReturnObjects.AgentData.SessionID != SessionId ||
9685 parcelReturnObjects.AgentData.AgentID != AgentId)
9690 UUID[] puserselectedOwnerIDs =
new UUID[parcelReturnObjects.OwnerIDs.Length];
9691 for (
int parceliterator = 0; parceliterator < parcelReturnObjects.OwnerIDs.Length; parceliterator++)
9692 puserselectedOwnerIDs[parceliterator] = parcelReturnObjects.OwnerIDs[parceliterator].OwnerID;
9694 UUID[] puserselectedTaskIDs =
new UUID[parcelReturnObjects.TaskIDs.Length];
9696 for (
int parceliterator = 0; parceliterator < parcelReturnObjects.TaskIDs.Length; parceliterator++)
9697 puserselectedTaskIDs[parceliterator] = parcelReturnObjects.TaskIDs[parceliterator].TaskID;
9700 if (handlerParcelReturnObjectsRequest != null)
9702 handlerParcelReturnObjectsRequest(parcelReturnObjects.ParcelData.LocalID, parcelReturnObjects.ParcelData.ReturnType, puserselectedOwnerIDs, puserselectedTaskIDs,
this);
9708 private bool HandleParcelSetOtherCleanTime(
IClientAPI sender, Packet Pack)
9710 ParcelSetOtherCleanTimePacket parcelSetOtherCleanTimePacket = (ParcelSetOtherCleanTimePacket)Pack;
9712 #region Packet Session and User Check
9715 if (parcelSetOtherCleanTimePacket.AgentData.SessionID != SessionId ||
9716 parcelSetOtherCleanTimePacket.AgentData.AgentID != AgentId)
9722 if (handlerParcelSetOtherCleanTime != null)
9724 handlerParcelSetOtherCleanTime(
this,
9725 parcelSetOtherCleanTimePacket.ParcelData.LocalID,
9726 parcelSetOtherCleanTimePacket.ParcelData.OtherCleanTime);
9731 private bool HandleLandStatRequest(
IClientAPI sender, Packet Pack)
9733 LandStatRequestPacket lsrp = (LandStatRequestPacket)Pack;
9735 #region Packet Session and User Check
9738 if (lsrp.AgentData.SessionID != SessionId ||
9739 lsrp.AgentData.AgentID != AgentId)
9745 if (handlerLandStatRequest != null)
9747 handlerLandStatRequest(lsrp.RequestData.ParcelLocalID, lsrp.RequestData.ReportType, lsrp.RequestData.RequestFlags,
Utils.BytesToString(lsrp.RequestData.Filter),
this);
9752 private bool HandleParcelDwellRequest(
IClientAPI sender, Packet Pack)
9754 ParcelDwellRequestPacket dwellrq =
9755 (ParcelDwellRequestPacket)Pack;
9757 #region Packet Session and User Check
9760 if (dwellrq.AgentData.SessionID != SessionId ||
9761 dwellrq.AgentData.AgentID != AgentId)
9767 if (handlerParcelDwellRequest != null)
9769 handlerParcelDwellRequest(dwellrq.Data.LocalID,
this);
9774 #endregion Parcel related packets
9776 #region Estate Packets
9778 private bool HandleEstateOwnerMessage(
IClientAPI sender, Packet Pack)
9780 EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack;
9784 #region Packet Session and User Check
9787 if (messagePacket.AgentData.SessionID != SessionId ||
9788 messagePacket.AgentData.AgentID != AgentId)
9793 string method = Utils.BytesToString(messagePacket.MethodData.Method);
9798 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
9800 OnDetailedEstateDataRequest(
this, messagePacket.MethodData.Invoice);
9803 case "setregioninfo":
9804 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
9806 OnSetEstateFlagsRequest(convertParamStringToBool(messagePacket.ParamList[0].Parameter), convertParamStringToBool(messagePacket.ParamList[1].Parameter),
9807 convertParamStringToBool(messagePacket.ParamList[2].Parameter), !convertParamStringToBool(messagePacket.ParamList[3].Parameter),
9808 Convert.ToInt16(Convert.ToDecimal(
Utils.BytesToString(messagePacket.ParamList[4].Parameter), Culture.NumberFormatInfo)),
9809 (float)Convert.ToDecimal(
Utils.BytesToString(messagePacket.ParamList[5].Parameter), Culture.NumberFormatInfo),
9810 Convert.ToInt16(
Utils.BytesToString(messagePacket.ParamList[6].Parameter)),
9811 convertParamStringToBool(messagePacket.ParamList[7].Parameter), convertParamStringToBool(messagePacket.ParamList[8].Parameter));
9829 case "texturedetail":
9830 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
9832 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
9834 string s = Utils.BytesToString(block.Parameter);
9835 string[] splitField = s.Split(
' ');
9836 if (splitField.Length == 2)
9838 Int16 corner = Convert.ToInt16(splitField[0]);
9839 UUID textureUUID =
new UUID(splitField[1]);
9841 OnSetEstateTerrainDetailTexture(
this, corner, textureUUID);
9847 case "textureheights":
9848 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
9850 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
9852 string s = Utils.BytesToString(block.Parameter);
9853 string[] splitField = s.Split(
' ');
9854 if (splitField.Length == 3)
9856 Int16 corner = Convert.ToInt16(splitField[0]);
9860 OnSetEstateTerrainTextureHeights(
this, corner, lowValue, highValue);
9865 case "texturecommit":
9866 OnCommitEstateTerrainTextureRequest(
this);
9868 case "setregionterrain":
9869 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
9871 if (messagePacket.ParamList.Length != 9)
9873 m_log.Error(
"EstateOwnerMessage: SetRegionTerrain method has a ParamList of invalid length");
9879 string tmp = Utils.BytesToString(messagePacket.ParamList[0].Parameter);
9880 if (!tmp.Contains(
".")) tmp +=
".00";
9882 tmp = Utils.BytesToString(messagePacket.ParamList[1].Parameter);
9883 if (!tmp.Contains(
".")) tmp +=
".00";
9885 tmp = Utils.BytesToString(messagePacket.ParamList[2].Parameter);
9886 if (!tmp.Contains(
".")) tmp +=
".00";
9888 bool UseEstateSun = convertParamStringToBool(messagePacket.ParamList[3].Parameter);
9889 bool UseFixedSun = convertParamStringToBool(messagePacket.ParamList[4].Parameter);
9890 float SunHour = (float)Convert.ToDecimal(
Utils.BytesToString(messagePacket.ParamList[5].Parameter), Culture.NumberFormatInfo);
9891 bool UseGlobal = convertParamStringToBool(messagePacket.ParamList[6].Parameter);
9892 bool EstateFixedSun = convertParamStringToBool(messagePacket.ParamList[7].Parameter);
9893 float EstateSunHour = (float)Convert.ToDecimal(
Utils.BytesToString(messagePacket.ParamList[8].Parameter), Culture.NumberFormatInfo);
9895 OnSetRegionTerrainSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseEstateSun, UseFixedSun, SunHour, UseGlobal, EstateFixedSun, EstateSunHour);
9898 catch (Exception ex)
9900 m_log.Error(
"EstateOwnerMessage: Exception while setting terrain settings: \n" + messagePacket +
"\n" + ex);
9907 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
9910 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
9913 Utils.TryParseSingle(Utils.BytesToString(block.Parameter), out timeSeconds);
9914 timeSeconds = (int)timeSeconds;
9915 OnEstateRestartSimRequest(
this, (
int)timeSeconds);
9920 case "estatechangecovenantid":
9921 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
9923 foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
9925 UUID newCovenantID =
new UUID(
Utils.BytesToString(block.Parameter));
9926 OnEstateChangeCovenantRequest(
this, newCovenantID);
9930 case "estateaccessdelta":
9931 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
9933 int estateAccessType = Convert.ToInt16(Utils.BytesToString(messagePacket.ParamList[1].Parameter));
9934 OnUpdateEstateAccessDeltaRequest(
this, messagePacket.MethodData.Invoice, estateAccessType,
new UUID(
Utils.BytesToString(messagePacket.ParamList[2].Parameter)));
9938 case "simulatormessage":
9939 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
9941 UUID invoice = messagePacket.MethodData.Invoice;
9942 UUID SenderID =
new UUID(
Utils.BytesToString(messagePacket.ParamList[2].Parameter));
9943 string SenderName = Utils.BytesToString(messagePacket.ParamList[3].Parameter);
9944 string Message = Utils.BytesToString(messagePacket.ParamList[4].Parameter);
9945 UUID sessionID = messagePacket.AgentData.SessionID;
9946 OnSimulatorBlueBoxMessageRequest(
this, invoice, SenderID, sessionID, SenderName, Message);
9949 case "instantmessage":
9950 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
9952 if (messagePacket.ParamList.Length < 2)
9955 UUID invoice = messagePacket.MethodData.Invoice;
9956 UUID sessionID = messagePacket.AgentData.SessionID;
9962 if (messagePacket.ParamList.Length < 5)
9965 SenderName = Utils.BytesToString(messagePacket.ParamList[0].Parameter);
9966 Message = Utils.BytesToString(messagePacket.ParamList[1].Parameter);
9970 SenderID =
new UUID(
Utils.BytesToString(messagePacket.ParamList[2].Parameter));
9971 SenderName = Utils.BytesToString(messagePacket.ParamList[3].Parameter);
9972 Message = Utils.BytesToString(messagePacket.ParamList[4].Parameter);
9975 OnEstateBlueBoxMessageRequest(
this, invoice, SenderID, sessionID, SenderName, Message);
9978 case "setregiondebug":
9979 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
9981 UUID invoice = messagePacket.MethodData.Invoice;
9982 UUID SenderID = messagePacket.AgentData.AgentID;
9983 bool scripted = convertParamStringToBool(messagePacket.ParamList[0].Parameter);
9984 bool collisionEvents = convertParamStringToBool(messagePacket.ParamList[1].Parameter);
9985 bool physics = convertParamStringToBool(messagePacket.ParamList[2].Parameter);
9987 OnEstateDebugRegionRequest(
this, invoice, SenderID, scripted, collisionEvents, physics);
9990 case "teleporthomeuser":
9991 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
9993 UUID invoice = messagePacket.MethodData.Invoice;
9994 UUID SenderID = messagePacket.AgentData.AgentID;
9997 UUID.TryParse(Utils.BytesToString(messagePacket.ParamList[1].Parameter), out Prey);
9999 OnEstateTeleportOneUserHomeRequest(
this, invoice, SenderID, Prey);
10002 case "teleporthomeallusers":
10003 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
10005 UUID invoice = messagePacket.MethodData.Invoice;
10006 UUID SenderID = messagePacket.AgentData.AgentID;
10007 OnEstateTeleportAllUsersHomeRequest(
this, invoice, SenderID);
10011 handlerLandStatRequest = OnLandStatRequest;
10012 if (handlerLandStatRequest != null)
10014 handlerLandStatRequest(0, 1, 0,
"",
this);
10018 handlerLandStatRequest = OnLandStatRequest;
10019 if (handlerLandStatRequest != null)
10021 handlerLandStatRequest(0, 0, 0,
"",
this);
10025 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
10027 if (messagePacket.ParamList.Length > 0)
10029 if (
Utils.BytesToString(messagePacket.ParamList[0].Parameter) ==
"bake")
10032 if (handlerBakeTerrain != null)
10034 handlerBakeTerrain(
this);
10037 if (
Utils.BytesToString(messagePacket.ParamList[0].Parameter) ==
"download filename")
10039 if (messagePacket.ParamList.Length > 1)
10042 if (handlerRequestTerrain != null)
10044 handlerRequestTerrain(
this,
Utils.BytesToString(messagePacket.ParamList[1].Parameter));
10048 if (
Utils.BytesToString(messagePacket.ParamList[0].Parameter) ==
"upload filename")
10050 if (messagePacket.ParamList.Length > 1)
10053 if (handlerUploadTerrain != null)
10055 handlerUploadTerrain(
this,
Utils.BytesToString(messagePacket.ParamList[1].Parameter));
10066 case "estatechangeinfo":
10067 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
10069 UUID invoice = messagePacket.MethodData.Invoice;
10070 UUID SenderID = messagePacket.AgentData.AgentID;
10071 UInt32 param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter));
10072 UInt32 param2 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[2].Parameter));
10075 if (handlerEstateChangeInfo != null)
10077 handlerEstateChangeInfo(
this, invoice, SenderID, param1, param2);
10083 if (((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
10085 UUID invoice = messagePacket.MethodData.Invoice;
10086 UUID SenderID = messagePacket.AgentData.AgentID;
10087 UInt32 param1 = 0u;
10089 string command = (string)
Utils.BytesToString(messagePacket.ParamList[0].Parameter);
10091 if (command !=
"info ui")
10095 param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter));
10103 if (handlerEstateManageTelehub != null)
10105 handlerEstateManageTelehub(
this, invoice, SenderID, command, param1);
10112 if(((
Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId,
false))
10114 UUID invoice = messagePacket.MethodData.Invoice;
10115 UUID SenderID = messagePacket.AgentData.AgentID;
10118 UUID.TryParse(Utils.BytesToString(messagePacket.ParamList[0].Parameter), out Prey);
10120 OnEstateTeleportOneUserHomeRequest(
this, invoice, SenderID, Prey);
10126 "[LLCLIENTVIEW]: EstateOwnerMessage: Unknown method {0} requested for {1} in {2}",
10127 method, Name, Scene.Name);
10129 for (
int i = 0; i < messagePacket.ParamList.Length; i++)
10131 EstateOwnerMessagePacket.ParamListBlock block = messagePacket.ParamList[i];
10132 string data = (string)
Utils.BytesToString(block.Parameter);
10133 m_log.DebugFormat(
"[LLCLIENTVIEW]: Param {0}={1}", i, data);
10147 private bool HandleRequestRegionInfo(
IClientAPI sender, Packet Pack)
10149 RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket)Pack)
.AgentData;
10151 #region Packet Session and User Check
10152 if (m_checkPackets)
10154 if (mPacket.SessionID != SessionId ||
10155 mPacket.AgentID != AgentId)
10161 if (handlerRegionInfoRequest != null)
10163 handlerRegionInfoRequest(
this);
10168 private bool HandleEstateCovenantRequest(
IClientAPI sender, Packet Pack)
10175 if (handlerEstateCovenantRequest != null)
10177 handlerEstateCovenantRequest(
this);
10183 #endregion Estate Packets
10187 private bool HandleRequestGodlikePowers(
IClientAPI sender, Packet Pack)
10189 RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket)Pack;
10190 RequestGodlikePowersPacket.RequestBlockBlock rblock = rglpPack.RequestBlock;
10191 UUID token = rblock.Token;
10193 RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData;
10197 if (handlerReqGodlikePowers != null)
10199 handlerReqGodlikePowers(ablock.AgentID, ablock.SessionID, token, rblock.Godlike,
this);
10205 private bool HandleGodUpdateRegionInfoUpdate(
IClientAPI client, Packet Packet)
10207 GodUpdateRegionInfoPacket GodUpdateRegionInfo =
10208 (GodUpdateRegionInfoPacket)Packet;
10211 if (handlerGodUpdateRegionInfo != null)
10213 handlerGodUpdateRegionInfo(
this,
10214 GodUpdateRegionInfo.RegionInfo.BillableFactor,
10215 GodUpdateRegionInfo.RegionInfo.EstateID,
10216 GodUpdateRegionInfo.RegionInfo.RegionFlags,
10217 GodUpdateRegionInfo.RegionInfo.SimName,
10218 GodUpdateRegionInfo.RegionInfo.RedirectGridX,
10219 GodUpdateRegionInfo.RegionInfo.RedirectGridY);
10225 private bool HandleSimWideDeletes(
IClientAPI client, Packet Packet)
10227 SimWideDeletesPacket SimWideDeletesRequest =
10228 (SimWideDeletesPacket)Packet;
10230 if (handlerSimWideDeletesRequest != null)
10232 handlerSimWideDeletesRequest(
this, SimWideDeletesRequest.AgentData.AgentID,(
int)SimWideDeletesRequest.DataBlock.Flags,SimWideDeletesRequest.DataBlock.TargetID);
10238 private bool HandleGodlikeMessage(
IClientAPI client, Packet Packet)
10241 (GodlikeMessagePacket)Packet;
10243 GodlikeMessage handlerGodlikeMessage = onGodlikeMessage;
10244 if (handlerGodlikeMessage != null)
10246 handlerGodlikeMessage(
this,
10247 GodlikeMessage.MethodData.Invoice,
10248 GodlikeMessage.MethodData.Method,
10249 GodlikeMessage.ParamList[0].Parameter);
10255 private bool HandleSaveStatePacket(
IClientAPI client, Packet Packet)
10257 StateSavePacket SaveStateMessage =
10258 (StateSavePacket)Packet;
10260 if (handlerSaveStatePacket != null)
10262 handlerSaveStatePacket(
this,SaveStateMessage.AgentData.AgentID);
10268 private bool HandleGodKickUser(
IClientAPI sender, Packet Pack)
10270 GodKickUserPacket gkupack = (GodKickUserPacket)Pack;
10272 if (gkupack.UserInfo.GodSessionID == SessionId && AgentId == gkupack.UserInfo.GodID)
10275 if (handlerGodKickUser != null)
10277 handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID,
10278 gkupack.UserInfo.AgentID, gkupack.UserInfo.KickFlags, gkupack.UserInfo.Reason);
10283 SendAgentAlertMessage(
"Kick request denied",
false);
10298 #endregion GodPackets
10300 #region Economy/Transaction Packets
10302 private bool HandleMoneyBalanceRequest(
IClientAPI sender, Packet Pack)
10304 MoneyBalanceRequestPacket moneybalancerequestpacket = (MoneyBalanceRequestPacket)Pack;
10306 #region Packet Session and User Check
10307 if (m_checkPackets)
10309 if (moneybalancerequestpacket.AgentData.SessionID != SessionId ||
10310 moneybalancerequestpacket.AgentData.AgentID != AgentId)
10317 if (handlerMoneyBalanceRequest != null)
10319 handlerMoneyBalanceRequest(
this, moneybalancerequestpacket.AgentData.AgentID, moneybalancerequestpacket.AgentData.SessionID, moneybalancerequestpacket.MoneyData.TransactionID);
10324 private bool HandleEconomyDataRequest(
IClientAPI sender, Packet Pack)
10327 if (handlerEconomoyDataRequest != null)
10329 handlerEconomoyDataRequest(
this);
10333 private bool HandleRequestPayPrice(
IClientAPI sender, Packet Pack)
10335 RequestPayPricePacket requestPayPricePacket = (RequestPayPricePacket)Pack;
10338 if (handlerRequestPayPrice != null)
10340 handlerRequestPayPrice(
this, requestPayPricePacket.ObjectData.ObjectID);
10344 private bool HandleObjectSaleInfo(
IClientAPI sender, Packet Pack)
10346 ObjectSaleInfoPacket objectSaleInfoPacket = (ObjectSaleInfoPacket)Pack;
10348 #region Packet Session and User Check
10349 if (m_checkPackets)
10351 if (objectSaleInfoPacket.AgentData.SessionID != SessionId ||
10352 objectSaleInfoPacket.AgentData.AgentID != AgentId)
10358 if (handlerObjectSaleInfo != null)
10360 foreach (ObjectSaleInfoPacket.ObjectDataBlock d
10361 in objectSaleInfoPacket.ObjectData)
10363 handlerObjectSaleInfo(
this,
10364 objectSaleInfoPacket.AgentData.AgentID,
10365 objectSaleInfoPacket.AgentData.SessionID,
10373 private bool HandleObjectBuy(
IClientAPI sender, Packet Pack)
10375 ObjectBuyPacket objectBuyPacket = (ObjectBuyPacket)Pack;
10377 #region Packet Session and User Check
10378 if (m_checkPackets)
10380 if (objectBuyPacket.AgentData.SessionID != SessionId ||
10381 objectBuyPacket.AgentData.AgentID != AgentId)
10386 ObjectBuy handlerObjectBuy = OnObjectBuy;
10388 if (handlerObjectBuy != null)
10390 foreach (ObjectBuyPacket.ObjectDataBlock d
10391 in objectBuyPacket.ObjectData)
10393 handlerObjectBuy(
this,
10394 objectBuyPacket.AgentData.AgentID,
10395 objectBuyPacket.AgentData.SessionID,
10396 objectBuyPacket.AgentData.GroupID,
10397 objectBuyPacket.AgentData.CategoryID,
10406 #endregion Economy/Transaction Packets
10408 #region Script Packets
10409 private bool HandleGetScriptRunning(
IClientAPI sender, Packet Pack)
10411 GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack;
10414 if (handlerGetScriptRunning != null)
10416 handlerGetScriptRunning(
this, scriptRunning.Script.ObjectID, scriptRunning.Script.ItemID);
10420 private bool HandleSetScriptRunning(
IClientAPI sender, Packet Pack)
10422 SetScriptRunningPacket setScriptRunning = (SetScriptRunningPacket)Pack;
10424 #region Packet Session and User Check
10425 if (m_checkPackets)
10427 if (setScriptRunning.AgentData.SessionID != SessionId ||
10428 setScriptRunning.AgentData.AgentID != AgentId)
10434 if (handlerSetScriptRunning != null)
10436 handlerSetScriptRunning(
this, setScriptRunning.Script.ObjectID, setScriptRunning.Script.ItemID, setScriptRunning.Script.Running);
10441 private bool HandleScriptReset(
IClientAPI sender, Packet Pack)
10443 ScriptResetPacket scriptResetPacket = (ScriptResetPacket)Pack;
10445 #region Packet Session and User Check
10446 if (m_checkPackets)
10448 if (scriptResetPacket.AgentData.SessionID != SessionId ||
10449 scriptResetPacket.AgentData.AgentID != AgentId)
10455 if (handlerScriptReset != null)
10457 handlerScriptReset(
this, scriptResetPacket.Script.ObjectID, scriptResetPacket.Script.ItemID);
10462 #endregion Script Packets
10464 #region Gesture Managment
10466 private bool HandleActivateGestures(
IClientAPI sender, Packet Pack)
10468 ActivateGesturesPacket activateGesturePacket = (ActivateGesturesPacket)Pack;
10470 #region Packet Session and User Check
10471 if (m_checkPackets)
10473 if (activateGesturePacket.AgentData.SessionID != SessionId ||
10474 activateGesturePacket.AgentData.AgentID != AgentId)
10480 if (handlerActivateGesture != null)
10482 handlerActivateGesture(
this,
10483 activateGesturePacket.Data[0].AssetID,
10484 activateGesturePacket.Data[0].ItemID);
10486 else m_log.Error(
"Null pointer for activateGesture");
10490 private bool HandleDeactivateGestures(
IClientAPI sender, Packet Pack)
10492 DeactivateGesturesPacket deactivateGesturePacket = (DeactivateGesturesPacket)Pack;
10494 #region Packet Session and User Check
10495 if (m_checkPackets)
10497 if (deactivateGesturePacket.AgentData.SessionID != SessionId ||
10498 deactivateGesturePacket.AgentData.AgentID != AgentId)
10504 if (handlerDeactivateGesture != null)
10506 handlerDeactivateGesture(
this, deactivateGesturePacket.Data[0].ItemID);
10510 private bool HandleObjectOwner(
IClientAPI sender, Packet Pack)
10512 ObjectOwnerPacket objectOwnerPacket = (ObjectOwnerPacket)Pack;
10514 #region Packet Session and User Check
10515 if (m_checkPackets)
10517 if (objectOwnerPacket.AgentData.SessionID != SessionId ||
10518 objectOwnerPacket.AgentData.AgentID != AgentId)
10523 List<uint> localIDs =
new List<uint>();
10525 foreach (ObjectOwnerPacket.ObjectDataBlock d in objectOwnerPacket.ObjectData)
10526 localIDs.Add(d.ObjectLocalID);
10529 if (handlerObjectOwner != null)
10531 handlerObjectOwner(
this, objectOwnerPacket.HeaderData.OwnerID, objectOwnerPacket.HeaderData.GroupID, localIDs);
10536 #endregion Gesture Managment
10538 private bool HandleAgentFOV(
IClientAPI sender, Packet Pack)
10540 AgentFOVPacket fovPacket = (AgentFOVPacket)Pack;
10542 if (fovPacket.FOVBlock.GenCounter > m_agentFOVCounter)
10544 m_agentFOVCounter = fovPacket.FOVBlock.GenCounter;
10545 AgentFOV handlerAgentFOV = OnAgentFOV;
10546 if (handlerAgentFOV != null)
10548 handlerAgentFOV(
this, fovPacket.FOVBlock.VerticalAngle);
10554 #region unimplemented handlers
10556 private bool HandleViewerStats(
IClientAPI sender, Packet Pack)
10563 private bool HandleMapItemRequest(
IClientAPI sender, Packet Pack)
10565 MapItemRequestPacket mirpk = (MapItemRequestPacket)Pack;
10567 #region Packet Session and User Check
10568 if (m_checkPackets)
10570 if (mirpk.AgentData.SessionID != SessionId ||
10571 mirpk.AgentData.AgentID != AgentId)
10578 if (handlerMapItemRequest != null)
10580 handlerMapItemRequest(
this, mirpk.AgentData.Flags, mirpk.AgentData.EstateID,
10581 mirpk.AgentData.Godlike, mirpk.RequestData.ItemType,
10582 mirpk.RequestData.RegionHandle);
10588 private bool HandleTransferAbort(
IClientAPI sender, Packet Pack)
10593 private bool HandleMuteListRequest(
IClientAPI sender, Packet Pack)
10595 MuteListRequestPacket muteListRequest =
10596 (MuteListRequestPacket)Pack;
10598 #region Packet Session and User Check
10599 if (m_checkPackets)
10601 if (muteListRequest.AgentData.SessionID != SessionId ||
10602 muteListRequest.AgentData.AgentID != AgentId)
10608 if (handlerMuteListRequest != null)
10610 handlerMuteListRequest(
this, muteListRequest.MuteData.MuteCRC);
10614 SendUseCachedMuteList();
10619 private bool HandleUpdateMuteListEntry(
IClientAPI client, Packet Packet)
10621 UpdateMuteListEntryPacket UpdateMuteListEntry =
10622 (UpdateMuteListEntryPacket)Packet;
10624 if (handlerUpdateMuteListEntry != null)
10626 handlerUpdateMuteListEntry(
this, UpdateMuteListEntry.MuteData.MuteID,
10627 Utils.BytesToString(UpdateMuteListEntry.MuteData.MuteName),
10628 UpdateMuteListEntry.MuteData.MuteType,
10629 UpdateMuteListEntry.MuteData.MuteFlags);
10635 private bool HandleRemoveMuteListEntry(
IClientAPI client, Packet Packet)
10637 RemoveMuteListEntryPacket RemoveMuteListEntry =
10638 (RemoveMuteListEntryPacket)Packet;
10640 if (handlerRemoveMuteListEntry != null)
10642 handlerRemoveMuteListEntry(
this,
10643 RemoveMuteListEntry.MuteData.MuteID,
10644 Utils.BytesToString(RemoveMuteListEntry.MuteData.MuteName));
10650 private bool HandleUserReport(
IClientAPI client, Packet Packet)
10652 UserReportPacket UserReport =
10653 (UserReportPacket)Packet;
10656 if (handlerUserReport != null)
10658 handlerUserReport(
this,
10659 Utils.BytesToString(UserReport.ReportData.AbuseRegionName),
10660 UserReport.ReportData.AbuserID,
10661 UserReport.ReportData.Category,
10662 UserReport.ReportData.CheckFlags,
10663 Utils.BytesToString(UserReport.ReportData.Details),
10664 UserReport.ReportData.ObjectID,
10665 UserReport.ReportData.Position,
10666 UserReport.ReportData.ReportType,
10667 UserReport.ReportData.ScreenshotID,
10668 Utils.BytesToString(UserReport.ReportData.Summary),
10669 UserReport.AgentData.AgentID);
10675 private bool HandleSendPostcard(
IClientAPI client, Packet packet)
10680 if (handlerSendPostcard != null)
10682 handlerSendPostcard(
this);
10688 private bool HandleChangeInventoryItemFlags(
IClientAPI client, Packet packet)
10691 (ChangeInventoryItemFlagsPacket)packet;
10692 ChangeInventoryItemFlags handlerChangeInventoryItemFlags = OnChangeInventoryItemFlags;
10693 if (handlerChangeInventoryItemFlags != null)
10695 foreach(ChangeInventoryItemFlagsPacket.InventoryDataBlock b in ChangeInventoryItemFlags.InventoryData)
10696 handlerChangeInventoryItemFlags(
this, b.ItemID, b.Flags);
10702 private bool HandleUseCircuitCode(
IClientAPI sender, Packet Pack)
10707 private bool HandleCreateNewOutfitAttachments(
IClientAPI sender, Packet Pack)
10709 CreateNewOutfitAttachmentsPacket packet = (CreateNewOutfitAttachmentsPacket)Pack;
10711 #region Packet Session and User Check
10712 if (m_checkPackets)
10714 if (packet.AgentData.SessionID != SessionId ||
10715 packet.AgentData.AgentID != AgentId)
10720 List<InventoryItemBase> items =
new List<InventoryItemBase>();
10721 foreach (CreateNewOutfitAttachmentsPacket.ObjectDataBlock n in packet.ObjectData)
10724 b.ID = n.OldItemID;
10725 b.Folder = n.OldFolderID;
10729 handlerMoveItemsAndLeaveCopy = OnMoveItemsAndLeaveCopy;
10730 if (handlerMoveItemsAndLeaveCopy != null)
10732 handlerMoveItemsAndLeaveCopy(
this, items, packet.HeaderData.NewFolderID);
10738 private bool HandleAgentHeightWidth(
IClientAPI sender, Packet Pack)
10743 private bool HandleInventoryDescendents(
IClientAPI sender, Packet Pack)
10748 #endregion unimplemented handlers
10750 #region Dir handlers
10752 private bool HandleDirPlacesQuery(
IClientAPI sender, Packet Pack)
10754 DirPlacesQueryPacket dirPlacesQueryPacket = (DirPlacesQueryPacket)Pack;
10757 #region Packet Session and User Check
10758 if (m_checkPackets)
10760 if (dirPlacesQueryPacket.AgentData.SessionID != SessionId ||
10761 dirPlacesQueryPacket.AgentData.AgentID != AgentId)
10767 if (handlerDirPlacesQuery != null)
10769 handlerDirPlacesQuery(
this,
10770 dirPlacesQueryPacket.QueryData.QueryID,
10771 Utils.BytesToString(
10772 dirPlacesQueryPacket.QueryData.QueryText),
10773 (int)dirPlacesQueryPacket.QueryData.QueryFlags,
10774 (
int)dirPlacesQueryPacket.QueryData.Category,
10775 Utils.BytesToString(
10776 dirPlacesQueryPacket.QueryData.SimName),
10777 dirPlacesQueryPacket.QueryData.QueryStart);
10782 private bool HandleDirFindQuery(
IClientAPI sender, Packet Pack)
10784 DirFindQueryPacket dirFindQueryPacket = (DirFindQueryPacket)Pack;
10786 #region Packet Session and User Check
10787 if (m_checkPackets)
10789 if (dirFindQueryPacket.AgentData.SessionID != SessionId ||
10790 dirFindQueryPacket.AgentData.AgentID != AgentId)
10796 if (handlerDirFindQuery != null)
10798 handlerDirFindQuery(
this,
10799 dirFindQueryPacket.QueryData.QueryID,
10800 Utils.BytesToString(
10801 dirFindQueryPacket.QueryData.QueryText).Trim(),
10802 dirFindQueryPacket.QueryData.QueryFlags,
10803 dirFindQueryPacket.QueryData.QueryStart);
10808 private bool HandleDirLandQuery(
IClientAPI sender, Packet Pack)
10810 DirLandQueryPacket dirLandQueryPacket = (DirLandQueryPacket)Pack;
10812 #region Packet Session and User Check
10813 if (m_checkPackets)
10815 if (dirLandQueryPacket.AgentData.SessionID != SessionId ||
10816 dirLandQueryPacket.AgentData.AgentID != AgentId)
10822 if (handlerDirLandQuery != null)
10824 handlerDirLandQuery(
this,
10825 dirLandQueryPacket.QueryData.QueryID,
10826 dirLandQueryPacket.QueryData.QueryFlags,
10827 dirLandQueryPacket.QueryData.SearchType,
10828 dirLandQueryPacket.QueryData.Price,
10829 dirLandQueryPacket.QueryData.Area,
10830 dirLandQueryPacket.QueryData.QueryStart);
10835 private bool HandleDirPopularQuery(
IClientAPI sender, Packet Pack)
10837 DirPopularQueryPacket dirPopularQueryPacket = (DirPopularQueryPacket)Pack;
10839 #region Packet Session and User Check
10840 if (m_checkPackets)
10842 if (dirPopularQueryPacket.AgentData.SessionID != SessionId ||
10843 dirPopularQueryPacket.AgentData.AgentID != AgentId)
10849 if (handlerDirPopularQuery != null)
10851 handlerDirPopularQuery(
this,
10852 dirPopularQueryPacket.QueryData.QueryID,
10853 dirPopularQueryPacket.QueryData.QueryFlags);
10858 private bool HandleDirClassifiedQuery(
IClientAPI sender, Packet Pack)
10860 DirClassifiedQueryPacket dirClassifiedQueryPacket = (DirClassifiedQueryPacket)Pack;
10862 #region Packet Session and User Check
10863 if (m_checkPackets)
10865 if (dirClassifiedQueryPacket.AgentData.SessionID != SessionId ||
10866 dirClassifiedQueryPacket.AgentData.AgentID != AgentId)
10872 if (handlerDirClassifiedQuery != null)
10874 handlerDirClassifiedQuery(
this,
10875 dirClassifiedQueryPacket.QueryData.QueryID,
10876 Utils.BytesToString(
10877 dirClassifiedQueryPacket.QueryData.QueryText),
10878 dirClassifiedQueryPacket.QueryData.QueryFlags,
10879 dirClassifiedQueryPacket.QueryData.Category,
10880 dirClassifiedQueryPacket.QueryData.QueryStart);
10885 private bool HandleEventInfoRequest(
IClientAPI sender, Packet Pack)
10887 EventInfoRequestPacket eventInfoRequestPacket = (EventInfoRequestPacket)Pack;
10889 #region Packet Session and User Check
10890 if (m_checkPackets)
10892 if (eventInfoRequestPacket.AgentData.SessionID != SessionId ||
10893 eventInfoRequestPacket.AgentData.AgentID != AgentId)
10898 if (OnEventInfoRequest != null)
10900 OnEventInfoRequest(
this, eventInfoRequestPacket.EventData.EventID);
10907 #region Calling Card
10909 private bool HandleOfferCallingCard(
IClientAPI sender, Packet Pack)
10911 OfferCallingCardPacket offerCallingCardPacket = (OfferCallingCardPacket)Pack;
10913 #region Packet Session and User Check
10914 if (m_checkPackets)
10916 if (offerCallingCardPacket.AgentData.SessionID != SessionId ||
10917 offerCallingCardPacket.AgentData.AgentID != AgentId)
10922 if (OnOfferCallingCard != null)
10924 OnOfferCallingCard(
this,
10925 offerCallingCardPacket.AgentBlock.DestID,
10926 offerCallingCardPacket.AgentBlock.TransactionID);
10931 private bool HandleAcceptCallingCard(
IClientAPI sender, Packet Pack)
10933 AcceptCallingCardPacket acceptCallingCardPacket = (AcceptCallingCardPacket)Pack;
10935 #region Packet Session and User Check
10936 if (m_checkPackets)
10938 if (acceptCallingCardPacket.AgentData.SessionID != SessionId ||
10939 acceptCallingCardPacket.AgentData.AgentID != AgentId)
10946 if (OnAcceptCallingCard != null && acceptCallingCardPacket.FolderData.Length > 0)
10948 OnAcceptCallingCard(
this,
10949 acceptCallingCardPacket.TransactionBlock.TransactionID,
10950 acceptCallingCardPacket.FolderData[0].FolderID);
10955 private bool HandleDeclineCallingCard(
IClientAPI sender, Packet Pack)
10957 DeclineCallingCardPacket declineCallingCardPacket = (DeclineCallingCardPacket)Pack;
10959 #region Packet Session and User Check
10960 if (m_checkPackets)
10962 if (declineCallingCardPacket.AgentData.SessionID != SessionId ||
10963 declineCallingCardPacket.AgentData.AgentID != AgentId)
10968 if (OnDeclineCallingCard != null)
10970 OnDeclineCallingCard(
this,
10971 declineCallingCardPacket.TransactionBlock.TransactionID);
10976 #endregion Calling Card
10980 private bool HandleActivateGroup(
IClientAPI sender, Packet Pack)
10982 ActivateGroupPacket activateGroupPacket = (ActivateGroupPacket)Pack;
10984 #region Packet Session and User Check
10985 if (m_checkPackets)
10987 if (activateGroupPacket.AgentData.SessionID != SessionId ||
10988 activateGroupPacket.AgentData.AgentID != AgentId)
10993 if (m_GroupsModule != null)
10995 m_GroupsModule.ActivateGroup(
this, activateGroupPacket.AgentData.GroupID);
10996 m_GroupsModule.SendAgentGroupDataUpdate(
this);
11002 private bool HandleGroupVoteHistoryRequest(
IClientAPI client, Packet Packet)
11005 (GroupVoteHistoryRequestPacket)Packet;
11006 GroupVoteHistoryRequest handlerGroupVoteHistoryRequest = OnGroupVoteHistoryRequest;
11007 if (handlerGroupVoteHistoryRequest != null)
11009 handlerGroupVoteHistoryRequest(
this, GroupVoteHistoryRequest.AgentData.AgentID,GroupVoteHistoryRequest.AgentData.SessionID,GroupVoteHistoryRequest.GroupData.GroupID,GroupVoteHistoryRequest.TransactionData.TransactionID);
11015 private bool HandleGroupActiveProposalsRequest(
IClientAPI client, Packet Packet)
11018 (GroupActiveProposalsRequestPacket)Packet;
11019 GroupActiveProposalsRequest handlerGroupActiveProposalsRequest = OnGroupActiveProposalsRequest;
11020 if (handlerGroupActiveProposalsRequest != null)
11022 handlerGroupActiveProposalsRequest(
this, GroupActiveProposalsRequest.AgentData.AgentID,GroupActiveProposalsRequest.AgentData.SessionID,GroupActiveProposalsRequest.GroupData.GroupID,GroupActiveProposalsRequest.TransactionData.TransactionID);
11028 private bool HandleGroupAccountDetailsRequest(
IClientAPI client, Packet Packet)
11031 (GroupAccountDetailsRequestPacket)Packet;
11032 GroupAccountDetailsRequest handlerGroupAccountDetailsRequest = OnGroupAccountDetailsRequest;
11033 if (handlerGroupAccountDetailsRequest != null)
11035 handlerGroupAccountDetailsRequest(
this, GroupAccountDetailsRequest.AgentData.AgentID,GroupAccountDetailsRequest.AgentData.GroupID,GroupAccountDetailsRequest.MoneyData.RequestID,GroupAccountDetailsRequest.AgentData.SessionID);
11041 private bool HandleGroupAccountSummaryRequest(
IClientAPI client, Packet Packet)
11044 (GroupAccountSummaryRequestPacket)Packet;
11045 GroupAccountSummaryRequest handlerGroupAccountSummaryRequest = OnGroupAccountSummaryRequest;
11046 if (handlerGroupAccountSummaryRequest != null)
11048 handlerGroupAccountSummaryRequest(
this, GroupAccountSummaryRequest.AgentData.AgentID,GroupAccountSummaryRequest.AgentData.GroupID);
11054 private bool HandleGroupTransactionsDetailsRequest(
IClientAPI client, Packet Packet)
11057 (GroupAccountTransactionsRequestPacket)Packet;
11058 GroupAccountTransactionsRequest handlerGroupAccountTransactionsRequest = OnGroupAccountTransactionsRequest;
11059 if (handlerGroupAccountTransactionsRequest != null)
11061 handlerGroupAccountTransactionsRequest(
this, GroupAccountTransactionsRequest.AgentData.AgentID,GroupAccountTransactionsRequest.AgentData.GroupID,GroupAccountTransactionsRequest.MoneyData.RequestID,GroupAccountTransactionsRequest.AgentData.SessionID);
11067 private bool HandleGroupTitlesRequest(
IClientAPI sender, Packet Pack)
11069 GroupTitlesRequestPacket groupTitlesRequest =
11070 (GroupTitlesRequestPacket)Pack;
11072 #region Packet Session and User Check
11073 if (m_checkPackets)
11075 if (groupTitlesRequest.AgentData.SessionID != SessionId ||
11076 groupTitlesRequest.AgentData.AgentID != AgentId)
11081 if (m_GroupsModule != null)
11083 GroupTitlesReplyPacket groupTitlesReply = (GroupTitlesReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupTitlesReply);
11085 groupTitlesReply.AgentData =
11086 new GroupTitlesReplyPacket.AgentDataBlock();
11088 groupTitlesReply.AgentData.AgentID = AgentId;
11089 groupTitlesReply.AgentData.GroupID =
11090 groupTitlesRequest.AgentData.GroupID;
11092 groupTitlesReply.AgentData.RequestID =
11093 groupTitlesRequest.AgentData.RequestID;
11095 List<GroupTitlesData> titles =
11096 m_GroupsModule.GroupTitlesRequest(
this,
11097 groupTitlesRequest.AgentData.GroupID);
11099 groupTitlesReply.GroupData =
11100 new GroupTitlesReplyPacket.GroupDataBlock[titles.Count];
11105 groupTitlesReply.GroupData[i] =
11106 new GroupTitlesReplyPacket.GroupDataBlock();
11108 groupTitlesReply.GroupData[i].Title =
11109 Util.StringToBytes256(d.Name);
11110 groupTitlesReply.GroupData[i].RoleID =
11112 groupTitlesReply.GroupData[i].Selected =
11121 private bool HandleGroupProfileRequest(
IClientAPI sender, Packet Pack)
11123 GroupProfileRequestPacket groupProfileRequest =
11124 (GroupProfileRequestPacket)Pack;
11126 #region Packet Session and User Check
11127 if (m_checkPackets)
11129 if (groupProfileRequest.AgentData.SessionID != SessionId ||
11130 groupProfileRequest.AgentData.AgentID != AgentId)
11135 if (m_GroupsModule != null)
11137 GroupProfileReplyPacket groupProfileReply = (GroupProfileReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupProfileReply);
11139 groupProfileReply.AgentData =
new GroupProfileReplyPacket.AgentDataBlock();
11140 groupProfileReply.GroupData =
new GroupProfileReplyPacket.GroupDataBlock();
11141 groupProfileReply.AgentData.AgentID = AgentId;
11144 groupProfileRequest.GroupData.GroupID);
11146 groupProfileReply.GroupData.GroupID = d.GroupID;
11147 groupProfileReply.GroupData.Name = Util.StringToBytes256(d.Name);
11148 groupProfileReply.GroupData.Charter = Util.StringToBytes1024(d.Charter);
11149 groupProfileReply.GroupData.ShowInList = d.ShowInList;
11150 groupProfileReply.GroupData.MemberTitle = Util.StringToBytes256(d.MemberTitle);
11151 groupProfileReply.GroupData.PowersMask = d.PowersMask;
11152 groupProfileReply.GroupData.InsigniaID = d.InsigniaID;
11153 groupProfileReply.GroupData.FounderID = d.FounderID;
11154 groupProfileReply.GroupData.MembershipFee = d.MembershipFee;
11155 groupProfileReply.GroupData.OpenEnrollment = d.OpenEnrollment;
11156 groupProfileReply.GroupData.Money = d.Money;
11157 groupProfileReply.GroupData.GroupMembershipCount = d.GroupMembershipCount;
11158 groupProfileReply.GroupData.GroupRolesCount = d.GroupRolesCount;
11159 groupProfileReply.GroupData.AllowPublish = d.AllowPublish;
11160 groupProfileReply.GroupData.MaturePublish = d.MaturePublish;
11161 groupProfileReply.GroupData.OwnerRole = d.OwnerRole;
11164 if (scene.
Permissions.
IsGod(sender.
AgentId) && (!sender.IsGroupMember(groupProfileRequest.GroupData.GroupID)))
11169 if (p.GodLevel >= 200)
11171 groupProfileReply.GroupData.OpenEnrollment =
true;
11172 groupProfileReply.GroupData.MembershipFee = 0;
11181 private bool HandleGroupMembersRequest(
IClientAPI sender, Packet Pack)
11183 GroupMembersRequestPacket groupMembersRequestPacket =
11184 (GroupMembersRequestPacket)Pack;
11186 #region Packet Session and User Check
11187 if (m_checkPackets)
11189 if (groupMembersRequestPacket.AgentData.SessionID != SessionId ||
11190 groupMembersRequestPacket.AgentData.AgentID != AgentId)
11195 if (m_GroupsModule != null)
11197 List<GroupMembersData> members =
11198 m_GroupsModule.GroupMembersRequest(
this, groupMembersRequestPacket.GroupData.GroupID);
11200 int memberCount = members.Count;
11204 int blockCount = members.Count;
11205 if (blockCount > 40)
11208 GroupMembersReplyPacket groupMembersReply = (GroupMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupMembersReply);
11210 groupMembersReply.AgentData =
11211 new GroupMembersReplyPacket.AgentDataBlock();
11212 groupMembersReply.GroupData =
11213 new GroupMembersReplyPacket.GroupDataBlock();
11214 groupMembersReply.MemberData =
11215 new GroupMembersReplyPacket.MemberDataBlock[
11218 groupMembersReply.AgentData.AgentID = AgentId;
11219 groupMembersReply.GroupData.GroupID =
11220 groupMembersRequestPacket.GroupData.GroupID;
11221 groupMembersReply.GroupData.RequestID =
11222 groupMembersRequestPacket.GroupData.RequestID;
11223 groupMembersReply.GroupData.MemberCount = memberCount;
11225 for (
int i = 0; i < blockCount; i++)
11228 members.RemoveAt(0);
11230 groupMembersReply.MemberData[i] =
11231 new GroupMembersReplyPacket.MemberDataBlock();
11232 groupMembersReply.MemberData[i].AgentID =
11234 groupMembersReply.MemberData[i].Contribution =
11236 groupMembersReply.MemberData[i].OnlineStatus =
11237 Util.StringToBytes256(m.OnlineStatus);
11238 groupMembersReply.MemberData[i].AgentPowers =
11240 groupMembersReply.MemberData[i].Title =
11241 Util.StringToBytes256(m.Title);
11242 groupMembersReply.MemberData[i].IsOwner =
11246 if (members.Count == 0)
11252 private bool HandleGroupRoleDataRequest(
IClientAPI sender, Packet Pack)
11254 GroupRoleDataRequestPacket groupRolesRequest =
11255 (GroupRoleDataRequestPacket)Pack;
11257 #region Packet Session and User Check
11258 if (m_checkPackets)
11260 if (groupRolesRequest.AgentData.SessionID != SessionId ||
11261 groupRolesRequest.AgentData.AgentID != AgentId)
11266 if (m_GroupsModule != null)
11268 GroupRoleDataReplyPacket groupRolesReply = (GroupRoleDataReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleDataReply);
11270 groupRolesReply.AgentData =
11271 new GroupRoleDataReplyPacket.AgentDataBlock();
11273 groupRolesReply.AgentData.AgentID = AgentId;
11275 groupRolesReply.GroupData =
11276 new GroupRoleDataReplyPacket.GroupDataBlock();
11278 groupRolesReply.GroupData.GroupID =
11279 groupRolesRequest.GroupData.GroupID;
11281 groupRolesReply.GroupData.RequestID =
11282 groupRolesRequest.GroupData.RequestID;
11284 List<GroupRolesData> titles =
11285 m_GroupsModule.GroupRoleDataRequest(
this,
11286 groupRolesRequest.GroupData.GroupID);
11288 groupRolesReply.GroupData.RoleCount =
11291 groupRolesReply.RoleData =
11292 new GroupRoleDataReplyPacket.RoleDataBlock[titles.Count];
11297 groupRolesReply.RoleData[i] =
11298 new GroupRoleDataReplyPacket.RoleDataBlock();
11300 groupRolesReply.RoleData[i].RoleID =
11302 groupRolesReply.RoleData[i].Name =
11303 Util.StringToBytes256(d.Name);
11304 groupRolesReply.RoleData[i].Title =
11305 Util.StringToBytes256(d.Title);
11306 groupRolesReply.RoleData[i].Description =
11307 Util.StringToBytes1024(d.Description);
11308 groupRolesReply.RoleData[i].Powers =
11310 groupRolesReply.RoleData[i].Members =
11321 private bool HandleGroupRoleMembersRequest(
IClientAPI sender, Packet Pack)
11323 GroupRoleMembersRequestPacket groupRoleMembersRequest =
11324 (GroupRoleMembersRequestPacket)Pack;
11326 #region Packet Session and User Check
11327 if (m_checkPackets)
11329 if (groupRoleMembersRequest.AgentData.SessionID != SessionId ||
11330 groupRoleMembersRequest.AgentData.AgentID != AgentId)
11335 if (m_GroupsModule != null)
11337 List<GroupRoleMembersData> mappings =
11338 m_GroupsModule.GroupRoleMembersRequest(
this,
11339 groupRoleMembersRequest.GroupData.GroupID);
11341 int mappingsCount = mappings.Count;
11343 while (mappings.Count > 0)
11345 int pairs = mappings.Count;
11349 GroupRoleMembersReplyPacket groupRoleMembersReply = (GroupRoleMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleMembersReply);
11350 groupRoleMembersReply.AgentData =
11351 new GroupRoleMembersReplyPacket.AgentDataBlock();
11352 groupRoleMembersReply.AgentData.AgentID =
11354 groupRoleMembersReply.AgentData.GroupID =
11355 groupRoleMembersRequest.GroupData.GroupID;
11356 groupRoleMembersReply.AgentData.RequestID =
11357 groupRoleMembersRequest.GroupData.RequestID;
11359 groupRoleMembersReply.AgentData.TotalPairs =
11360 (uint)mappingsCount;
11362 groupRoleMembersReply.MemberData =
11363 new GroupRoleMembersReplyPacket.MemberDataBlock[pairs];
11365 for (
int i = 0; i < pairs; i++)
11368 mappings.RemoveAt(0);
11370 groupRoleMembersReply.MemberData[i] =
11371 new GroupRoleMembersReplyPacket.MemberDataBlock();
11373 groupRoleMembersReply.MemberData[i].RoleID =
11375 groupRoleMembersReply.MemberData[i].MemberID =
11384 private bool HandleCreateGroupRequest(
IClientAPI sender, Packet Pack)
11386 CreateGroupRequestPacket createGroupRequest =
11387 (CreateGroupRequestPacket)Pack;
11389 #region Packet Session and User Check
11390 if (m_checkPackets)
11392 if (createGroupRequest.AgentData.SessionID != SessionId ||
11393 createGroupRequest.AgentData.AgentID != AgentId)
11398 if (m_GroupsModule != null)
11400 m_GroupsModule.CreateGroup(
this,
11401 Utils.BytesToString(createGroupRequest.GroupData.Name),
11402 Utils.BytesToString(createGroupRequest.GroupData.Charter),
11403 createGroupRequest.GroupData.ShowInList,
11404 createGroupRequest.GroupData.InsigniaID,
11405 createGroupRequest.GroupData.MembershipFee,
11406 createGroupRequest.GroupData.OpenEnrollment,
11407 createGroupRequest.GroupData.AllowPublish,
11408 createGroupRequest.GroupData.MaturePublish);
11412 private bool HandleUpdateGroupInfo(
IClientAPI sender, Packet Pack)
11414 UpdateGroupInfoPacket updateGroupInfo =
11415 (UpdateGroupInfoPacket)Pack;
11417 #region Packet Session and User Check
11418 if (m_checkPackets)
11420 if (updateGroupInfo.AgentData.SessionID != SessionId ||
11421 updateGroupInfo.AgentData.AgentID != AgentId)
11426 if (m_GroupsModule != null)
11428 m_GroupsModule.UpdateGroupInfo(
this,
11429 updateGroupInfo.GroupData.GroupID,
11430 Utils.BytesToString(updateGroupInfo.GroupData.Charter),
11431 updateGroupInfo.GroupData.ShowInList,
11432 updateGroupInfo.GroupData.InsigniaID,
11433 updateGroupInfo.GroupData.MembershipFee,
11434 updateGroupInfo.GroupData.OpenEnrollment,
11435 updateGroupInfo.GroupData.AllowPublish,
11436 updateGroupInfo.GroupData.MaturePublish);
11441 private bool HandleSetGroupAcceptNotices(
IClientAPI sender, Packet Pack)
11443 SetGroupAcceptNoticesPacket setGroupAcceptNotices =
11444 (SetGroupAcceptNoticesPacket)Pack;
11446 #region Packet Session and User Check
11447 if (m_checkPackets)
11449 if (setGroupAcceptNotices.AgentData.SessionID != SessionId ||
11450 setGroupAcceptNotices.AgentData.AgentID != AgentId)
11455 if (m_GroupsModule != null)
11457 m_GroupsModule.SetGroupAcceptNotices(
this,
11458 setGroupAcceptNotices.Data.GroupID,
11459 setGroupAcceptNotices.Data.AcceptNotices,
11460 setGroupAcceptNotices.NewData.ListInProfile);
11465 private bool HandleGroupTitleUpdate(
IClientAPI sender, Packet Pack)
11467 GroupTitleUpdatePacket groupTitleUpdate =
11468 (GroupTitleUpdatePacket)Pack;
11470 #region Packet Session and User Check
11471 if (m_checkPackets)
11473 if (groupTitleUpdate.AgentData.SessionID != SessionId ||
11474 groupTitleUpdate.AgentData.AgentID != AgentId)
11479 if (m_GroupsModule != null)
11481 m_GroupsModule.GroupTitleUpdate(
this,
11482 groupTitleUpdate.AgentData.GroupID,
11483 groupTitleUpdate.AgentData.TitleRoleID);
11488 private bool HandleParcelDeedToGroup(
IClientAPI sender, Packet Pack)
11490 ParcelDeedToGroupPacket parcelDeedToGroup = (ParcelDeedToGroupPacket)Pack;
11491 if (m_GroupsModule != null)
11494 if (handlerParcelDeedToGroup != null)
11496 handlerParcelDeedToGroup(parcelDeedToGroup.Data.LocalID, parcelDeedToGroup.Data.GroupID,
this);
11503 private bool HandleGroupNoticesListRequest(
IClientAPI sender, Packet Pack)
11505 GroupNoticesListRequestPacket groupNoticesListRequest =
11506 (GroupNoticesListRequestPacket)Pack;
11508 #region Packet Session and User Check
11509 if (m_checkPackets)
11511 if (groupNoticesListRequest.AgentData.SessionID != SessionId ||
11512 groupNoticesListRequest.AgentData.AgentID != AgentId)
11517 if (m_GroupsModule != null)
11520 m_GroupsModule.GroupNoticesListRequest(
this,
11521 groupNoticesListRequest.Data.GroupID);
11523 GroupNoticesListReplyPacket groupNoticesListReply = (GroupNoticesListReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupNoticesListReply);
11524 groupNoticesListReply.AgentData =
11525 new GroupNoticesListReplyPacket.AgentDataBlock();
11526 groupNoticesListReply.AgentData.AgentID = AgentId;
11527 groupNoticesListReply.AgentData.GroupID = groupNoticesListRequest.Data.GroupID;
11529 groupNoticesListReply.Data =
new GroupNoticesListReplyPacket.DataBlock[gn.Length];
11534 groupNoticesListReply.Data[i] =
new GroupNoticesListReplyPacket.DataBlock();
11535 groupNoticesListReply.Data[i].NoticeID =
11537 groupNoticesListReply.Data[i].Timestamp =
11539 groupNoticesListReply.Data[i].FromName =
11540 Util.StringToBytes256(g.FromName);
11541 groupNoticesListReply.Data[i].Subject =
11542 Util.StringToBytes256(g.Subject);
11543 groupNoticesListReply.Data[i].HasAttachment =
11545 groupNoticesListReply.Data[i].AssetType =
11555 private bool HandleGroupNoticeRequest(
IClientAPI sender, Packet Pack)
11557 GroupNoticeRequestPacket groupNoticeRequest =
11558 (GroupNoticeRequestPacket)Pack;
11560 #region Packet Session and User Check
11561 if (m_checkPackets)
11563 if (groupNoticeRequest.AgentData.SessionID != SessionId ||
11564 groupNoticeRequest.AgentData.AgentID != AgentId)
11569 if (m_GroupsModule != null)
11571 m_GroupsModule.GroupNoticeRequest(
this,
11572 groupNoticeRequest.Data.GroupNoticeID);
11576 private bool HandleGroupRoleUpdate(
IClientAPI sender, Packet Pack)
11578 GroupRoleUpdatePacket groupRoleUpdate =
11579 (GroupRoleUpdatePacket)Pack;
11581 #region Packet Session and User Check
11582 if (m_checkPackets)
11584 if (groupRoleUpdate.AgentData.SessionID != SessionId ||
11585 groupRoleUpdate.AgentData.AgentID != AgentId)
11590 if (m_GroupsModule != null)
11592 foreach (GroupRoleUpdatePacket.RoleDataBlock d in
11593 groupRoleUpdate.RoleData)
11595 m_GroupsModule.GroupRoleUpdate(
this,
11596 groupRoleUpdate.AgentData.GroupID,
11598 Utils.BytesToString(d.Name),
11599 Utils.BytesToString(d.Description),
11600 Utils.BytesToString(d.Title),
11604 m_GroupsModule.NotifyChange(groupRoleUpdate.AgentData.GroupID);
11608 private bool HandleGroupRoleChanges(
IClientAPI sender, Packet Pack)
11610 GroupRoleChangesPacket groupRoleChanges =
11611 (GroupRoleChangesPacket)Pack;
11613 #region Packet Session and User Check
11614 if (m_checkPackets)
11616 if (groupRoleChanges.AgentData.SessionID != SessionId ||
11617 groupRoleChanges.AgentData.AgentID != AgentId)
11622 if (m_GroupsModule != null)
11624 foreach (GroupRoleChangesPacket.RoleChangeBlock d in
11625 groupRoleChanges.RoleChange)
11627 m_GroupsModule.GroupRoleChanges(
this,
11628 groupRoleChanges.AgentData.GroupID,
11633 m_GroupsModule.NotifyChange(groupRoleChanges.AgentData.GroupID);
11637 private bool HandleJoinGroupRequest(
IClientAPI sender, Packet Pack)
11639 JoinGroupRequestPacket joinGroupRequest =
11640 (JoinGroupRequestPacket)Pack;
11642 #region Packet Session and User Check
11643 if (m_checkPackets)
11645 if (joinGroupRequest.AgentData.SessionID != SessionId ||
11646 joinGroupRequest.AgentData.AgentID != AgentId)
11651 if (m_GroupsModule != null)
11653 m_GroupsModule.JoinGroupRequest(
this,
11654 joinGroupRequest.GroupData.GroupID);
11658 private bool HandleLeaveGroupRequest(
IClientAPI sender, Packet Pack)
11660 LeaveGroupRequestPacket leaveGroupRequest =
11661 (LeaveGroupRequestPacket)Pack;
11663 #region Packet Session and User Check
11664 if (m_checkPackets)
11666 if (leaveGroupRequest.AgentData.SessionID != SessionId ||
11667 leaveGroupRequest.AgentData.AgentID != AgentId)
11672 if (m_GroupsModule != null)
11674 m_GroupsModule.LeaveGroupRequest(
this,
11675 leaveGroupRequest.GroupData.GroupID);
11679 private bool HandleEjectGroupMemberRequest(
IClientAPI sender, Packet Pack)
11681 EjectGroupMemberRequestPacket ejectGroupMemberRequest =
11682 (EjectGroupMemberRequestPacket)Pack;
11684 #region Packet Session and User Check
11685 if (m_checkPackets)
11687 if (ejectGroupMemberRequest.AgentData.SessionID != SessionId ||
11688 ejectGroupMemberRequest.AgentData.AgentID != AgentId)
11693 if (m_GroupsModule != null)
11695 foreach (EjectGroupMemberRequestPacket.EjectDataBlock e
11696 in ejectGroupMemberRequest.EjectData)
11698 m_GroupsModule.EjectGroupMemberRequest(
this,
11699 ejectGroupMemberRequest.GroupData.GroupID,
11705 private bool HandleInviteGroupRequest(
IClientAPI sender, Packet Pack)
11707 InviteGroupRequestPacket inviteGroupRequest =
11708 (InviteGroupRequestPacket)Pack;
11710 #region Packet Session and User Check
11711 if (m_checkPackets)
11713 if (inviteGroupRequest.AgentData.SessionID != SessionId ||
11714 inviteGroupRequest.AgentData.AgentID != AgentId)
11719 if (m_GroupsModule != null)
11721 foreach (InviteGroupRequestPacket.InviteDataBlock b in
11722 inviteGroupRequest.InviteData)
11724 m_GroupsModule.InviteGroupRequest(
this,
11725 inviteGroupRequest.GroupData.GroupID,
11735 private bool HandleStartLure(
IClientAPI sender, Packet Pack)
11737 StartLurePacket startLureRequest = (StartLurePacket)Pack;
11739 #region Packet Session and User Check
11740 if (m_checkPackets)
11742 if (startLureRequest.AgentData.SessionID != SessionId ||
11743 startLureRequest.AgentData.AgentID != AgentId)
11748 StartLure handlerStartLure = OnStartLure;
11749 if (handlerStartLure != null)
11751 for (
int i = 0 ; i < startLureRequest.TargetData.Length ; i++)
11753 handlerStartLure(startLureRequest.Info.LureType,
11754 Utils.BytesToString(
11755 startLureRequest.Info.Message),
11756 startLureRequest.TargetData[i].TargetID,
11762 private bool HandleTeleportLureRequest(
IClientAPI sender, Packet Pack)
11764 TeleportLureRequestPacket teleportLureRequest =
11765 (TeleportLureRequestPacket)Pack;
11767 #region Packet Session and User Check
11768 if (m_checkPackets)
11770 if (teleportLureRequest.Info.SessionID != SessionId ||
11771 teleportLureRequest.Info.AgentID != AgentId)
11777 if (handlerTeleportLureRequest != null)
11778 handlerTeleportLureRequest(
11779 teleportLureRequest.Info.LureID,
11780 teleportLureRequest.Info.TeleportFlags,
11784 private bool HandleClassifiedInfoRequest(
IClientAPI sender, Packet Pack)
11786 ClassifiedInfoRequestPacket classifiedInfoRequest =
11787 (ClassifiedInfoRequestPacket)Pack;
11789 #region Packet Session and User Check
11790 if (m_checkPackets)
11792 if (classifiedInfoRequest.AgentData.SessionID != SessionId ||
11793 classifiedInfoRequest.AgentData.AgentID != AgentId)
11799 if (handlerClassifiedInfoRequest != null)
11800 handlerClassifiedInfoRequest(
11801 classifiedInfoRequest.Data.ClassifiedID,
11805 private bool HandleClassifiedInfoUpdate(
IClientAPI sender, Packet Pack)
11807 ClassifiedInfoUpdatePacket classifiedInfoUpdate =
11808 (ClassifiedInfoUpdatePacket)Pack;
11810 #region Packet Session and User Check
11811 if (m_checkPackets)
11813 if (classifiedInfoUpdate.AgentData.SessionID != SessionId ||
11814 classifiedInfoUpdate.AgentData.AgentID != AgentId)
11820 if (handlerClassifiedInfoUpdate != null)
11821 handlerClassifiedInfoUpdate(
11822 classifiedInfoUpdate.Data.ClassifiedID,
11823 classifiedInfoUpdate.Data.Category,
11824 Utils.BytesToString(
11825 classifiedInfoUpdate.Data.Name),
11826 Utils.BytesToString(
11827 classifiedInfoUpdate.Data.Desc),
11828 classifiedInfoUpdate.Data.ParcelID,
11829 classifiedInfoUpdate.Data.ParentEstate,
11830 classifiedInfoUpdate.Data.SnapshotID,
11832 classifiedInfoUpdate.Data.PosGlobal),
11833 classifiedInfoUpdate.Data.ClassifiedFlags,
11834 classifiedInfoUpdate.Data.PriceForListing,
11838 private bool HandleClassifiedDelete(
IClientAPI sender, Packet Pack)
11840 ClassifiedDeletePacket classifiedDelete =
11841 (ClassifiedDeletePacket)Pack;
11843 #region Packet Session and User Check
11844 if (m_checkPackets)
11846 if (classifiedDelete.AgentData.SessionID != SessionId ||
11847 classifiedDelete.AgentData.AgentID != AgentId)
11853 if (handlerClassifiedDelete != null)
11854 handlerClassifiedDelete(
11855 classifiedDelete.Data.ClassifiedID,
11859 private bool HandleClassifiedGodDelete(
IClientAPI sender, Packet Pack)
11861 ClassifiedGodDeletePacket classifiedGodDelete =
11862 (ClassifiedGodDeletePacket)Pack;
11864 #region Packet Session and User Check
11865 if (m_checkPackets)
11867 if (classifiedGodDelete.AgentData.SessionID != SessionId ||
11868 classifiedGodDelete.AgentData.AgentID != AgentId)
11874 if (handlerClassifiedGodDelete != null)
11875 handlerClassifiedGodDelete(
11876 classifiedGodDelete.Data.ClassifiedID,
11877 classifiedGodDelete.Data.QueryID,
11881 private bool HandleEventGodDelete(
IClientAPI sender, Packet Pack)
11883 EventGodDeletePacket eventGodDelete =
11884 (EventGodDeletePacket)Pack;
11886 #region Packet Session and User Check
11887 if (m_checkPackets)
11889 if (eventGodDelete.AgentData.SessionID != SessionId ||
11890 eventGodDelete.AgentData.AgentID != AgentId)
11896 if (handlerEventGodDelete != null)
11897 handlerEventGodDelete(
11898 eventGodDelete.EventData.EventID,
11899 eventGodDelete.QueryData.QueryID,
11900 Utils.BytesToString(
11901 eventGodDelete.QueryData.QueryText),
11902 eventGodDelete.QueryData.QueryFlags,
11903 eventGodDelete.QueryData.QueryStart,
11907 private bool HandleEventNotificationAddRequest(
IClientAPI sender, Packet Pack)
11909 EventNotificationAddRequestPacket eventNotificationAdd =
11910 (EventNotificationAddRequestPacket)Pack;
11912 #region Packet Session and User Check
11913 if (m_checkPackets)
11915 if (eventNotificationAdd.AgentData.SessionID != SessionId ||
11916 eventNotificationAdd.AgentData.AgentID != AgentId)
11922 if (handlerEventNotificationAddRequest != null)
11923 handlerEventNotificationAddRequest(
11924 eventNotificationAdd.EventData.EventID,
this);
11927 private bool HandleEventNotificationRemoveRequest(
IClientAPI sender, Packet Pack)
11929 EventNotificationRemoveRequestPacket eventNotificationRemove =
11930 (EventNotificationRemoveRequestPacket)Pack;
11932 #region Packet Session and User Check
11933 if (m_checkPackets)
11935 if (eventNotificationRemove.AgentData.SessionID != SessionId ||
11936 eventNotificationRemove.AgentData.AgentID != AgentId)
11942 if (handlerEventNotificationRemoveRequest != null)
11943 handlerEventNotificationRemoveRequest(
11944 eventNotificationRemove.EventData.EventID,
this);
11947 private bool HandleRetrieveInstantMessages(
IClientAPI sender, Packet Pack)
11949 RetrieveInstantMessagesPacket rimpInstantMessagePack = (RetrieveInstantMessagesPacket)Pack;
11951 #region Packet Session and User Check
11952 if (m_checkPackets)
11954 if (rimpInstantMessagePack.AgentData.SessionID != SessionId ||
11955 rimpInstantMessagePack.AgentData.AgentID != AgentId)
11961 if (handlerRetrieveInstantMessages != null)
11962 handlerRetrieveInstantMessages(
this);
11965 private bool HandlePickDelete(
IClientAPI sender, Packet Pack)
11967 PickDeletePacket pickDelete =
11968 (PickDeletePacket)Pack;
11970 #region Packet Session and User Check
11971 if (m_checkPackets)
11973 if (pickDelete.AgentData.SessionID != SessionId ||
11974 pickDelete.AgentData.AgentID != AgentId)
11979 PickDelete handlerPickDelete = OnPickDelete;
11980 if (handlerPickDelete != null)
11981 handlerPickDelete(
this, pickDelete.Data.PickID);
11984 private bool HandlePickGodDelete(
IClientAPI sender, Packet Pack)
11986 PickGodDeletePacket pickGodDelete =
11987 (PickGodDeletePacket)Pack;
11989 #region Packet Session and User Check
11990 if (m_checkPackets)
11992 if (pickGodDelete.AgentData.SessionID != SessionId ||
11993 pickGodDelete.AgentData.AgentID != AgentId)
11999 if (handlerPickGodDelete != null)
12000 handlerPickGodDelete(
this,
12001 pickGodDelete.AgentData.AgentID,
12002 pickGodDelete.Data.PickID,
12003 pickGodDelete.Data.QueryID);
12006 private bool HandlePickInfoUpdate(
IClientAPI sender, Packet Pack)
12008 PickInfoUpdatePacket pickInfoUpdate =
12009 (PickInfoUpdatePacket)Pack;
12011 #region Packet Session and User Check
12012 if (m_checkPackets)
12014 if (pickInfoUpdate.AgentData.SessionID != SessionId ||
12015 pickInfoUpdate.AgentData.AgentID != AgentId)
12021 if (handlerPickInfoUpdate != null)
12022 handlerPickInfoUpdate(
this,
12023 pickInfoUpdate.Data.PickID,
12024 pickInfoUpdate.Data.CreatorID,
12025 pickInfoUpdate.Data.TopPick,
12026 Utils.BytesToString(pickInfoUpdate.Data.Name),
12027 Utils.BytesToString(pickInfoUpdate.Data.Desc),
12028 pickInfoUpdate.Data.SnapshotID,
12029 pickInfoUpdate.Data.SortOrder,
12030 pickInfoUpdate.Data.Enabled);
12033 private bool HandleAvatarNotesUpdate(
IClientAPI sender, Packet Pack)
12035 AvatarNotesUpdatePacket avatarNotesUpdate =
12036 (AvatarNotesUpdatePacket)Pack;
12038 #region Packet Session and User Check
12039 if (m_checkPackets)
12041 if (avatarNotesUpdate.AgentData.SessionID != SessionId ||
12042 avatarNotesUpdate.AgentData.AgentID != AgentId)
12048 if (handlerAvatarNotesUpdate != null)
12049 handlerAvatarNotesUpdate(
this,
12050 avatarNotesUpdate.Data.TargetID,
12051 Utils.BytesToString(avatarNotesUpdate.Data.Notes));
12054 private bool HandleAvatarInterestsUpdate(
IClientAPI sender, Packet Pack)
12056 AvatarInterestsUpdatePacket avatarInterestUpdate =
12057 (AvatarInterestsUpdatePacket)Pack;
12059 #region Packet Session and User Check
12060 if (m_checkPackets)
12062 if (avatarInterestUpdate.AgentData.SessionID != SessionId ||
12063 avatarInterestUpdate.AgentData.AgentID != AgentId)
12069 if (handlerAvatarInterestUpdate != null)
12070 handlerAvatarInterestUpdate(
this,
12071 avatarInterestUpdate.PropertiesData.WantToMask,
12072 Utils.BytesToString(avatarInterestUpdate.PropertiesData.WantToText),
12073 avatarInterestUpdate.PropertiesData.SkillsMask,
12074 Utils.BytesToString(avatarInterestUpdate.PropertiesData.SkillsText),
12075 Utils.BytesToString(avatarInterestUpdate.PropertiesData.LanguagesText));
12079 private bool HandleGrantUserRights(
IClientAPI sender, Packet Pack)
12081 GrantUserRightsPacket GrantUserRights =
12082 (GrantUserRightsPacket)Pack;
12083 #region Packet Session and User Check
12084 if (m_checkPackets)
12086 if (GrantUserRights.AgentData.SessionID != SessionId ||
12087 GrantUserRights.AgentData.AgentID != AgentId)
12093 if (GrantUserRightsHandler != null)
12094 GrantUserRightsHandler(
this,
12095 GrantUserRights.Rights[0].AgentRelated,
12096 GrantUserRights.Rights[0].RelatedRights);
12101 private bool HandlePlacesQuery(
IClientAPI sender, Packet Pack)
12103 PlacesQueryPacket placesQueryPacket =
12104 (PlacesQueryPacket)Pack;
12108 if (handlerPlacesQuery != null)
12109 handlerPlacesQuery(placesQueryPacket.AgentData.QueryID,
12110 placesQueryPacket.TransactionData.TransactionID,
12111 Utils.BytesToString(
12112 placesQueryPacket.QueryData.QueryText),
12113 placesQueryPacket.QueryData.QueryFlags,
12114 (byte)placesQueryPacket.QueryData.Category,
12115 Utils.BytesToString(
12116 placesQueryPacket.QueryData.SimName),
12121 #endregion Packet Handlers
12126 scriptQuestion.Data =
new ScriptQuestionPacket.DataBlock();
12128 scriptQuestion.Data.TaskID = taskID;
12129 scriptQuestion.Data.ItemID = itemID;
12130 scriptQuestion.Data.Questions = question;
12131 scriptQuestion.Data.ObjectName = Util.StringToBytes256(taskName);
12132 scriptQuestion.Data.ObjectOwner = Util.StringToBytes256(ownerName);
12145 if (packet.Type == PacketType.LogoutRequest)
12150 return Logout(client);
12160 m_log.InfoFormat(
"[CLIENT]: Got a logout request for {0} in {1}", Name, Scene.RegionInfo.RegionName);
12162 Action<IClientAPI> handlerLogout = OnLogout;
12164 if (handlerLogout != null)
12166 handlerLogout(client);
12250 AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet;
12251 AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)
PacketPool.
Instance.
GetPacket(PacketType.AgentCachedTextureResponse);
12253 if (cachedtex.AgentData.SessionID != SessionId)
12257 cachedresp.AgentData.AgentID = AgentId;
12258 cachedresp.AgentData.SessionID = m_sessionId;
12259 cachedresp.AgentData.SerialNum = cachedtex.AgentData.SerialNum;
12260 cachedresp.WearableData =
12261 new AgentCachedTextureResponsePacket.WearableDataBlock[cachedtex.WearableData.Length];
12269 ScenePresence p = m_scene.GetScenePresence(AgentId);
12273 cacheItems = p.Appearance.WearableCacheItems;
12276 int maxWearablesLoop = cachedtex.WearableData.Length;
12277 if (maxWearablesLoop > cacheItems.Length)
12278 maxWearablesLoop = cacheItems.Length;
12280 if (cacheItems != null)
12282 for (
int i = 0; i < maxWearablesLoop; i++)
12284 int idx = cachedtex.WearableData[i].TextureIndex;
12285 cachedresp.WearableData[i] =
new AgentCachedTextureResponsePacket.WearableDataBlock();
12286 cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex;
12287 cachedresp.WearableData[i].HostName =
new byte[0];
12288 if (cachedtex.WearableData[i].ID == cacheItems[idx].
CacheId)
12290 cachedresp.WearableData[i].TextureID = cacheItems[idx].TextureID;
12295 cachedresp.WearableData[i].TextureID = UUID.Zero;
12301 for (
int i = 0; i < maxWearablesLoop; i++)
12303 cachedresp.WearableData[i] =
new AgentCachedTextureResponsePacket.WearableDataBlock();
12304 cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex;
12305 cachedresp.WearableData[i].TextureID = UUID.Zero;
12306 cachedresp.WearableData[i].HostName =
new byte[0];
12312 cachedresp.Header.Zerocoded =
true;
12328 ScenePresence presence = avatar as ScenePresence;
12329 if (presence == null)
12332 AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)
PacketPool.
Instance.
GetPacket(PacketType.AgentCachedTextureResponse);
12335 cachedresp.AgentData.AgentID = m_agentId;
12336 cachedresp.AgentData.SessionID = m_sessionId;
12337 cachedresp.AgentData.SerialNum = serial;
12338 cachedresp.WearableData =
new AgentCachedTextureResponsePacket.WearableDataBlock[cachedTextures.Count];
12340 for (
int i = 0; i < cachedTextures.Count; i++)
12342 cachedresp.WearableData[i] =
new AgentCachedTextureResponsePacket.WearableDataBlock();
12343 cachedresp.WearableData[i].TextureIndex = (byte)cachedTextures[i].BakedTextureIndex;
12344 cachedresp.WearableData[i].TextureID = cachedTextures[i].BakedTextureID;
12345 cachedresp.WearableData[i].HostName =
new byte[0];
12348 cachedresp.Header.Zerocoded =
true;
12354 MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet;
12356 if (multipleupdate.AgentData.SessionID != SessionId)
12364 for (
int i = 0; i < multipleupdate.ObjectData.Length; i++)
12366 MultipleObjectUpdatePacket.ObjectDataBlock block = multipleupdate.ObjectData[i];
12369 if (block.Data != null)
12371 uint localId = block.ObjectLocalID;
12372 SceneObjectPart part = tScene.GetSceneObjectPart(localId);
12377 simClient.SendKillObject(
new List<uint> { localId });
12383 if (updatehandler != null)
12399 switch (block.Type)
12402 udata.position =
new Vector3(block.Data, 0);
12404 udata.change = ObjectChangeType.primP;
12405 updatehandler(localId, udata,
this);
12409 udata.rotation =
new Quaternion(block.Data, 0,
true);
12411 udata.change = ObjectChangeType.primR;
12412 updatehandler(localId, udata,
this);
12416 udata.position =
new Vector3(block.Data, 0);
12417 udata.rotation =
new Quaternion(block.Data, 12,
true);
12419 udata.change = ObjectChangeType.primPR;
12420 updatehandler(localId, udata,
this);
12424 udata.scale =
new Vector3(block.Data, 0);
12425 udata.change = ObjectChangeType.primS;
12427 updatehandler(localId, udata,
this);
12431 udata.scale =
new Vector3(block.Data, 0);
12433 udata.change = ObjectChangeType.primUS;
12434 updatehandler(localId, udata,
this);
12438 udata.position =
new Vector3(block.Data, 0);
12439 udata.scale =
new Vector3(block.Data, 12);
12441 udata.change = ObjectChangeType.primPS;
12442 updatehandler(localId, udata,
this);
12446 udata.position =
new Vector3(block.Data, 0);
12447 udata.scale =
new Vector3(block.Data, 12);
12449 udata.change = ObjectChangeType.primPUS;
12450 updatehandler(localId, udata,
this);
12455 udata.position =
new Vector3(block.Data, 0);
12457 udata.change = ObjectChangeType.groupP;
12458 updatehandler(localId, udata,
this);
12462 udata.rotation =
new Quaternion(block.Data, 0,
true);
12464 udata.change = ObjectChangeType.groupR;
12465 updatehandler(localId, udata,
this);
12469 udata.position =
new Vector3(block.Data, 0);
12470 udata.rotation =
new Quaternion(block.Data, 12,
true);
12472 udata.change = ObjectChangeType.groupPR;
12473 updatehandler(localId, udata,
this);
12481 udata.scale =
new Vector3(block.Data, 0);
12483 udata.change = ObjectChangeType.groupS;
12484 updatehandler(localId, udata,
this);
12491 udata.position =
new Vector3(block.Data, 0);
12492 udata.scale =
new Vector3(block.Data, 12);
12494 udata.change = ObjectChangeType.groupPS;
12495 updatehandler(localId, udata,
this);
12499 udata.scale =
new Vector3(block.Data, 0);
12501 udata.change = ObjectChangeType.groupUS;
12502 updatehandler(localId, udata,
this);
12506 udata.position =
new Vector3(block.Data, 0);
12507 udata.scale =
new Vector3(block.Data, 12);
12509 udata.change = ObjectChangeType.groupPUS;
12510 updatehandler(localId, udata,
this);
12514 m_log.Debug(
"[CLIENT]: MultipleObjUpdate recieved an unknown packet type: " + (block.Type));
12531 mapReply.AgentData.AgentID = AgentId;
12532 mapReply.AgentData.Flags = 0;
12533 mapReply.LayerData =
new MapLayerReplyPacket.LayerDataBlock[1];
12534 mapReply.LayerData[0] =
new MapLayerReplyPacket.LayerDataBlock();
12535 mapReply.LayerData[0].Bottom = 0;
12536 mapReply.LayerData[0].Left = 0;
12537 mapReply.LayerData[0].Top = 30000;
12538 mapReply.LayerData[0].Right = 30000;
12539 mapReply.LayerData[0].ImageID =
new UUID(
"00000000-0000-1111-9999-000000000006");
12540 mapReply.Header.Zerocoded =
true;
12581 SetChildAgentThrottle(throttles, 1.0f);
12586 m_udpClient.SetThrottles(throttles, factor);
12588 if (handler != null)
12600 m_udpClient.ForceThrottleSetting(throttle,setting);
12605 return m_udpClient.GetThrottleSetting(throttle);
12615 return m_udpClient.GetThrottlesPacked(multiplier);
12623 throw new NotImplementedException();
12633 #region BinaryStats
12634 LLUDPServer.LogPacketHeader(
false, m_circuitCode, 0, packet.Type, (ushort)packet.Length);
12635 #endregion BinaryStats
12637 OutPacket(packet, throttlePacketType,
true);
12650 OutPacket(packet, throttlePacketType, doAutomaticSplitting, null);
12666 if (m_outPacketsToDrop != null)
12667 if (m_outPacketsToDrop.Contains(packet.Type.ToString()))
12670 if (DebugPacketLevel > 0)
12672 bool logPacket =
true;
12674 if (DebugPacketLevel <= 255
12675 && (packet.Type == PacketType.SimStats || packet.Type == PacketType.SimulatorViewerTimeMessage))
12678 if (DebugPacketLevel <= 200
12679 && (packet.Type == PacketType.ImagePacket
12680 || packet.Type == PacketType.ImageData
12681 || packet.Type == PacketType.LayerData
12682 || packet.Type == PacketType.CoarseLocationUpdate))
12685 if (DebugPacketLevel <= 100 && (packet.Type == PacketType.AvatarAnimation || packet.Type == PacketType.ViewerEffect))
12688 if (DebugPacketLevel <= 50
12689 && (packet.Type == PacketType.ImprovedTerseObjectUpdate || packet.Type == PacketType.ObjectUpdate))
12692 if (DebugPacketLevel <= 25 && packet.Type == PacketType.ObjectPropertiesFamily)
12697 "[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}",
12698 Name, SceneAgent.IsChildAgent ?
"child" :
"root ", m_scene.RegionInfo.RegionName, packet.Type);
12701 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method);
12712 Utils.LongToUInts(m_scene.RegionInfo.RegionHandle, out regionX, out regionY);
12713 locx = (float)(Convert.ToDouble(args[0]) - (double)regionX);
12714 locy = (float)(Convert.ToDouble(args[1]) - (double)regionY);
12715 locz = Convert.ToSingle(args[2]);
12717 Action<Vector3, bool, bool> handlerAutoPilotGo = OnAutoPilotGo;
12718 if (handlerAutoPilotGo != null)
12719 handlerAutoPilotGo(
new Vector3(locx, locy, locz),
false,
false);
12728 if (m_inPacketsToDrop != null)
12729 if (m_inPacketsToDrop.Contains(packet.Type.ToString()))
12732 if (DebugPacketLevel > 0)
12734 bool logPacket =
true;
12736 if (DebugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate)
12739 if (DebugPacketLevel <= 200 && packet.Type == PacketType.RequestImage)
12742 if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
12745 if (DebugPacketLevel <= 25 && packet.Type == PacketType.RequestObjectPropertiesFamily)
12750 "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}",
12751 Name, SceneAgent.IsChildAgent ?
"child" :
"root ", Scene.Name, packet.Type);
12754 if (!ProcessPacketMethod(packet))
12756 "[CLIENT]: Unhandled packet {0} from {1} ({2}) in {3}. Ignoring.",
12757 packet.Type, Name, SceneAgent.IsChildAgent ?
"child" :
"root ",
Scene.
Name);
12764 shape.PCode = addPacket.ObjectData.PCode;
12765 shape.State = addPacket.ObjectData.State;
12766 shape.LastAttachPoint = addPacket.ObjectData.State;
12767 shape.PathBegin = addPacket.ObjectData.PathBegin;
12768 shape.PathEnd = addPacket.ObjectData.PathEnd;
12769 shape.PathScaleX = addPacket.ObjectData.PathScaleX;
12770 shape.PathScaleY = addPacket.ObjectData.PathScaleY;
12771 shape.PathShearX = addPacket.ObjectData.PathShearX;
12772 shape.PathShearY = addPacket.ObjectData.PathShearY;
12773 shape.PathSkew = addPacket.ObjectData.PathSkew;
12774 shape.ProfileBegin = addPacket.ObjectData.ProfileBegin;
12775 shape.ProfileEnd = addPacket.ObjectData.ProfileEnd;
12776 shape.Scale = addPacket.ObjectData.Scale;
12777 shape.PathCurve = addPacket.ObjectData.PathCurve;
12778 shape.ProfileCurve = addPacket.ObjectData.ProfileCurve;
12779 shape.ProfileHollow = addPacket.ObjectData.ProfileHollow;
12780 shape.PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset;
12781 shape.PathRevolutions = addPacket.ObjectData.PathRevolutions;
12782 shape.PathTaperX = addPacket.ObjectData.PathTaperX;
12783 shape.PathTaperY = addPacket.ObjectData.PathTaperY;
12784 shape.PathTwist = addPacket.ObjectData.PathTwist;
12785 shape.PathTwistBegin = addPacket.ObjectData.PathTwistBegin;
12786 Primitive.TextureEntry ntex =
new Primitive.TextureEntry(
new UUID(
"89556747-24cb-43ed-920b-47caed15465f"));
12787 shape.TextureEntry = ntex.GetBytes();
12794 ClientInfo info = m_udpClient.GetClientInfo();
12796 info.proxyEP = null;
12798 info.agentcircuit = RequestClientInfo();
12805 m_udpClient.SetClientInfo(info);
12808 #region Media Parcel Members
12812 ParcelMediaCommandMessagePacket commandMessagePacket =
new ParcelMediaCommandMessagePacket();
12813 commandMessagePacket.CommandBlock.Flags = flags;
12814 commandMessagePacket.CommandBlock.Command = (uint)command;
12815 commandMessagePacket.CommandBlock.Time = time;
12821 byte autoScale,
string mediaType,
string mediaDesc,
int mediaWidth,
int mediaHeight,
12824 ParcelMediaUpdatePacket updatePacket =
new ParcelMediaUpdatePacket();
12825 updatePacket.DataBlock.MediaURL = Util.StringToBytes256(mediaUrl);
12826 updatePacket.DataBlock.MediaID = mediaTextureID;
12827 updatePacket.DataBlock.MediaAutoScale = autoScale;
12829 updatePacket.DataBlockExtended.MediaType = Util.StringToBytes256(mediaType);
12830 updatePacket.DataBlockExtended.MediaDesc = Util.StringToBytes256(mediaDesc);
12831 updatePacket.DataBlockExtended.MediaWidth = mediaWidth;
12832 updatePacket.DataBlockExtended.MediaHeight = mediaHeight;
12833 updatePacket.DataBlockExtended.MediaLoop = mediaLoop;
12844 SetFollowCamPropertiesPacket packet = (SetFollowCamPropertiesPacket)
PacketPool.
Instance.
GetPacket(PacketType.SetFollowCamProperties);
12845 packet.ObjectData.ObjectID = objectID;
12846 SetFollowCamPropertiesPacket.CameraPropertyBlock[] camPropBlock =
new SetFollowCamPropertiesPacket.CameraPropertyBlock[parameters.Count];
12848 foreach (KeyValuePair<int, float> pair
in parameters)
12850 SetFollowCamPropertiesPacket.CameraPropertyBlock block =
new SetFollowCamPropertiesPacket.CameraPropertyBlock();
12851 block.Type = pair.Key;
12852 block.Value = pair.Value;
12854 camPropBlock[idx++] = block;
12856 packet.CameraProperty = camPropBlock;
12862 ClearFollowCamPropertiesPacket packet = (ClearFollowCamPropertiesPacket)
PacketPool.
Instance.
GetPacket(PacketType.ClearFollowCamProperties);
12863 packet.ObjectData.ObjectID = objectID;
12885 return string.Empty;
12888 #region IClientCore
12890 private readonly Dictionary<Type, object> m_clientInterfaces =
new Dictionary<Type, object>();
12897 protected void RegisterInterface<T>(T iface)
12899 lock (m_clientInterfaces)
12901 if (!m_clientInterfaces.ContainsKey(typeof(T)))
12903 m_clientInterfaces.Add(typeof(T), iface);
12908 public bool TryGet<T>(out T iface)
12910 if (m_clientInterfaces.ContainsKey(typeof(T)))
12912 iface = (T)m_clientInterfaces[typeof(T)];
12915 iface =
default(T);
12921 return (T)m_clientInterfaces[typeof(T)];
12927 Thread.Sleep(1000);
12940 if (m_GroupsModule != null)
12943 m_GroupsModule.GetMembershipData(AgentId);
12945 m_groupPowers.Clear();
12947 if (GroupMembership != null)
12949 for (
int i = 0; i < GroupMembership.Length; i++)
12951 m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers;
12959 return m_udpClient.GetStats();
12964 return String.Empty;
12979 UUID requestID = UUID.Zero;
12980 int sourceType = transferRequest.TransferInfo.SourceType;
12982 if (sourceType == (
int)SourceType.Asset)
12984 requestID =
new UUID(transferRequest.TransferInfo.Params, 0);
12986 else if (sourceType == (
int)SourceType.SimInventoryItem)
12988 requestID =
new UUID(transferRequest.TransferInfo.Params, 80);
12990 else if (sourceType == (
int)SourceType.SimEstate)
12992 requestID = taskID;
13001 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
13013 TransferRequestPacket transferRequest = (TransferRequestPacket)sender;
13015 UUID requestID = UUID.Zero;
13016 byte source = (byte)SourceType.Asset;
13025 string assetServerURL = string.Empty;
13026 if (inventoryAccessModule.
IsForeignUser(AgentId, out assetServerURL) && !string.IsNullOrEmpty(assetServerURL))
13028 if (!assetServerURL.EndsWith(
"/") && !assetServerURL.EndsWith(
"="))
13029 assetServerURL = assetServerURL +
"/";
13032 asset = m_scene.AssetService.Get(assetServerURL + id);
13037 req.AssetInf = null;
13038 req.AssetRequestSource = source;
13039 req.IsTextureRequest =
false;
13040 req.NumPackets = 0;
13041 req.Params = transferRequest.TransferInfo.Params;
13042 req.RequestAssetID = requestID;
13043 req.TransferRequestID = transferRequest.TransferInfo.TransferID;
13045 SendAssetNotFound(req);
13051 if (transferRequest.TransferInfo.SourceType == (
int)SourceType.Asset)
13053 requestID =
new UUID(transferRequest.TransferInfo.Params, 0);
13055 else if (transferRequest.TransferInfo.SourceType == (
int)SourceType.SimInventoryItem)
13057 requestID =
new UUID(transferRequest.TransferInfo.Params, 80);
13058 source = (byte)SourceType.SimInventoryItem;
13063 if (transferRequest.TransferInfo.SourceType == (
int)SourceType.Asset && asset.Type == 10)
13067 req.AssetInf = asset;
13068 req.AssetRequestSource = source;
13069 req.IsTextureRequest =
false;
13070 req.NumPackets = CalculateNumPackets(asset.
Data);
13071 req.Params = transferRequest.TransferInfo.Params;
13072 req.RequestAssetID = requestID;
13073 req.TransferRequestID = transferRequest.TransferInfo.TransferID;
13083 private static int CalculateNumPackets(byte[] data)
13086 uint m_maxPacketSize = MaxTransferBytesPerPacket;
13087 int numPackets = 1;
13092 if (data.LongLength > m_maxPacketSize)
13095 long restData = data.LongLength - m_maxPacketSize;
13096 int restPackets = (int)((restData + m_maxPacketSize - 1) / m_maxPacketSize);
13097 numPackets += restPackets;
13105 RebakeAvatarTexturesPacket pack =
13108 pack.TextureData =
new RebakeAvatarTexturesPacket.TextureDataBlock();
13109 pack.TextureData.TextureID = textureID;
13118 public PacketMethod method {
get; set; }
13123 public bool Async {
get; set; }
13129 public bool InEngine {
get; set; }
13134 public bool result =
false;
13136 public readonly Packet Pack = null;
13137 public readonly PacketMethod Method = null;
13140 ClientView = pClientview;
13149 osdEvent.Add(
"message",
new OSDString(eventName));
13150 osdEvent.Add(
"body", eventBody);
13159 packet.AgentData =
new AvatarInterestsReplyPacket.AgentDataBlock();
13160 packet.AgentData.AgentID = AgentId;
13161 packet.AgentData.AvatarID = avatarID;
13163 packet.PropertiesData =
new AvatarInterestsReplyPacket.PropertiesDataBlock();
13164 packet.PropertiesData.WantToMask = wantMask;
13165 packet.PropertiesData.WantToText = Utils.StringToBytes(wantText);
13166 packet.PropertiesData.SkillsMask = skillsMask;
13167 packet.PropertiesData.SkillsText = Utils.StringToBytes(skillsText);
13168 packet.PropertiesData.LanguagesText = Utils.StringToBytes(languages);
13176 packet.AgentData =
new ChangeUserRightsPacket.AgentDataBlock();
13177 packet.AgentData.AgentID = agentID;
13179 packet.Rights =
new ChangeUserRightsPacket.RightsBlock[1];
13180 packet.Rights[0] =
new ChangeUserRightsPacket.RightsBlock();
13181 packet.Rights[0].AgentRelated = friendID;
13182 packet.Rights[0].RelatedRights = rights;
13187 public void SendTextBoxRequest(
string message,
int chatChannel,
string objectname, UUID ownerID,
string ownerFirstName,
string ownerLastName, UUID objectId)
13190 dialog.Data.ObjectID = objectId;
13191 dialog.Data.ChatChannel = chatChannel;
13192 dialog.Data.ImageID = UUID.Zero;
13193 dialog.Data.ObjectName = Util.StringToBytes256(objectname);
13195 dialog.Data.FirstName = Util.StringToBytes256(ownerFirstName);
13196 dialog.Data.LastName = Util.StringToBytes256(ownerLastName);
13197 dialog.Data.Message = Util.StringToBytes(message,512);
13199 ScriptDialogPacket.ButtonsBlock[] buttons =
new ScriptDialogPacket.ButtonsBlock[1];
13200 buttons[0] =
new ScriptDialogPacket.ButtonsBlock();
13201 buttons[0].ButtonLabel = Util.StringToBytes256(
"!!llTextBox!!");
13202 dialog.Buttons = buttons;
13204 dialog.OwnerData =
new ScriptDialogPacket.OwnerDataBlock[1];
13205 dialog.OwnerData[0] =
new ScriptDialogPacket.OwnerDataBlock();
13206 dialog.OwnerData[0].OwnerID = ownerID;
13213 if (p is ScenePresence)
13226 ImprovedTerseObjectUpdatePacket.ObjectDataBlock block =
13227 CreateImprovedTerseBlock(p,
false);
13230 ushort timeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f);;
13232 ImprovedTerseObjectUpdatePacket packet
13234 PacketType.ImprovedTerseObjectUpdate);
13236 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
13237 packet.RegionData.TimeDilation = timeDilation;
13238 packet.ObjectData =
new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
13240 packet.ObjectData[0] = block;
13252 PlacesReplyPacket reply = null;
13253 PlacesReplyPacket.QueryDataBlock[] dataBlocks =
13254 new PlacesReplyPacket.QueryDataBlock[0];
13256 for (
int i = 0 ; i < data.Length ; i++)
13258 PlacesReplyPacket.QueryDataBlock block =
13259 new PlacesReplyPacket.QueryDataBlock();
13261 block.OwnerID = data[i].OwnerID;
13262 block.Name = Util.StringToBytes256(data[i].Name);
13263 block.Desc = Util.StringToBytes1024(data[i].Desc);
13264 block.ActualArea = data[i].ActualArea;
13265 block.BillableArea = data[i].BillableArea;
13266 block.Flags = data[i].Flags;
13267 block.GlobalX = data[i].GlobalX;
13268 block.GlobalY = data[i].GlobalY;
13269 block.GlobalZ = data[i].GlobalZ;
13270 block.SimName = Util.StringToBytes256(data[i].SimName);
13271 block.SnapshotID = data[i].SnapshotID;
13272 block.Dwell = data[i].Dwell;
13273 block.Price = data[i].Price;
13275 if (reply != null && reply.Length + block.Length > 1400)
13280 dataBlocks =
new PlacesReplyPacket.QueryDataBlock[0];
13286 reply.AgentData =
new PlacesReplyPacket.AgentDataBlock();
13287 reply.AgentData.AgentID = AgentId;
13288 reply.AgentData.QueryID = queryID;
13290 reply.TransactionData =
new PlacesReplyPacket.TransactionDataBlock();
13291 reply.TransactionData.TransactionID = transactionID;
13293 reply.QueryData = dataBlocks;
13296 Array.Resize(ref dataBlocks, dataBlocks.Length + 1);
13297 dataBlocks[dataBlocks.Length - 1] = block;
13298 reply.QueryData = dataBlocks;
13310 m_log.DebugFormat(
"[LLCLIENT]: Null event queue");
13317 AgentDataMap.Add(
"AgentID", OSD.FromUUID(AgentId));
13318 AgentDataMap.Add(
"SessionID", OSD.FromUUID(SessionId));
13321 AgentData.Add(AgentDataMap);
13323 llsd.Add(
"AgentData", AgentData);
13327 foreach (
UUID item
in items)
13330 ItemDataMap.Add(
"ItemID", OSD.FromUUID(item));
13331 ItemDataMap.Add(
"AgentID", OSD.FromUUID(AgentId));
13333 ItemData.Add(ItemDataMap);
13336 llsd.Add(
"InventoryData", ItemData);
13338 eq.Enqueue(BuildEvent(
"RemoveInventoryItem",
13348 m_log.DebugFormat(
"[LLCLIENT]: Null event queue");
13355 AgentDataMap.Add(
"AgentID", OSD.FromUUID(AgentId));
13356 AgentDataMap.Add(
"SessionID", OSD.FromUUID(SessionId));
13359 AgentData.Add(AgentDataMap);
13361 llsd.Add(
"AgentData", AgentData);
13365 foreach (
UUID folder
in folders)
13368 FolderDataMap.Add(
"FolderID", OSD.FromUUID(folder));
13369 FolderDataMap.Add(
"AgentID", OSD.FromUUID(AgentId));
13371 FolderData.Add(FolderDataMap);
13374 llsd.Add(
"FolderData", FolderData);
13376 eq.Enqueue(BuildEvent(
"RemoveInventoryFolder",
13380 private byte[] EncodeU32(uint val)
13382 byte[] ret = BitConverter.GetBytes(val);
13383 if (BitConverter.IsLittleEndian)
13384 Array.Reverse(ret);
13394 m_log.DebugFormat(
"[LLCLIENT]: Null event queue");
13401 AgentDataMap.Add(
"AgentID", OSD.FromUUID(AgentId));
13402 AgentDataMap.Add(
"SessionID", OSD.FromUUID(SessionId));
13403 AgentDataMap.Add(
"TransactionID", OSD.FromUUID(UUID.Random()));
13406 AgentData.Add(AgentDataMap);
13408 llsd.Add(
"AgentData", AgentData);
13415 FolderDataMap.Add(
"FolderID", OSD.FromUUID(folder.ID));
13416 FolderDataMap.Add(
"AgentID", OSD.FromUUID(AgentId));
13417 FolderDataMap.Add(
"ParentID", OSD.FromUUID(folder.ParentID));
13418 FolderDataMap.Add(
"Type", OSD.FromInteger(folder.Type));
13419 FolderDataMap.Add(
"Name", OSD.FromString(folder.Name));
13421 FolderData.Add(FolderDataMap);
13424 llsd.Add(
"FolderData", FolderData);
13432 ItemDataMap.Add(
"ItemID", OSD.FromUUID(item.ID));
13433 ItemDataMap.Add(
"FolderID", OSD.FromUUID(item.Folder));
13435 ItemDataMap.Add(
"CreatorID", OSD.FromUUID(item.CreatorIdAsUuid));
13436 ItemDataMap.Add(
"OwnerID", OSD.FromUUID(item.Owner));
13437 ItemDataMap.Add(
"GroupID", OSD.FromUUID(item.GroupID));
13438 ItemDataMap.Add(
"BaseMask", OSD.FromBinary(EncodeU32((uint)item.
BasePermissions)));
13439 ItemDataMap.Add(
"OwnerMask", OSD.FromBinary(EncodeU32((uint)item.
CurrentPermissions)));
13440 ItemDataMap.Add(
"GroupMask", OSD.FromBinary(EncodeU32((uint)item.
GroupPermissions)));
13441 ItemDataMap.Add(
"EveryoneMask", OSD.FromBinary(EncodeU32((uint)item.
EveryOnePermissions)));
13442 ItemDataMap.Add(
"NextOwnerMask", OSD.FromBinary(EncodeU32((uint)item.
NextPermissions)));
13443 ItemDataMap.Add(
"GroupOwned", OSD.FromBoolean(item.GroupOwned));
13444 ItemDataMap.Add(
"AssetID", OSD.FromUUID(item.AssetID));
13445 ItemDataMap.Add(
"Type", OSD.FromInteger(item.AssetType));
13446 ItemDataMap.Add(
"InvType", OSD.FromInteger(item.InvType));
13447 ItemDataMap.Add(
"Flags", OSD.FromBinary(EncodeU32((uint)item.
Flags)));
13448 ItemDataMap.Add(
"SaleType", OSD.FromInteger((byte)item.
SaleType));
13449 ItemDataMap.Add(
"SalePrice", OSD.FromInteger(item.SalePrice));
13450 ItemDataMap.Add(
"Name", OSD.FromString(item.Name));
13451 ItemDataMap.Add(
"Description", OSD.FromString(item.Description));
13452 ItemDataMap.Add(
"CreationDate", OSD.FromInteger(item.CreationDate));
13454 ItemDataMap.Add(
"CRC", OSD.FromBinary(EncodeU32(
13455 Helpers.InventoryCRC(1000, 0, (sbyte)item.
InvType,
13463 ItemDataMap.Add(
"CallbackID", 0);
13465 ItemData.Add(ItemDataMap);
13468 llsd.Add(
"ItemData", ItemData);
13470 eq.Enqueue(BuildEvent(
"BulkUpdateInventory",
13474 private HashSet<string> m_outPacketsToDrop;
13478 if (m_outPacketsToDrop == null)
13479 m_outPacketsToDrop =
new HashSet<string>();
13481 return m_outPacketsToDrop.Add(packetName);
13486 if (m_outPacketsToDrop == null)
13489 return m_outPacketsToDrop.Remove(packetName);
13494 return new HashSet<string>(m_outPacketsToDrop);
13497 private HashSet<string> m_inPacketsToDrop;
13501 if (m_inPacketsToDrop == null)
13502 m_inPacketsToDrop =
new HashSet<string>();
13504 return m_inPacketsToDrop.Add(packetName);
13509 if (m_inPacketsToDrop == null)
13512 return m_inPacketsToDrop.Remove(packetName);
13517 return new HashSet<string>(m_inPacketsToDrop);
TrackAgentUpdate OnTrackAgent
TeleportCancel OnTeleportCancel
delegate void ObjectPermissions(IClientAPI controller, UUID agentID, UUID sessionID, byte field, uint localId, uint mask, byte set)
void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackId)
Tell the client that we have created the item it requested.
delegate void RezScript(IClientAPI remoteClient, InventoryItemBase item, UUID transactionID, uint localID)
SetScriptRunning OnSetScriptRunning
delegate void ParcelBuyPass(IClientAPI client, UUID agentID, int ParcelLocalID)
delegate void ImprovedInstantMessage(IClientAPI remoteclient, GridInstantMessage im)
Implemented by classes which collect up non-viewer statistical information
LinkInventoryItem OnLinkInventoryItem
delegate void ObjectDrop(uint localID, IClientAPI remoteClient)
void SendAvatarNotesReply(UUID targetID, string text)
void SendTaskInventory(UUID taskID, short serial, byte[] fileName)
FriendActionDelegate OnDenyFriendRequest
GenericCall7 OnObjectDescription
void SendTerminateFriend(UUID exFriendID)
SendPostcard OnSendPostcard
void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
Send the first part of a texture. For sufficiently small textures, this may be the only packet...
delegate void TeleportCancel(IClientAPI remoteClient)
void SendNameReply(UUID profileId, string firstname, string lastname)
AgentCircuitData RequestClientInfo()
Return circuit information for this client.
void SendUseCachedMuteList()
delegate void DirClassifiedQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, uint category, int queryStart)
OpenSim.Framework.PermissionMask PermissionMask
void SendGroupMembership(GroupMembershipData[] GroupMembership)
void SendLandObjectOwners(LandData land, List< UUID > groups, Dictionary< UUID, int > ownersAndCount)
bool IsForeignUser(UUID userID, out string assetServerURL)
delegate void EventInfoRequest(IClientAPI remoteClient, uint eventID)
delegate void NewUserReport(IClientAPI client, string regionName, UUID abuserID, byte catagory, byte checkflags, string details, UUID objectID, Vector3 postion, byte reportType, UUID screenshotID, string Summary, UUID reporter)
RegionInfoRequest OnRegionInfoRequest
void SendLayerData(int px, int py, TerrainData terrData)
delegate void UpdatePrimSingleRotationPosition(uint localID, Quaternion rot, Vector3 pos, IClientAPI remoteClient)
Action< IClientAPI, bool > OnCompleteMovementToRegion
delegate void EjectUserUpdate(IClientAPI client, UUID parcelowner, uint flags, UUID target)
delegate void AbortXfer(IClientAPI remoteClient, ulong xferID)
delegate void UpdatePrimGroupRotation(uint localID, Vector3 pos, Quaternion rot, IClientAPI remoteClient)
ulong m_activeGroupPowers
byte[] GetThrottlesPacked(float multiplier)
Get the current throttles for this client as a packed byte array
delegate void PurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID)
static NumberFormatInfo NumberFormatInfo
GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate
bool HasPrivateAttachmentPoint
If this scene object has an attachment point then indicate whether there is a point where attachments...
delegate void RequestAsset(IClientAPI remoteClient, RequestAssetArgs transferRequest)
delegate void RezMultipleAttachmentsFromInv(IClientAPI remoteClient, List< KeyValuePair< UUID, uint >> rezlist)
void SendLoadURL(string objectname, UUID objectID, UUID ownerID, bool groupOwned, string message, string url)
delegate void RemoveInventoryItem(IClientAPI remoteClient, List< UUID > itemIDs)
delegate void UpdatePrimSingleRotation(uint localID, Quaternion rot, IClientAPI remoteClient)
int MediaWidth
Width of parcel media render
virtual bool ProcessPacketMethod(Packet packet)
Try to process a packet using registered packet handlers
void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data)
void SendSetFollowCamProperties(UUID objectID, SortedDictionary< int, float > parameters)
delegate void GroupAccountSummaryRequest(IClientAPI client, UUID agentID, UUID groupID)
void ReprioritizeUpdates()
void SendDeclineCallingCard(UUID transactionID)
void SendAgentGroupDataUpdate(UUID avatarID, GroupMembershipData[] data)
virtual void InPacket(object NewPack)
Cruft?
void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
delegate void PickInfoUpdate(IClientAPI client, UUID pickID, UUID creatorID, bool topPick, string name, string desc, UUID snapshotID, int sortOrder, bool enabled)
ObjectRequest OnObjectRequest
delegate void ScriptAnswer(IClientAPI remoteClient, UUID objectID, UUID itemID, int answer)
void SendDialog(string objectname, UUID objectID, UUID ownerID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels)
Open a dialog box on the client.
delegate void ObjectSaleInfo(IClientAPI remoteClient, UUID agentID, UUID sessionID, uint localID, byte saleType, int salePrice)
GenericCall7 OnObjectName
OpenMetaverse.StructuredData.OSDArray OSDArray
void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages)
PickInfoUpdate OnPickInfoUpdate
void SendAvatarDataImmediate(ISceneEntity avatar)
Send an ObjectUpdate packet with information about an avatar
FindAgentUpdate OnFindAgent
delegate void UpdateTaskInventory(IClientAPI remoteClient, UUID transactionID, TaskInventoryItem item, uint localID)
delegate void UpdatePrimRotation(uint localID, Quaternion rot, IClientAPI remoteClient)
delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
bool AddGenericPacketHandler(string MethodName, GenericMessage handler)
delegate void RezRestoreToWorld(IClientAPI remoteClient, UUID itemId)
delegate void GrabObject(uint localID, Vector3 pos, IClientAPI remoteClient, List< SurfaceTouchEventArgs > surfaceArgs)
delegate void CachedTextureRequest(IClientAPI remoteClient, int serial, List< CachedTextureRequestArg > cachedTextureRequest)
GenericCall1 OnRequestWearables
void SendGenericMessage(string method, UUID invoice, List< string > message)
TeleportLocationRequest OnSetStartLocationRequest
Client provided parameters for avatar movement
delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID)
AgentRequestSit OnAgentRequestSit
CachedTextureRequest OnCachedTextureRequest
void SendLeaveGroupReply(UUID groupID, bool success)
void SendPartPhysicsProprieties(ISceneEntity entity)
bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler)
Add a handler for the given packet type.
delegate void RequestPayPrice(IClientAPI remoteClient, UUID objectID)
DisconnectUser OnDisconnectUser
RezMultipleAttachmentsFromInv OnRezMultipleAttachmentsFromInv
FriendActionDelegate OnApproveFriendRequest
void SendMuteListUpdate(string filename)
BuyObjectInventory OnBuyObjectInventory
RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv
void SendCachedTextureResponse(ISceneEntity avatar, int serial, List< CachedTextureResponseArg > cachedTextures)
Send a response back to a client when it asks the asset server (via the region server) if it has its ...
TextureRequest OnRequestTexture
delegate void MoveItemsAndLeaveCopy(IClientAPI remoteClient, List< InventoryItemBase > items, UUID destFolder)
RegionHandleRequest OnRegionHandleRequest
delegate void SoundTrigger(UUID soundId, UUID ownerid, UUID objid, UUID parentid, double Gain, Vector3 Position, UInt64 Handle, float radius)
void SendPayPrice(UUID objectID, int[] payPrice)
GodLandStatRequest OnLandStatRequest
void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting)
This is the starting point for sending a simulator packet out to the client
void SendMapBlock(List< MapBlockData > mapBlocks, uint flag)
UpdateVector OnUpdatePrimSinglePosition
GroupActiveProposalsRequest OnGroupActiveProposalsRequest
delegate void SetRegionTerrainSettings(float waterHeight, float terrainRaiseLimit, float terrainLowerLimit, bool estateSun, bool fixedSun, float sunHour, bool globalSun, bool estateFixed, float estateSunHour)
int m_terrainCheckerCount
DirPlacesQuery OnDirPlacesQuery
void SendAvatarClassifiedReply(UUID targetID, UUID[] classifiedID, string[] name)
void SendConfirmXfer(ulong xferID, uint PacketID)
OpenSim.Server.Handlers.Simulation.Utils Utils
EstateCovenantRequest OnEstateCovenantRequest
EstateRestartSimRequest OnEstateRestartSimRequest
GodKickUser OnGodKickUser
FetchInventory OnAgentDataUpdateRequest
PickGodDelete OnPickGodDelete
void SendRemoveInventoryItems(UUID[] items)
virtual void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt, IPEndPoint externalIPEndPoint, string capsURL)
void SendKillObject(List< uint > localIDs)
Tell the client that an object has been deleted
void SetAgentThrottleSilent(int throttle, int setting)
Sets the throttles from values supplied caller
void SendParcelDwellReply(int localID, UUID parcelID, float dwell)
delegate void ObjectIncludeInSearch(IClientAPI remoteClient, bool IncludeInSearch, uint localID)
RequestGodlikePowers OnRequestGodlikePowers
delegate void ObjectRequest(uint localID, IClientAPI remoteClient)
void SendAgentDropGroup(UUID groupID)
ObjectDeselect OnObjectDeselect
delegate void ParcelAbandonRequest(int local_id, IClientAPI remote_client)
delegate void AcceptCallingCard(IClientAPI remoteClient, UUID transactionID, UUID folderID)
delegate void UpdateInventoryFolder(IClientAPI remoteClient, UUID folderID, ushort type, string name, UUID parentID)
void SendTeleportProgress(uint flags, string message)
GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest
UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest
delegate void UpdatePrimFlags(uint localID, bool UsePhysics, bool IsTemporary, bool IsPhantom, ExtraPhysicsData PhysData, IClientAPI remoteClient)
void SendDirGroupsReply(UUID queryID, DirGroupsReplyData[] data)
Vector3 UserLocation
When teleporting is restricted to a certain point, this is the location that the user will be redirec...
delegate void RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, bool RezSelected, bool RemoveItem, UUID fromTaskID)
UpdateTaskInventory OnUpdateTaskInventory
OpenMetaverse.RegionFlags RegionFlags
void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)
delegate void SetEstateFlagsRequest(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, int matureLevel, bool restrictPushObject, bool allowParcelChanges)
IPrimCounts PrimCounts
Prim counts for this land object.
ParcelAbandonRequest OnParcelAbandonRequest
ParcelStatus Status
Status of Parcel, Leased, Abandoned, For Sale
int PassPrice
Price to purchase a Pass to a restricted parcel
Handles new client connections Constructor takes a single Packet and authenticates everything ...
void PopulateStats(int inPackets, int outPackets, int unAckedBytes)
void SendScriptRunningReply(UUID objectID, UUID itemID, bool running)
SoundTrigger OnSoundTrigger
delegate void ForceReleaseControls(IClientAPI remoteClient, UUID agentID)
delegate void StopAnim(IClientAPI remoteClient, UUID animID)
AvatarNotesUpdate OnAvatarNotesUpdate
SetAppearance OnSetAppearance
ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateImprovedTerseBlock(ISceneEntity entity, bool sendTexture)
delegate void EstateChangeCovenantRequest(IClientAPI remoteClient, UUID newCovenantID)
XferReceive OnXferReceive
delegate void ClientChangeObject(uint localID, object data, IClientAPI remoteClient)
delegate void SetAlwaysRun(IClientAPI remoteClient, bool SetAlwaysRun)
void SendRemoveInventoryItem(UUID itemID)
StatusChange OnChildAgentStatus
UpdateInventoryItem OnUpdateInventoryItem
FetchInventoryDescendents OnFetchInventoryDescendents
void SendAgentOffline(UUID[] agentIDs)
delegate void TextureRequest(Object sender, TextureRequestArgs e)
LinkObjects OnLinkObjects
UpdatePrimFlags OnUpdatePrimFlags
SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture
delegate void DelinkObjects(List< uint > primIds, IClientAPI client)
AvatarAppearance Appearance
ObjectSelect OnObjectSelect
uint RegionSizeY
X dimension of the region.
OpenMetaverse.StructuredData.OSDMap OSDMap
void SendAgentAlertMessage(string message, bool modal)
Send an agent alert message to the client.
delegate void ClassifiedInfoUpdate(UUID classifiedID, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, Vector3 globalPos, byte classifiedFlags, int price, IClientAPI client)
bool IsGroupMember(UUID groupID)
delegate void AvatarNowWearing(IClientAPI sender, AvatarWearingArgs e)
ClassifiedGodDelete OnClassifiedGodDelete
delegate void FriendshipTermination(IClientAPI remoteClient, UUID ExID)
delegate void GroupActiveProposalsRequest(IClientAPI client, UUID agentID, UUID groupID, UUID transactionID, UUID sessionID)
void SendPickInfoReply(UUID pickID, UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled)
delegate void ActivateGesture(IClientAPI client, UUID gestureid, UUID assetId)
EventNotificationAddRequest OnEventNotificationAddRequest
delegate void ParcelGodForceOwner(int local_id, UUID ownerID, IClientAPI remote_client)
bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync, bool inEngine)
Add a handler for the given packet type.
void ProcessSpecificPacketAsync(object state)
SimWideDeletesDelegate OnSimWideDeletes
NewUserReport OnUserReport
Vector3 UserLookAt
When teleporting is restricted to a certain point, this is the rotation that the user will be positio...
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
CommitEstateTerrainTextureRequest OnCommitEstateTerrainTextureRequest
void SendTexture(AssetBase TextureAsset)
void SendOfferCallingCard(UUID srcID, UUID transactionID)
RetrieveInstantMessages OnRetrieveInstantMessages
AgentAlertMessagePacket BuildAgentAlertPacket(string message, bool modal)
Construct an agent alert packet
ParcelObjectOwnerRequest OnParcelObjectOwnerRequest
void SendBannedUserList(UUID invoice, EstateBan[] bl, uint estateID)
delegate void TeleportLocationRequest(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags)
int MediaHeight
Height of parcel media render
virtual void RegisterLocalPacketHandlers()
This is a different way of processing packets then ProcessInPacket
delegate void UserInfoRequest(IClientAPI client)
ParcelSelectObjects OnParcelSelectObjects
ObjectIncludeInSearch OnObjectIncludeInSearch
Represents an item in a task inventory
void SendEstateList(UUID invoice, int code, UUID[] Data, uint estateID)
Dictionary< string, object > ServiceURLs
sbyte Type
(sbyte) AssetType enum
AsyncPacketProcess(LLClientView pClientview, PacketMethod pMethod, Packet pPack)
Dictionary< string, int > GenericRequests
ImprovedInstantMessage OnInstantMessage
AvatarPickerRequest OnAvatarPickerRequest
ulong GetGroupPowers(UUID groupID)
delegate void LinkInventoryItem(IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, UUID olditemID)
delegate void EstateTeleportAllUsersHomeRequest(IClientAPI remoteClient, UUID invoice, UUID senderID)
delegate void AgentSit(IClientAPI remoteClient, UUID agentID)
delegate void ParcelObjectOwnerRequest(int local_id, IClientAPI remote_client)
delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient)
UUIDNameRequest OnTeleportHomeRequest
GroupAccountSummaryRequest OnGroupAccountSummaryRequest
bool ObscureMusic
Whether to obscure parcel music URL
void SendScriptTeleportRequest(string objName, string simName, Vector3 pos, Vector3 lookAt)
delegate void DirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart)
delegate void ParcelBuy(UUID agentId, UUID groupId, bool final, bool groupOwned, bool removeContribution, int parcelLocalID, int parcelArea, int parcelPrice, bool authenticated)
bool HandleObjectGroupRequest(IClientAPI sender, Packet Pack)
DeactivateGesture OnDeactivateGesture
BakeTerrain OnBakeTerrain
delegate void MoneyTransferRequest(UUID sourceID, UUID destID, int amount, int transactionType, string description)
delegate void AddNewPrim(UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape, byte bypassRaycast, Vector3 RayStart, UUID RayTargetID, byte RayEndIsIntersection)
void SendAttachedSoundGainChange(UUID objectID, float gain)
void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain)
delegate void ParcelDeedToGroup(int local_id, UUID group_id, IClientAPI remote_client)
delegate void PickGodDelete(IClientAPI client, UUID agentID, UUID pickID, UUID queryID)
void SendAvatarPicksReply(UUID targetID, Dictionary< UUID, string > picks)
void SendSunPos(Vector3 Position, Vector3 Velocity, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition)
Update the client as to where the sun is currently located.
Action< Vector3, bool, bool > OnAutoPilotGo
int SimwideArea
Number of meters^2 in the Simulator
SetAlwaysRun OnSetAlwaysRun
DirLandQuery OnDirLandQuery
delegate void ObjectDuplicate(uint localID, Vector3 offset, uint dupeFlags, UUID AgentID, UUID GroupID)
void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags)
Generate one of the object update packets based on PrimUpdateFlags and broadcast the packet to client...
virtual void SendCloudData(float[] cloudDensity)
Send the cloud matrix to the client
EventNotificationRemoveRequest OnEventNotificationRemoveRequest
UpdateVector OnUpdatePrimGroupScale
void SendTransferAbort(TransferRequestPacket transferRequest)
bool ObscureMedia
Whether to obscure parcel media URL
UUIDNameRequest OnUUIDGroupNameRequest
delegate void ClassifiedGodDelete(UUID classifiedID, UUID queryID, IClientAPI client)
delegate void GenericCall2()
SetEstateFlagsRequest OnSetEstateFlagsRequest
void Disconnect(string reason)
void Close()
Close down the client view
delegate void FreezeUserUpdate(IClientAPI client, UUID parcelowner, uint flags, UUID target)
ParcelGodMark OnParcelGodMark
Enapsulate statistics for a simulator/scene.
void SendGroupAccountingSummary(IClientAPI sender, UUID groupID, uint moneyAmt, int totalTier, int usedTier)
delegate void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, UUID oldAgentID, UUID oldItemID, UUID newFolderID, string newName)
List< ObjectUpdatePacket.ObjectDataBlock > m_fullUpdateDataBlocksBuilder
RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily
ClassifiedInfoRequest OnClassifiedInfoRequest
delegate void TerrainUnacked(IClientAPI remoteClient, int patchX, int patchY)
delegate void FriendActionDelegate(IClientAPI remoteClient, UUID transactionID, List< UUID > callingCardFolders)
delegate void GenericMessage(Object sender, string method, List< String > args)
EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest
void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data)
bool AddInPacketToDropSet(string packetName)
ObjectSaleInfo OnObjectSaleInfo
LLClientView(Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo, UUID agentId, UUID sessionId, uint circuitCode)
Constructor
void SendEventInfoReply(EventData data)
EstateDebugRegionRequest OnEstateDebugRegionRequest
delegate void RequestGodlikePowers(UUID AgentID, UUID SessionID, UUID token, bool GodLike, IClientAPI remote_client)
void DeactivateGesture(UUID assetId, UUID gestureId)
void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks)
RequestMapName OnMapNameRequest
delegate void GenericCall7(IClientAPI remoteClient, uint localID, string message)
delegate void ObjectSelect(uint localID, IClientAPI remoteClient)
System.Timers.Timer Timer
EstateManageTelehub OnEstateManageTelehub
delegate bool PacketMethod(IClientAPI simClient, Packet packet)
delegate void GodUpdateRegionInfoUpdate(IClientAPI client, float BillableFactor, ulong EstateID, ulong RegionFlags, byte[] SimName, int RedirectX, int RedirectY)
ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(SceneObjectPart data, UUID recipientID)
virtual UUID Owner
The agent who's inventory this is contained by
delegate void NetworkStats(int inPackets, int outPackets, int unAckedBytes)
delegate void SaveStateHandler(IClientAPI client, UUID agentID)
virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, uint flags, string capsURL)
EstateTeleportAllUsersHomeRequest OnEstateTeleportAllUsersHomeRequest
delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name)
void SendWearables(AvatarWearable[] wearables, int serial)
Tell this client what items it should be wearing now
delegate void DeGrabObject(uint localID, IClientAPI remoteClient, List< SurfaceTouchEventArgs > surfaceArgs)
delegate void EstateDebugRegionRequest(IClientAPI remoteClient, UUID invoice, UUID senderID, bool scripted, bool collisionEvents, bool physics)
This class was created to refactor OutPacket out of AssetCache There is a conflict between OpenSim...
Action< IClientAPI > OnConnectionClosed
delegate void StartAnim(IClientAPI remoteClient, UUID animID)
UserInfoRequest OnUserInfoRequest
ParcelReclaim OnParcelReclaim
void SetChildAgentThrottle(byte[] throttles)
Sets the throttles from values supplied by the client
void SendCoarseLocationUpdate(List< UUID > users, List< Vector3 > CoarseLocations)
Action< IClientAPI > OnRequestAvatarsData
void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message)
Send the client an Estate message blue box pop-down with a single OK button
UUIDNameRequest OnNameFromUUIDRequest
void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
void SendBulkUpdateInventoryItem(InventoryItemBase item)
void SendAbortXferPacket(ulong xferID)
void SendCreateGroupReply(UUID groupID, bool success, string message)
void SendGenericMessage(string method, UUID invoice, List< byte[]> message)
void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look)
Sent when an agent completes its movement into a region.
Tracks state for a client UDP connection and provides client-specific methods
void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data)
TeleportLureRequest OnTeleportLureRequest
bool CanGetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID)
Does the client have sufficient permissions to retrieve the inventory item?
GroupAccountDetailsRequest OnGroupAccountDetailsRequest
void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item)
bool IsDeleted
Signals whether this entity was in a scene but has since been removed from it.
Asset class. All Assets are reference by this class or a class derived from this class ...
OfferCallingCard OnOfferCallingCard
ParcelGodForceOwner OnParcelGodForceOwner
ForceReleaseControls OnForceReleaseControls
void SendForceClientSelectObjects(List< uint > ObjectIDs)
GenericCall7 OnObjectClickAction
void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner)
delegate void TeleportLureRequest(UUID lureID, uint teleportFlags, IClientAPI client)
delegate void RequestTerrain(IClientAPI remoteClient, string clientFileName)
void RequestMapBlocksX(int minX, int minY, int maxX, int maxY)
delegate void ParcelSetOtherCleanTime(IClientAPI remoteClient, int localID, int otherCleanTime)
uint AuctionID
ID of auction (3rd Party Integration) when parcel is being auctioned
UpdateShape OnUpdatePrimShape
delegate void EventNotificationAddRequest(uint EventID, IClientAPI client)
void SetClientInfo(ClientInfo info)
delegate void ObjectBuy(IClientAPI remoteClient, UUID agentID, UUID sessionID, UUID groupID, UUID categoryID, uint localID, byte saleType, int salePrice)
delegate void EventGodDelete(uint eventID, UUID queryID, string queryText, uint queryFlags, int queryStart, IClientAPI client)
delegate void SimulatorBlueBoxMessageRequest(IClientAPI remoteClient, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message)
UpdateAgent OnAgentCameraUpdate
delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client)
delegate void EstateRestartSimRequest(IClientAPI remoteClient, int secondsTilReboot)
delegate void MoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID)
Action< UUID > OnRemoveAvatar
void SendBulkUpdateInventory(InventoryNodeBase node)
Used by the server to inform the client of new inventory items and folders.
void SendRebakeAvatarTextures(UUID textureID)
delegate void AgentRequestSit(IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset)
Dictionary< string, int > SyncRequests
delegate void CommitEstateTerrainTextureRequest(IClientAPI remoteClient)
ParcelSetOtherCleanTime OnParcelSetOtherCleanTime
GenericCall2 OnUpdateThrottles
delegate void UpdateAvatarProperties(IClientAPI remoteClient, UserProfileData ProfileData)
HashSet< string > GetOutPacketDropSet()
void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
Send land properties to the client.
delegate void UpdateEstateAccessDeltaRequest(IClientAPI remote_client, UUID invoice, int estateAccessType, UUID user)
string Report()
Report back collected statistical information.
void SendJoinGroupReply(UUID groupID, bool success)
void AssetReceived(string id, Object sender, AssetBase asset)
When we get a reply back from the asset service in response to a client request, send back the data...
void SendGroupNameReply(UUID groupLLUID, string GroupName)
delegate void MoveObject(UUID objectID, Vector3 offset, Vector3 grapPos, IClientAPI remoteClient, List< SurfaceTouchEventArgs > surfaceArgs)
void SendTeleportFailed(string reason)
Inform the client that a teleport attempt has failed
delegate void ObjectDuplicateOnRay(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, UUID RayTargetObj, Vector3 RayEnd, Vector3 RayStart, bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates)
void SendViewerTime(int phase)
ClassifiedInfoUpdate OnClassifiedInfoUpdate
void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot, Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook)
GrantUserFriendRights OnGrantUserRights
RequestXfer OnRequestXfer
delegate void StatusChange(bool status)
void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData)
Send the next packet for a series of packets making up a single texture, as established by SendImageF...
ParcelDwellRequest OnParcelDwellRequest
delegate void UDPAssetUploadRequest(IClientAPI remoteClient, UUID assetID, UUID transaction, sbyte type, byte[] data, bool storeLocal, bool tempFile)
delegate void MuteListEntryUpdate(IClientAPI client, UUID MuteID, string Name, int type, uint flags)
void SendParcelMediaUpdate(string mediaUrl, UUID mediaTextureID, byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, byte mediaLoop)
virtual Vector3 AvatarSize
OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion rotation
void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs)
UUID GroupID
Unique ID of the Group that owns
BinaryGenericMessage OnBinaryGenericMessage
UpdateVector OnUpdatePrimScale
delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, UUID invoice, UUID senderID, UUID prey)
MoneyBalanceRequest OnMoneyBalanceRequest
FetchInventory OnFetchInventory
RegionFlags
Region flags used internally by OpenSimulator to store installation specific information about region...
void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory)
delegate void UpdateVector(uint localID, Vector3 pos, IClientAPI remoteClient)
delegate void UpdateShape(UUID agentID, uint localID, UpdateShapeArgs shapeBlock)
delegate void GrantUserFriendRights(IClientAPI client, UUID target, int rights)
GenericMessage OnGenericMessage
void SendParcelInfo(RegionInfo info, LandData land, UUID parcelID, uint x, uint y)
delegate void UpdateInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID itemID, InventoryItemBase itemUpd)
delegate void ParcelGodMark(IClientAPI client, UUID agentID, int ParcelLocalID)
EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest
CopyInventoryItem OnCopyInventoryItem
delegate void DirPlacesQuery(IClientAPI remoteClient, UUID queryID, string queryText, int queryFlags, int category, string simName, int queryStart)
UpdatePrimSingleRotation OnUpdatePrimSingleRotation
delegate void GodlikeMessage(IClientAPI client, UUID requester, byte[] Method, byte[] Parameter)
Circuit data for an agent. Connection information shared between regions that accept UDP connections ...
uint AttachmentPoint
Attachment point of this scene object to an avatar.
delegate void DeRezObject(IClientAPI remoteClient, List< uint > localIDs, UUID groupID, DeRezAction action, UUID destinationID)
float PassHours
How long in hours a Pass to the parcel is given
Inventory Item - contains all the properties associated with an individual inventory piece...
delegate void MuteListRequest(IClientAPI client, uint muteCRC)
RequestObjectPropertiesFamily OnObjectGroupRequest
GenericCall7 OnObjectMaterial
void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data)
ConfirmXfer OnConfirmXfer
void SendInitiateDownload(string simFileName, string clientFileName)
EventInfoRequest OnEventInfoRequest
UpdateAvatarProperties OnUpdateAvatarProperties
void SendSimStats(SimStats stats)
Send statistical information about the sim to the client.
delegate void ScriptReset(IClientAPI remoteClient, UUID objectID, UUID itemID)
bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync)
Add a handler for the given packet type.
RezRestoreToWorld OnRezRestoreToWorld
RequestPayPrice OnRequestPayPrice
void SendClassifiedInfoReply(UUID classifiedID, UUID creatorID, uint creationDate, uint expirationDate, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, string simName, Vector3 globalPos, string parcelName, byte classifiedFlags, int price)
delegate void ObjectAttach(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent)
void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting, UnackedPacketMethod method)
This is the starting point for sending a simulator packet out to the client
TeleportLandmarkRequest OnTeleportLandmarkRequest
void SendEjectGroupMemberReply(UUID agentID, UUID groupID, bool success)
delegate void CreateInventoryFolder(IClientAPI remoteClient, UUID folderID, ushort folderType, string folderName, UUID parentID)
SaveStateHandler OnSaveState
bool HandleMultipleObjUpdate(IClientAPI simClient, Packet packet)
UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation
UpdateVector OnUpdatePrimGroupPosition
delegate void GroupAccountDetailsRequest(IClientAPI client, UUID agentID, UUID groupID, UUID transactionID, UUID sessionID)
void SendObjectPropertiesFamilyData(ISceneEntity entity, uint requestFlags)
void SendRegionHandle(UUID regionID, ulong handle)
delegate void DetailedEstateDataRequest(IClientAPI remoteClient, UUID invoice)
void SendPartFullUpdate(ISceneEntity ent, uint?parentID)
delegate void MapItemRequest(IClientAPI remoteClient, uint flags, uint EstateID, bool godlike, uint itemtype, ulong regionhandle)
Details of a Parcel of land
delegate void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
void SendFindAgent(UUID HunterID, UUID PreyID, double GlobalX, double GlobalY)
void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent)
DirPopularQuery OnDirPopularQuery
ParcelDivideRequest OnParcelDivideRequest
delegate void ObjectExtraParams(UUID agentID, uint localID, ushort type, bool inUse, byte[] data)
delegate void ObjectOwner(IClientAPI remoteClient, UUID ownerID, UUID groupID, List< uint > localIDs)
delegate void ParcelReturnObjectsRequest(int local_id, uint return_type, UUID[] agent_ids, UUID[] selected_ids, IClientAPI remote_client)
void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags)
void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, UUID ownerID, byte source, byte audible)
delegate void EstateChangeInfo(IClientAPI client, UUID invoice, UUID senderID, UInt32 param1, UInt32 param2)
UpdateAgent OnPreAgentUpdate
ScenePermissions Permissions
MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy
delegate void MoveTaskInventory(IClientAPI remoteClient, UUID folderID, uint localID, UUID itemID)
virtual bool Logout(IClientAPI client)
Information about a particular user known to the userserver
ClientChangeObject onClientChangeObject
ParcelDeedToGroup OnParcelDeedToGroup
RequestAvatarProperties OnRequestAvatarProperties
UDPAssetUploadRequest OnAssetUploadRequest
delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client)
void Kick(string message)
OpenSim.Framework.AssetLandmark AssetLandmark
const int TerrainPatchSize
void SendGroupAccountingDetails(IClientAPI sender, UUID groupID, UUID transactionID, UUID sessionID, int amt)
delegate void ModifyTerrain(UUID user, float height, float seconds, byte size, byte action, float north, float west, float south, float east, UUID agentId)
OpenMetaverse.StructuredData.OSD OSD
FriendshipTermination OnTerminateFriendship
delegate void SendPostcard(IClientAPI client)
delegate void ChangeAnim(UUID animID, bool addOrRemove, bool sendPack)
RequestAsset OnRequestAsset
delegate void UpdateAgent(IClientAPI remoteClient, AgentUpdateArgs agentData)
void SendEstateCovenantInformation(UUID covenant)
virtual bool HandleLogout(IClientAPI client, Packet packet)
Handler called when we receive a logout packet.
delegate void GodLandStatRequest(int parcelID, uint reportType, uint requestflags, string filter, IClientAPI remoteClient)
void SendAvatarClassifiedReply(UUID targetID, Dictionary< UUID, string > classifieds)
delegate void ParcelDwellRequest(int localID, IClientAPI client)
The LLUDP server for a region. This handles incoming and outgoing packets for all UDP connections to ...
DeRezObject OnDeRezObject
delegate void MoveInventoryItem(IClientAPI remoteClient, List< InventoryItemBase > items)
bool HandleAgentTextureCached(IClientAPI simclient, Packet packet)
delegate void AvatarNotesUpdate(IClientAPI client, UUID targetID, string notes)
DelinkObjects OnDelinkObjects
delegate void GroupAccountTransactionsRequest(IClientAPI client, UUID agentID, UUID groupID, UUID transactionID, UUID sessionID)
void SendLandAccessListData(List< LandAccessEntry > accessList, uint accessFlag, int localLandID)
delegate void BuyObjectInventory(IClientAPI remoteClient, UUID agentID, UUID sessionID, UUID objectID, UUID itemID, UUID folderID)
SetRegionTerrainSettings OnSetRegionTerrainSettings
ObjectAttach OnObjectAttach
PurgeInventoryDescendents OnPurgeInventoryDescendents
delegate void LinkObjects(IClientAPI remoteClient, uint parent, List< uint > children)
delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client)
ObjectUpdatePacket.ObjectDataBlock CreateAvatarUpdateBlock(ScenePresence data)
NetworkStats OnNetworkStatsUpdate
void SendBulkUpdateInventoryFolder(InventoryFolderBase folderBase)
void SendImageNotFound(UUID imageid)
Tell the client that the requested texture cannot be found
void SendTelehubInfo(UUID ObjectID, string ObjectName, Vector3 ObjectPos, Quaternion ObjectRot, List< Vector3 > SpawnPoint)
MoneyTransferRequest OnMoneyTransferRequest
DeGrabObject OnDeGrabObject
delegate void StartLure(byte lureType, string message, UUID targetID, IClientAPI client)
void SendDirEventsReply(UUID queryID, DirEventsReplyData[] data)
RemoveTaskInventory OnRemoveTaskItem
MoveTaskInventory OnMoveTaskItem
delegate void EconomyDataRequest(IClientAPI client)
delegate void GodKickUser(UUID GodAgentID, UUID GodSessionID, UUID AgentID, uint kickflags, byte[] reason)
RequestMapBlocks OnRequestMapBlocks
byte LandingType
Determines if people are able to teleport where they please on the parcel or if they get constrainted...
delegate ISceneEntity RezSingleAttachmentFromInv(IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
void SendRemoveInventoryFolders(UUID[] folders)
delegate void ParcelReclaim(int local_id, IClientAPI remote_client)
override bool TryGetScenePresence(UUID agentID, out ScenePresence sp)
Try to get a scene presence from the scene
void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data)
AgentCircuitData agentcircuit
ActivateGesture OnActivateGesture
AvatarNowWearing OnAvatarNowWearing
CreateInventoryFolder OnCreateNewInventoryFolder
int GetAgentThrottleSilent(int throttle)
UUID ID
A UUID containing the ID for the inventory node itself
TerrainUnacked OnUnackedTerrain
void SendCameraConstraint(Vector4 ConstraintPlane)
ObjectPermissions OnObjectPermissions
delegate void RegionHandleRequest(IClientAPI remoteClient, UUID regionID)
virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint)
Tell the client that the given neighbour region is ready to receive a child agent.
ObjectDuplicateOnRay OnObjectDuplicateOnRay
delegate void EstateBlueBoxMessageRequest(IClientAPI remoteClient, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message)
RemoveInventoryItem OnRemoveInventoryItem
delegate void SetEstateTerrainDetailTexture(IClientAPI remoteClient, int corner, UUID side)
delegate void SpinStart(UUID objectID, IClientAPI remoteClient)
PlacesQuery OnPlacesQuery
delegate void DeactivateGesture(IClientAPI client, UUID gestureid)
delegate void ParcelInfoRequest(IClientAPI remoteClient, UUID parcelID)
delegate void SpinObject(UUID objectID, Quaternion rotation, IClientAPI remoteClient)
ScriptReset OnScriptReset
int Owner
Parcel owner owned prims
SceneObjectGroup ParentGroup
virtual void Start()
Start processing for this client.
void SendPlayAttachedSound(UUID soundID, UUID objectID, UUID ownerID, float gain, byte flags)
DirFindQuery OnDirFindQuery
delegate void PlacesQuery(UUID QueryID, UUID TransactionID, string QueryText, uint QueryFlags, byte Category, string SimName, IClientAPI client)
delegate void ClassifiedDelete(UUID classifiedID, IClientAPI client)
System.Timers.Timer Timer
void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId)
IClientAPI.SendInventoryItemCreateUpdate(InventoryItemBase)
PrimUpdateFlags
Specifies the fields that have been changed when sending a prim or avatar update
EventGodDelete OnEventGodDelete
static PacketPool Instance
OSDMap OReport(string uptime, string version)
Report back collected statistical information as an OSDMap of key/values
HashSet< string > GetInPacketDropSet()
Action< IClientAPI > OnLogout
RequestTaskInventory OnRequestTaskInventory
Args to return to a client that queries picker data
void SendShutdownConnectionNotice()
ClassifiedDelete OnClassifiedDelete
void CloseWithoutChecks(bool sendStop)
Closes down the client view without first checking whether it is active.
delegate void RequestMapName(IClientAPI remoteClient, string mapName, uint flags)
bool RemoveInPacketFromDropSet(string packetName)
bool AddOutPacketToDropSet(string packetName)
delegate void SetEstateTerrainTextureHeights(IClientAPI remoteClient, int corner, float lowVal, float highVal)
delegate void ParcelAccessListUpdateRequest(UUID agentID, uint flags, int landLocalID, UUID transactionID, int sequenceID, int sections, List< LandAccessEntry > entries, IClientAPI remote_client)
void SendObjectPropertiesReply(ISceneEntity entity)
void HandleAutopilot(Object sender, string method, List< String > args)
void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List< InventoryItemBase > items, List< InventoryFolderBase > folders, int version, bool fetchFolders, bool fetchItems)
Send information about the items contained in a folder to the client.
delegate void ParcelSelectObjects(int land_local_id, int request_type, List< UUID > returnIDs, IClientAPI remote_client)
DirClassifiedQuery OnDirClassifiedQuery
delegate void ClassifiedInfoRequest(UUID classifiedID, IClientAPI client)
string MediaDescription
parcel media description
virtual string Name
The name of the node (64 characters or less)
string XReport(string uptime, string version)
Report back collected statistical information in json
delegate void ConfirmXfer(IClientAPI remoteClient, ulong xferID, uint packetID)
delegate void DeclineCallingCard(IClientAPI remoteClient, UUID transactionID)
UUIDNameRequest OnDetachAttachmentIntoInv
void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args)
bool HandleGenericMessage(IClientAPI sender, Packet pack)
delegate void EstateManageTelehub(IClientAPI client, UUID invoice, UUID senderID, string cmd, UInt32 param1)
void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
void SendTeleportStart(uint flags)
void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType)
This is the starting point for sending a simulator packet out to the client
void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data)
FreezeUserUpdate OnParcelFreezeUser
void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
string GetClientOption(string option)
ModifyTerrain OnModifyTerrain
DeclineCallingCard OnDeclineCallingCard
delegate void GroupVoteHistoryRequest(IClientAPI client, UUID agentID, UUID groupID, UUID transactionID, UUID sessionID)
void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry)
Send information about the given agent's appearance to another client.
delegate void GenericCall1(IClientAPI remoteClient)
Common base class for inventory nodes of different types (files, folders, etc.)
void SendLayerData(int px, int py, float[] map)
delegate void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID)
void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID)
MuteListEntryRemove OnRemoveMuteListEntry
delegate void SetEstateTerrainBaseTexture(IClientAPI remoteClient, int corner, UUID side)
EstateChangeInfo OnEstateChangeInfo
delegate void ParcelAccessListRequest(UUID agentID, UUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client)
virtual bool CanSendLayerData()
ChangeInventoryItemFlags OnChangeInventoryItemFlags
delegate void BakeTerrain(IClientAPI remoteClient)
void SendAsset(AssetRequestToClient req)
delegate void PickDelete(IClientAPI client, UUID pickID)
delegate void OfferCallingCard(IClientAPI remoteClient, UUID destID, UUID transactionID)
delegate void FetchInventory(IClientAPI remoteClient, UUID itemID, UUID ownerID)
uint Flags
Parcel settings. Access flags, Fly, NoPush, Voice, Scripts allowed, etc. ParcelFlags ...
delegate void DirPopularQuery(IClientAPI remoteClient, UUID queryID, uint queryFlags)
Packet GetPacket(PacketType type)
Gets a packet of the given type.
void SendPreLoadSound(UUID objectID, UUID ownerID, UUID soundID)
delegate void SetScriptRunning(IClientAPI remoteClient, UUID objectID, UUID itemID, bool running)
ChatMessage OnChatFromClient
delegate void FetchInventoryDescendents(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder)
ThrottleOutPacketTypeFlags
void SendAgentOnline(UUID[] agentIDs)
void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle)
IAssetService m_assetService
void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time)
bool MediaLoop
Whether to loop parcel media
void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item)
MoveInventoryFolder OnMoveInventoryFolder
ObjectDeselect OnObjectDetach
static OSD BuildEvent(string eventName, OSD eventBody)
void SetChildAgentThrottle(byte[] throttles, float factor)
delegate void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName)
EstateChangeCovenantRequest OnEstateChangeCovenantRequest
void ActivateGesture(UUID assetId, UUID gestureId)
void SendInstantMessage(GridInstantMessage im)
Send an instant message to this client
void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items)
GodlikeMessage onGodlikeMessage
delegate void RemoveInventoryFolder(IClientAPI remoteClient, List< UUID > folderIDs)
delegate void LandUndo(IClientAPI remoteClient)
ParcelAccessListRequest OnParcelAccessListRequest
GenericCall2 OnStopMovement
delegate void FindAgentUpdate(IClientAPI client, UUID hunter, UUID target)
delegate void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data)
ObjectDuplicate OnObjectDuplicate
void RefreshGroupMembership()
TeleportLocationRequest OnTeleportLocationRequest
void SendStartPingCheck(byte seq)
void SendAlertMessage(string message)
Send an alert message to the client. On the Linden client (tested 1.19.1.4), this pops up a brief dur...
MuteListEntryUpdate OnUpdateMuteListEntry
delegate void SetAppearance(IClientAPI remoteClient, Primitive.TextureEntry textureEntry, byte[] visualParams, Vector3 AvSize, WearableCacheItem[] CacheItems)
void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question)
void SendLocalTeleport(Vector3 position, Vector3 lookAt, uint flags)
UpdateAgent OnAgentUpdate
ViewerEffectEventHandler OnViewerEffect
Material
Material type for a primitive
ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest
MapItemRequest OnMapItemRequest
UpdateUserInfo OnUpdateUserInfo
delegate void UpdateUserInfo(bool imViaEmail, bool visible, IClientAPI client)
void SendAssetNotFound(AssetRequestToClient req)
void ProcessInPacket(Packet packet)
Entryway from the client to the simulator. All UDP packets from the client will end up here ...
delegate void EstateCovenantRequest(IClientAPI remote_client)
EconomyDataRequest OnEconomyDataRequest
delegate void ParcelPropertiesUpdateRequest(LandUpdateArgs args, int local_id, IClientAPI remote_client)
UpdateInventoryFolder OnUpdateInventoryFolder
void SendGroupTransactionsSummaryDetails(IClientAPI sender, UUID groupID, UUID transactionID, UUID sessionID, int amt)
UpdatePrimTexture OnUpdatePrimTexture
void SendLandParcelOverlay(byte[] data, int sequence_id)
DetailedEstateDataRequest OnDetailedEstateDataRequest
virtual RegionInfo RegionInfo
void SendTextBoxRequest(string message, int chatChannel, string objectname, UUID ownerID, string ownerFirstName, string ownerLastName, UUID objectId)
delegate void SpinStop(UUID objectID, IClientAPI remoteClient)
AvatarInterestUpdate OnAvatarInterestUpdate
EjectUserUpdate OnParcelEjectUser
void SendAcceptCallingCard(UUID transactionID)
MuteListRequest OnMuteListRequest
ParcelReturnObjectsRequest OnParcelReturnObjectsRequest
bool CheckAgentUpdateSignificance(AgentUpdatePacket.AgentDataBlock x)
This checks the update significance against the last update made.
ObjectExtraParams OnUpdateExtraParams
delegate void ChatMessage(Object sender, OSChatMessage e)
bool RemoveOutPacketFromDropSet(string packetName)
int LocalID
Internal ID of the parcel. Sometimes the client will try to use this value
ScriptAnswer OnScriptAnswer
UpdatePrimRotation OnUpdatePrimGroupRotation
void SendClearFollowCamProperties(UUID objectID)
void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes)
delegate void RequestObjectPropertiesFamily(IClientAPI remoteClient, UUID AgentID, uint RequestFlags, UUID TaskID)
string Description
Parcel Description
MoveInventoryItem OnMoveInventoryItem
void SendTakeControls(int controls, bool passToAgent, bool TakeControls)
This class handles UDP texture requests.
void SoundTrigger(UUID soundId, UUID owerid, UUID Objectid, UUID ParentId, float Gain, Vector3 Position, UInt64 Handle)
SetEstateTerrainTextureHeights OnSetEstateTerrainTextureHeights
SetEstateTerrainDetailTexture OnSetEstateTerrainDetailTexture
delegate void AvatarPickerRequest(IClientAPI remoteClient, UUID agentdata, UUID queryID, string UserQuery)
int Area
Area in meters^2 the parcel contains
RequestTerrain OnUploadTerrain
AcceptCallingCard OnAcceptCallingCard
GroupVoteHistoryRequest OnGroupVoteHistoryRequest
delegate void ViewerEffectEventHandler(IClientAPI sender, List< ViewerEffectEventHandlerArg > args)
void SendXferRequest(ulong XferID, short AssetType, UUID vFileID, byte FilePath, byte[] FileName)
delegate void RegionInfoRequest(IClientAPI remote_client)
delegate void DirLandQuery(IClientAPI remoteClient, UUID queryID, uint queryFlags, uint searchType, int price, int area, int queryStart)
void SendUserInfoReply(bool imViaEmail, bool visible, string email)
RequestTerrain OnRequestTerrain
ObjectOwner OnObjectOwner
delegate void TrackAgentUpdate(IClientAPI client, UUID hunter, UUID target)
delegate void RetrieveInstantMessages(IClientAPI client)
delegate void AvatarInterestUpdate(IClientAPI client, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages)
void SetClientOption(string option, string value)
void SendDirLandReply(UUID queryID, DirLandReplyData[] data)
ClientInfo GetClientInfo()
ParcelInfoRequest OnParcelInfoRequest
delegate void ObjectDeselect(uint localID, IClientAPI remoteClient)
UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition
CreateNewInventoryItem OnCreateNewInventoryItem
void SendAvatarPickerReply(AvatarPickerReplyAgentDataArgs AgentData, List< AvatarPickerReplyDataArgs > Data)
ObjectUpdateCompressedPacket.ObjectDataBlock CreateCompressedUpdateBlock(SceneObjectPart part, PrimUpdateFlags updateFlags)
ParcelJoinRequest OnParcelJoinRequest
virtual void SendWindData(Vector2[] windSpeeds)
Send the wind matrix to the client
delegate void UnackedPacketMethod(OutgoingPacket oPacket)
RemoveInventoryFolder OnRemoveInventoryFolder
delegate void TeleportLandmarkRequest(IClientAPI remoteClient, AssetLandmark lm)
ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest
ParcelPropertiesRequest OnParcelPropertiesRequest
void SendAdminResponse(UUID Token, uint AdminLevel)
delegate void AgentFOV(IClientAPI client, float verticalAngle)
GetScriptRunning OnGetScriptRunning
static bool AddPacketHandler(PacketType packetType, PacketMethod handler)
void MakeAssetRequest(TransferRequestPacket transferRequest, UUID taskID)
Make an asset request to the asset service in response to a client request.
Used to serialize a whole inventory for transfer over the network.
SimulatorBlueBoxMessageRequest OnSimulatorBlueBoxMessageRequest
bool IsAttachment
Is this scene object acting as an attachment?
delegate void UUIDNameRequest(UUID id, IClientAPI remote_client)
Action< IClientAPI > OnRegionHandShakeReply
delegate void GetScriptRunning(IClientAPI remoteClient, UUID objectID, UUID itemID)
void SendAgentTerseUpdate(ISceneEntity p)
delegate void CreateNewInventoryItem(IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask, int creationDate)
Dictionary< string, int > AsyncRequests
delegate void EventNotificationRemoveRequest(uint EventID, IClientAPI client)
Holds a reference to the LLUDPClientthis packet is destined for, along with the serialized packet dat...
virtual void SendLayerData(float[] map)
Send the region heightmap to the client This method is only called when not doing intellegent terrain...
delegate void SimWideDeletesDelegate(IClientAPI client, UUID agentID, int flags, UUID targetID)
void SendHealth(float health)
ParcelBuyPass OnParcelBuyPass
uint ParentID
If the avatar is sitting, the local ID of the prim that it's sitting on. If not sitting then zero...
delegate void MoneyBalanceRequest(IClientAPI remoteClient, UUID agentID, UUID sessionID, UUID TransactionID)
delegate void ChangeInventoryItemFlags(IClientAPI client, UUID itemID, uint flags)
void Close(bool sendStop, bool force)
Close this client
delegate void DisconnectUser()