Merge branch 'master' into httptests

This commit is contained in:
UbitUmarov
2016-12-04 23:39:15 +00:00
21 changed files with 235 additions and 167 deletions

View File

@@ -337,7 +337,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (UUID.TryParse(friendID, out id))
return base.FriendshipMessage(friendID);
return "Please confirm this friendship you made while you were away.";
return "Please confirm this friendship you made while you where on another HG grid";
}
protected override FriendInfo GetFriend(FriendInfo[] friends, UUID friendID)
@@ -456,6 +456,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{
// local grid users
m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
DeletePreviousHGRelations(agentID, friendID);
base.StoreFriendships(agentID, friendID);
return;
}
@@ -624,6 +625,45 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
}
private void DeletePreviousHGRelations(UUID a1, UUID a2)
{
// Delete any previous friendship relations
FriendInfo[] finfos = null;
finfos = GetFriendsFromCache(a1);
if (finfos != null)
{
foreach (FriendInfo f in finfos)
{
if (f.TheirFlags == -1)
{
if (f.Friend.StartsWith(a2.ToString()))
{
FriendsService.Delete(a1, f.Friend);
// and also the converse
FriendsService.Delete(f.Friend, a1.ToString());
}
}
}
}
finfos = GetFriendsFromCache(a1);
if (finfos != null)
{
foreach (FriendInfo f in finfos)
{
if (f.TheirFlags == -1)
{
if (f.Friend.StartsWith(a1.ToString()))
{
FriendsService.Delete(a2, f.Friend);
// and also the converse
FriendsService.Delete(f.Friend, a2.ToString());
}
}
}
}
}
protected override bool DeleteFriendship(UUID agentID, UUID exfriendID)
{
Boolean agentIsLocal = true;

View File

@@ -2093,19 +2093,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
spScene.SimulationService.UpdateAgent(neighbour, agentpos);
}
}
catch (ArgumentOutOfRangeException)
{
m_log.ErrorFormat(
"[ENTITY TRANSFER MODULE]: Neighbour Regions response included the current region in the neighbour list. The following region will not display to the client: {0} for region {1} ({2}, {3}).",
neighbour.ExternalHostName,
neighbour.RegionHandle,
neighbour.RegionLocX,
neighbour.RegionLocY);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[ENTITY TRANSFER MODULE]: Could not resolve external hostname {0} for region {1} ({2}, {3}). {4}",
"[ENTITY TRANSFER MODULE]: Error creating child agent at {0} ({1} ({2}, {3}). {4}",
neighbour.ExternalHostName,
neighbour.RegionHandle,
neighbour.RegionLocX,
@@ -2279,24 +2270,28 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// <param name="a"></param>
/// <param name="regionHandle"></param>
/// <param name="endPoint"></param>
private void InformClientOfNeighbourAsync(ScenePresence sp, AgentCircuitData a, GridRegion reg,
private void InformClientOfNeighbourAsync(ScenePresence sp, AgentCircuitData agentCircData, GridRegion reg,
IPEndPoint endPoint, bool newAgent)
{
if (newAgent)
{
// we may already had lost this sp
if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened
return;
Scene scene = sp.Scene;
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Informing {0} {1} about neighbour {2} {3} at ({4},{5})",
sp.Name, sp.UUID, reg.RegionName, endPoint, reg.RegionCoordX, reg.RegionCoordY);
string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath);
string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(agentCircData.CapsPath);
string reason = String.Empty;
EntityTransferContext ctx = new EntityTransferContext();
bool regionAccepted = scene.SimulationService.CreateAgent(reg, reg, a, (uint)TeleportFlags.Default, ctx, out reason);
bool regionAccepted = scene.SimulationService.CreateAgent(reg, reg, agentCircData, (uint)TeleportFlags.Default, ctx, out reason);
if (regionAccepted)
{
@@ -2306,6 +2301,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (m_eqModule != null)
{
#region IP Translation for NAT
if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened
return;
IClientIPEndpoint ipepClient;
if (sp.ClientView.TryGet(out ipepClient))
{

View File

@@ -981,6 +981,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset.
part.LastOwnerID = part.OwnerID;
part.OwnerID = remoteClient.AgentId;
part.RezzerID = remoteClient.AgentId;
}
}
@@ -1150,6 +1151,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
part.LastOwnerID = part.OwnerID;
part.OwnerID = item.Owner;
part.RezzerID = item.Owner;
part.Inventory.ChangeInventoryOwner(item.Owner);
}