OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
SampleMoneyModule.cs
Go to the documentation of this file.
1 /*
2  * Copyright (c) Contributors, http://opensimulator.org/
3  * See CONTRIBUTORS.TXT for a full list of copyright holders.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of the OpenSimulator Project nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 using System;
29 using System.Collections;
30 using System.Collections.Generic;
31 using System.Net;
32 using System.Reflection;
33 using log4net;
34 using Nini.Config;
35 using Nwc.XmlRpc;
36 using Mono.Addins;
37 using OpenMetaverse;
38 using OpenSim.Framework;
39 using OpenSim.Framework.Servers;
40 using OpenSim.Framework.Servers.HttpServer;
41 using OpenSim.Region.Framework.Interfaces;
42 using OpenSim.Region.Framework.Scenes;
43 using OpenSim.Services.Interfaces;
44 
45 namespace OpenSim.Region.OptionalModules.World.MoneyModule
46 {
57 
58  [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SampleMoneyModule")]
60  {
61  private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
62 
66  // private UUID EconomyBaseAccount = UUID.Zero;
67 
68  private float EnergyEfficiency = 0f;
69  // private ObjectPaid handerOnObjectPaid;
70  private bool m_enabled = true;
71  private bool m_sellEnabled = false;
72 
73  private IConfigSource m_gConfig;
74 
78 
82  private Dictionary<ulong, Scene> m_scenel = new Dictionary<ulong, Scene>();
83 
84  // private int m_stipend = 1000;
85 
86  private int ObjectCount = 0;
87  private int PriceEnergyUnit = 0;
88  private int PriceGroupCreate = 0;
89  private int PriceObjectClaim = 0;
90  private float PriceObjectRent = 0f;
91  private float PriceObjectScaleFactor = 0f;
92  private int PriceParcelClaim = 0;
93  private float PriceParcelClaimFactor = 0f;
94  private int PriceParcelRent = 0;
95  private int PricePublicObjectDecay = 0;
96  private int PricePublicObjectDelete = 0;
97  private int PriceRentLight = 0;
98  private int PriceUpload = 0;
99  private int TeleportMinPrice = 0;
100 
101  private float TeleportPriceExponent = 0f;
102 
103 
104  #region IMoneyModule Members
105 
106 #pragma warning disable 0067
107  public event ObjectPaid OnObjectPaid;
108 #pragma warning restore 0067
109 
110  public int UploadCharge
111  {
112  get { return 0; }
113  }
114 
115  public int GroupCreationCharge
116  {
117  get { return 0; }
118  }
119 
124  public void Initialise(IConfigSource config)
125  {
126  m_gConfig = config;
127 
128  IConfig startupConfig = m_gConfig.Configs["Startup"];
129  IConfig economyConfig = m_gConfig.Configs["Economy"];
130 
131 
132  ReadConfigAndPopulate(startupConfig, "Startup");
133  ReadConfigAndPopulate(economyConfig, "Economy");
134  }
135 
136  public void AddRegion(Scene scene)
137  {
138  if (m_enabled)
139  {
140  scene.RegisterModuleInterface<IMoneyModule>(this);
141  IHttpServer httpServer = MainServer.Instance;
142 
143  lock (m_scenel)
144  {
145  if (m_scenel.Count == 0)
146  {
147  // XMLRPCHandler = scene;
148 
149  // To use the following you need to add:
150  // -helperuri <ADDRESS TO HERE OR grid MONEY SERVER>
151  // to the command line parameters you use to start up your client
152  // This commonly looks like -helperuri http://127.0.0.1:9000/
153 
154 
155  // Local Server.. enables functionality only.
156  httpServer.AddXmlRPCHandler("getCurrencyQuote", quote_func);
157  httpServer.AddXmlRPCHandler("buyCurrency", buy_func);
158  httpServer.AddXmlRPCHandler("preflightBuyLandPrep", preflightBuyLandPrep_func);
159  httpServer.AddXmlRPCHandler("buyLandPrep", landBuy_func);
160 
161  }
162 
163  if (m_scenel.ContainsKey(scene.RegionInfo.RegionHandle))
164  {
165  m_scenel[scene.RegionInfo.RegionHandle] = scene;
166  }
167  else
168  {
169  m_scenel.Add(scene.RegionInfo.RegionHandle, scene);
170  }
171  }
172 
173  scene.EventManager.OnNewClient += OnNewClient;
174  scene.EventManager.OnMoneyTransfer += MoneyTransferAction;
175  scene.EventManager.OnClientClosed += ClientClosed;
176  scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
177  scene.EventManager.OnMakeChildAgent += MakeChildAgent;
178  scene.EventManager.OnClientClosed += ClientLoggedOut;
179  scene.EventManager.OnValidateLandBuy += ValidateLandBuy;
180  scene.EventManager.OnLandBuy += processLandBuy;
181  }
182  }
183 
184  public void RemoveRegion(Scene scene)
185  {
186  }
187 
188  public void RegionLoaded(Scene scene)
189  {
190  }
191 
192 
193  // Please do not refactor these to be just one method
194  // Existing implementations need the distinction
195  //
196  public void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData)
197  {
198  }
199 
200  public void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type)
201  {
202  }
203 
204  public void ApplyUploadCharge(UUID agentID, int amount, string text)
205  {
206  }
207 
208  public bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount, UUID txn, out string result)
209  {
210  result = String.Empty;
211  string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID));
212 
213  bool give_result = doMoneyTransfer(fromID, toID, amount, 2, description);
214 
215 
216  BalanceUpdate(fromID, toID, give_result, description);
217 
218  return give_result;
219  }
220 
221  public void PostInitialise()
222  {
223  }
224 
225  public void Close()
226  {
227  }
228 
229  public Type ReplaceableInterface
230  {
231  get { return typeof(IMoneyModule); }
232  }
233 
234  public string Name
235  {
236  get { return "BetaGridLikeMoneyModule"; }
237  }
238 
239  #endregion
240 
247  private void ReadConfigAndPopulate(IConfig startupConfig, string config)
248  {
249  if (config == "Startup" && startupConfig != null)
250  {
251  m_enabled = (startupConfig.GetString("economymodule", "BetaGridLikeMoneyModule") == "BetaGridLikeMoneyModule");
252  }
253 
254  if (config == "Economy" && startupConfig != null)
255  {
256  PriceEnergyUnit = startupConfig.GetInt("PriceEnergyUnit", 100);
257  PriceObjectClaim = startupConfig.GetInt("PriceObjectClaim", 10);
258  PricePublicObjectDecay = startupConfig.GetInt("PricePublicObjectDecay", 4);
259  PricePublicObjectDelete = startupConfig.GetInt("PricePublicObjectDelete", 4);
260  PriceParcelClaim = startupConfig.GetInt("PriceParcelClaim", 1);
261  PriceParcelClaimFactor = startupConfig.GetFloat("PriceParcelClaimFactor", 1f);
262  PriceUpload = startupConfig.GetInt("PriceUpload", 0);
263  PriceRentLight = startupConfig.GetInt("PriceRentLight", 5);
264  TeleportMinPrice = startupConfig.GetInt("TeleportMinPrice", 2);
265  TeleportPriceExponent = startupConfig.GetFloat("TeleportPriceExponent", 2f);
266  EnergyEfficiency = startupConfig.GetFloat("EnergyEfficiency", 1);
267  PriceObjectRent = startupConfig.GetFloat("PriceObjectRent", 1);
268  PriceObjectScaleFactor = startupConfig.GetFloat("PriceObjectScaleFactor", 10);
269  PriceParcelRent = startupConfig.GetInt("PriceParcelRent", 1);
270  PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1);
271  m_sellEnabled = startupConfig.GetBoolean("SellEnabled", false);
272  }
273  }
274 
275  private void GetClientFunds(IClientAPI client)
276  {
277  CheckExistAndRefreshFunds(client.AgentId);
278  }
279 
284  private void OnNewClient(IClientAPI client)
285  {
286  GetClientFunds(client);
287 
288  // Subscribe to Money messages
289  client.OnEconomyDataRequest += EconomyDataRequestHandler;
290  client.OnMoneyBalanceRequest += SendMoneyBalance;
291  client.OnRequestPayPrice += requestPayPrice;
292  client.OnObjectBuy += ObjectBuy;
293  client.OnLogout += ClientClosed;
294  }
295 
303  private bool doMoneyTransfer(UUID Sender, UUID Receiver, int amount, int transactiontype, string description)
304  {
305  bool result = true;
306 
307  return result;
308  }
309 
310 
318  public void SendMoneyBalance(IClientAPI client, UUID agentID, UUID SessionID, UUID TransactionID)
319  {
320  if (client.AgentId == agentID && client.SessionId == SessionID)
321  {
322  int returnfunds = 0;
323 
324  try
325  {
326  returnfunds = GetFundsForAgentID(agentID);
327  }
328  catch (Exception e)
329  {
330  client.SendAlertMessage(e.Message + " ");
331  }
332 
333  client.SendMoneyBalance(TransactionID, true, new byte[0], returnfunds, 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty);
334  }
335  else
336  {
337  client.SendAlertMessage("Unable to send your money balance to you!");
338  }
339  }
340 
341  private SceneObjectPart findPrim(UUID objectID)
342  {
343  lock (m_scenel)
344  {
345  foreach (Scene s in m_scenel.Values)
346  {
347  SceneObjectPart part = s.GetSceneObjectPart(objectID);
348  if (part != null)
349  {
350  return part;
351  }
352  }
353  }
354  return null;
355  }
356 
357  private string resolveObjectName(UUID objectID)
358  {
359  SceneObjectPart part = findPrim(objectID);
360  if (part != null)
361  {
362  return part.Name;
363  }
364  return String.Empty;
365  }
366 
367  private string resolveAgentName(UUID agentID)
368  {
369  // try avatar username surname
370  Scene scene = GetRandomScene();
371  UserAccount account = scene.UserAccountService.GetUserAccount(scene.RegionInfo.ScopeID, agentID);
372  if (account != null)
373  {
374  string avatarname = account.FirstName + " " + account.LastName;
375  return avatarname;
376  }
377  else
378  {
379  m_log.ErrorFormat(
380  "[MONEY]: Could not resolve user {0}",
381  agentID);
382  }
383 
384  return String.Empty;
385  }
386 
387  private void BalanceUpdate(UUID senderID, UUID receiverID, bool transactionresult, string description)
388  {
389  IClientAPI sender = LocateClientObject(senderID);
390  IClientAPI receiver = LocateClientObject(receiverID);
391 
392  if (senderID != receiverID)
393  {
394  if (sender != null)
395  {
396  sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(senderID), 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty);
397  }
398 
399  if (receiver != null)
400  {
401  receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(receiverID), 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty);
402  }
403  }
404  }
405 
409  public XmlRpcResponse UserAlert(XmlRpcRequest request, IPEndPoint remoteClient)
410  {
411  XmlRpcResponse ret = new XmlRpcResponse();
412  Hashtable retparam = new Hashtable();
413  Hashtable requestData = (Hashtable) request.Params[0];
414 
415  UUID agentId;
416  UUID soundId;
417  UUID regionId;
418 
419  UUID.TryParse((string) requestData["agentId"], out agentId);
420  UUID.TryParse((string) requestData["soundId"], out soundId);
421  UUID.TryParse((string) requestData["regionId"], out regionId);
422  string text = (string) requestData["text"];
423  string secret = (string) requestData["secret"];
424 
425  Scene userScene = GetSceneByUUID(regionId);
426  if (userScene != null)
427  {
428  if (userScene.RegionInfo.regionSecret == secret)
429  {
430 
431  IClientAPI client = LocateClientObject(agentId);
432  if (client != null)
433  {
434 
435  if (soundId != UUID.Zero)
436  client.SendPlayAttachedSound(soundId, UUID.Zero, UUID.Zero, 1.0f, 0);
437 
438  client.SendBlueBoxMessage(UUID.Zero, "", text);
439 
440  retparam.Add("success", true);
441  }
442  else
443  {
444  retparam.Add("success", false);
445  }
446  }
447  else
448  {
449  retparam.Add("success", false);
450  }
451  }
452 
453  ret.Value = retparam;
454  return ret;
455  }
456 
457  # region Standalone box enablers only
458 
459  public XmlRpcResponse quote_func(XmlRpcRequest request, IPEndPoint remoteClient)
460  {
461  // Hashtable requestData = (Hashtable) request.Params[0];
462  // UUID agentId = UUID.Zero;
463  int amount = 0;
464  Hashtable quoteResponse = new Hashtable();
465  XmlRpcResponse returnval = new XmlRpcResponse();
466 
467 
468  Hashtable currencyResponse = new Hashtable();
469  currencyResponse.Add("estimatedCost", 0);
470  currencyResponse.Add("currencyBuy", amount);
471 
472  quoteResponse.Add("success", true);
473  quoteResponse.Add("currency", currencyResponse);
474  quoteResponse.Add("confirm", "asdfad9fj39ma9fj");
475 
476  returnval.Value = quoteResponse;
477  return returnval;
478 
479 
480 
481  }
482 
483  public XmlRpcResponse buy_func(XmlRpcRequest request, IPEndPoint remoteClient)
484  {
485  // Hashtable requestData = (Hashtable) request.Params[0];
486  // UUID agentId = UUID.Zero;
487  // int amount = 0;
488 
489  XmlRpcResponse returnval = new XmlRpcResponse();
490  Hashtable returnresp = new Hashtable();
491  returnresp.Add("success", true);
492  returnval.Value = returnresp;
493  return returnval;
494  }
495 
496  public XmlRpcResponse preflightBuyLandPrep_func(XmlRpcRequest request, IPEndPoint remoteClient)
497  {
498  XmlRpcResponse ret = new XmlRpcResponse();
499  Hashtable retparam = new Hashtable();
500  Hashtable membershiplevels = new Hashtable();
501  ArrayList levels = new ArrayList();
502  Hashtable level = new Hashtable();
503  level.Add("id", "00000000-0000-0000-0000-000000000000");
504  level.Add("description", "some level");
505  levels.Add(level);
506  //membershiplevels.Add("levels",levels);
507 
508  Hashtable landuse = new Hashtable();
509  landuse.Add("upgrade", false);
510  landuse.Add("action", "http://invaliddomaininvalid.com/");
511 
512  Hashtable currency = new Hashtable();
513  currency.Add("estimatedCost", 0);
514 
515  Hashtable membership = new Hashtable();
516  membershiplevels.Add("upgrade", false);
517  membershiplevels.Add("action", "http://invaliddomaininvalid.com/");
518  membershiplevels.Add("levels", membershiplevels);
519 
520  retparam.Add("success", true);
521  retparam.Add("currency", currency);
522  retparam.Add("membership", membership);
523  retparam.Add("landuse", landuse);
524  retparam.Add("confirm", "asdfajsdkfjasdkfjalsdfjasdf");
525 
526  ret.Value = retparam;
527 
528  return ret;
529  }
530 
531  public XmlRpcResponse landBuy_func(XmlRpcRequest request, IPEndPoint remoteClient)
532  {
533  XmlRpcResponse ret = new XmlRpcResponse();
534  Hashtable retparam = new Hashtable();
535  // Hashtable requestData = (Hashtable) request.Params[0];
536 
537  // UUID agentId = UUID.Zero;
538  // int amount = 0;
539 
540  retparam.Add("success", true);
541  ret.Value = retparam;
542 
543  return ret;
544  }
545 
546  #endregion
547 
548  #region local Fund Management
549 
554  private void CheckExistAndRefreshFunds(UUID agentID)
555  {
556 
557  }
558 
564  private int GetFundsForAgentID(UUID AgentID)
565  {
566  int returnfunds = 0;
567 
568  return returnfunds;
569  }
570 
571  // private void SetLocalFundsForAgentID(UUID AgentID, int amount)
572  // {
573 
574  // }
575 
576  #endregion
577 
578  #region Utility Helpers
579 
585  private IClientAPI LocateClientObject(UUID AgentID)
586  {
587  ScenePresence tPresence = null;
588  IClientAPI rclient = null;
589 
590  lock (m_scenel)
591  {
592  foreach (Scene _scene in m_scenel.Values)
593  {
594  tPresence = _scene.GetScenePresence(AgentID);
595  if (tPresence != null)
596  {
597  if (!tPresence.IsChildAgent)
598  {
599  rclient = tPresence.ControllingClient;
600  }
601  }
602  if (rclient != null)
603  {
604  return rclient;
605  }
606  }
607  }
608  return null;
609  }
610 
611  private Scene LocateSceneClientIn(UUID AgentId)
612  {
613  lock (m_scenel)
614  {
615  foreach (Scene _scene in m_scenel.Values)
616  {
617  ScenePresence tPresence = _scene.GetScenePresence(AgentId);
618  if (tPresence != null)
619  {
620  if (!tPresence.IsChildAgent)
621  {
622  return _scene;
623  }
624  }
625  }
626  }
627  return null;
628  }
629 
635  {
636  lock (m_scenel)
637  {
638  foreach (Scene rs in m_scenel.Values)
639  return rs;
640  }
641  return null;
642  }
643 
649  public Scene GetSceneByUUID(UUID RegionID)
650  {
651  lock (m_scenel)
652  {
653  foreach (Scene rs in m_scenel.Values)
654  {
655  if (rs.RegionInfo.originRegionID == RegionID)
656  {
657  return rs;
658  }
659  }
660  }
661  return null;
662  }
663 
664  #endregion
665 
666  #region event Handlers
667 
668  public void requestPayPrice(IClientAPI client, UUID objectID)
669  {
670  Scene scene = LocateSceneClientIn(client.AgentId);
671  if (scene == null)
672  return;
673 
674  SceneObjectPart task = scene.GetSceneObjectPart(objectID);
675  if (task == null)
676  return;
677  SceneObjectGroup group = task.ParentGroup;
678  SceneObjectPart root = group.RootPart;
679 
680  client.SendPayPrice(objectID, root.PayPrice);
681  }
682 
690  public void ClientClosed(UUID AgentID, Scene scene)
691  {
692 
693  }
694 
700  {
701  Scene s = (Scene)user.Scene;
702 
703  user.SendEconomyData(EnergyEfficiency, s.RegionInfo.ObjectCapacity, ObjectCount, PriceEnergyUnit, PriceGroupCreate,
704  PriceObjectClaim, PriceObjectRent, PriceObjectScaleFactor, PriceParcelClaim, PriceParcelClaimFactor,
705  PriceParcelRent, PricePublicObjectDecay, PricePublicObjectDelete, PriceRentLight, PriceUpload,
706  TeleportMinPrice, TeleportPriceExponent);
707  }
708 
709  private void ValidateLandBuy(Object osender, EventManager.LandBuyArgs e)
710  {
711 
712 
713  lock (e)
714  {
715  e.economyValidated = true;
716  }
717 
718 
719  }
720 
721  private void processLandBuy(Object osender, EventManager.LandBuyArgs e)
722  {
723 
724  }
725 
731  private void MoneyTransferAction(Object osender, EventManager.MoneyTransferArgs e)
732  {
733 
734  }
735 
740  private void MakeChildAgent(ScenePresence avatar)
741  {
742 
743  }
744 
749  private void ClientLoggedOut(UUID AgentId, Scene scene)
750  {
751 
752  }
753 
758  public void ClientClosed(IClientAPI client)
759  {
760  ClientClosed(client.AgentId, null);
761  }
762 
769  private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID)
770  {
771 
772  //m_log.Info("[FRIEND]: " + avatar.Name + " status:" + (!avatar.IsChildAgent).ToString());
773  }
774 
775  public int GetBalance(UUID agentID)
776  {
777  return 0;
778  }
779 
780  // Please do not refactor these to be just one method
781  // Existing implementations need the distinction
782  //
783  public bool UploadCovered(UUID agentID, int amount)
784  {
785  return true;
786  }
787  public bool AmountCovered(UUID agentID, int amount)
788  {
789  return true;
790  }
791 
792  #endregion
793 
794  public void ObjectBuy(IClientAPI remoteClient, UUID agentID,
795  UUID sessionID, UUID groupID, UUID categoryID,
796  uint localID, byte saleType, int salePrice)
797  {
798  if (!m_sellEnabled)
799  {
800  remoteClient.SendBlueBoxMessage(UUID.Zero, "", "Buying is not implemented in this version");
801  return;
802  }
803 
804  if (salePrice != 0)
805  {
806  remoteClient.SendBlueBoxMessage(UUID.Zero, "", "Buying anything for a price other than zero is not implemented");
807  return;
808  }
809 
810  Scene s = LocateSceneClientIn(remoteClient.AgentId);
811 
812  // Implmenting base sale data checking here so the default OpenSimulator implementation isn't useless
813  // combined with other implementations. We're actually validating that the client is sending the data
814  // that it should. In theory, the client should already know what to send here because it'll see it when it
815  // gets the object data. If the data sent by the client doesn't match the object, the viewer probably has an
816  // old idea of what the object properties are. Viewer developer Hazim informed us that the base module
817  // didn't check the client sent data against the object do any. Since the base modules are the
818  // 'crowning glory' examples of good practice..
819 
820  // Validate that the object exists in the scene the user is in
821  SceneObjectPart part = s.GetSceneObjectPart(localID);
822  if (part == null)
823  {
824  remoteClient.SendAgentAlertMessage("Unable to buy now. The object was not found.", false);
825  return;
826  }
827 
828  // Validate that the client sent the price that the object is being sold for
829  if (part.SalePrice != salePrice)
830  {
831  remoteClient.SendAgentAlertMessage("Cannot buy at this price. Buy Failed. If you continue to get this relog.", false);
832  return;
833  }
834 
835  // Validate that the client sent the proper sale type the object has set
836  if (part.ObjectSaleType != saleType)
837  {
838  remoteClient.SendAgentAlertMessage("Cannot buy this way. Buy Failed. If you continue to get this relog.", false);
839  return;
840  }
841 
842  IBuySellModule module = s.RequestModuleInterface<IBuySellModule>();
843  if (module != null)
844  module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice);
845  }
846 
847  public void MoveMoney(UUID fromAgentID, UUID toAgentID, int amount, string text)
848  {
849  }
850  }
851 
852  public enum TransactionType : int
853  {
854  SystemGenerated = 0,
855  RegionMoneyRequest = 1,
856  Gift = 2,
857  Purchase = 3
858  }
859 }
void SendMoneyBalance(IClientAPI client, UUID agentID, UUID SessionID, UUID TransactionID)
Sends the the stored money balance to the client
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
Scene GetSceneByUUID(UUID RegionID)
Utility function to get a Scene by RegionID in a module
void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type)
XmlRpcResponse buy_func(XmlRpcRequest request, IPEndPoint remoteClient)
XmlRpcResponse landBuy_func(XmlRpcRequest request, IPEndPoint remoteClient)
void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData)
OpenSim.Server.Handlers.Simulation.Utils Utils
bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount, UUID txn, out string result)
void PostInitialise()
This is called exactly once after all the shared region-modules have been instanciated and IRegionMod...
void EconomyDataRequestHandler(IClientAPI user)
Event called Economy Data Request handler.
This is only the functionality required to make the functionality associated with money work (such as...
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
void ClientClosed(IClientAPI client)
Call this when the client disconnects.
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
void Initialise(IConfigSource config)
Called on startup so the module can be configured.
Interface to OpenSimulator's built in HTTP server. Use this to register handlers (http, llsd, xmlrpc, etc.) for given URLs.
Definition: IHttpServer.cs:36
void ApplyUploadCharge(UUID agentID, int amount, string text)
delegate void ObjectBuy(IClientAPI remoteClient, UUID agentID, UUID sessionID, UUID groupID, UUID categoryID, uint localID, byte saleType, int salePrice)
void ObjectBuy(IClientAPI remoteClient, UUID agentID, UUID sessionID, UUID groupID, UUID categoryID, uint localID, byte saleType, int salePrice)
void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent)
void MoveMoney(UUID fromAgentID, UUID toAgentID, int amount, string text)
delegate void ObjectPaid(UUID objectID, UUID agentID, int amount)
Interactive OpenSim region server
Definition: OpenSim.cs:55
A class for triggering remote scene events.
Definition: EventManager.cs:44
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
XmlRpcResponse preflightBuyLandPrep_func(XmlRpcRequest request, IPEndPoint remoteClient)
XmlRpcResponse quote_func(XmlRpcRequest request, IPEndPoint remoteClient)
void ClientClosed(UUID AgentID, Scene scene)
When the client closes the connection we remove their accounting info from memory to free up resource...
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
Scene GetRandomScene()
Utility function Gets a Random scene in the instance. For when which scene exactly you're doing somet...
XmlRpcResponse UserAlert(XmlRpcRequest request, IPEndPoint remoteClient)
XMLRPC handler to send alert message and sound to client