SendPacket() public method

Sends a packet
public SendPacket ( NetworkManager outgoingPacket ) : void
outgoingPacket NetworkManager Packet to be sent
return void
示例#1
0
        /// <summary>
        /// Set Autoreturn time
        /// </summary>
        /// <param name="simulator">Simulator to send the update to</param>
        public void UpdateOtherCleanTime(Simulator simulator)
        {
            ParcelSetOtherCleanTimePacket request = new ParcelSetOtherCleanTimePacket();
            request.AgentData.AgentID = simulator.Client.Self.AgentID;
            request.AgentData.SessionID = simulator.Client.Self.SessionID;
            request.ParcelData.LocalID = this.LocalID;
            request.ParcelData.OtherCleanTime = this.OtherCleanTime;

            simulator.SendPacket(request);
        }
示例#2
0
 /// <summary>
 /// Send a packet to a specified simulator
 /// </summary>
 /// <param name="packet">Packet to send</param>
 /// <param name="simulator">Simulator to send the packet to</param>
 public void SendPacket(Packet packet, Simulator simulator)
 {
     if (simulator != null)
         simulator.SendPacket(packet, true);
 }
示例#3
0
        /// <summary>
        /// Update the simulator with any local changes to this Parcel object
        /// </summary>
        /// <param name="simulator">Simulator to send updates to</param>
        /// <param name="wantReply">Whether we want the simulator to confirm
        /// the update with a reply packet or not</param>
        public void Update(Simulator simulator, bool wantReply)
        {
            Uri url = simulator.Caps.CapabilityURI("ParcelPropertiesUpdate");

            if (url != null)
            {
                ParcelPropertiesUpdateMessage req = new ParcelPropertiesUpdateMessage();
                req.AuthBuyerID = this.AuthBuyerID;
                req.Category = this.Category;
                req.Desc = this.Desc;
                req.GroupID = this.GroupID;
                req.Landing = this.Landing;
                req.LocalID = this.LocalID;
                req.MediaAutoScale = this.Media.MediaAutoScale;
                req.MediaDesc = this.Media.MediaDesc;
                req.MediaHeight = this.Media.MediaHeight;
                req.MediaID = this.Media.MediaID;
                req.MediaLoop = this.Media.MediaLoop;
                req.MediaType = this.Media.MediaType;
                req.MediaURL = this.Media.MediaURL;
                req.MediaWidth = this.Media.MediaWidth;
                req.MusicURL = this.MusicURL;
                req.Name = this.Name;
                req.ObscureMedia = this.ObscureMedia;
                req.ObscureMusic = this.ObscureMusic;
                req.ParcelFlags = this.Flags;
                req.PassHours = this.PassHours;
                req.PassPrice = (uint)this.PassPrice;
                req.SalePrice = (uint)this.SalePrice;
                req.SnapshotID = this.SnapshotID;
                req.UserLocation = this.UserLocation;
                req.UserLookAt = this.UserLookAt;
               
                OSDMap body = req.Serialize();

                CapsClient capsPost = new CapsClient(url);
                capsPost.BeginGetResponse(body, OSDFormat.Xml, simulator.Client.Settings.CAPS_TIMEOUT);
            }
            else
            {
                ParcelPropertiesUpdatePacket request = new ParcelPropertiesUpdatePacket();

                request.AgentData.AgentID = simulator.Client.Self.AgentID;
                request.AgentData.SessionID = simulator.Client.Self.SessionID;

                request.ParcelData.LocalID = this.LocalID;

                request.ParcelData.AuthBuyerID = this.AuthBuyerID;
                request.ParcelData.Category = (byte)this.Category;
                request.ParcelData.Desc = Utils.StringToBytes(this.Desc);
                request.ParcelData.GroupID = this.GroupID;
                request.ParcelData.LandingType = (byte)this.Landing;
                request.ParcelData.MediaAutoScale = (this.Media.MediaAutoScale) ? (byte)0x1 : (byte)0x0;
                request.ParcelData.MediaID = this.Media.MediaID;
                request.ParcelData.MediaURL = Utils.StringToBytes(this.Media.MediaURL.ToString());
                request.ParcelData.MusicURL = Utils.StringToBytes(this.MusicURL.ToString());
                request.ParcelData.Name = Utils.StringToBytes(this.Name);
                if (wantReply) request.ParcelData.Flags = 1;
                request.ParcelData.ParcelFlags = (uint)this.Flags;
                request.ParcelData.PassHours = this.PassHours;
                request.ParcelData.PassPrice = this.PassPrice;
                request.ParcelData.SalePrice = this.SalePrice;
                request.ParcelData.SnapshotID = this.SnapshotID;
                request.ParcelData.UserLocation = this.UserLocation;
                request.ParcelData.UserLookAt = this.UserLookAt;

                simulator.SendPacket(request);
            }

            UpdateOtherCleanTime(simulator);
            
        }
 /// <summary>
 /// Send a packet to a specified simulator
 /// </summary>
 /// <param name="packet">Packet to send</param>
 /// <param name="simulator">Simulator to send the packet to</param>
 public void SendPacket(Packet packet, Simulator simulator)
 {
     if (simulator != null)
     {
         simulator.SendPacket(packet);
     }
     else
     {
         Logger.Log("Packet received before simulator packet processing threads running, make certain you are completely logged in", Helpers.LogLevel.Error);
     }
 }
