Beispiel #1
0
        /// <summary>
        /// Requests estate information such as top scripts and colliders
        /// </summary>
        /// <param name="parcelLocalID"></param>
        /// <param name="reportType"></param>
        /// <param name="requestFlags"></param>
        /// <param name="filter"></param>
        public void LandStatRequest(int parcelLocalID, LandStatReportType reportType, uint requestFlags, string filter)
        {
            LandStatRequestPacket p = new LandStatRequestPacket();

            p.AgentData.AgentID         = Client.Self.AgentID;
            p.AgentData.SessionID       = Client.Self.SessionID;
            p.RequestData.Filter        = Utils.StringToBytes(filter);
            p.RequestData.ParcelLocalID = parcelLocalID;
            p.RequestData.ReportType    = (uint)reportType;
            p.RequestData.RequestFlags  = requestFlags;
            Client.Network.SendPacket(p);
        }
Beispiel #2
0
        /// <summary></summary>
        /// <param name="packet"></param>
        /// <param name="simulator"></param>
        private void LandStatReplyHandler(Packet packet, Simulator simulator)
        {
            //if (OnLandStatReply != null || OnGetTopScripts != null || OnGetTopColliders != null)
            if (OnGetTopScripts != null || OnGetTopColliders != null)
            {
                LandStatReplyPacket p     = (LandStatReplyPacket)packet;
                List <EstateTask>   Tasks = new List <EstateTask>();

                foreach (LandStatReplyPacket.ReportDataBlock rep in p.ReportData)
                {
                    EstateTask task = new EstateTask();
                    task.Position    = new Vector3(rep.LocationX, rep.LocationY, rep.LocationZ);
                    task.Score       = rep.Score;
                    task.TaskID      = rep.TaskID;
                    task.TaskLocalID = rep.TaskLocalID;
                    task.TaskName    = Utils.BytesToString(rep.TaskName);
                    task.OwnerName   = Utils.BytesToString(rep.OwnerName);
                    Tasks.Add(task);
                }

                LandStatReportType type = (LandStatReportType)p.RequestData.ReportType;

                if (OnGetTopScripts != null && type == LandStatReportType.TopScripts)
                {
                    try { OnGetTopScripts((int)p.RequestData.TotalObjectCount, Tasks); }
                    catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                }
                else if (OnGetTopColliders != null && type == LandStatReportType.TopColliders)
                {
                    try { OnGetTopColliders((int)p.RequestData.TotalObjectCount, Tasks); }
                    catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                }

                /*
                 * if (OnGetTopColliders != null)
                 * {
                 *  //FIXME - System.UnhandledExceptionEventArgs
                 *  OnLandStatReply(
                 *      type,
                 *      p.RequestData.RequestFlags,
                 *      (int)p.RequestData.TotalObjectCount,
                 *      Tasks
                 *  );
                 * }
                 */
            }
        }
Beispiel #3
0
 /// <summary>
 /// Requests estate information such as top scripts and colliders
 /// </summary>
 /// <param name="parcelLocalID"></param>
 /// <param name="reportType"></param>
 /// <param name="requestFlags"></param>
 /// <param name="filter"></param>
 public void LandStatRequest(int parcelLocalID, LandStatReportType reportType, uint requestFlags, string filter)
 {
     LandStatRequestPacket p = new LandStatRequestPacket();
     p.AgentData.AgentID = Client.Self.AgentID;
     p.AgentData.SessionID = Client.Self.SessionID;
     p.RequestData.Filter = Utils.StringToBytes(filter);
     p.RequestData.ParcelLocalID = parcelLocalID;
     p.RequestData.ReportType = (uint)reportType;
     p.RequestData.RequestFlags = requestFlags;
     Client.Network.SendPacket(p);
 }