From ce60ca5e673cd97fb2bcc4f5b943badc717d3527 Mon Sep 17 00:00:00 2001 From: gareth Date: Mon, 30 Apr 2007 04:50:25 +0000 Subject: [PATCH] It kinda works... Loads assets across the network, body shape still broken and not displaying properly in grid mode --- OpenGridServices.AssetServer/Main.cs | 30 ++++++++++++++++++- .../Remote/RemoteAssetServer.cs | 4 +-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/OpenGridServices.AssetServer/Main.cs b/OpenGridServices.AssetServer/Main.cs index 887bf07903..b57a5a5050 100644 --- a/OpenGridServices.AssetServer/Main.cs +++ b/OpenGridServices.AssetServer/Main.cs @@ -100,7 +100,35 @@ namespace OpenGridServices.AssetServer } public string assetGetMethod(string request, string path, string param) { - return ""; + byte[] assetdata=getAssetData(new LLUUID(param),false); + if(assetdata!=null) { + return System.Text.Encoding.ASCII.GetString(assetdata); + } else { + return ""; + } + + } + + public byte[] getAssetData(LLUUID assetID, bool isTexture) { + byte[] idata = null; + bool found = false; + AssetStorage foundAsset = null; + + IObjectSet result = db.Get(new AssetStorage(assetID)); + if (result.Count > 0) + { + foundAsset = (AssetStorage)result.Next(); + found = true; + } + + if (found) + { + return foundAsset.Data; + } + else + { + return null; + } } public void setupDB() { diff --git a/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs b/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs index bcebf821b4..436b148aa8 100644 --- a/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs +++ b/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs @@ -66,8 +66,8 @@ namespace OpenSim.GridInterfaces.Remote // 404... THE MAGIC FILE NOT FOUND ERROR, very useful for telling you things such as a file (or asset ;) ) not being found!!!!!!!!!!! it's 2:22AM ARequest req = this._assetRequests.Dequeue(); LLUUID assetID = req.AssetID; - OpenSim.Framework.Console.MainConsole.Instance.WriteLine(" RemoteAssetServer- Got a AssetServer request, processing it - " + this.AssetServerUrl + "assets/" + assetID + "/data"); - WebRequest AssetLoad = WebRequest.Create(this.AssetServerUrl + "assets/" + assetID + "/data"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(" RemoteAssetServer- Got a AssetServer request, processing it - " + this.AssetServerUrl + "assets/" + assetID); + WebRequest AssetLoad = WebRequest.Create(this.AssetServerUrl + "assets/" + assetID); WebResponse AssetResponse = AssetLoad.GetResponse(); byte[] idata = new byte[(int)AssetResponse.ContentLength]; BinaryReader br = new BinaryReader(AssetResponse.GetResponseStream());