示例#5
0
        /// <summary>
        /// Update the simulator with any local changes to this Parcel object
        /// </summary>
        /// <param name="simulator">Simulator to send updates to</param>
        /// <param name="wantReply">Whether we want the simulator to confirm
        /// the update with a reply packet or not</param>
        public void Update(Simulator simulator, bool wantReply)
        {
            Uri url = simulator.Caps.CapabilityURI("ParcelPropertiesUpdate");

            if (url != null)
            {
                OSDMap body = new OSDMap();
                body["auth_buyer_id"] =  OSD.FromUUID(this.AuthBuyerID);
                body["auto_scale"] =  OSD.FromInteger(this.Media.MediaAutoScale);
                body["category"] = OSD.FromInteger((byte)this.Category);
                body["description"] = OSD.FromString(this.Desc);
                body["flags"] =  OSD.FromBinary(Utils.EmptyBytes);
                body["group_id"] = OSD.FromUUID(this.GroupID);
                body["landing_type"] = OSD.FromInteger((byte)this.Landing);
                body["local_id"] = OSD.FromInteger(this.LocalID);
                body["media_desc"] = OSD.FromString(this.Media.MediaDesc);
                body["media_height"] = OSD.FromInteger(this.Media.MediaHeight);
                body["media_id"] = OSD.FromUUID(this.Media.MediaID);
                body["media_loop"] = OSD.FromInteger(this.Media.MediaLoop ? 1 : 0);
                body["media_type"] = OSD.FromString(this.Media.MediaType);
                body["media_url"] = OSD.FromString(this.Media.MediaURL);
                body["media_width"] = OSD.FromInteger(this.Media.MediaWidth);
                body["music_url"] = OSD.FromString(this.MusicURL);
                body["name"] = OSD.FromString(this.Name);
                body["obscure_media"]= OSD.FromInteger(this.ObscureMedia ? 1 : 0);
                body["obscure_music"] = OSD.FromInteger(this.ObscureMusic ? 1 : 0);

                byte[] flags = Utils.IntToBytes((int)this.Flags); ;
                if (BitConverter.IsLittleEndian)
                    Array.Reverse(flags);
                body["parcel_flags"] = OSD.FromBinary(flags);

                body["pass_hours"] = OSD.FromReal(this.PassHours);
                body["pass_price"] = OSD.FromInteger(this.PassPrice);
                body["sale_price"] = OSD.FromInteger(this.SalePrice);
                body["snapshot_id"] = OSD.FromUUID(this.SnapshotID);
                OSDArray uloc = new OSDArray();
                uloc.Add(OSD.FromReal(this.UserLocation.X));
                uloc.Add(OSD.FromReal(this.UserLocation.Y));
                uloc.Add(OSD.FromReal(this.UserLocation.Z));
                body["user_location"] = uloc;
                OSDArray ulat = new OSDArray();
                ulat.Add(OSD.FromReal(this.UserLocation.X));
                ulat.Add(OSD.FromReal(this.UserLocation.Y));
                ulat.Add(OSD.FromReal(this.UserLocation.Z));
                body["user_look_at"] = ulat;

                //Console.WriteLine("OSD REQUEST\n{0}", body.ToString());

                byte[] postData = StructuredData.OSDParser.SerializeLLSDXmlBytes(body);
                //Console.WriteLine("{0}", OSDParser.SerializeLLSDXmlString(body));
                CapsClient capsPost = new CapsClient(url);
                capsPost.StartRequest(postData);

            }
            else
            {

                ParcelPropertiesUpdatePacket request = new ParcelPropertiesUpdatePacket();

                request.AgentData.AgentID = simulator.Client.Self.AgentID;
                request.AgentData.SessionID = simulator.Client.Self.SessionID;

                request.ParcelData.LocalID = this.LocalID;

                request.ParcelData.AuthBuyerID = this.AuthBuyerID;
                request.ParcelData.Category = (byte)this.Category;
                request.ParcelData.Desc = Utils.StringToBytes(this.Desc);
                request.ParcelData.GroupID = this.GroupID;
                request.ParcelData.LandingType = (byte)this.Landing;
                request.ParcelData.MediaAutoScale = this.Media.MediaAutoScale;
                request.ParcelData.MediaID = this.Media.MediaID;
                request.ParcelData.MediaURL = Utils.StringToBytes(this.Media.MediaURL);
                request.ParcelData.MusicURL = Utils.StringToBytes(this.MusicURL);
                request.ParcelData.Name = Utils.StringToBytes(this.Name);
                if (wantReply) request.ParcelData.Flags = 1;
                request.ParcelData.ParcelFlags = (uint)this.Flags;
                request.ParcelData.PassHours = this.PassHours;
                request.ParcelData.PassPrice = this.PassPrice;
                request.ParcelData.SalePrice = this.SalePrice;
                request.ParcelData.SnapshotID = this.SnapshotID;
                request.ParcelData.UserLocation = this.UserLocation;
                request.ParcelData.UserLookAt = this.UserLookAt;

                simulator.SendPacket(request, true);
            }

            UpdateOtherCleanTime(simulator);
            
        }
