mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 09:16:28 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs OpenSim/Region/Framework/Scenes/Scene.cs
This commit is contained in:
@@ -372,21 +372,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
UUID fromAgentID, UUID ownerID, string fromName, ChatTypeEnum type,
|
||||
string message, ChatSourceType src, bool ignoreDistance)
|
||||
{
|
||||
// don't send chat to child agents
|
||||
if (presence.IsChildAgent) return false;
|
||||
|
||||
Vector3 fromRegionPos = fromPos + regionPos;
|
||||
Vector3 toRegionPos = presence.AbsolutePosition +
|
||||
new Vector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize,
|
||||
presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
|
||||
|
||||
int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos);
|
||||
|
||||
if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
|
||||
type == ChatTypeEnum.Say && dis > m_saydistance ||
|
||||
type == ChatTypeEnum.Shout && dis > m_shoutdistance)
|
||||
{
|
||||
if (presence.LifecycleState != ScenePresenceState.Running)
|
||||
return false;
|
||||
|
||||
if (!ignoreDistance)
|
||||
{
|
||||
Vector3 fromRegionPos = fromPos + regionPos;
|
||||
Vector3 toRegionPos = presence.AbsolutePosition +
|
||||
new Vector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize,
|
||||
presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
|
||||
|
||||
int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos);
|
||||
|
||||
if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
|
||||
type == ChatTypeEnum.Say && dis > m_saydistance ||
|
||||
type == ChatTypeEnum.Shout && dis > m_shoutdistance)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: should change so the message is sent through the avatar rather than direct to the ClientView
|
||||
|
||||
@@ -1212,7 +1212,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
json.Add("jsonrpc", OSD.FromString("2.0"));
|
||||
json.Add("id", OSD.FromString(jsonId));
|
||||
json.Add("method", OSD.FromString(method));
|
||||
// Experiment
|
||||
|
||||
json.Add("params", OSD.SerializeMembers(parameters));
|
||||
|
||||
string jsonRequestData = OSDParser.SerializeJsonString(json);
|
||||
@@ -1240,8 +1240,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
}
|
||||
|
||||
Stream rstream = webResponse.GetResponseStream();
|
||||
if (rstream.Length < 1)
|
||||
return false;
|
||||
|
||||
OSDMap mret = new OSDMap();
|
||||
try
|
||||
@@ -1318,8 +1316,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
}
|
||||
|
||||
Stream rstream = webResponse.GetResponseStream();
|
||||
if (rstream.Length < 1)
|
||||
return false;
|
||||
|
||||
OSDMap response = new OSDMap();
|
||||
try
|
||||
|
||||
@@ -925,6 +925,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
|
||||
{
|
||||
if (!sp.Scene.IncomingPreCloseAgent(sp))
|
||||
return;
|
||||
|
||||
// We need to delay here because Imprudence viewers, unlike v1 or v3, have a short (<200ms, <500ms) delay before
|
||||
// they regard the new region as the current region after receiving the AgentMovementComplete
|
||||
// response. If close is sent before then, it will cause the viewer to quit instead.
|
||||
@@ -1087,6 +1090,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
|
||||
if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
|
||||
{
|
||||
if (!sp.Scene.IncomingPreCloseAgent(sp))
|
||||
return;
|
||||
|
||||
// RED ALERT!!!!
|
||||
// PLEASE DO NOT DECREASE THIS WAIT TIME UNDER ANY CIRCUMSTANCES.
|
||||
// THE VIEWERS SEEM TO NEED SOME TIME AFTER RECEIVING MoveAgentIntoRegion
|
||||
@@ -1100,6 +1106,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// then this will be handled in IncomingCloseAgent under lock conditions
|
||||
m_log.DebugFormat(
|
||||
"[ENTITY TRANSFER MODULE]: Closing agent {0} in {1} after teleport", sp.Name, Scene.Name);
|
||||
|
||||
sp.Scene.IncomingCloseAgent(sp.UUID, false);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -481,14 +481,20 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
|
||||
public string GetUserUUI(UUID userID)
|
||||
{
|
||||
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID);
|
||||
if (account != null)
|
||||
return userID.ToString();
|
||||
|
||||
UserData ud;
|
||||
lock (m_UserCache)
|
||||
m_UserCache.TryGetValue(userID, out ud);
|
||||
|
||||
if (ud == null) // It's not in the cache
|
||||
{
|
||||
string[] names = new string[2];
|
||||
// This will pull the data from either UserAccounts or GridUser
|
||||
// and stick it into the cache
|
||||
TryGetUserNamesFromServices(userID, names);
|
||||
lock (m_UserCache)
|
||||
m_UserCache.TryGetValue(userID, out ud);
|
||||
}
|
||||
|
||||
if (ud != null)
|
||||
{
|
||||
string homeURL = ud.HomeURL;
|
||||
|
||||
@@ -235,6 +235,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
return m_GridService.GetDefaultRegions(scopeID);
|
||||
}
|
||||
|
||||
public List<GridRegion> GetDefaultHypergridRegions(UUID scopeID)
|
||||
{
|
||||
return m_GridService.GetDefaultHypergridRegions(scopeID);
|
||||
}
|
||||
|
||||
public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y)
|
||||
{
|
||||
return m_GridService.GetFallbackRegions(scopeID, x, y);
|
||||
|
||||
@@ -277,6 +277,26 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
public List<GridRegion> GetDefaultHypergridRegions(UUID scopeID)
|
||||
{
|
||||
List<GridRegion> rinfo = m_LocalGridService.GetDefaultHypergridRegions(scopeID);
|
||||
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetDefaultHypergridRegions {0} found {1} regions", name, rinfo.Count);
|
||||
List<GridRegion> grinfo = m_RemoteGridService.GetDefaultHypergridRegions(scopeID);
|
||||
|
||||
if (grinfo != null)
|
||||
{
|
||||
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetDefaultHypergridRegions {0} found {1} regions", name, grinfo.Count);
|
||||
foreach (GridRegion r in grinfo)
|
||||
{
|
||||
m_RegionInfoCache.Cache(r);
|
||||
if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
|
||||
rinfo.Add(r);
|
||||
}
|
||||
}
|
||||
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y)
|
||||
{
|
||||
List<GridRegion> rinfo = m_LocalGridService.GetFallbackRegions(scopeID, x, y);
|
||||
|
||||
Reference in New Issue
Block a user