diff options
author | gareth | 2007-04-30 04:50:25 +0000 |
---|---|---|
committer | gareth | 2007-04-30 04:50:25 +0000 |
commit | ce60ca5e673cd97fb2bcc4f5b943badc717d3527 (patch) | |
tree | 22af777c6f2b22bebfa72ee3312873487b738e7e | |
parent | W00t! It loads a DB! (diff) | |
download | opensim-SC_OLD-ce60ca5e673cd97fb2bcc4f5b943badc717d3527.zip opensim-SC_OLD-ce60ca5e673cd97fb2bcc4f5b943badc717d3527.tar.gz opensim-SC_OLD-ce60ca5e673cd97fb2bcc4f5b943badc717d3527.tar.bz2 opensim-SC_OLD-ce60ca5e673cd97fb2bcc4f5b943badc717d3527.tar.xz |
It kinda works...
Loads assets across the network, body shape still broken and not displaying properly in grid mode
-rw-r--r-- | OpenGridServices.AssetServer/Main.cs | 30 | ||||
-rw-r--r-- | OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs | 4 |
2 files changed, 31 insertions, 3 deletions
diff --git a/OpenGridServices.AssetServer/Main.cs b/OpenGridServices.AssetServer/Main.cs index 887bf07..b57a5a5 100644 --- a/OpenGridServices.AssetServer/Main.cs +++ b/OpenGridServices.AssetServer/Main.cs | |||
@@ -100,7 +100,35 @@ namespace OpenGridServices.AssetServer | |||
100 | } | 100 | } |
101 | 101 | ||
102 | public string assetGetMethod(string request, string path, string param) { | 102 | public string assetGetMethod(string request, string path, string param) { |
103 | return ""; | 103 | byte[] assetdata=getAssetData(new LLUUID(param),false); |
104 | if(assetdata!=null) { | ||
105 | return System.Text.Encoding.ASCII.GetString(assetdata); | ||
106 | } else { | ||
107 | return ""; | ||
108 | } | ||
109 | |||
110 | } | ||
111 | |||
112 | public byte[] getAssetData(LLUUID assetID, bool isTexture) { | ||
113 | byte[] idata = null; | ||
114 | bool found = false; | ||
115 | AssetStorage foundAsset = null; | ||
116 | |||
117 | IObjectSet result = db.Get(new AssetStorage(assetID)); | ||
118 | if (result.Count > 0) | ||
119 | { | ||
120 | foundAsset = (AssetStorage)result.Next(); | ||
121 | found = true; | ||
122 | } | ||
123 | |||
124 | if (found) | ||
125 | { | ||
126 | return foundAsset.Data; | ||
127 | } | ||
128 | else | ||
129 | { | ||
130 | return null; | ||
131 | } | ||
104 | } | 132 | } |
105 | 133 | ||
106 | public void setupDB() { | 134 | public void setupDB() { |
diff --git a/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs b/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs index bcebf82..436b148 100644 --- a/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs +++ b/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs | |||
@@ -66,8 +66,8 @@ namespace OpenSim.GridInterfaces.Remote | |||
66 | // 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 | 66 | // 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 |
67 | ARequest req = this._assetRequests.Dequeue(); | 67 | ARequest req = this._assetRequests.Dequeue(); |
68 | LLUUID assetID = req.AssetID; | 68 | LLUUID assetID = req.AssetID; |
69 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(" RemoteAssetServer- Got a AssetServer request, processing it - " + this.AssetServerUrl + "assets/" + assetID + "/data"); | 69 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(" RemoteAssetServer- Got a AssetServer request, processing it - " + this.AssetServerUrl + "assets/" + assetID); |
70 | WebRequest AssetLoad = WebRequest.Create(this.AssetServerUrl + "assets/" + assetID + "/data"); | 70 | WebRequest AssetLoad = WebRequest.Create(this.AssetServerUrl + "assets/" + assetID); |
71 | WebResponse AssetResponse = AssetLoad.GetResponse(); | 71 | WebResponse AssetResponse = AssetLoad.GetResponse(); |
72 | byte[] idata = new byte[(int)AssetResponse.ContentLength]; | 72 | byte[] idata = new byte[(int)AssetResponse.ContentLength]; |
73 | BinaryReader br = new BinaryReader(AssetResponse.GetResponseStream()); | 73 | BinaryReader br = new BinaryReader(AssetResponse.GetResponseStream()); |