示例#6
0
        /// <summary>
        /// Update the simulator with any local changes to this Parcel object
        /// </summary>
        /// <param name="simulator">Simulator to send updates to</param>
        /// <param name="wantReply">Whether we want the simulator to confirm
        /// the update with a reply packet or not</param>
        public void Update(Simulator simulator, bool wantReply)
        {
            ParcelPropertiesUpdatePacket request = new ParcelPropertiesUpdatePacket();

            request.AgentData.AgentID = simulator.Client.Self.AgentID;
            request.AgentData.SessionID = simulator.Client.Self.SessionID;

            request.ParcelData.LocalID = this.LocalID;

            request.ParcelData.AuthBuyerID = this.AuthBuyerID;
            request.ParcelData.Category = (byte)this.Category;
            request.ParcelData.Desc = Utils.StringToBytes(this.Desc);
            request.ParcelData.GroupID = this.GroupID;
            request.ParcelData.LandingType = (byte)this.Landing;

            request.ParcelData.MediaAutoScale = this.Media.MediaAutoScale;
            request.ParcelData.MediaID = this.Media.MediaID;
            request.ParcelData.MediaURL = Utils.StringToBytes(this.Media.MediaURL);
            request.ParcelData.MusicURL = Utils.StringToBytes(this.MusicURL);
            request.ParcelData.Name = Utils.StringToBytes(this.Name);
            if (wantReply) request.ParcelData.Flags = 1;
            request.ParcelData.ParcelFlags = (uint)this.Flags;
            request.ParcelData.PassHours = this.PassHours;
            request.ParcelData.PassPrice = this.PassPrice;
            request.ParcelData.SalePrice = this.SalePrice;
            request.ParcelData.SnapshotID = this.SnapshotID;
            request.ParcelData.UserLocation = this.UserLocation;
            request.ParcelData.UserLookAt = this.UserLookAt;

            simulator.SendPacket(request, true);

            UpdateOtherCleanTime(simulator);
        }
