aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Interfaces/IXMLRPC.cs1
-rw-r--r--OpenSim/Region/Environment/ModuleLoader.cs3
-rw-r--r--OpenSim/Region/Environment/Modules/XMLRPCModule.cs49
3 files changed, 42 insertions, 11 deletions
diff --git a/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs b/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs
index 6786b8c..02b74cb 100644
--- a/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs
+++ b/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs
@@ -38,5 +38,6 @@ namespace OpenSim.Region.Environment.Interfaces
38 bool hasRequests(); 38 bool hasRequests();
39 RPCRequestInfo GetNextRequest(); 39 RPCRequestInfo GetNextRequest();
40 void RemoteDataReply(string channel, string message_id, string sdata, int idata); 40 void RemoteDataReply(string channel, string message_id, string sdata, int idata);
41 bool IsEnabled();
41 } 42 }
42} \ No newline at end of file 43} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs
index 1bab2e5..6893e3f 100644
--- a/OpenSim/Region/Environment/ModuleLoader.cs
+++ b/OpenSim/Region/Environment/ModuleLoader.cs
@@ -90,6 +90,9 @@ namespace OpenSim.Region.Environment
90 AvatarFactoryModule avatarFactory = new AvatarFactoryModule(); 90 AvatarFactoryModule avatarFactory = new AvatarFactoryModule();
91 m_loadedSharedModules.Add(avatarFactory.Name, avatarFactory); 91 m_loadedSharedModules.Add(avatarFactory.Name, avatarFactory);
92 92
93 XMLRPCModule xmlRpcMod = new XMLRPCModule();
94 m_loadedSharedModules.Add(xmlRpcMod.Name, xmlRpcMod);
95
93 //TextureDownloadModule textureModule = new TextureDownloadModule(); 96 //TextureDownloadModule textureModule = new TextureDownloadModule();
94 //LoadedSharedModules.Add(textureModule.Name, textureModule); 97 //LoadedSharedModules.Add(textureModule.Name, textureModule);
95 } 98 }
diff --git a/OpenSim/Region/Environment/Modules/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/XMLRPCModule.cs
index 2618b17..f139d64 100644
--- a/OpenSim/Region/Environment/Modules/XMLRPCModule.cs
+++ b/OpenSim/Region/Environment/Modules/XMLRPCModule.cs
@@ -26,6 +26,7 @@
26* 26*
27*/ 27*/
28 28
29using System;
29using System.Collections; 30using System.Collections;
30using System.Collections.Generic; 31using System.Collections.Generic;
31using System.Threading; 32using System.Threading;
@@ -35,6 +36,7 @@ using Nwc.XmlRpc;
35using OpenSim.Framework.Servers; 36using OpenSim.Framework.Servers;
36using OpenSim.Region.Environment.Interfaces; 37using OpenSim.Region.Environment.Interfaces;
37using OpenSim.Region.Environment.Scenes; 38using OpenSim.Region.Environment.Scenes;
39using OpenSim.Framework.Console;
38 40
39/***************************************************** 41/*****************************************************
40 * 42 *
@@ -77,8 +79,11 @@ namespace OpenSim.Region.Environment.Modules
77 private Queue<RPCRequestInfo> rpcQueue = new Queue<RPCRequestInfo>(); 79 private Queue<RPCRequestInfo> rpcQueue = new Queue<RPCRequestInfo>();
78 private object XMLRPCListLock = new object(); 80 private object XMLRPCListLock = new object();
79 private string m_name = "XMLRPCModule"; 81 private string m_name = "XMLRPCModule";
80 private int RemoteReplyScriptWait = 100; 82 private int RemoteReplyScriptWait = 300;
81 private int RemoteReplyScriptTimeout = 300; 83 private int RemoteReplyScriptTimeout = 900;
84 private int m_remoteDataPort = 0;
85 private List<Scene> m_scenes = new List<Scene>();
86 private LogBase m_log;
82 87
83 // <channel id, RPCChannelInfo> 88 // <channel id, RPCChannelInfo>
84 private Dictionary<LLUUID, RPCChannelInfo> m_openChannels; 89 private Dictionary<LLUUID, RPCChannelInfo> m_openChannels;
@@ -88,26 +93,43 @@ namespace OpenSim.Region.Environment.Modules
88 93
89 public XMLRPCModule() 94 public XMLRPCModule()
90 { 95 {
96 m_log = MainLog.Instance;
91 } 97 }
92 98
93 public void Initialise(Scene scene, IConfigSource config) 99 public void Initialise(Scene scene, IConfigSource config)
94 { 100 {
95 m_scene = scene; 101 try
102 {
103
104 m_remoteDataPort = config.Configs["Network"].GetInt("remoteDataPort", m_remoteDataPort);
96 105
97 m_scene.RegisterModuleInterface<IXMLRPC>(this); 106 }
107 catch (Exception e)
108 {
109 }
98 110
99 m_openChannels = new Dictionary<LLUUID, RPCChannelInfo>(); 111 if (!m_scenes.Contains(scene))
100 m_pendingResponse = new Dictionary<LLUUID, RPCRequestInfo>(); 112 {
113 m_scenes.Add(scene);
101 114
102 // Start http server 115 scene.RegisterModuleInterface<IXMLRPC>(this);
103 // Attach xmlrpc handlers 116 }
104 BaseHttpServer httpServer = new BaseHttpServer(20800);
105 httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData);
106 httpServer.Start();
107 } 117 }
108 118
109 public void PostInitialise() 119 public void PostInitialise()
110 { 120 {
121 if ( IsEnabled() )
122 {
123 m_openChannels = new Dictionary<LLUUID, RPCChannelInfo>();
124 m_pendingResponse = new Dictionary<LLUUID, RPCRequestInfo>();
125
126 // Start http server
127 // Attach xmlrpc handlers
128 m_log.Verbose("REMOTE_DATA", "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands.");
129 BaseHttpServer httpServer = new BaseHttpServer((uint)m_remoteDataPort);
130 httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData);
131 httpServer.Start();
132 }
111 } 133 }
112 134
113 public void Close() 135 public void Close()
@@ -124,6 +146,11 @@ namespace OpenSim.Region.Environment.Modules
124 get { return true; } 146 get { return true; }
125 } 147 }
126 148
149 public bool IsEnabled()
150 {
151 return (m_remoteDataPort > 0);
152 }
153
127 /********************************************** 154 /**********************************************
128 * OpenXMLRPCChannel 155 * OpenXMLRPCChannel
129 * 156 *