From 38a800400ae8c61eef0770b8c49aa6e637478e58 Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 24 Jun 2007 15:24:02 +0000 Subject: Disabled the CheckSum Server as it seems that isn't used by viewer 1.18. Started to add support for asset uploads over CAPS (the asset is uploaded but seems to come out corrupt). Started to cleanup/rewrite the AssetCache. Fixed bug in MapBlock requests, where data for some regions wasn't being sent. Renamed PrimData's Texture to TextureEntry. most likely a few other small changes. --- Common/OpenSim.Framework/Interfaces/IClientAPI.cs | 2 +- Common/OpenSim.Framework/Types/PrimData.cs | 14 +++++++------- Common/OpenSim.Servers/BaseHttpServer.cs | 20 +++++++++++++++++++- Common/OpenSim.Servers/CheckSumServer.cs | 7 ++++--- 4 files changed, 31 insertions(+), 12 deletions(-) (limited to 'Common') diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs index ea38f06..9028d8d 100644 --- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs +++ b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs @@ -144,7 +144,7 @@ namespace OpenSim.Framework.Interfaces void SendTeleportCancel(); void SendTeleportLocationStart(); - void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos); + void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry); void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity); void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); diff --git a/Common/OpenSim.Framework/Types/PrimData.cs b/Common/OpenSim.Framework/Types/PrimData.cs index 56d41b3..f84ae3e 100644 --- a/Common/OpenSim.Framework/Types/PrimData.cs +++ b/Common/OpenSim.Framework/Types/PrimData.cs @@ -58,7 +58,7 @@ namespace OpenSim.Framework.Types public sbyte PathTaperY; public sbyte PathTwist; public sbyte PathTwistBegin; - public byte[] Texture; + public byte[] TextureEntry; // a LL textureEntry in byte[] format public Int32 CreationDate; public uint OwnerMask = FULL_MASK_PERMISSIONS; @@ -105,8 +105,8 @@ namespace OpenSim.Framework.Types this.PathTwist = (sbyte)data[i++]; this.PathTwistBegin = (sbyte)data[i++]; ushort length = (ushort)(data[i++] + (data[i++] << 8)); - this.Texture = new byte[length]; - Array.Copy(data, i, Texture, 0, length); i += length; + this.TextureEntry = new byte[length]; + Array.Copy(data, i, TextureEntry, 0, length); i += length; this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); @@ -123,7 +123,7 @@ namespace OpenSim.Framework.Types public byte[] ToBytes() { int i = 0; - byte[] bytes = new byte[126 + Texture.Length]; + byte[] bytes = new byte[126 + TextureEntry.Length]; Array.Copy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16; bytes[i++] = this.PCode; bytes[i++] = (byte)(this.PathBegin % 256); @@ -154,9 +154,9 @@ namespace OpenSim.Framework.Types bytes[i++] = ((byte)this.PathTaperY); bytes[i++] = ((byte)this.PathTwist); bytes[i++] = ((byte)this.PathTwistBegin); - bytes[i++] = (byte)(Texture.Length % 256); - bytes[i++] = (byte)((Texture.Length >> 8) % 256); - Array.Copy(Texture, 0, bytes, i, Texture.Length); i += Texture.Length; + bytes[i++] = (byte)(TextureEntry.Length % 256); + bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256); + Array.Copy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length; bytes[i++] = (byte)(this.CreationDate % 256); bytes[i++] = (byte)((this.CreationDate >> 8) % 256); bytes[i++] = (byte)((this.CreationDate >> 16) % 256); diff --git a/Common/OpenSim.Servers/BaseHttpServer.cs b/Common/OpenSim.Servers/BaseHttpServer.cs index 1071692..55826f6 100644 --- a/Common/OpenSim.Servers/BaseHttpServer.cs +++ b/Common/OpenSim.Servers/BaseHttpServer.cs @@ -88,6 +88,17 @@ namespace OpenSim.Servers return false; } + public bool RemoveRestHandler(string method, string path) + { + string methodKey = String.Format("{0}: {1}", method, path); + if (this.m_restHandlers.ContainsKey(methodKey)) + { + this.m_restHandlers.Remove(methodKey); + return true; + } + return false; + } + public bool AddXmlRPCHandler(string method, XmlRpcMethod handler) { if (!this.m_rpcHandlers.ContainsKey(method)) @@ -213,7 +224,7 @@ namespace OpenSim.Servers //Console.WriteLine(requestBody); string responseString = ""; - //Console.WriteLine("new request " + request.ContentType); + Console.WriteLine("new request " + request.ContentType +" at "+ request.RawUrl); switch (request.ContentType) { case "text/xml": @@ -232,6 +243,13 @@ namespace OpenSim.Servers response.AddHeader("Content-type", "application/xml"); break; + case "application/octet-stream": + // probably LLSD we hope, otherwise it should be ignored by the parser + // responseString = ParseLLSDXML(requestBody); + responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod); + response.AddHeader("Content-type", "application/xml"); + break; + case "application/x-www-form-urlencoded": // a form data POST so send to the REST parser responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod); diff --git a/Common/OpenSim.Servers/CheckSumServer.cs b/Common/OpenSim.Servers/CheckSumServer.cs index 14ac11b..a359205 100644 --- a/Common/OpenSim.Servers/CheckSumServer.cs +++ b/Common/OpenSim.Servers/CheckSumServer.cs @@ -42,7 +42,7 @@ using OpenSim.Framework.Console; namespace OpenSim.Servers { - public class CheckSumServer : UDPServerBase +/* public class CheckSumServer : UDPServerBase { //protected ConsoleBase m_log; @@ -79,7 +79,7 @@ namespace OpenSim.Servers SecuredTemplateChecksumRequestPacket checkrequest = new SecuredTemplateChecksumRequestPacket(); checkrequest.TokenBlock.Token = checksum.TokenBlock.Token; this.SendPacket(checkrequest, epSender); - */ + } else if (packet.Type == PacketType.TemplateChecksumReply) { @@ -136,5 +136,6 @@ namespace OpenSim.Servers { this.Server.SendTo(buffer, size, flags, endp); } - } + * + }*/ } \ No newline at end of file -- cgit v1.1