示例#7
0
        /// <summary>
        /// Update the simulator with any local changes to this Parcel object
        /// </summary>
        /// <param name="simulator">Simulator to send updates to</param>
        /// <param name="wantReply">Whether we want the simulator to confirm
        /// the update with a reply packet or not</param>
        public void Update(Simulator simulator, bool wantReply)
        {
            Uri url = simulator.Caps.CapabilityURI("ParcelPropertiesUpdate");

            if (url != null)
            {
                ParcelPropertiesUpdateMessage req = new ParcelPropertiesUpdateMessage();
                req.AuthBuyerID = this.AuthBuyerID;
                req.Category = this.Category;
                req.Desc = this.Desc;
                req.GroupID = this.GroupID;
                req.Landing = this.Landing;
                req.LocalID = this.LocalID;
                req.MediaAutoScale = this.Media.MediaAutoScale;
                req.MediaDesc = this.Media.MediaDesc;
                req.MediaHeight = this.Media.MediaHeight;
                req.MediaID = this.Media.MediaID;
                req.MediaLoop = this.Media.MediaLoop;
                req.MediaType = this.Media.MediaType;
                req.MediaURL = this.Media.MediaURL;
                req.MediaWidth = this.Media.MediaWidth;
                req.MusicURL = this.MusicURL;
                req.Name = this.Name;
                req.ObscureMedia = this.ObscureMedia;
                req.ObscureMusic = this.ObscureMusic;
                req.ParcelFlags = this.Flags;
                req.PassHours = this.PassHours;
                req.PassPrice = (uint)this.PassPrice;
                req.SalePrice = (uint)this.SalePrice;
                req.SnapshotID = this.SnapshotID;
                req.UserLocation = this.UserLocation;
                req.UserLookAt = this.UserLookAt;

                //OSDMap body = new OSDMap();
                //body["auth_buyer_id"] =  OSD.FromUUID(this.AuthBuyerID);
                //body["auto_scale"] =  OSD.FromBoolean(this.Media.MediaAutoScale);
                //body["category"] = OSD.FromInteger((byte)this.Category);
                //body["description"] = OSD.FromString(this.Desc);
                //body["flags"] =  OSD.FromBinary(Utils.EmptyBytes);
                //body["group_id"] = OSD.FromUUID(this.GroupID);
                //body["landing_type"] = OSD.FromInteger((byte)this.Landing);
                //body["local_id"] = OSD.FromInteger(this.LocalID);
                //body["media_desc"] = OSD.FromString(this.Media.MediaDesc);
                //body["media_height"] = OSD.FromInteger(this.Media.MediaHeight);
                //body["media_id"] = OSD.FromUUID(this.Media.MediaID);
                //body["media_loop"] = OSD.FromInteger(this.Media.MediaLoop ? 1 : 0);
                //body["media_type"] = OSD.FromString(this.Media.MediaType);
                //body["media_url"] = OSD.FromString(this.Media.MediaURL);
                //body["media_width"] = OSD.FromInteger(this.Media.MediaWidth);
                //body["music_url"] = OSD.FromString(this.MusicURL);
                //body["name"] = OSD.FromString(this.Name);
                //body["obscure_media"]= OSD.FromInteger(this.ObscureMedia ? 1 : 0);
                //body["obscure_music"] = OSD.FromInteger(this.ObscureMusic ? 1 : 0);

                //byte[] flags = Utils.IntToBytes((int)this.Flags); ;
                //if (BitConverter.IsLittleEndian)
                //    Array.Reverse(flags);
                //body["parcel_flags"] = OSD.FromBinary(flags);

                //body["pass_hours"] = OSD.FromReal(this.PassHours);
                //body["pass_price"] = OSD.FromInteger(this.PassPrice);
                //body["sale_price"] = OSD.FromInteger(this.SalePrice);
                //body["snapshot_id"] = OSD.FromUUID(this.SnapshotID);
                //OSDArray uloc = new OSDArray();
                //uloc.Add(OSD.FromReal(this.UserLocation.X));
                //uloc.Add(OSD.FromReal(this.UserLocation.Y));
                //uloc.Add(OSD.FromReal(this.UserLocation.Z));
                //body["user_location"] = uloc;
                //OSDArray ulat = new OSDArray();
                //ulat.Add(OSD.FromReal(this.UserLocation.X));
                //ulat.Add(OSD.FromReal(this.UserLocation.Y));
                //ulat.Add(OSD.FromReal(this.UserLocation.Z));
                //body["user_look_at"] = ulat;

                OSDMap body = req.Serialize();

                CapsClient capsPost = new CapsClient(url);
                capsPost.BeginGetResponse(body, OSDFormat.Xml, simulator.Network.CapsTimeout);
            }
            else
            {
                ParcelPropertiesUpdatePacket request = new ParcelPropertiesUpdatePacket();

                request.AgentData.AgentID = simulator.Network.AgentID;
                request.AgentData.SessionID = simulator.Network.SessionID;

                request.ParcelData.LocalID = this.LocalID;

                request.ParcelData.AuthBuyerID = this.AuthBuyerID;
                request.ParcelData.Category = (byte)this.Category;
                request.ParcelData.Desc = Utils.StringToBytes(this.Desc);
                request.ParcelData.GroupID = this.GroupID;
                request.ParcelData.LandingType = (byte)this.Landing;
                request.ParcelData.MediaAutoScale = (this.Media.MediaAutoScale) ? (byte)0x1 : (byte)0x0;
                request.ParcelData.MediaID = this.Media.MediaID;
                request.ParcelData.MediaURL = Utils.StringToBytes(this.Media.MediaURL.ToString());
                request.ParcelData.MusicURL = Utils.StringToBytes(this.MusicURL.ToString());
                request.ParcelData.Name = Utils.StringToBytes(this.Name);
                if (wantReply) request.ParcelData.Flags = 1;
                request.ParcelData.ParcelFlags = (uint)this.Flags;
                request.ParcelData.PassHours = this.PassHours;
                request.ParcelData.PassPrice = this.PassPrice;
                request.ParcelData.SalePrice = this.SalePrice;
                request.ParcelData.SnapshotID = this.SnapshotID;
                request.ParcelData.UserLocation = this.UserLocation;
                request.ParcelData.UserLookAt = this.UserLookAt;

                simulator.SendPacket(request);
            }

            UpdateOtherCleanTime(simulator);
            
        }
 /// <summary>
 /// Send a packet to a specified simulator
 /// </summary>
 /// <param name="packet">Packet to send</param>
 /// <param name="simulator">Simulator to send the packet to</param>
 public void SendPacket(Packet packet, Simulator simulator)
 {
     if (simulator != null)
     {
         simulator.SendPacket(packet);
     }
     else
     {
         throw new NotConnectedException("Packet received before simulator packet processing threads running, make certain you are completely logged in");
     }
 }