mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
silly null ref
This commit is contained in:
@@ -269,38 +269,23 @@ namespace OpenSim.Services.HypergridService
|
||||
|
||||
bool SendIMToRegion(PresenceInfo upd, GridInstantMessage im, UUID toAgentID, bool foreigner)
|
||||
{
|
||||
bool imresult = false;
|
||||
GridRegion reginfo = null;
|
||||
if (!m_RegionCache.TryGetValue(upd.RegionID, REGIONCACHE_EXPIRATION, out reginfo))
|
||||
if (!m_RegionCache.TryGetValue(upd.RegionID, REGIONCACHE_EXPIRATION, out reginfo) )
|
||||
{
|
||||
reginfo = m_GridService.GetRegionByUUID(UUID.Zero /*!!!*/, upd.RegionID);
|
||||
m_RegionCache.AddOrUpdate(upd.RegionID, reginfo, reginfo == null ? 60000 : REGIONCACHE_EXPIRATION);
|
||||
}
|
||||
|
||||
if (reginfo != null)
|
||||
{
|
||||
imresult = InstantMessageServiceConnector.SendInstantMessage(reginfo.ServerURI, im, m_messageKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("[HG IM SERVICE]: Failed to deliver message to {0}", reginfo.ServerURI);
|
||||
if (reginfo == null)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool imresult = InstantMessageServiceConnector.SendInstantMessage(reginfo.ServerURI, im, m_messageKey);
|
||||
|
||||
if (imresult)
|
||||
{
|
||||
// IM delivery successful, so store the Agent's location in our local cache.
|
||||
lock (m_UserLocationMap)
|
||||
{
|
||||
if (m_UserLocationMap.ContainsKey(toAgentID))
|
||||
{
|
||||
m_UserLocationMap[toAgentID] = upd;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_UserLocationMap.Add(toAgentID, upd);
|
||||
}
|
||||
}
|
||||
m_UserLocationMap.Add(toAgentID, upd);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user