diff options
author | Charles Krinke | 2008-05-28 02:06:56 +0000 |
---|---|---|
committer | Charles Krinke | 2008-05-28 02:06:56 +0000 |
commit | 6d51eef9cee86c74f00fd149327a378053a597b2 (patch) | |
tree | 60993888c310eb6b505523d6da2579838ba57cd8 /OpenSim/Region/Environment | |
parent | Thank you kindly, Melanie for a patch that adds a two-stage (diff) | |
download | opensim-SC_OLD-6d51eef9cee86c74f00fd149327a378053a597b2.zip opensim-SC_OLD-6d51eef9cee86c74f00fd149327a378053a597b2.tar.gz opensim-SC_OLD-6d51eef9cee86c74f00fd149327a378053a597b2.tar.bz2 opensim-SC_OLD-6d51eef9cee86c74f00fd149327a378053a597b2.tar.xz |
Thank you, Grumly57 kindly for:
This patch proposes a new function : osOpenRemoteDataChannel(key channeID)
that allow to open an XMLRPC channel for remote_data event. The difference
is that the channelID can be customized instead of being randomly generated.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Interfaces/IXMLRPC.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs | 20 |
2 files changed, 13 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs b/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs index 6c1d025..a2c164f 100644 --- a/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs +++ b/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs | |||
@@ -32,7 +32,7 @@ namespace OpenSim.Region.Environment.Interfaces | |||
32 | { | 32 | { |
33 | public interface IXMLRPC | 33 | public interface IXMLRPC |
34 | { | 34 | { |
35 | LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID); | 35 | LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID, LLUUID channelID); |
36 | void CloseXMLRPCChannel(LLUUID channelKey); | 36 | void CloseXMLRPCChannel(LLUUID channelKey); |
37 | bool hasRequests(); | 37 | bool hasRequests(); |
38 | void RemoteDataReply(string channel, string message_id, string sdata, int idata); | 38 | void RemoteDataReply(string channel, string message_id, string sdata, int idata); |
diff --git a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs index bf21dd3..aa7a20f 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs | |||
@@ -160,6 +160,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
160 | * | 160 | * |
161 | * Generate a LLUUID channel key and add it and | 161 | * Generate a LLUUID channel key and add it and |
162 | * the prim id to dictionary <channelUUID, primUUID> | 162 | * the prim id to dictionary <channelUUID, primUUID> |
163 | * | ||
164 | * A custom channel key can be proposed. | ||
165 | * Otherwise, passing LLUUID.Zero will generate | ||
166 | * and return a random channel | ||
163 | * | 167 | * |
164 | * First check if there is a channel assigned for | 168 | * First check if there is a channel assigned for |
165 | * this itemID. If there is, then someone called | 169 | * this itemID. If there is, then someone called |
@@ -169,9 +173,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
169 | * | 173 | * |
170 | * ********************************************/ | 174 | * ********************************************/ |
171 | 175 | ||
172 | public LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID) | 176 | public LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID, LLUUID channelID) |
173 | { | 177 | { |
174 | LLUUID channel = new LLUUID(); | 178 | LLUUID newChannel = LLUUID.Zero; |
175 | 179 | ||
176 | //Is a dupe? | 180 | //Is a dupe? |
177 | foreach (RPCChannelInfo ci in m_openChannels.Values) | 181 | foreach (RPCChannelInfo ci in m_openChannels.Values) |
@@ -179,22 +183,22 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC | |||
179 | if (ci.GetItemID().Equals(itemID)) | 183 | if (ci.GetItemID().Equals(itemID)) |
180 | { | 184 | { |
181 | // return the original channel ID for this item | 185 | // return the original channel ID for this item |
182 | channel = ci.GetChannelID(); | 186 | newChannel = ci.GetChannelID(); |
183 | break; | 187 | break; |
184 | } | 188 | } |
185 | } | 189 | } |
186 | 190 | ||
187 | if (channel == LLUUID.Zero) | 191 | if (newChannel == LLUUID.Zero) |
188 | { | 192 | { |
189 | channel = LLUUID.Random(); | 193 | newChannel = (channelID == LLUUID.Zero) ? LLUUID.Random() : channelID; |
190 | RPCChannelInfo rpcChanInfo = new RPCChannelInfo(localID, itemID, channel); | 194 | RPCChannelInfo rpcChanInfo = new RPCChannelInfo(localID, itemID, newChannel); |
191 | lock (XMLRPCListLock) | 195 | lock (XMLRPCListLock) |
192 | { | 196 | { |
193 | m_openChannels.Add(channel, rpcChanInfo); | 197 | m_openChannels.Add(newChannel, rpcChanInfo); |
194 | } | 198 | } |
195 | } | 199 | } |
196 | 200 | ||
197 | return channel; | 201 | return newChannel; |
198 | } | 202 | } |
199 | 203 | ||
200 | // Delete channels based on itemID | 204 | // Delete channels based on itemID |