aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs17
-rw-r--r--OpenSim/Framework/General/Interfaces/IClientAPI.cs1
-rw-r--r--OpenSim/Framework/General/LoginService.cs34
-rw-r--r--OpenSim/Framework/Servers/BinaryStreamHandler.cs19
-rw-r--r--OpenSim/Framework/Servers/RestMethod.cs1
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs12
6 files changed, 31 insertions, 53 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index ebc9632..550372f 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -55,20 +55,17 @@ namespace OpenSim.Framework.Communications
55 #region Packet Handlers 55 #region Packet Handlers
56 public void HandleUUIDNameRequest(LLUUID uuid, IClientAPI remote_client) 56 public void HandleUUIDNameRequest(LLUUID uuid, IClientAPI remote_client)
57 { 57 {
58 Encoding enc = Encoding.ASCII;
59 UserProfileData profileData = this.UserServer.GetUserProfile(uuid); 58 UserProfileData profileData = this.UserServer.GetUserProfile(uuid);
60 if (profileData != null) 59 if (profileData != null)
61 { 60 {
62 UUIDNameReplyPacket packet = new UUIDNameReplyPacket(); 61 LLUUID profileId = profileData.UUID;
63 packet.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[1]; 62 string firstname = profileData.username;
64 packet.UUIDNameBlock[0] = new UUIDNameReplyPacket.UUIDNameBlockBlock(); 63 string lastname = profileData.surname;
65 packet.UUIDNameBlock[0].ID = profileData.UUID; 64
66 packet.UUIDNameBlock[0].FirstName = enc.GetBytes(profileData.username + "\0"); 65 remote_client.SendNameReply(profileId, firstname, lastname);
67 packet.UUIDNameBlock[0].LastName = enc.GetBytes(profileData.surname +"\0"); 66 }
68 remote_client.OutPacket((Packet)packet);
69 }
70
71 } 67 }
68
72 #endregion 69 #endregion
73 } 70 }
74} 71}
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
index edd693e..b6f304b 100644
--- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs
+++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
@@ -180,5 +180,6 @@ namespace OpenSim.Framework.Interfaces
180 180
181 void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items); 181 void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items);
182 void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item); 182 void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item);
183 void SendNameReply(LLUUID profileId, string firstname, string lastname);
183 } 184 }
184} 185}
diff --git a/OpenSim/Framework/General/LoginService.cs b/OpenSim/Framework/General/LoginService.cs
deleted file mode 100644
index 02efcec..0000000
--- a/OpenSim/Framework/General/LoginService.cs
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28namespace OpenSim.Framework.Grid
29{
30 public abstract class LoginService
31 {
32
33 }
34} \ No newline at end of file
diff --git a/OpenSim/Framework/Servers/BinaryStreamHandler.cs b/OpenSim/Framework/Servers/BinaryStreamHandler.cs
index 302dbff..7d4e4ce 100644
--- a/OpenSim/Framework/Servers/BinaryStreamHandler.cs
+++ b/OpenSim/Framework/Servers/BinaryStreamHandler.cs
@@ -5,27 +5,28 @@ using System.IO;
5 5
6namespace OpenSim.Framework.Servers 6namespace OpenSim.Framework.Servers
7{ 7{
8 public delegate string BinaryMethod(byte[] data, string path, string param);
8 9
9 public class BinaryStreamHandler : BaseStreamHandler 10 public class BinaryStreamHandler : BaseStreamHandler
10 { 11 {
11 BinaryMethod m_restMethod; 12 BinaryMethod m_method;
12 13
13 override public byte[] Handle(string path, Stream request) 14 override public byte[] Handle(string path, Stream request)
14 { 15 {
15 byte[] data = ReadFully(request); 16 byte[] data = ReadFully(request);
16 string param = GetParam(path); 17 string param = GetParam(path);
17 string responseString = m_restMethod(data, path, param); 18 string responseString = m_method(data, path, param);
18 19
19 return Encoding.UTF8.GetBytes(responseString); 20 return Encoding.UTF8.GetBytes(responseString);
20 } 21 }
21 22
22 public BinaryStreamHandler(string httpMethod, string path, BinaryMethod restMethod) 23 public BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod)
23 : base(httpMethod, path) 24 : base(httpMethod, path)
24 { 25 {
25 m_restMethod = restMethod; 26 m_method = binaryMethod;
26 } 27 }
27 28
28 public byte[] ReadFully(Stream stream) 29 private byte[] ReadFully(Stream stream)
29 { 30 {
30 byte[] buffer = new byte[32768]; 31 byte[] buffer = new byte[32768];
31 using (MemoryStream ms = new MemoryStream()) 32 using (MemoryStream ms = new MemoryStream())
@@ -33,11 +34,15 @@ namespace OpenSim.Framework.Servers
33 while (true) 34 while (true)
34 { 35 {
35 int read = stream.Read(buffer, 0, buffer.Length); 36 int read = stream.Read(buffer, 0, buffer.Length);
37
36 if (read <= 0) 38 if (read <= 0)
39 {
37 return ms.ToArray(); 40 return ms.ToArray();
41 }
42
38 ms.Write(buffer, 0, read); 43 ms.Write(buffer, 0, read);
39 } 44 }
40 } 45 }
41 } 46 }
42 } 47 }
43 48
diff --git a/OpenSim/Framework/Servers/RestMethod.cs b/OpenSim/Framework/Servers/RestMethod.cs
index 2a92fc1..c6cb230 100644
--- a/OpenSim/Framework/Servers/RestMethod.cs
+++ b/OpenSim/Framework/Servers/RestMethod.cs
@@ -28,5 +28,4 @@
28namespace OpenSim.Framework.Servers 28namespace OpenSim.Framework.Servers
29{ 29{
30 public delegate string RestMethod( string request, string path, string param ); 30 public delegate string RestMethod( string request, string path, string param );
31 public delegate string BinaryMethod(byte[] data, string path, string param);
32} 31}
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 1c359c2..b47d95a 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -576,7 +576,6 @@ namespace OpenSim.Region.ClientStack
576 this.OutPacket(inventoryReply); 576 this.OutPacket(inventoryReply);
577 } 577 }
578 578
579
580 #region Appearance/ Wearables Methods 579 #region Appearance/ Wearables Methods
581 580
582 /// <summary> 581 /// <summary>
@@ -1202,5 +1201,16 @@ namespace OpenSim.Region.ClientStack
1202 } 1201 }
1203 #endregion 1202 #endregion
1204 1203
1204 public void SendNameReply(LLUUID profileId, string firstname, string lastname)
1205 {
1206 Encoding enc = Encoding.ASCII;
1207 UUIDNameReplyPacket packet = new UUIDNameReplyPacket();
1208 packet.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[1];
1209 packet.UUIDNameBlock[0] = new UUIDNameReplyPacket.UUIDNameBlockBlock();
1210 packet.UUIDNameBlock[0].ID = profileId;
1211 packet.UUIDNameBlock[0].FirstName = enc.GetBytes(firstname + "\0");
1212 packet.UUIDNameBlock[0].LastName = enc.GetBytes(lastname + "\0");
1213 OutPacket((Packet)packet);
1214 }
1205 } 1215 }
1206} 1216}