* Rex merge, OGS1 Merged fairly cleanly.

afrisby-3
Adam Frisby 2008-02-23 03:36:50 +00:00
parent fe50f2e6b9
commit d6e571517f
6 changed files with 2489 additions and 2095 deletions

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
@ -45,6 +45,8 @@ namespace OpenSim.Region.Communications.OGS1
public delegate bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate childUpdate);
public delegate bool TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID);
public sealed class InterRegionSingleton
{
private static readonly InterRegionSingleton instance = new InterRegionSingleton();
@ -55,6 +57,15 @@ namespace OpenSim.Region.Communications.OGS1
public event PrimGroupArrival OnPrimGroupArrival;
public event RegionUp OnRegionUp;
public event ChildAgentUpdate OnChildAgentUpdate;
public event TellRegionToCloseChildConnection OnTellRegionToCloseChildConnection;
private InformRegionChild handler001 = null; // OnChildAgent;
private ExpectArrival handler002 = null; // OnArrival;
private InformRegionPrimGroup handler003 = null; // OnPrimGroupNear;
private PrimGroupArrival handler004 = null; // OnPrimGroupArrival;
private RegionUp handler005 = null; // OnRegionUp;
private ChildAgentUpdate handler006 = null; // OnChildAgentUpdate;
private TellRegionToCloseChildConnection handler007 = null; // OnTellRegionToCloseChildConnection;
static InterRegionSingleton()
@ -72,54 +83,70 @@ namespace OpenSim.Region.Communications.OGS1
public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
{
if (OnChildAgent != null)
handler001 = OnChildAgent;
if (handler001 != null)
{
return OnChildAgent(regionHandle, agentData);
return handler001(regionHandle, agentData);
}
return false;
}
public bool RegionUp(SearializableRegionInfo sregion, ulong regionhandle)
{
if (OnRegionUp != null)
handler005 = OnRegionUp;
if (handler005 != null)
{
return OnRegionUp(sregion, regionhandle);
return handler005(sregion, regionhandle);
}
return false;
}
public bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentUpdate)
{
if (OnChildAgentUpdate != null)
handler006 = OnChildAgentUpdate;
if (handler006 != null)
{
return OnChildAgentUpdate(regionHandle, cAgentUpdate);
return handler006(regionHandle, cAgentUpdate);
}
return false;
}
public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying)
{
if (OnArrival != null)
handler002 = OnArrival;
if (handler002 != null)
{
return OnArrival(regionHandle, agentID, position, isFlying);
return handler002(regionHandle, agentID, position, isFlying);
}
return false;
}
public bool InformRegionPrim(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical)
{
if (OnPrimGroupNear != null)
handler003 = OnPrimGroupNear;
if (handler003 != null)
{
return OnPrimGroupNear(regionHandle, primID, position, isPhysical);
return handler003(regionHandle, primID, position, isPhysical);
}
return false;
}
public bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, string objData)
{
if (OnPrimGroupArrival != null)
handler004 = OnPrimGroupArrival;
if (handler004 != null)
{
return OnPrimGroupArrival(regionHandle, primID, objData);
return handler004(regionHandle, primID, objData);
}
return false;
}
public bool TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID)
{
handler007 = OnTellRegionToCloseChildConnection;
if (handler007 != null)
{
return handler007(regionHandle, agentID);
}
return false;
}
@ -127,6 +154,8 @@ namespace OpenSim.Region.Communications.OGS1
public class OGS1InterRegionRemoting : MarshalByRefObject
{
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public OGS1InterRegionRemoting()
{
}
@ -171,6 +200,7 @@ namespace OpenSim.Region.Communications.OGS1
}
}
public bool ExpectAvatarCrossing(ulong regionHandle, Guid agentID, sLLVector3 position, bool isFlying)
{
try
@ -215,5 +245,18 @@ namespace OpenSim.Region.Communications.OGS1
return false;
}
}
public bool TellRegionToCloseChildConnection(ulong regionHandle, Guid agentID)
{
try
{
return InterRegionSingleton.Instance.TellRegionToCloseChildConnection(regionHandle, new LLUUID(agentID));
}
catch (RemotingException)
{
m_log.Info("[INTERREGION]: Remoting Error: Unable to connect to remote region: " + regionHandle.ToString());
return false;
}
}
}
}

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
@ -38,6 +38,8 @@ namespace OpenSim.Region.Communications.OGS1
{
public class OGS1InventoryService : IInventoryServices
{
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private string _inventoryServerUrl;
private Dictionary<LLUUID, InventoryRequest> m_RequestingInventory = new Dictionary<LLUUID, InventoryRequest>();
@ -71,8 +73,8 @@ namespace OpenSim.Region.Communications.OGS1
{
try
{
MainLog.Instance.Verbose(
"INVENTORY", "Requesting inventory from {0}/GetInventory/ for user {1}",
m_log.InfoFormat(
"[INVENTORY]: Requesting inventory from {0}/GetInventory/ for user {1}",
_inventoryServerUrl, userID);
RestObjectPosterResponse<InventoryCollection> requester
@ -83,7 +85,7 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (Exception e)
{
MainLog.Instance.Error("INVENTORY", e.ToString());
m_log.Error("[INVENTORY]: " + e.ToString());
}
}
@ -96,9 +98,9 @@ namespace OpenSim.Region.Communications.OGS1
LLUUID userID = response.UserID;
if (m_RequestingInventory.ContainsKey(userID))
{
MainLog.Instance.Verbose("INVENTORY",
"Received inventory response for user {0} containing {1} folders and {2} items",
userID, response.Folders.Count, response.AllItems.Count);
m_log.InfoFormat("[INVENTORY]: " +
"Received inventory response for user {0} containing {1} folders and {2} items",
userID, response.Folders.Count, response.AllItems.Count);
InventoryFolderImpl rootFolder = null;
InventoryRequest request = m_RequestingInventory[userID];
@ -132,8 +134,8 @@ namespace OpenSim.Region.Communications.OGS1
}
else
{
MainLog.Instance.Warn(
"INVENTORY",
m_log.WarnFormat(
"[INVENTORY]: " +
"Received inventory response for {0} for which we do not have a record of requesting!",
userID);
}
@ -163,6 +165,21 @@ namespace OpenSim.Region.Communications.OGS1
"POST", _inventoryServerUrl + "/DeleteItem/", item);
}
public bool HasInventoryForUser(LLUUID userID)
{
return false;
}
public InventoryFolderBase RequestRootFolder(LLUUID userID)
{
return null;
}
public virtual InventoryFolderBase RequestNamedFolder(LLUUID userID, string folderName)
{
return null;
}
public void CreateNewUserInventory(LLUUID user)
{
}

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
@ -40,6 +40,8 @@ namespace OpenSim.Region.Communications.OGS1
{
public class OGS1UserServices : IUserService
{
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private CommunicationsOGS1 m_parent;
public OGS1UserServices(CommunicationsOGS1 parent)
@ -83,10 +85,10 @@ namespace OpenSim.Region.Communications.OGS1
{
if (data.Contains("error_type"))
{
MainLog.Instance.Warn("GRID",
"Error sent by user server when trying to get user profile: (" +
data["error_type"] +
"): " + data["error_desc"]);
m_log.Warn("[GRID]: " +
"Error sent by user server when trying to get user profile: (" +
data["error_type"] +
"): " + data["error_desc"]);
return null;
}
@ -136,7 +138,7 @@ namespace OpenSim.Region.Communications.OGS1
}
else
{
MainLog.Instance.Warn("INTERGRID", "Got invalid queryID from userServer");
m_log.Warn("[INTERGRID]: Got invalid queryID from userServer");
}
return pickerlist;
}
@ -163,7 +165,39 @@ namespace OpenSim.Region.Communications.OGS1
return buddylist;
}
public UserProfileData GetUserProfile(string firstName, string lastName, string authAddr)
/// <summary>
/// Logs off a user on the user server
/// </summary>
/// <param name="UserID">UUID of the user</param>
/// <param name="regionData">UUID of the Region</param>
/// <param name="posx">final position x</param>
/// <param name="posy">final position y</param>
/// <param name="posz">final position z</param>
public void LogOffUser(LLUUID userid, LLUUID regionid, ulong regionhandle, float posx, float posy, float posz)
{
Hashtable param = new Hashtable();
param["avatar_uuid"] = userid.UUID.ToString();
param["region_uuid"] = regionid.UUID.ToString();
param["region_handle"] = regionhandle.ToString();
param["region_pos_x"] = posx.ToString();
param["region_pos_y"] = posy.ToString();
param["region_pos_z"] = posz.ToString();
IList parameters = new ArrayList();
parameters.Add(param);
XmlRpcRequest req = new XmlRpcRequest("logout_of_simulator", parameters);
try
{
XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000);
}
catch (System.Net.WebException)
{
m_log.Warn("[LOGOFF]: Unable to notify grid server of user logoff");
}
}
public UserProfileData GetUserProfile(string firstName, string lastName)
{
return GetUserProfile(firstName + " " + lastName, authAddr);
}
@ -200,7 +234,7 @@ namespace OpenSim.Region.Communications.OGS1
{
Hashtable param = new Hashtable();
param["queryid"] = (string) queryID.ToString();
param["avquery"] = objAlphaNumericPattern.Replace(query, "");
param["avquery"] = objAlphaNumericPattern.Replace(query, String.Empty);
IList parameters = new ArrayList();
parameters.Add(param);
XmlRpcRequest req = new XmlRpcRequest("get_avatar_picker_avatar", parameters);
@ -210,8 +244,8 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (WebException e)
{
MainLog.Instance.Warn("Error when trying to fetch Avatar Picker Response: " +
e.Message);
m_log.Warn("Error when trying to fetch Avatar Picker Response: " +
e.Message);
// Return Empty picker list (no results)
}
return pickerlist;
@ -235,8 +269,8 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (Exception e)
{
Console.WriteLine("Error when trying to fetch profile data by uuid from remote user server: " +
e.Message);
m_log.Warn("Error when trying to fetch profile data by name from remote user server: " +
e.Message);
}
return null;
}
@ -274,7 +308,7 @@ namespace OpenSim.Region.Communications.OGS1
public UserProfileData SetupMasterUser(string firstName, string lastName)
{
return SetupMasterUser(firstName, lastName, "");
return SetupMasterUser(firstName, lastName, String.Empty);
}
public UserProfileData SetupMasterUser(string firstName, string lastName, string password)
@ -329,24 +363,24 @@ namespace OpenSim.Region.Communications.OGS1
}
else
{
MainLog.Instance.Warn("GRID", "Unable to add new friend, User Server Reported an issue");
m_log.Warn("[GRID]: Unable to add new friend, User Server Reported an issue");
}
}
else
{
MainLog.Instance.Warn("GRID", "Unable to add new friend, UserServer didn't understand me!");
m_log.Warn("[GRID]: Unable to add new friend, UserServer didn't understand me!");
}
}
else
{
MainLog.Instance.Warn("GRID", "Unable to add new friend, UserServer didn't understand me!");
m_log.Warn("[GRID]: Unable to add new friend, UserServer didn't understand me!");
}
}
catch (WebException e)
{
MainLog.Instance.Warn("GRID","Error when trying to AddNewUserFriend: " +
e.Message);
m_log.Warn("[GRID]: Error when trying to AddNewUserFriend: " +
e.Message);
}
@ -382,24 +416,24 @@ namespace OpenSim.Region.Communications.OGS1
}
else
{
MainLog.Instance.Warn("GRID", "Unable to remove friend, User Server Reported an issue");
m_log.Warn("[GRID]: Unable to remove friend, User Server Reported an issue");
}
}
else
{
MainLog.Instance.Warn("GRID", "Unable to remove friend, UserServer didn't understand me!");
m_log.Warn("[GRID]: Unable to remove friend, UserServer didn't understand me!");
}
}
else
{
MainLog.Instance.Warn("GRID", "Unable to remove friend, UserServer didn't understand me!");
m_log.Warn("[GRID]: Unable to remove friend, UserServer didn't understand me!");
}
}
catch (WebException e)
{
MainLog.Instance.Warn("GRID", "Error when trying to RemoveUserFriend: " +
e.Message);
m_log.Warn("[GRID]: Error when trying to RemoveUserFriend: " +
e.Message);
}
}
@ -434,25 +468,24 @@ namespace OpenSim.Region.Communications.OGS1
}
else
{
MainLog.Instance.Warn("GRID", "Unable to update_user_friend_perms, User Server Reported an issue");
m_log.Warn("[GRID]: Unable to update_user_friend_perms, User Server Reported an issue");
}
}
else
{
MainLog.Instance.Warn("GRID", "Unable to update_user_friend_perms, UserServer didn't understand me!");
m_log.Warn("[GRID]: Unable to update_user_friend_perms, UserServer didn't understand me!");
}
}
else
{
MainLog.Instance.Warn("GRID", "Unable to update_user_friend_perms, UserServer didn't understand me!");
m_log.Warn("[GRID]: Unable to update_user_friend_perms, UserServer didn't understand me!");
}
}
catch (WebException e)
{
MainLog.Instance.Warn("GRID", "Error when trying to update_user_friend_perms: " +
e.Message);
m_log.Warn("[GRID]: Error when trying to update_user_friend_perms: " +
e.Message);
}
}
/// <summary>
@ -482,12 +515,11 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (WebException e)
{
MainLog.Instance.Warn("Error when trying to fetch Avatar's friends list: " +
e.Message);
m_log.Warn("Error when trying to fetch Avatar's friends list: " +
e.Message);
// Return Empty list (no friends)
}
return buddylist;
}
#endregion

View File

@ -1,3 +1,31 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
using System.Reflection;
using System.Runtime.InteropServices;
@ -10,7 +38,7 @@ using System.Runtime.InteropServices;
[assembly : AssemblyConfiguration("")]
[assembly : AssemblyCompany("")]
[assembly : AssemblyProduct("OpenGrid.Framework.Communications.OGS1")]
[assembly : AssemblyCopyright("Copyright © 2007")]
[assembly : AssemblyCopyright("Copyright © OpenSimulator.org Developers 2007-2008")]
[assembly : AssemblyTrademark("")]
[assembly : AssemblyCulture("")]