| 20 |
private readonly List<Scene> m_scenes = new List<Scene>(); |
private readonly List<Scene> m_scenes = new List<Scene>(); |
| 21 |
private readonly Dictionary<UUID, string> m_authUrl = new Dictionary<UUID, string>(); |
private readonly Dictionary<UUID, string> m_authUrl = new Dictionary<UUID, string>(); |
| 22 |
|
|
| 23 |
private RexUDPServer m_udpserver; |
private List<RexUDPServer> m_udpservers = new List<RexUDPServer>(); |
| 24 |
private IConfigSource m_config; |
private IConfigSource m_config; |
| 25 |
|
|
| 26 |
private RegionInfo m_primaryRegionInfo; |
private RegionInfo m_primaryRegionInfo; |
| 27 |
private uint m_rexPort = 7000; |
private uint m_rexPort = 7000; |
| 28 |
|
|
| 29 |
|
private OpenSim.Framework.Servers.XmlRpcMethod default_login_to_simulator; |
| 30 |
|
|
| 31 |
public void Configure(IConfigSource config) |
public void Configure(IConfigSource config) |
| 32 |
{ |
{ |
| 33 |
if (config.Configs.Contains("ModRex")) |
if (config.Configs.Contains("ModRex")) |
| 42 |
|
|
| 43 |
public void Initialise(Scene scene, IConfigSource source) |
public void Initialise(Scene scene, IConfigSource source) |
| 44 |
{ |
{ |
| 45 |
if (m_udpserver == null) |
//if (m_udpserver == null) |
| 46 |
m_udpserver = new RexUDPServer(); |
// m_udpserver = new RexUDPServer(); |
| 47 |
|
|
| 48 |
m_config = source; |
m_config = source; |
| 49 |
|
|
| 74 |
{ |
{ |
| 75 |
|
|
| 76 |
m_log.Info("[REX] Overloading Login_to_Simulator"); |
m_log.Info("[REX] Overloading Login_to_Simulator"); |
| 77 |
|
default_login_to_simulator = m_scenes[0].CommsManager.HttpServer.GetXmlRPCHandler("login_to_simulator"); |
| 78 |
m_scenes[0].CommsManager.HttpServer.AddXmlRPCHandler("login_to_simulator", XmlRpcLoginMethod); |
m_scenes[0].CommsManager.HttpServer.AddXmlRPCHandler("login_to_simulator", XmlRpcLoginMethod); |
| 79 |
|
|
| 80 |
m_primaryRegionInfo = m_scenes[0].RegionInfo; |
m_primaryRegionInfo = m_scenes[0].RegionInfo; |
| 81 |
|
|
| 82 |
m_log.Info("[REX] Initialising"); |
m_log.Info("[REX] Initialising"); |
| 83 |
m_udpserver.Initialise(m_primaryRegionInfo.InternalEndPoint.Address, ref m_rexPort, 0, false, m_config, m_scenes[0].AssetCache, |
//m_udpserver.Initialise(m_primaryRegionInfo.InternalEndPoint.Address, ref m_rexPort, 0, false, m_config, m_scenes[0].AssetCache, |
| 84 |
m_scenes[0].AuthenticateHandler); |
// m_scenes[0].AuthenticateHandler); |
| 85 |
foreach (Scene scene in m_scenes) |
foreach (Scene scene in m_scenes) |
| 86 |
{ |
{ |
| 87 |
m_udpserver.AddScene(scene); //this doesn't add scene to existing UDP server, but instead replaces the old one |
RexUDPServer udpserver = new RexUDPServer(); |
| 88 |
|
m_log.Debug("[REX] RegionInfo: " + scene.RegionInfo.InternalEndPoint.Port); |
| 89 |
|
uint udp_port = Convert.ToUInt32(scene.RegionInfo.InternalEndPoint.Port - 2000); |
| 90 |
|
//uses 2000 smaller port num than spesified for LLClient in Regions/ xml-file |
| 91 |
|
udpserver.Initialise(scene.RegionInfo.InternalEndPoint.Address, ref udp_port, 0, false, m_config, |
| 92 |
|
scene.AssetCache, scene.AuthenticateHandler); |
| 93 |
|
udpserver.AddScene(scene); |
| 94 |
|
//m_udpserver.AddScene(scene); //this doesn't add scene to existing UDP server, but instead replaces the old one |
| 95 |
|
m_udpservers.Add(udpserver); |
| 96 |
|
udpserver.Start(); |
| 97 |
} |
} |
| 98 |
m_udpserver.Start(); |
//m_udpserver.Start(); |
| 99 |
} |
} |
| 100 |
else |
else |
| 101 |
{ |
{ |
| 257 |
} |
} |
| 258 |
else |
else |
| 259 |
{ |
{ |
| 260 |
|
if (default_login_to_simulator != null) |
| 261 |
|
{ |
| 262 |
m_log.Info( |
m_log.Info( |
| 263 |
"[REXLOGIN END]: XMLRPC login_to_simulator login message did not contain all the required data"); |
"[REXLOGIN END]: XMLRPC login_to_simulator login message did not contain all the required data. Trying default method."); |
| 264 |
|
return default_login_to_simulator(request); |
| 265 |
|
} |
| 266 |
|
else |
| 267 |
|
{ |
| 268 |
|
m_log.Info( |
| 269 |
|
"[REXLOGIN END]: XMLRPC login_to_simulator login message did not contain all the required data."); |
| 270 |
return logResponse.CreateGridErrorResponse(); |
return logResponse.CreateGridErrorResponse(); |
| 271 |
} |
} |
| 272 |
|
} |
| 273 |
|
|
| 274 |
if (!GoodLogin) |
if (!GoodLogin) |
| 275 |
{ |
{ |