* Made a change to InterGrid module to prevent duplicate registrations.

0.6.0-stable
Adam Frisby 2008-04-29 18:46:15 +00:00
parent faccbf4994
commit d05c443b71
2 changed files with 14 additions and 8 deletions

View File

@ -10,5 +10,6 @@ namespace OpenSim.Region.Environment.Modules.Communications.Interregion
T RequestInterface<T>(Location loc);
T[] RequestInterface<T>();
Location GetLocationByDirection(Scene scene, InterregionModule.Direction dir);
void internal_CreateRemotingObjects();
}
}

View File

@ -41,6 +41,7 @@ namespace OpenSim.Region.Environment.Modules.Communications.Interregion
#region IRegionModule Members
//TODO: This prevents us from registering new scenes after PostInitialise if we want comms updated.
public void Initialise(Scene scene, IConfigSource source)
{
m_myLocations.Add(new Location((int) scene.RegionInfo.RegionLocX,
@ -61,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Communications.Interregion
{
}
CreateRemotingObjects();
internal_CreateRemotingObjects();
}
public void Close()
@ -81,7 +82,11 @@ namespace OpenSim.Region.Environment.Modules.Communications.Interregion
#endregion
private void CreateRemotingObjects()
public void internal_CreateRemotingObjects()
{
lock (m_tcpChannel)
{
if (m_tcpChannel == null)
{
m_myRemote = new RemotingObject(m_interfaces, m_myLocations.ToArray());
m_tcpChannel = new TcpChannel(m_tcpPort);
@ -89,6 +94,8 @@ namespace OpenSim.Region.Environment.Modules.Communications.Interregion
ChannelServices.RegisterChannel(m_tcpChannel, false);
RemotingServices.Marshal(m_myRemote, "OpenSimRemote2", typeof (RemotingObject));
}
}
}
public void RegisterRemoteRegion(string uri)
{
@ -155,7 +162,5 @@ namespace OpenSim.Region.Environment.Modules.Communications.Interregion
{
return new Location(0, 0);
}
//TODO: This prevents us from registering new scenes after PostInitialise if we want comms updated.
}
}