protected void SendCompleteMessage(IClientAPI remoteClient)
        {
            lock (_finishedLock)
            {
                m_finished = true;
                if (FinishedEvent != null)
                {
                    FinishedEvent();
                }

                if (m_createItem)
                {
                    DoCreateItem(m_createItemCallback, remoteClient);
                }
                else if (m_storeLocal)
                {
                    m_asset.ID = m_userTransactions.Manager.MyScene.AssetService.Store(m_asset);
                }
            }
            remoteClient.SendAssetUploadCompleteMessage((sbyte)m_asset.Type, true, m_asset.ID);

            IMonitorModule monitorModule = m_userTransactions.Manager.MyScene.RequestModuleInterface <IMonitorModule>();

            if (monitorModule != null)
            {
                INetworkMonitor networkMonitor =
                    (INetworkMonitor)
                    monitorModule.GetMonitor(m_userTransactions.Manager.MyScene.RegionInfo.RegionID.ToString(),
                                             MonitorModuleHelper.NetworkMonitor);
                networkMonitor.AddPendingUploads(-1);
            }

            MainConsole.Instance.DebugFormat(
                "[ASSET TRANSACTIONS]: Uploaded asset {0} for transaction {1}", m_asset.ID, TransactionID);
        }
        protected void SendCompleteMessage()
        {
            ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID);

            m_finished = true;
            if (m_createItem)
            {
                DoCreateItem(m_createItemCallback);
            }
            else if (m_storeLocal)
            {
                m_userTransactions.Manager.MyScene.AssetService.Store(m_asset);
            }

            m_log.DebugFormat(
                "[ASSET TRANSACTIONS]: Uploaded asset {0} for transaction {1}", m_asset.FullID, TransactionID);

            if (m_dumpAssetToFile)
            {
                DateTime now      = DateTime.Now;
                string   filename =
                    String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day,
                                  now.Hour, now.Minute, now.Second, m_asset.Name, m_asset.Type);
                SaveAssetToFile(filename, m_asset.Data);
            }
        }
Ejemplo n.º 3
0
        protected void SendCompleteMessage(IClientAPI remoteClient)
        {
            remoteClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID);

            m_finished = true;
            if (m_createItem)
            {
                DoCreateItem(m_createItemCallback, remoteClient);
            }
            else if (m_storeLocal)
            {
                m_userTransactions.Manager.MyScene.AssetService.Store(m_asset);
            }

            IMonitorModule monitorModule = m_userTransactions.Manager.MyScene.RequestModuleInterface <IMonitorModule>();

            if (monitorModule != null)
            {
                INetworkMonitor networkMonitor = (INetworkMonitor)monitorModule.GetMonitor(m_userTransactions.Manager.MyScene.RegionInfo.RegionID.ToString(), "Network Monitor");
                networkMonitor.AddPendingUploads(-1);
            }

            m_log.DebugFormat(
                "[ASSET TRANSACTIONS]: Uploaded asset {0} for transaction {1}", m_asset.FullID, TransactionID);

            if (m_dumpAssetToFile)
            {
                DateTime now      = DateTime.Now;
                string   filename =
                    String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day,
                                  now.Hour, now.Minute, now.Second, m_asset.Name, m_asset.Type);
                SaveAssetToFile(filename, m_asset.Data);
            }
        }
Ejemplo n.º 4
0
        protected void SendCompleteMessage()
        {
            m_finished = true;
            if (m_createItem)
            {
                DoCreateItem(m_createItemCallback);
            }
            else if (m_storeLocal)
            {
                try
                {
                    m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset, AssetRequestInfo.GenericNetRequest());
                }
                catch (AssetServerException e)
                {
                    m_log.ErrorFormat("[ASSET TRANSACTIONS]: Error uploading asset data for transaction {0}", e);
                    ourClient.SendAgentAlertMessage("Unable to upload asset. Please try again later.", false);
                    ourClient.SendAssetUploadCompleteMessage(m_asset.Type, false, UUID.Zero);
                    return;
                }
            }

            ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID);
            m_log.DebugFormat("[ASSET TRANSACTIONS]: Uploaded asset data for transaction {0}", TransactionID);

            if (m_dumpAssetToFile)
            {
                DateTime now      = DateTime.Now;
                string   filename =
                    String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day,
                                  now.Hour, now.Minute, now.Second, m_asset.Name, m_asset.Type);
                SaveAssetToFile(filename, m_asset.Data);
            }

            // Callback to the completion delegate if defined.
            if (m_assetUploadedDelegate != null)
            {
                TriggerWhenUploadComplete(m_assetUploadedDelegate);
            }
        }
        protected void SendCompleteMessage()
        {
            ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true,
                                                     m_asset.FullID);

            // We must lock in order to avoid a race with a separate thread dealing with an inventory item or create
            // message from other client UDP.
            lock (this)
            {
                m_finished = true;
                if (m_createItem)
                {
                    DoCreateItem(m_createItemCallback);
                }
                else if (m_updateItem)
                {
                    StoreAssetForItemUpdate(m_updateItemData);

                    // Remove ourselves from the list of transactions if completion was delayed until the transaction
                    // was complete.
                    // TODO: Should probably do the same for create item.
                    m_transactions.RemoveXferUploader(TransactionID);
                }
                else if (m_storeLocal)
                {
                    m_Scene.AssetService.Store(m_asset);
                }
            }

            m_log.DebugFormat(
                "[ASSET XFER UPLOADER]: Uploaded asset {0} for transaction {1}",
                m_asset.FullID, TransactionID);

            if (m_dumpAssetToFile)
            {
                DateTime now      = DateTime.Now;
                string   filename =
                    String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat",
                                  now.Year, now.Month, now.Day, now.Hour, now.Minute,
                                  now.Second, m_asset.Name, m_asset.Type);
                SaveAssetToFile(filename, m_asset.Data);
            }
        }
