diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/XMLRPCModule.cs | 49 |
1 files changed, 38 insertions, 11 deletions
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 | ||
29 | using System; | ||
29 | using System.Collections; | 30 | using System.Collections; |
30 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
31 | using System.Threading; | 32 | using System.Threading; |
@@ -35,6 +36,7 @@ using Nwc.XmlRpc; | |||
35 | using OpenSim.Framework.Servers; | 36 | using OpenSim.Framework.Servers; |
36 | using OpenSim.Region.Environment.Interfaces; | 37 | using OpenSim.Region.Environment.Interfaces; |
37 | using OpenSim.Region.Environment.Scenes; | 38 | using OpenSim.Region.Environment.Scenes; |
39 | using 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 | * |