aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorTeravus Ovares2007-11-13 22:48:19 +0000
committerTeravus Ovares2007-11-13 22:48:19 +0000
commit9f6b3e2357e76b9b85b447da189b4bf4163edd3c (patch)
tree7d9c39258e45e6271db953608e6868433f9ac70d /OpenSim/Region
parentfirst pass on unlinking of objects. From Jay Clarke (IBM) (diff)
downloadopensim-SC-9f6b3e2357e76b9b85b447da189b4bf4163edd3c.zip
opensim-SC-9f6b3e2357e76b9b85b447da189b4bf4163edd3c.tar.gz
opensim-SC-9f6b3e2357e76b9b85b447da189b4bf4163edd3c.tar.bz2
opensim-SC-9f6b3e2357e76b9b85b447da189b4bf4163edd3c.tar.xz
* Added AvatarPicker in Standalone mode. Works for finding avatar to ban, manually trying to add a friend (with the add button) or useful to those who are curious which usernames have visited your standalone sim. Important for future development :D.
* Grid mode always returns 0 results until the Grid Communications portion is done.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs5
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs11
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs15
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs39
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs5
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs4
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs4
8 files changed, 83 insertions, 8 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index b24b207..77c1701 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -55,6 +55,7 @@ namespace OpenSim.Region.ClientStack
55 public event UpdateAgent OnAgentUpdate; 55 public event UpdateAgent OnAgentUpdate;
56 public event AgentRequestSit OnAgentRequestSit; 56 public event AgentRequestSit OnAgentRequestSit;
57 public event AgentSit OnAgentSit; 57 public event AgentSit OnAgentSit;
58 public event AvatarPickerRequest OnAvatarPickerRequest;
58 public event StartAnim OnStartAnim; 59 public event StartAnim OnStartAnim;
59 public event Action<IClientAPI> OnRequestAvatarsData; 60 public event Action<IClientAPI> OnRequestAvatarsData;
60 public event LinkObjects OnLinkObjects; 61 public event LinkObjects OnLinkObjects;
@@ -705,6 +706,10 @@ namespace OpenSim.Region.ClientStack
705 sendXfer.DataPacket.Data = data; 706 sendXfer.DataPacket.Data = data;
706 OutPacket(sendXfer); 707 OutPacket(sendXfer);
707 } 708 }
709 public void SendAvatarPickerReply(AvatarPickerReplyPacket replyPacket)
710 {
711 OutPacket(replyPacket);
712 }
708 713
709 /// <summary> 714 /// <summary>
710 /// 715 ///
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 82ad1c8..1383ad9 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -217,7 +217,16 @@ namespace OpenSim.Region.ClientStack
217 OnAgentSit(this, agentSit.AgentData.AgentID); 217 OnAgentSit(this, agentSit.AgentData.AgentID);
218 } 218 }
219 break; 219 break;
220 220 case PacketType.AvatarPickerRequest:
221 AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack;
222 AvatarPickerRequestPacket.AgentDataBlock Requestdata = avRequestQuery.AgentData;
223 AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data;
224 //System.Console.WriteLine("Agent Sends:" + Helpers.FieldToUTF8String(querydata.Name));
225 if (OnAvatarPickerRequest != null)
226 {
227 OnAvatarPickerRequest(this, Requestdata.AgentID, Requestdata.QueryID, Helpers.FieldToUTF8String(querydata.Name));
228 }
229 break;
221 #endregion 230 #endregion
222 231
223 #region Objects/m_sceneObjects 232 #region Objects/m_sceneObjects
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 839556d..353a24c 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -295,11 +295,16 @@ namespace OpenSim.Region.ClientStack
295 queuedLast = false; 295 queuedLast = false;
296 296
297 // TODO: May be a bit expensive doing this twice. 297 // TODO: May be a bit expensive doing this twice.
298 throttleSentPeriod += nextPacket.Packet.ToBytes().Length; 298
299 299 //Don't throttle AvatarPickerReplies!, they return a null .ToBytes()!
300 //is a out going packet 300 if (nextPacket.Packet.Type != PacketType.AvatarPickerReply)
301 DebugPacket("OUT", nextPacket.Packet); 301 throttleSentPeriod += nextPacket.Packet.ToBytes().Length;
302 ProcessOutPacket(nextPacket.Packet); 302
303
304 //is a out going packet
305 DebugPacket("OUT", nextPacket.Packet);
306 ProcessOutPacket(nextPacket.Packet);
307
303 } 308 }
304 } 309 }
305 } 310 }
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index 990998e..cd60ac2 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -28,6 +28,7 @@
28 28
29using System; 29using System;
30using System.Collections; 30using System.Collections;
31using System.Collections.Generic;
31using System.Net; 32using System.Net;
32using libsecondlife; 33using libsecondlife;
33using Nwc.XmlRpc; 34using Nwc.XmlRpc;
@@ -85,6 +86,13 @@ namespace OpenSim.Region.Communications.OGS1
85 return GetUserProfile(firstName + " " + lastName); 86 return GetUserProfile(firstName + " " + lastName);
86 } 87 }
87 88
89
90 public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query)
91 {
92 List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>();
93
94 return pickerlist;
95 }
88 public UserProfileData GetUserProfile(string name) 96 public UserProfileData GetUserProfile(string name)
89 { 97 {
90 try 98 try
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 74e9a43..435022b 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -29,6 +29,7 @@ using System.Collections.Generic;
29using libsecondlife; 29using libsecondlife;
30using libsecondlife.Packets; 30using libsecondlife.Packets;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Framework.UserManagement;
32using OpenSim.Framework.Console; 33using OpenSim.Framework.Console;
33 34
34namespace OpenSim.Region.Environment.Scenes 35namespace OpenSim.Region.Environment.Scenes
@@ -155,5 +156,43 @@ namespace OpenSim.Region.Environment.Scenes
155 } 156 }
156 } 157 }
157 } 158 }
159 public void ProcessAvatarPickerRequest(IClientAPI client, LLUUID avatarID, LLUUID RequestID, string query)
160 {
161 //EventManager.TriggerAvatarPickerRequest();
162
163
164 List<AvatarPickerAvatar> AvatarResponses = new List<AvatarPickerAvatar>();
165 AvatarResponses = CommsManager.GenerateAgentPickerRequestResponse(RequestID, query);
166
167 AvatarPickerReplyPacket replyPacket = new AvatarPickerReplyPacket();
168 AvatarPickerReplyPacket.DataBlock[] searchData = new AvatarPickerReplyPacket.DataBlock[AvatarResponses.Count];
169 AvatarPickerReplyPacket.AgentDataBlock agentData = new AvatarPickerReplyPacket.AgentDataBlock();
170
171 agentData.AgentID = avatarID;
172 agentData.QueryID = RequestID;
173 replyPacket.AgentData = agentData;
174 byte[] bytes = new byte[AvatarResponses.Count * 32];
175
176 int i = 0;
177 foreach (AvatarPickerAvatar item in AvatarResponses)
178 {
179 LLUUID translatedIDtem = item.AvatarID;
180 searchData[i] = new AvatarPickerReplyPacket.DataBlock();
181 searchData[i].AvatarID = translatedIDtem;
182 searchData[i].FirstName = Helpers.StringToField((string)item.firstName);
183 searchData[i].LastName = Helpers.StringToField((string)item.lastName);
184 i++;
185
186 }
187 if (AvatarResponses.Count == 0)
188 {
189 searchData = new AvatarPickerReplyPacket.DataBlock[0];
190 }
191 replyPacket.Data = searchData;
192 client.SendAvatarPickerReply(replyPacket);
193
194
195 }
196
158 } 197 }
159} \ No newline at end of file 198} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index bf56fe8..d7e36c5 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -38,10 +38,10 @@ using OpenSim.Framework;
38using OpenSim.Framework.Communications; 38using OpenSim.Framework.Communications;
39using OpenSim.Framework.Communications.Cache; 39using OpenSim.Framework.Communications.Cache;
40using OpenSim.Framework.Console; 40using OpenSim.Framework.Console;
41using OpenSim.Region.Environment.LandManagement;
41using OpenSim.Framework.Servers; 42using OpenSim.Framework.Servers;
42using OpenSim.Region.Capabilities; 43using OpenSim.Region.Capabilities;
43using OpenSim.Region.Environment.Interfaces; 44using OpenSim.Region.Environment.Interfaces;
44using OpenSim.Region.Environment.LandManagement;
45using OpenSim.Region.Environment.Modules; 45using OpenSim.Region.Environment.Modules;
46using OpenSim.Region.Environment.Scenes.Scripting; 46using OpenSim.Region.Environment.Scenes.Scripting;
47using OpenSim.Region.Environment.Types; 47using OpenSim.Region.Environment.Types;
@@ -732,7 +732,8 @@ namespace OpenSim.Region.Environment.Scenes
732 client.OnRemoveTaskItem += RemoveTaskInventory; 732 client.OnRemoveTaskItem += RemoveTaskInventory;
733 733
734 client.OnGrabObject += ProcessObjectGrab; 734 client.OnGrabObject += ProcessObjectGrab;
735 735 client.OnAvatarPickerRequest += ProcessAvatarPickerRequest;
736
736 EventManager.TriggerOnNewClient(client); 737 EventManager.TriggerOnNewClient(client);
737 } 738 }
738 739
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index c9c24fe..3c6cad8 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -32,9 +32,11 @@ using libsecondlife;
32using libsecondlife.Packets; 32using libsecondlife.Packets;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Console; 34using OpenSim.Framework.Console;
35using OpenSim.Framework.Communications;
35using OpenSim.Region.Environment.Types; 36using OpenSim.Region.Environment.Types;
36using OpenSim.Region.Physics.Manager; 37using OpenSim.Region.Physics.Manager;
37 38
39
38namespace OpenSim.Region.Environment.Scenes 40namespace OpenSim.Region.Environment.Scenes
39{ 41{
40 public partial class ScenePresence : EntityBase 42 public partial class ScenePresence : EntityBase
@@ -274,6 +276,7 @@ namespace OpenSim.Region.Environment.Scenes
274 m_controllingClient.OnAgentRequestSit += HandleAgentRequestSit; 276 m_controllingClient.OnAgentRequestSit += HandleAgentRequestSit;
275 m_controllingClient.OnAgentSit += HandleAgentSit; 277 m_controllingClient.OnAgentSit += HandleAgentSit;
276 m_controllingClient.OnSetAlwaysRun += HandleSetAlwaysRun; 278 m_controllingClient.OnSetAlwaysRun += HandleSetAlwaysRun;
279
277 // ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); 280 // ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
278 // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); 281 // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
279 //ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); 282 //ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
@@ -1227,5 +1230,6 @@ namespace OpenSim.Region.Environment.Scenes
1227 { 1230 {
1228 m_controllingClient.SendWearables(m_wearables, m_wearablesSerial++); 1231 m_controllingClient.SendWearables(m_wearables, m_wearablesSerial++);
1229 } 1232 }
1233
1230 } 1234 }
1231} 1235}
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 86bb532..61402be 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -71,6 +71,7 @@ namespace SimpleApp
71 public event UpdateAgent OnAgentUpdate; 71 public event UpdateAgent OnAgentUpdate;
72 public event AgentRequestSit OnAgentRequestSit; 72 public event AgentRequestSit OnAgentRequestSit;
73 public event AgentSit OnAgentSit; 73 public event AgentSit OnAgentSit;
74 public event AvatarPickerRequest OnAvatarPickerRequest;
74 public event Action<IClientAPI> OnRequestAvatarsData; 75 public event Action<IClientAPI> OnRequestAvatarsData;
75 public event AddNewPrim OnAddPrim; 76 public event AddNewPrim OnAddPrim;
76 public event ObjectDuplicate OnObjectDuplicate; 77 public event ObjectDuplicate OnObjectDuplicate;
@@ -179,7 +180,10 @@ namespace SimpleApp
179 public virtual void SendStartPingCheck(byte seq) 180 public virtual void SendStartPingCheck(byte seq)
180 { 181 {
181 } 182 }
183 public virtual void SendAvatarPickerReply(AvatarPickerReplyPacket response)
184 {
182 185
186 }
183 public virtual void SendKillObject(ulong regionHandle, uint localID) 187 public virtual void SendKillObject(ulong regionHandle, uint localID)
184 { 188 {
185 } 189 }