From fe0528b98cfc13d26ac7f1bf6bc23655be1f52e5 Mon Sep 17 00:00:00 2001
From: mingchen
Date: Thu, 28 Jun 2007 19:09:50 +0000
Subject: *Added UUIDNameRequest packet support (untested, but should work --
at least in sandbox mode) *Various small renamings
---
.../Communications/OGS1/CommunicationsOGS1.cs | 2 +-
.../Communications/OGS1/OGS1InterSimComms.cs | 70 +++++++++++++
.../Region/Communications/OGS1/OGS1UserServices.cs | 109 +++++++++++++++++++++
.../Region/Communications/OGS1/OGSInterSimComms.cs | 70 -------------
.../Region/Communications/OGS1/OGSUserServices.cs | 103 -------------------
.../OGS1/OpenSim.Region.Communications.OGS1.csproj | 51 +++++-----
.../OpenSim.Region.Communications.OGS1.dll.build | 6 +-
7 files changed, 205 insertions(+), 206 deletions(-)
create mode 100644 OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
create mode 100644 OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
delete mode 100644 OpenSim/Region/Communications/OGS1/OGSInterSimComms.cs
delete mode 100644 OpenSim/Region/Communications/OGS1/OGSUserServices.cs
(limited to 'OpenSim/Region/Communications/OGS1')
diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
index f2b3b92..870f577 100644
--- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
+++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
@@ -12,7 +12,7 @@ namespace OpenSim.Region.Communications.OGS1
{
GridServer = gridInterComms;
InterRegion = gridInterComms;
- UserServer = new OGSUserServices(this);
+ UserServer = new OGS1UserServices(this);
}
}
}
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
new file mode 100644
index 0000000..51b33e9
--- /dev/null
+++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OpenSim.Framework.Types;
+using OpenSim.Framework.Communications;
+namespace OpenSim.Region.Communications.OGS1
+{
+ public delegate bool InformRegionChild(ulong regionHandle, AgentCircuitData agentData);
+ public delegate bool ExpectArrival(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position);
+
+ public sealed class InterRegionSingleton
+ {
+ static readonly InterRegionSingleton instance = new InterRegionSingleton();
+
+ public event InformRegionChild OnChildAgent;
+ public event ExpectArrival OnArrival;
+
+ static InterRegionSingleton()
+ {
+ }
+
+ InterRegionSingleton()
+ {
+ }
+
+ public static InterRegionSingleton Instance
+ {
+ get
+ {
+ return instance;
+ }
+ }
+
+ public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
+ {
+ if (OnChildAgent != null)
+ {
+ return OnChildAgent(regionHandle, agentData);
+ }
+ return false;
+ }
+
+ public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
+ {
+ if (OnArrival != null)
+ {
+ return OnArrival(regionHandle, agentID, position);
+ }
+ return false;
+ }
+ }
+
+ public class OGS1InterRegionRemoting : MarshalByRefObject
+ {
+
+ public OGS1InterRegionRemoting()
+ {
+ }
+
+ public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
+ {
+ return InterRegionSingleton.Instance.InformRegionOfChildAgent(regionHandle, agentData);
+ }
+
+ public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
+ {
+ return InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, agentID, position);
+ }
+ }
+}
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
new file mode 100644
index 0000000..856c447
--- /dev/null
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -0,0 +1,109 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using OpenSim.Framework.Types;
+using OpenSim.Framework.Communications;
+using OpenSim.Framework.Data;
+using libsecondlife;
+
+using Nwc.XmlRpc;
+
+namespace OpenSim.Region.Communications.OGS1
+{
+ public class OGS1UserServices :IUserServices
+ {
+ CommunicationsOGS1 m_parent;
+ public OGS1UserServices(CommunicationsOGS1 parent)
+ {
+ m_parent = parent;
+ }
+
+ public UserProfileData ConvertXMLRPCDataToUserProfile(Hashtable data)
+ {
+ if (data.Contains("error_type"))
+ {
+ Console.WriteLine("Error sent by user server when trying to get user profile: (" + data["error_type"] + "): " + data["error_desc"]);
+ return null;
+ }
+
+ UserProfileData userData = new UserProfileData();
+ userData.username = (string)data["firstname"];
+ userData.surname = (string)data["lastname"];
+ userData.UUID = new LLUUID((string)data["uuid"]);
+ userData.userInventoryURI = (string)data["server_inventory"];
+ userData.userAssetURI = (string)data["server_asset"];
+ userData.profileFirstText = (string)data["profile_firstlife_about"];
+ userData.profileFirstImage = new LLUUID((string)data["profile_firstlife_image"]);
+ userData.profileCanDoMask = (uint)data["profile_can_do"];
+ userData.profileWantDoMask = (uint)data["profile_want_do"];
+ userData.profileImage = new LLUUID((string)data["profile_image"]);
+ userData.lastLogin = (int)data["profile_lastlogin"];
+ userData.homeLocation = new LLVector3();
+ userData.homeLookAt = new LLVector3();
+
+ return userData;
+ }
+ public UserProfileData GetUserProfile(string firstName, string lastName)
+ {
+ return GetUserProfile(firstName + " " + lastName);
+ }
+ public UserProfileData GetUserProfile(string name)
+ {
+
+ try
+ {
+ Hashtable param = new Hashtable();
+ param["avatar_name"] = name;
+ IList parameters = new ArrayList();
+ parameters.Add(param);
+ XmlRpcRequest req = new XmlRpcRequest("get_user_by_name", parameters);
+ XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000);
+ Hashtable respData = (Hashtable)resp.Value;
+
+ return ConvertXMLRPCDataToUserProfile(respData);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("Error when trying to fetch profile data by name from remote user server: " + e.Message);
+ }
+ return null;
+ }
+ public UserProfileData GetUserProfile(LLUUID avatarID)
+ {
+ try
+ {
+
+ Hashtable param = new Hashtable();
+ param["avatar_uuid"] = avatarID.ToString();
+ IList parameters = new ArrayList();
+ parameters.Add(param);
+ XmlRpcRequest req = new XmlRpcRequest("get_user_by_uuid", parameters);
+ XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000);
+ Hashtable respData = (Hashtable)resp.Value;
+
+ return ConvertXMLRPCDataToUserProfile(respData);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("Error when trying to fetch profile data by uuid from remote user server: " + e.Message);
+ }
+ return null;
+ }
+
+ public UserProfileData SetupMasterUser(string firstName, string lastName)
+ {
+ return SetupMasterUser(firstName, lastName, "");
+ }
+
+ public UserProfileData SetupMasterUser(string firstName, string lastName, string password)
+ {
+ UserProfileData profile = GetUserProfile(firstName, lastName);
+ if (profile == null)
+ {
+ Console.WriteLine("Unknown Master User. Grid Mode: No clue what I should do. Probably would choose the grid owner UUID when that is implemented");
+ }
+ return null;
+ }
+ }
+}
diff --git a/OpenSim/Region/Communications/OGS1/OGSInterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGSInterSimComms.cs
deleted file mode 100644
index 51b33e9..0000000
--- a/OpenSim/Region/Communications/OGS1/OGSInterSimComms.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using OpenSim.Framework.Types;
-using OpenSim.Framework.Communications;
-namespace OpenSim.Region.Communications.OGS1
-{
- public delegate bool InformRegionChild(ulong regionHandle, AgentCircuitData agentData);
- public delegate bool ExpectArrival(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position);
-
- public sealed class InterRegionSingleton
- {
- static readonly InterRegionSingleton instance = new InterRegionSingleton();
-
- public event InformRegionChild OnChildAgent;
- public event ExpectArrival OnArrival;
-
- static InterRegionSingleton()
- {
- }
-
- InterRegionSingleton()
- {
- }
-
- public static InterRegionSingleton Instance
- {
- get
- {
- return instance;
- }
- }
-
- public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
- {
- if (OnChildAgent != null)
- {
- return OnChildAgent(regionHandle, agentData);
- }
- return false;
- }
-
- public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
- {
- if (OnArrival != null)
- {
- return OnArrival(regionHandle, agentID, position);
- }
- return false;
- }
- }
-
- public class OGS1InterRegionRemoting : MarshalByRefObject
- {
-
- public OGS1InterRegionRemoting()
- {
- }
-
- public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
- {
- return InterRegionSingleton.Instance.InformRegionOfChildAgent(regionHandle, agentData);
- }
-
- public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
- {
- return InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, agentID, position);
- }
- }
-}
diff --git a/OpenSim/Region/Communications/OGS1/OGSUserServices.cs b/OpenSim/Region/Communications/OGS1/OGSUserServices.cs
deleted file mode 100644
index 56a7837..0000000
--- a/OpenSim/Region/Communications/OGS1/OGSUserServices.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Text;
-using OpenSim.Framework.Types;
-using OpenSim.Framework.Communications;
-using OpenSim.Framework.Data;
-using libsecondlife;
-
-using Nwc.XmlRpc;
-
-namespace OpenSim.Region.Communications.OGS1
-{
- public class OGSUserServices :IUserServices
- {
- CommunicationsOGS1 m_parent;
- public OGSUserServices(CommunicationsOGS1 parent)
- {
- m_parent = parent;
- }
-
- public UserProfileData ConvertXMLRPCDataToUserProfile(Hashtable data)
- {
- UserProfileData userData = new UserProfileData();
- userData.username = (string)data["firstname"];
- userData.surname = (string)data["lastname"];
- userData.UUID = new LLUUID((string)data["uuid"]);
- userData.userInventoryURI = (string)data["server_inventory"];
- userData.userAssetURI = (string)data["server_asset"];
- userData.profileFirstText = (string)data["profile_firstlife_about"];
- userData.profileFirstImage = new LLUUID((string)data["profile_firstlife_image"]);
- userData.profileCanDoMask = (uint)data["profile_can_do"];
- userData.profileWantDoMask = (uint)data["profile_want_do"];
- userData.profileImage = new LLUUID((string)data["profile_image"]);
- userData.lastLogin = (int)data["profile_lastlogin"];
- userData.homeLocation = new LLVector3();
- userData.homeLookAt = new LLVector3();
-
- return userData;
- }
- public UserProfileData GetUserProfile(string firstName, string lastName)
- {
- return GetUserProfile(firstName + " " + lastName);
- }
- public UserProfileData GetUserProfile(string name)
- {
-
- try
- {
- Hashtable param = new Hashtable();
- param["avatar_name"] = name;
- IList parameters = new ArrayList();
- parameters.Add(param);
- XmlRpcRequest req = new XmlRpcRequest("get_user_by_name", parameters);
- XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000);
- Hashtable respData = (Hashtable)resp.Value;
-
- return ConvertXMLRPCDataToUserProfile(respData);
- }
- catch (Exception e)
- {
- Console.WriteLine("Error when trying to fetch profile data by name from remote user server: " + e.Message);
- }
- return null;
- }
- public UserProfileData GetUserProfile(LLUUID avatarID)
- {
- try
- {
-
- Hashtable param = new Hashtable();
- param["avatar_uuid"] = avatarID.ToString();
- IList parameters = new ArrayList();
- parameters.Add(param);
- XmlRpcRequest req = new XmlRpcRequest("get_user_by_uuid", parameters);
- XmlRpcResponse resp = req.Send(m_parent.ServersInfo.UserURL, 3000);
- Hashtable respData = (Hashtable)resp.Value;
-
- return ConvertXMLRPCDataToUserProfile(respData);
- }
- catch (Exception e)
- {
- Console.WriteLine("Error when trying to fetch profile data by uuid from remote user server: " + e.Message);
- }
- return null;
- }
-
- public UserProfileData SetupMasterUser(string firstName, string lastName)
- {
- return SetupMasterUser(firstName, lastName, "");
- }
-
- public UserProfileData SetupMasterUser(string firstName, string lastName, string password)
- {
- UserProfileData profile = GetUserProfile(firstName, lastName);
- if (profile == null)
- {
- Console.WriteLine("Unknown Master User. Grid Mode: No clue what I should do. Probably would choose the grid owner UUID when that is implemented");
- }
- return null;
- }
- }
-}
diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj
index b03ac7e..0a9e5fb 100644
--- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj
+++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj
@@ -1,4 +1,4 @@
-
+
Local
8.0.50727
@@ -6,8 +6,7 @@
{4806E378-0000-0000-0000-000000000000}
Debug
AnyCPU
-
-
+
OpenSim.Region.Communications.OGS1
@@ -16,11 +15,9 @@
IE50
false
Library
-
-
+
OpenSim.Region.Communications.OGS1
-
-
+
@@ -31,8 +28,7 @@
TRACE;DEBUG
-
-
+
True
4096
False
@@ -41,8 +37,7 @@
False
False
4
-
-
+
False
@@ -51,8 +46,7 @@
TRACE
-
-
+
False
4096
True
@@ -61,31 +55,30 @@
False
False
4
-
-
+
-
+
..\..\..\..\bin\libsecondlife.dll
False
-
+
System.dll
False
-
+
System.Data.dll
False
-
+
System.Runtime.Remoting.dll
False
-
+
System.Xml.dll
False
-
+
..\..\..\..\bin\XMLRPC.dll
False
@@ -95,35 +88,35 @@
OpenSim.Framework
{8ACA2445-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Framework.Communications
{CB52B7E7-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Framework.Console
{A7CD0630-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Framework.Data
{36B72A9B-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Framework.Servers
{2CC71860-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
-
+
Code
@@ -132,7 +125,7 @@
Code
-
+
Code
@@ -146,4 +139,4 @@
-
\ No newline at end of file
+
diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build
index 1a7cf69..2176b14 100644
--- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build
+++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build
@@ -11,10 +11,10 @@
-
+
-
-
+
+
--
cgit v1.1