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());