From 384293ac5676cf7ba1fbf77c182a117bd61822be Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 15 May 2007 17:51:13 +0000 Subject: Worked on Asset server, asset downloads (from server to sim) now work. Asset uploads (from sim to server) may or may not work, needs more testing, if they don't work then it should be just a encoding problem and not hard to fix. --- OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs') diff --git a/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs b/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs index d79073a..7432dee 100644 --- a/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs +++ b/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs @@ -49,6 +49,11 @@ namespace OpenSim.GridInterfaces.Remote public void UploadNewAsset(AssetBase asset) { + Encoding Windows1252Encoding = Encoding.GetEncoding(1252); + string ret = Windows1252Encoding.GetString(asset.Data); + byte[] buffer = Windows1252Encoding.GetBytes(ret); + WebClient client = new WebClient(); + client.UploadData(this.AssetServerUrl + "assets/" + asset.FullID, buffer); } @@ -66,14 +71,14 @@ 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(OpenSim.Framework.Console.LogPriority.LOW," RemoteAssetServer- Got a AssetServer request, processing it - " + this.AssetServerUrl + "assets/" + assetID); + // OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW," 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()); idata = br.ReadBytes((int)AssetResponse.ContentLength); br.Close(); - + AssetBase asset = new AssetBase(); asset.FullID = assetID; asset.Data = idata; -- cgit v1.1