diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs b/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs index d950af9..aef0f81 100644 --- a/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs +++ b/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs | |||
@@ -144,6 +144,7 @@ namespace OpenSim.Region.Environment.Modules | |||
144 | // Centralized grid structure using OpenSimWi Redux revision 9+ | 144 | // Centralized grid structure using OpenSimWi Redux revision 9+ |
145 | // https://opensimwiredux.svn.sourceforge.net/svnroot/opensimwiredux | 145 | // https://opensimwiredux.svn.sourceforge.net/svnroot/opensimwiredux |
146 | scene.AddXmlRPCHandler("dynamic_balance_update_request", GridMoneyUpdate); | 146 | scene.AddXmlRPCHandler("dynamic_balance_update_request", GridMoneyUpdate); |
147 | scene.AddXmlRPCHandler("user_alert", UserAlert); | ||
147 | } | 148 | } |
148 | else | 149 | else |
149 | { | 150 | { |
@@ -1164,6 +1165,49 @@ namespace OpenSim.Region.Environment.Modules | |||
1164 | r.Value = rparms; | 1165 | r.Value = rparms; |
1165 | return r; | 1166 | return r; |
1166 | } | 1167 | } |
1168 | /// <summary> | ||
1169 | /// XMLRPC handler to send alert message and sound to client | ||
1170 | /// </summary> | ||
1171 | public XmlRpcResponse UserAlert(XmlRpcRequest request) | ||
1172 | { | ||
1173 | XmlRpcResponse ret = new XmlRpcResponse(); | ||
1174 | Hashtable retparam = new Hashtable(); | ||
1175 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
1176 | |||
1177 | LLUUID agentId = LLUUID.Zero; | ||
1178 | LLUUID soundId = LLUUID.Zero; | ||
1179 | |||
1180 | Helpers.TryParse((string)requestData["agentId"], out agentId); | ||
1181 | Helpers.TryParse((string)requestData["soundId"], out soundId); | ||
1182 | string text=(string)requestData["text"]; | ||
1183 | string secret=(string)requestData["secret"]; | ||
1184 | |||
1185 | Scene userScene = GetRandomScene(); | ||
1186 | if(userScene.RegionInfo.regionSecret.ToString() == secret) | ||
1187 | { | ||
1188 | IClientAPI client = LocateClientObject(agentId); | ||
1189 | |||
1190 | if (client != null) | ||
1191 | { | ||
1192 | if(soundId != LLUUID.Zero) | ||
1193 | client.SendPlayAttachedSound(soundId, LLUUID.Zero, LLUUID.Zero, 1.0f, 0); | ||
1194 | client.SendBlueBoxMessage(LLUUID.Zero, LLUUID.Zero, "", text); | ||
1195 | retparam.Add("success", true); | ||
1196 | } | ||
1197 | else | ||
1198 | { | ||
1199 | retparam.Add("success", false); | ||
1200 | } | ||
1201 | } | ||
1202 | else | ||
1203 | { | ||
1204 | retparam.Add("success", false); | ||
1205 | } | ||
1206 | ret.Value = retparam; | ||
1207 | |||
1208 | return ret; | ||
1209 | } | ||
1210 | |||
1167 | 1211 | ||
1168 | # region Standalone box enablers only | 1212 | # region Standalone box enablers only |
1169 | 1213 | ||