Ejemplo n.º 6
0
        protected void SendCompleteMessage()
        {
            // We must lock in order to avoid a race with a separate thread dealing with an inventory item or create
            // message from other client UDP.
            lock (this)
            {
                m_uploadState = UploadState.Complete;

                ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID);

                if (m_createItem)
                {
                    CompleteCreateItem(m_createItemCallback);
                }
                else if (m_updateItem)
                {
                    CompleteItemUpdate(m_updateItemData);
                }
                else if (m_updateTaskItem)
                {
                    CompleteTaskItemUpdate(m_updateTaskItemData);
                }
//                else if (m_storeLocal)
//                {
//                    m_Scene.AssetService.Store(m_asset);
//                }
            }

            m_log.DebugFormat(
                "[ASSET XFER UPLOADER]: Uploaded asset {0} for transaction {1}",
                m_asset.FullID, m_transactionID);

            if (m_dumpAssetToFile)
            {
                DateTime now      = DateTime.Now;
                string   filename =
                    String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat",
                                  now.Year, now.Month, now.Day, now.Hour, now.Minute,
                                  now.Second, m_asset.Name, m_asset.Type);
                SaveAssetToFile(filename, m_asset.Data);
            }
        }
Ejemplo n.º 7
0
        protected void SendCompleteMessage(IClientAPI remoteClient)
        {
            remoteClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID);

            m_finished = true;
            if (m_createItem)
            {
                DoCreateItem(m_createItemCallback, remoteClient);
            }
            else if (m_storeLocal)
            {
                m_userTransactions.Manager.MyScene.AssetService.Store(m_asset);
            }

            IMonitorModule monitorModule = m_userTransactions.Manager.MyScene.RequestModuleInterface<IMonitorModule>();
            if (monitorModule != null)
            {
                INetworkMonitor networkMonitor = (INetworkMonitor)monitorModule.GetMonitor(m_userTransactions.Manager.MyScene.RegionInfo.RegionID.ToString(), "Network Monitor");
                networkMonitor.AddPendingUploads(-1);
            }

            m_log.DebugFormat(
                "[ASSET TRANSACTIONS]: Uploaded asset {0} for transaction {1}", m_asset.FullID, TransactionID);

            if (m_dumpAssetToFile)
            {
                DateTime now = DateTime.Now;
                string filename =
                    String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day,
                                  now.Hour, now.Minute, now.Second, m_asset.Name, m_asset.Type);
                SaveAssetToFile(filename, m_asset.Data);
            }
        }
Ejemplo n.º 8
0
        protected void SendCompleteMessage(IClientAPI remoteClient)
        {
            m_finished = true;
            if (m_createItem)
            {
                DoCreateItem(m_createItemCallback, remoteClient);
            }
            else if (m_storeLocal)
            {
                m_asset.ID = m_userTransactions.Manager.MyScene.AssetService.Store(m_asset);
            }
            remoteClient.SendAssetUploadCompleteMessage((sbyte) m_asset.Type, true, m_asset.ID);

            IMonitorModule monitorModule = m_userTransactions.Manager.MyScene.RequestModuleInterface<IMonitorModule>();
            if (monitorModule != null)
            {
                INetworkMonitor networkMonitor =
                    (INetworkMonitor)
                    monitorModule.GetMonitor(m_userTransactions.Manager.MyScene.RegionInfo.RegionID.ToString(),
                                             MonitorModuleHelper.NetworkMonitor);
                networkMonitor.AddPendingUploads(-1);
            }

            MainConsole.Instance.DebugFormat(
                "[ASSET TRANSACTIONS]: Uploaded asset {0} for transaction {1}", m_asset.ID, TransactionID);
        }
Ejemplo n.º 9
0
        protected void SendCompleteMessage(IClientAPI remoteClient)
        {
            remoteClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID);

            m_finished = true;
            if (m_createItem)
            {
                DoCreateItem(m_createItemCallback, remoteClient);
            }
            else if (m_storeLocal)
            {
                m_userTransactions.Manager.MyScene.AssetService.Store(m_asset);
            }

            //m_log.DebugFormat(
            //    "[ASSET TRANSACTIONS]: Uploaded asset {0} for transaction {1}", m_asset.FullID, TransactionID);

            if (m_dumpAssetToFile)
            {
                DateTime now = DateTime.Now;
                string filename =
                    String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day,
                                  now.Hour, now.Minute, now.Second, m_asset.Name, m_asset.Type);
                SaveAssetToFile(filename, m_asset.Data);
            }
        }