aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/XMLRPCModule.cs
diff options
context:
space:
mode:
authorSean Dague2007-12-13 19:50:21 +0000
committerSean Dague2007-12-13 19:50:21 +0000
commitf773733fcb6ef18ddb70d597cdf6f1e334dcf13e (patch)
treedd59cbd8f684a9fc4f0ad656738857170905c6b2 /OpenSim/Region/Environment/Modules/XMLRPCModule.cs
parentEnabled the sit_ground animation. The sit state is not properly set, but it ... (diff)
downloadopensim-SC-f773733fcb6ef18ddb70d597cdf6f1e334dcf13e.zip
opensim-SC-f773733fcb6ef18ddb70d597cdf6f1e334dcf13e.tar.gz
opensim-SC-f773733fcb6ef18ddb70d597cdf6f1e334dcf13e.tar.bz2
opensim-SC-f773733fcb6ef18ddb70d597cdf6f1e334dcf13e.tar.xz
From Michael Osias (IBM)
This patch makes some enhancements to the llRemoteData functions. The module is now a shared module, and allows remote data channels to be created among multiple regions in the same sim. The port is controlled from the remoteDataPort property under the [Network] section in OpenSim.ini. If this setting is not present or = 0, the module is disabled and no port is opened. llRemoteData commands have not effect when module is disabled.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/XMLRPCModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/XMLRPCModule.cs49
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
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 *