Texture request download handler, allows a configurable number of download slots
        public PeriscopeImageDelivery(Simian server, GridClient client)
        {
            this.server = server;
            this.client = client;

            Pipeline = new TexturePipeline(client, 12);
            Pipeline.OnDownloadFinished += new TexturePipeline.DownloadFinishedCallback(pipeline_OnDownloadFinished);

            server.UDP.RegisterPacketCallback(PacketType.RequestImage, RequestImageHandler);
        }
        public PeriscopeImageDelivery(ISceneProvider scene, GridClient client)
        {
            this.scene = scene;
            this.client = client;

            Pipeline = new TexturePipeline(client, 12);
            Pipeline.OnDownloadFinished += new TexturePipeline.DownloadFinishedCallback(pipeline_OnDownloadFinished);

            scene.UDP.RegisterPacketCallback(PacketType.RequestImage, RequestImageHandler);
        }
        public SimExport(string firstName, string lastName, string password, string loginServer, string regionName, string filename)
        {
            this.filename = filename;
            directoryname = Path.GetFileNameWithoutExtension(filename);

            try
            {
                if (!Directory.Exists(directoryname)) Directory.CreateDirectory(filename);
                if (!Directory.Exists(directoryname + "/assets")) Directory.CreateDirectory(directoryname + "/assets");
                if (!Directory.Exists(directoryname + "/objects")) Directory.CreateDirectory(directoryname + "/objects");
                if (!Directory.Exists(directoryname + "/terrains")) Directory.CreateDirectory(directoryname + "/terrains");

                CheckTextures();
            }
            catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error); return; }

            running = true;

            client = new GridClient();
            texturePipeline = new TexturePipeline(client);
            //texturePipeline.OnDownloadFinished += new TexturePipeline.DownloadFinishedCallback(texturePipeline_OnDownloadFinished);

            //Settings.LOG_LEVEL = Helpers.LogLevel.Info;
            client.Settings.MULTIPLE_SIMS = false;
            client.Settings.PARCEL_TRACKING = true;
            client.Settings.ALWAYS_REQUEST_PARCEL_ACL = true;
            client.Settings.ALWAYS_REQUEST_PARCEL_DWELL = false;
            client.Settings.ALWAYS_REQUEST_OBJECTS = true;
            client.Settings.STORE_LAND_PATCHES = true;
            client.Settings.SEND_AGENT_UPDATES = true;
            client.Settings.DISABLE_AGENT_UPDATE_DUPLICATE_CHECK = true;
            /*
            //todo
            client.Network.OnCurrentSimChanged += Network_OnCurrentSimChanged;
            client.Objects.OnNewPrim += Objects_OnNewPrim;
            client.Objects.OnObjectKilled += Objects_OnObjectKilled;
            client.Objects.OnObjectProperties += Objects_OnObjectProperties;
            client.Objects.OnObjectUpdated += Objects_OnObjectUpdated;
            client.Parcels.OnSimParcelsDownloaded += new ParcelManager.SimParcelsDownloaded(Parcels_OnSimParcelsDownloaded);
            */
            LoginParams loginParams = client.Network.DefaultLoginParams(firstName, lastName, password, "SimExport", "0.0.1");
            loginParams.URI = loginServer;
            loginParams.Start = NetworkManager.StartLocation(regionName, 128, 128, 40);

            if (client.Network.Login(loginParams))
            {
                Run();
            }
            else
            {
                Logger.Log(String.Format("Login failed ({0}: {1}", client.Network.LoginErrorKey, client.Network.LoginMessage),
                    Helpers.LogLevel.Error);
            }
        }
Exemple #4
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="client">A reference to the GridClient object</param>
        public AssetManager(GridClient client)
        {
            Client = client;
            Cache = new AssetCache(client);
            Texture = new TexturePipeline(client);

            // Transfer packets for downloading large assets
            Client.Network.RegisterCallback(PacketType.TransferInfo, TransferInfoHandler);
            Client.Network.RegisterCallback(PacketType.TransferPacket, TransferPacketHandler);

            // Xfer packets for uploading large assets
            Client.Network.RegisterCallback(PacketType.RequestXfer, RequestXferHandler);
            Client.Network.RegisterCallback(PacketType.ConfirmXferPacket, ConfirmXferPacketHandler);
            Client.Network.RegisterCallback(PacketType.AssetUploadComplete, AssetUploadCompleteHandler);

            // Xfer packets for downloading misc assets
            Client.Network.RegisterCallback(PacketType.SendXferPacket, SendXferPacketHandler);
            Client.Network.RegisterCallback(PacketType.AbortXfer, AbortXferHandler);

            // Simulator is responding to a request to download a file
            Client.Network.RegisterCallback(PacketType.InitiateDownload, InitiateDownloadPacketHandler);

        }
Exemple #5
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="client">A reference to the GridClient object</param>
        public AssetManager(LoggerInstance log, NetworkManager network)
        {
            Log = log;
            Network = network;
            Cache = new TextureCache(log, network, this);
            Texture = new TexturePipeline(log, network, this);

            // Transfer packets for downloading large assets
            Network.RegisterCallback(PacketType.TransferInfo, new NetworkManager.PacketCallback(TransferInfoHandler));
            Network.RegisterCallback(PacketType.TransferPacket, new NetworkManager.PacketCallback(TransferPacketHandler));

            // Xfer packets for uploading large assets
            Network.RegisterCallback(PacketType.RequestXfer, new NetworkManager.PacketCallback(RequestXferHandler));
            Network.RegisterCallback(PacketType.ConfirmXferPacket, new NetworkManager.PacketCallback(ConfirmXferPacketHandler));
            Network.RegisterCallback(PacketType.AssetUploadComplete, new NetworkManager.PacketCallback(AssetUploadCompleteHandler));

            // Xfer packet for downloading misc assets
            Network.RegisterCallback(PacketType.SendXferPacket, new NetworkManager.PacketCallback(SendXferPacketHandler));

            // Simulator is responding to a request to download a file
            Network.RegisterCallback(PacketType.InitiateDownload, new NetworkManager.PacketCallback(InitiateDownloadPacketHandler));

        }