diff options
author | Teravus Ovares | 2008-09-06 07:52:41 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-09-06 07:52:41 +0000 |
commit | 7d89e122930be39e84a6d174548fa2d12ac0484a (patch) | |
tree | e5aa5752f988a9aba2a969f49e5e208985eda80c /OpenSim/Region/Environment/Modules/Avatar/Currency | |
parent | * minor: speculatively try a change to bamboo.build to see if this generates ... (diff) | |
download | opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.zip opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.gz opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.bz2 opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.xz |
* This is the fabled LibOMV update with all of the libOMV types from JHurliman
* This is a HUGE OMG update and will definitely have unknown side effects.. so this is really only for the strong hearted at this point. Regular people should let the dust settle.
* This has been tested to work with most basic functions. However.. make sure you back up 'everything' before using this. It's that big!
* Essentially we're back at square 1 in the testing phase.. so lets identify things that broke.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Avatar/Currency')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs | 138 |
1 files changed, 68 insertions, 70 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs index 2a0bba4..19c193f 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs | |||
@@ -32,7 +32,7 @@ using System.Net; | |||
32 | using System.Net.Sockets; | 32 | using System.Net.Sockets; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using System.Xml; | 34 | using System.Xml; |
35 | using libsecondlife; | 35 | using OpenMetaverse; |
36 | using log4net; | 36 | using log4net; |
37 | using Nini.Config; | 37 | using Nini.Config; |
38 | using Nwc.XmlRpc; | 38 | using Nwc.XmlRpc; |
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Where Stipends come from and Fees go to. | 63 | /// Where Stipends come from and Fees go to. |
64 | /// </summary> | 64 | /// </summary> |
65 | // private LLUUID EconomyBaseAccount = LLUUID.Zero; | 65 | // private UUID EconomyBaseAccount = UUID.Zero; |
66 | 66 | ||
67 | private float EnergyEfficiency = 0f; | 67 | private float EnergyEfficiency = 0f; |
68 | private bool gridmode = false; | 68 | private bool gridmode = false; |
@@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
72 | private IConfigSource m_gConfig; | 72 | private IConfigSource m_gConfig; |
73 | 73 | ||
74 | private bool m_keepMoneyAcrossLogins = true; | 74 | private bool m_keepMoneyAcrossLogins = true; |
75 | private Dictionary<LLUUID, int> m_KnownClientFunds = new Dictionary<LLUUID, int>(); | 75 | private Dictionary<UUID, int> m_KnownClientFunds = new Dictionary<UUID, int>(); |
76 | // private string m_LandAddress = String.Empty; | 76 | // private string m_LandAddress = String.Empty; |
77 | 77 | ||
78 | private int m_minFundsBeforeRefresh = 100; | 78 | private int m_minFundsBeforeRefresh = 100; |
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
81 | /// <summary> | 81 | /// <summary> |
82 | /// Region UUIDS indexed by AgentID | 82 | /// Region UUIDS indexed by AgentID |
83 | /// </summary> | 83 | /// </summary> |
84 | private Dictionary<LLUUID, LLUUID> m_rootAgents = new Dictionary<LLUUID, LLUUID>(); | 84 | private Dictionary<UUID, UUID> m_rootAgents = new Dictionary<UUID, UUID>(); |
85 | 85 | ||
86 | /// <summary> | 86 | /// <summary> |
87 | /// Scenes by Region Handle | 87 | /// Scenes by Region Handle |
@@ -184,11 +184,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
184 | } | 184 | } |
185 | } | 185 | } |
186 | 186 | ||
187 | public void ApplyUploadCharge(LLUUID agentID) | 187 | public void ApplyUploadCharge(UUID agentID) |
188 | { | 188 | { |
189 | } | 189 | } |
190 | 190 | ||
191 | public bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID, int amount) | 191 | public bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount) |
192 | { | 192 | { |
193 | string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID)); | 193 | string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID)); |
194 | 194 | ||
@@ -252,7 +252,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
252 | PriceObjectScaleFactor = startupConfig.GetFloat("PriceObjectScaleFactor", 10); | 252 | PriceObjectScaleFactor = startupConfig.GetFloat("PriceObjectScaleFactor", 10); |
253 | PriceParcelRent = startupConfig.GetInt("PriceParcelRent", 1); | 253 | PriceParcelRent = startupConfig.GetInt("PriceParcelRent", 1); |
254 | PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1); | 254 | PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1); |
255 | // string EBA = startupConfig.GetString("EconomyBaseAccount", LLUUID.Zero.ToString()); | 255 | // string EBA = startupConfig.GetString("EconomyBaseAccount", UUID.Zero.ToString()); |
256 | // Helpers.TryParse(EBA, out EconomyBaseAccount); | 256 | // Helpers.TryParse(EBA, out EconomyBaseAccount); |
257 | 257 | ||
258 | // UserLevelPaysFees = startupConfig.GetInt("UserLevelPaysFees", -1); | 258 | // UserLevelPaysFees = startupConfig.GetInt("UserLevelPaysFees", -1); |
@@ -294,7 +294,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
294 | if (s != null && agent != null && childYN == false) | 294 | if (s != null && agent != null && childYN == false) |
295 | { | 295 | { |
296 | //s.RegionInfo.RegionHandle; | 296 | //s.RegionInfo.RegionHandle; |
297 | LLUUID agentID = LLUUID.Zero; | 297 | UUID agentID = UUID.Zero; |
298 | int funds = 0; | 298 | int funds = 0; |
299 | 299 | ||
300 | Hashtable hbinfo = | 300 | Hashtable hbinfo = |
@@ -302,7 +302,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
302 | s.RegionInfo.regionSecret); | 302 | s.RegionInfo.regionSecret); |
303 | if ((bool) hbinfo["success"] == true) | 303 | if ((bool) hbinfo["success"] == true) |
304 | { | 304 | { |
305 | Helpers.TryParse((string) hbinfo["agentId"], out agentID); | 305 | UUID.TryParse((string)hbinfo["agentId"], out agentID); |
306 | try | 306 | try |
307 | { | 307 | { |
308 | funds = (Int32) hbinfo["funds"]; | 308 | funds = (Int32) hbinfo["funds"]; |
@@ -331,7 +331,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
331 | (string) hbinfo["errorMessage"]); | 331 | (string) hbinfo["errorMessage"]); |
332 | client.SendAlertMessage((string) hbinfo["errorMessage"]); | 332 | client.SendAlertMessage((string) hbinfo["errorMessage"]); |
333 | } | 333 | } |
334 | SendMoneyBalance(client, agentID, client.SessionId, LLUUID.Zero); | 334 | SendMoneyBalance(client, agentID, client.SessionId, UUID.Zero); |
335 | } | 335 | } |
336 | } | 336 | } |
337 | } | 337 | } |
@@ -365,7 +365,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
365 | /// <param name="Receiver"></param> | 365 | /// <param name="Receiver"></param> |
366 | /// <param name="amount"></param> | 366 | /// <param name="amount"></param> |
367 | /// <returns></returns> | 367 | /// <returns></returns> |
368 | private bool doMoneyTransfer(LLUUID Sender, LLUUID Receiver, int amount, int transactiontype, string description) | 368 | private bool doMoneyTransfer(UUID Sender, UUID Receiver, int amount, int transactiontype, string description) |
369 | { | 369 | { |
370 | bool result = false; | 370 | bool result = false; |
371 | if (amount >= 0) | 371 | if (amount >= 0) |
@@ -425,7 +425,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
425 | /// <param name="agentID"></param> | 425 | /// <param name="agentID"></param> |
426 | /// <param name="SessionID"></param> | 426 | /// <param name="SessionID"></param> |
427 | /// <param name="TransactionID"></param> | 427 | /// <param name="TransactionID"></param> |
428 | public void SendMoneyBalance(IClientAPI client, LLUUID agentID, LLUUID SessionID, LLUUID TransactionID) | 428 | public void SendMoneyBalance(IClientAPI client, UUID agentID, UUID SessionID, UUID TransactionID) |
429 | { | 429 | { |
430 | if (client.AgentId == agentID && client.SessionId == SessionID) | 430 | if (client.AgentId == agentID && client.SessionId == SessionID) |
431 | { | 431 | { |
@@ -456,7 +456,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
456 | /// <param name="regionId"></param> | 456 | /// <param name="regionId"></param> |
457 | /// <param name="regionSecret"></param> | 457 | /// <param name="regionSecret"></param> |
458 | /// <returns></returns> | 458 | /// <returns></returns> |
459 | public Hashtable GetBalanceForUserFromMoneyServer(LLUUID agentId, LLUUID secureSessionID, LLUUID regionId, string regionSecret) | 459 | public Hashtable GetBalanceForUserFromMoneyServer(UUID agentId, UUID secureSessionID, UUID regionId, string regionSecret) |
460 | { | 460 | { |
461 | Hashtable MoneyBalanceRequestParams = new Hashtable(); | 461 | Hashtable MoneyBalanceRequestParams = new Hashtable(); |
462 | MoneyBalanceRequestParams["agentId"] = agentId.ToString(); | 462 | MoneyBalanceRequestParams["agentId"] = agentId.ToString(); |
@@ -551,7 +551,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
551 | /// <param name="regionId"></param> | 551 | /// <param name="regionId"></param> |
552 | /// <param name="regionSecret"></param> | 552 | /// <param name="regionSecret"></param> |
553 | /// <returns></returns> | 553 | /// <returns></returns> |
554 | public Hashtable claim_user(LLUUID agentId, LLUUID secureSessionID, LLUUID regionId, string regionSecret) | 554 | public Hashtable claim_user(UUID agentId, UUID secureSessionID, UUID regionId, string regionSecret) |
555 | { | 555 | { |
556 | Hashtable MoneyBalanceRequestParams = new Hashtable(); | 556 | Hashtable MoneyBalanceRequestParams = new Hashtable(); |
557 | MoneyBalanceRequestParams["agentId"] = agentId.ToString(); | 557 | MoneyBalanceRequestParams["agentId"] = agentId.ToString(); |
@@ -563,12 +563,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
563 | IClientAPI sendMoneyBal = LocateClientObject(agentId); | 563 | IClientAPI sendMoneyBal = LocateClientObject(agentId); |
564 | if (sendMoneyBal != null) | 564 | if (sendMoneyBal != null) |
565 | { | 565 | { |
566 | SendMoneyBalance(sendMoneyBal, agentId, sendMoneyBal.SessionId, LLUUID.Zero); | 566 | SendMoneyBalance(sendMoneyBal, agentId, sendMoneyBal.SessionId, UUID.Zero); |
567 | } | 567 | } |
568 | return MoneyRespData; | 568 | return MoneyRespData; |
569 | } | 569 | } |
570 | 570 | ||
571 | private SceneObjectPart findPrim(LLUUID objectID) | 571 | private SceneObjectPart findPrim(UUID objectID) |
572 | { | 572 | { |
573 | lock (m_scenel) | 573 | lock (m_scenel) |
574 | { | 574 | { |
@@ -584,7 +584,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
584 | return null; | 584 | return null; |
585 | } | 585 | } |
586 | 586 | ||
587 | private string resolveObjectName(LLUUID objectID) | 587 | private string resolveObjectName(UUID objectID) |
588 | { | 588 | { |
589 | SceneObjectPart part = findPrim(objectID); | 589 | SceneObjectPart part = findPrim(objectID); |
590 | if (part != null) | 590 | if (part != null) |
@@ -594,7 +594,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
594 | return String.Empty; | 594 | return String.Empty; |
595 | } | 595 | } |
596 | 596 | ||
597 | private string resolveAgentName(LLUUID agentID) | 597 | private string resolveAgentName(UUID agentID) |
598 | { | 598 | { |
599 | // try avatar username surname | 599 | // try avatar username surname |
600 | Scene scene = GetRandomScene(); | 600 | Scene scene = GetRandomScene(); |
@@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
607 | return String.Empty; | 607 | return String.Empty; |
608 | } | 608 | } |
609 | 609 | ||
610 | private void BalanceUpdate(LLUUID senderID, LLUUID receiverID, bool transactionresult, string description) | 610 | private void BalanceUpdate(UUID senderID, UUID receiverID, bool transactionresult, string description) |
611 | { | 611 | { |
612 | IClientAPI sender = LocateClientObject(senderID); | 612 | IClientAPI sender = LocateClientObject(senderID); |
613 | IClientAPI receiver = LocateClientObject(receiverID); | 613 | IClientAPI receiver = LocateClientObject(receiverID); |
@@ -616,12 +616,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
616 | { | 616 | { |
617 | if (sender != null) | 617 | if (sender != null) |
618 | { | 618 | { |
619 | sender.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(description), GetFundsForAgentID(senderID)); | 619 | sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(senderID)); |
620 | } | 620 | } |
621 | 621 | ||
622 | if (receiver != null) | 622 | if (receiver != null) |
623 | { | 623 | { |
624 | receiver.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(description), GetFundsForAgentID(receiverID)); | 624 | receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(receiverID)); |
625 | } | 625 | } |
626 | } | 626 | } |
627 | } | 627 | } |
@@ -633,7 +633,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
633 | /// <param name="destId"></param> | 633 | /// <param name="destId"></param> |
634 | /// <param name="amount"></param> | 634 | /// <param name="amount"></param> |
635 | /// <returns></returns> | 635 | /// <returns></returns> |
636 | public bool TransferMoneyonMoneyServer(LLUUID sourceId, LLUUID destId, int amount, int transactiontype, string description) | 636 | public bool TransferMoneyonMoneyServer(UUID sourceId, UUID destId, int amount, int transactiontype, string description) |
637 | { | 637 | { |
638 | int aggregatePermInventory = 0; | 638 | int aggregatePermInventory = 0; |
639 | int aggregatePermNextOwner = 0; | 639 | int aggregatePermNextOwner = 0; |
@@ -709,7 +709,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
709 | return rvalue; | 709 | return rvalue; |
710 | } | 710 | } |
711 | 711 | ||
712 | public int GetRemoteBalance(LLUUID agentId) | 712 | public int GetRemoteBalance(UUID agentId) |
713 | { | 713 | { |
714 | int funds = 0; | 714 | int funds = 0; |
715 | 715 | ||
@@ -755,7 +755,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
755 | } | 755 | } |
756 | 756 | ||
757 | SetLocalFundsForAgentID(agentId, funds); | 757 | SetLocalFundsForAgentID(agentId, funds); |
758 | SendMoneyBalance(aClient, agentId, aClient.SessionId, LLUUID.Zero); | 758 | SendMoneyBalance(aClient, agentId, aClient.SessionId, UUID.Zero); |
759 | } | 759 | } |
760 | else | 760 | else |
761 | { | 761 | { |
@@ -776,10 +776,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
776 | 776 | ||
777 | if (requestData.ContainsKey("agentId")) | 777 | if (requestData.ContainsKey("agentId")) |
778 | { | 778 | { |
779 | LLUUID agentId = LLUUID.Zero; | 779 | UUID agentId = UUID.Zero; |
780 | 780 | ||
781 | Helpers.TryParse((string) requestData["agentId"], out agentId); | 781 | UUID.TryParse((string) requestData["agentId"], out agentId); |
782 | if (agentId != LLUUID.Zero) | 782 | if (agentId != UUID.Zero) |
783 | { | 783 | { |
784 | GetRemoteBalance(agentId); | 784 | GetRemoteBalance(agentId); |
785 | } | 785 | } |
@@ -809,13 +809,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
809 | Hashtable retparam = new Hashtable(); | 809 | Hashtable retparam = new Hashtable(); |
810 | Hashtable requestData = (Hashtable) request.Params[0]; | 810 | Hashtable requestData = (Hashtable) request.Params[0]; |
811 | 811 | ||
812 | LLUUID agentId = LLUUID.Zero; | 812 | UUID agentId = UUID.Zero; |
813 | LLUUID soundId = LLUUID.Zero; | 813 | UUID soundId = UUID.Zero; |
814 | LLUUID regionId = LLUUID.Zero; | 814 | UUID regionId = UUID.Zero; |
815 | 815 | ||
816 | Helpers.TryParse((string) requestData["agentId"], out agentId); | 816 | UUID.TryParse((string) requestData["agentId"], out agentId); |
817 | Helpers.TryParse((string) requestData["soundId"], out soundId); | 817 | UUID.TryParse((string) requestData["soundId"], out soundId); |
818 | Helpers.TryParse((string) requestData["regionId"], out regionId); | 818 | UUID.TryParse((string) requestData["regionId"], out regionId); |
819 | string text = (string) requestData["text"]; | 819 | string text = (string) requestData["text"]; |
820 | string secret = (string) requestData["secret"]; | 820 | string secret = (string) requestData["secret"]; |
821 | 821 | ||
@@ -828,9 +828,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
828 | IClientAPI client = LocateClientObject(agentId); | 828 | IClientAPI client = LocateClientObject(agentId); |
829 | if (client != null) | 829 | if (client != null) |
830 | { | 830 | { |
831 | if (soundId != LLUUID.Zero) | 831 | |
832 | client.SendPlayAttachedSound(soundId, LLUUID.Zero, LLUUID.Zero, 1.0f, 0); | 832 | if (soundId != UUID.Zero) |
833 | client.SendBlueBoxMessage(LLUUID.Zero, LLUUID.Zero, "", text); | 833 | client.SendPlayAttachedSound(soundId, UUID.Zero, UUID.Zero, 1.0f, 0); |
834 | |||
835 | client.SendBlueBoxMessage(UUID.Zero, UUID.Zero, "", text); | ||
836 | |||
834 | retparam.Add("success", true); | 837 | retparam.Add("success", true); |
835 | } | 838 | } |
836 | else | 839 | else |
@@ -843,10 +846,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
843 | retparam.Add("success", false); | 846 | retparam.Add("success", false); |
844 | } | 847 | } |
845 | } | 848 | } |
846 | else | 849 | |
847 | { | ||
848 | retparam.Add("success", false); | ||
849 | } | ||
850 | ret.Value = retparam; | 850 | ret.Value = retparam; |
851 | return ret; | 851 | return ret; |
852 | } | 852 | } |
@@ -856,14 +856,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
856 | public XmlRpcResponse quote_func(XmlRpcRequest request) | 856 | public XmlRpcResponse quote_func(XmlRpcRequest request) |
857 | { | 857 | { |
858 | Hashtable requestData = (Hashtable) request.Params[0]; | 858 | Hashtable requestData = (Hashtable) request.Params[0]; |
859 | LLUUID agentId = LLUUID.Zero; | 859 | UUID agentId = UUID.Zero; |
860 | int amount = 0; | 860 | int amount = 0; |
861 | Hashtable quoteResponse = new Hashtable(); | 861 | Hashtable quoteResponse = new Hashtable(); |
862 | XmlRpcResponse returnval = new XmlRpcResponse(); | 862 | XmlRpcResponse returnval = new XmlRpcResponse(); |
863 | 863 | ||
864 | if (requestData.ContainsKey("agentId") && requestData.ContainsKey("currencyBuy")) | 864 | if (requestData.ContainsKey("agentId") && requestData.ContainsKey("currencyBuy")) |
865 | { | 865 | { |
866 | Helpers.TryParse((string) requestData["agentId"], out agentId); | 866 | UUID.TryParse((string) requestData["agentId"], out agentId); |
867 | try | 867 | try |
868 | { | 868 | { |
869 | amount = (Int32) requestData["currencyBuy"]; | 869 | amount = (Int32) requestData["currencyBuy"]; |
@@ -894,11 +894,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
894 | public XmlRpcResponse buy_func(XmlRpcRequest request) | 894 | public XmlRpcResponse buy_func(XmlRpcRequest request) |
895 | { | 895 | { |
896 | Hashtable requestData = (Hashtable) request.Params[0]; | 896 | Hashtable requestData = (Hashtable) request.Params[0]; |
897 | LLUUID agentId = LLUUID.Zero; | 897 | UUID agentId = UUID.Zero; |
898 | int amount = 0; | 898 | int amount = 0; |
899 | if (requestData.ContainsKey("agentId") && requestData.ContainsKey("currencyBuy")) | 899 | if (requestData.ContainsKey("agentId") && requestData.ContainsKey("currencyBuy")) |
900 | { | 900 | { |
901 | Helpers.TryParse((string) requestData["agentId"], out agentId); | 901 | UUID.TryParse((string) requestData["agentId"], out agentId); |
902 | try | 902 | try |
903 | { | 903 | { |
904 | amount = (Int32) requestData["currencyBuy"]; | 904 | amount = (Int32) requestData["currencyBuy"]; |
@@ -906,7 +906,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
906 | catch (InvalidCastException) | 906 | catch (InvalidCastException) |
907 | { | 907 | { |
908 | } | 908 | } |
909 | if (agentId != LLUUID.Zero) | 909 | if (agentId != UUID.Zero) |
910 | { | 910 | { |
911 | lock (m_KnownClientFunds) | 911 | lock (m_KnownClientFunds) |
912 | { | 912 | { |
@@ -922,7 +922,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
922 | IClientAPI client = LocateClientObject(agentId); | 922 | IClientAPI client = LocateClientObject(agentId); |
923 | if (client != null) | 923 | if (client != null) |
924 | { | 924 | { |
925 | SendMoneyBalance(client, agentId, client.SessionId, LLUUID.Zero); | 925 | SendMoneyBalance(client, agentId, client.SessionId, UUID.Zero); |
926 | } | 926 | } |
927 | } | 927 | } |
928 | } | 928 | } |
@@ -974,11 +974,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
974 | Hashtable retparam = new Hashtable(); | 974 | Hashtable retparam = new Hashtable(); |
975 | Hashtable requestData = (Hashtable) request.Params[0]; | 975 | Hashtable requestData = (Hashtable) request.Params[0]; |
976 | 976 | ||
977 | LLUUID agentId = LLUUID.Zero; | 977 | UUID agentId = UUID.Zero; |
978 | int amount = 0; | 978 | int amount = 0; |
979 | if (requestData.ContainsKey("agentId") && requestData.ContainsKey("currencyBuy")) | 979 | if (requestData.ContainsKey("agentId") && requestData.ContainsKey("currencyBuy")) |
980 | { | 980 | { |
981 | Helpers.TryParse((string) requestData["agentId"], out agentId); | 981 | UUID.TryParse((string) requestData["agentId"], out agentId); |
982 | try | 982 | try |
983 | { | 983 | { |
984 | amount = (Int32) requestData["currencyBuy"]; | 984 | amount = (Int32) requestData["currencyBuy"]; |
@@ -986,7 +986,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
986 | catch (InvalidCastException) | 986 | catch (InvalidCastException) |
987 | { | 987 | { |
988 | } | 988 | } |
989 | if (agentId != LLUUID.Zero) | 989 | if (agentId != UUID.Zero) |
990 | { | 990 | { |
991 | lock (m_KnownClientFunds) | 991 | lock (m_KnownClientFunds) |
992 | { | 992 | { |
@@ -1002,7 +1002,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1002 | IClientAPI client = LocateClientObject(agentId); | 1002 | IClientAPI client = LocateClientObject(agentId); |
1003 | if (client != null) | 1003 | if (client != null) |
1004 | { | 1004 | { |
1005 | SendMoneyBalance(client, agentId, client.SessionId, LLUUID.Zero); | 1005 | SendMoneyBalance(client, agentId, client.SessionId, UUID.Zero); |
1006 | } | 1006 | } |
1007 | } | 1007 | } |
1008 | } | 1008 | } |
@@ -1020,7 +1020,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1020 | /// Ensures that the agent accounting data is set up in this instance. | 1020 | /// Ensures that the agent accounting data is set up in this instance. |
1021 | /// </summary> | 1021 | /// </summary> |
1022 | /// <param name="agentID"></param> | 1022 | /// <param name="agentID"></param> |
1023 | private void CheckExistAndRefreshFunds(LLUUID agentID) | 1023 | private void CheckExistAndRefreshFunds(UUID agentID) |
1024 | { | 1024 | { |
1025 | lock (m_KnownClientFunds) | 1025 | lock (m_KnownClientFunds) |
1026 | { | 1026 | { |
@@ -1043,7 +1043,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1043 | /// </summary> | 1043 | /// </summary> |
1044 | /// <param name="AgentID"></param> | 1044 | /// <param name="AgentID"></param> |
1045 | /// <returns></returns> | 1045 | /// <returns></returns> |
1046 | private int GetFundsForAgentID(LLUUID AgentID) | 1046 | private int GetFundsForAgentID(UUID AgentID) |
1047 | { | 1047 | { |
1048 | int returnfunds = 0; | 1048 | int returnfunds = 0; |
1049 | lock (m_KnownClientFunds) | 1049 | lock (m_KnownClientFunds) |
@@ -1060,7 +1060,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1060 | return returnfunds; | 1060 | return returnfunds; |
1061 | } | 1061 | } |
1062 | 1062 | ||
1063 | private void SetLocalFundsForAgentID(LLUUID AgentID, int amount) | 1063 | private void SetLocalFundsForAgentID(UUID AgentID, int amount) |
1064 | { | 1064 | { |
1065 | lock (m_KnownClientFunds) | 1065 | lock (m_KnownClientFunds) |
1066 | { | 1066 | { |
@@ -1084,7 +1084,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1084 | /// </summary> | 1084 | /// </summary> |
1085 | /// <param name="AgentID"></param> | 1085 | /// <param name="AgentID"></param> |
1086 | /// <returns></returns> | 1086 | /// <returns></returns> |
1087 | private IClientAPI LocateClientObject(LLUUID AgentID) | 1087 | private IClientAPI LocateClientObject(UUID AgentID) |
1088 | { | 1088 | { |
1089 | ScenePresence tPresence = null; | 1089 | ScenePresence tPresence = null; |
1090 | IClientAPI rclient = null; | 1090 | IClientAPI rclient = null; |
@@ -1110,7 +1110,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1110 | return null; | 1110 | return null; |
1111 | } | 1111 | } |
1112 | 1112 | ||
1113 | private Scene LocateSceneClientIn(LLUUID AgentId) | 1113 | private Scene LocateSceneClientIn(UUID AgentId) |
1114 | { | 1114 | { |
1115 | lock (m_scenel) | 1115 | lock (m_scenel) |
1116 | { | 1116 | { |
@@ -1148,7 +1148,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1148 | /// </summary> | 1148 | /// </summary> |
1149 | /// <param name="RegionID"></param> | 1149 | /// <param name="RegionID"></param> |
1150 | /// <returns></returns> | 1150 | /// <returns></returns> |
1151 | public Scene GetSceneByUUID(LLUUID RegionID) | 1151 | public Scene GetSceneByUUID(UUID RegionID) |
1152 | { | 1152 | { |
1153 | lock (m_scenel) | 1153 | lock (m_scenel) |
1154 | { | 1154 | { |
@@ -1167,7 +1167,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1167 | 1167 | ||
1168 | #region event Handlers | 1168 | #region event Handlers |
1169 | 1169 | ||
1170 | public void requestPayPrice(IClientAPI client, LLUUID objectID) | 1170 | public void requestPayPrice(IClientAPI client, UUID objectID) |
1171 | { | 1171 | { |
1172 | Scene scene = LocateSceneClientIn(client.AgentId); | 1172 | Scene scene = LocateSceneClientIn(client.AgentId); |
1173 | if (scene == null) | 1173 | if (scene == null) |
@@ -1186,7 +1186,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1186 | /// When the client closes the connection we remove their accounting info from memory to free up resources. | 1186 | /// When the client closes the connection we remove their accounting info from memory to free up resources. |
1187 | /// </summary> | 1187 | /// </summary> |
1188 | /// <param name="AgentID"></param> | 1188 | /// <param name="AgentID"></param> |
1189 | public void ClientClosed(LLUUID AgentID) | 1189 | public void ClientClosed(UUID AgentID) |
1190 | { | 1190 | { |
1191 | lock (m_KnownClientFunds) | 1191 | lock (m_KnownClientFunds) |
1192 | { | 1192 | { |
@@ -1204,7 +1204,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1204 | /// Event called Economy Data Request handler. | 1204 | /// Event called Economy Data Request handler. |
1205 | /// </summary> | 1205 | /// </summary> |
1206 | /// <param name="agentId"></param> | 1206 | /// <param name="agentId"></param> |
1207 | public void EconomyDataRequestHandler(LLUUID agentId) | 1207 | public void EconomyDataRequestHandler(UUID agentId) |
1208 | { | 1208 | { |
1209 | IClientAPI user = LocateClientObject(agentId); | 1209 | IClientAPI user = LocateClientObject(agentId); |
1210 | 1210 | ||
@@ -1309,11 +1309,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1309 | 1309 | ||
1310 | if (e.sender != e.receiver) | 1310 | if (e.sender != e.receiver) |
1311 | { | 1311 | { |
1312 | sender.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(e.sender)); | 1312 | sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(e.description), GetFundsForAgentID(e.sender)); |
1313 | } | 1313 | } |
1314 | if (receiver != null) | 1314 | if (receiver != null) |
1315 | { | 1315 | { |
1316 | receiver.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(part.OwnerID)); | 1316 | receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(e.description), GetFundsForAgentID(part.OwnerID)); |
1317 | } | 1317 | } |
1318 | } | 1318 | } |
1319 | return; | 1319 | return; |
@@ -1330,13 +1330,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1330 | { | 1330 | { |
1331 | if (sender != null) | 1331 | if (sender != null) |
1332 | { | 1332 | { |
1333 | sender.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(e.sender)); | 1333 | sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(e.description), GetFundsForAgentID(e.sender)); |
1334 | } | 1334 | } |
1335 | } | 1335 | } |
1336 | 1336 | ||
1337 | if (receiver != null) | 1337 | if (receiver != null) |
1338 | { | 1338 | { |
1339 | receiver.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(e.receiver)); | 1339 | receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(e.description), GetFundsForAgentID(e.receiver)); |
1340 | } | 1340 | } |
1341 | } | 1341 | } |
1342 | else | 1342 | else |
@@ -1369,7 +1369,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1369 | /// Event Handler for when the client logs out. | 1369 | /// Event Handler for when the client logs out. |
1370 | /// </summary> | 1370 | /// </summary> |
1371 | /// <param name="AgentId"></param> | 1371 | /// <param name="AgentId"></param> |
1372 | private void ClientLoggedOut(LLUUID AgentId) | 1372 | private void ClientLoggedOut(UUID AgentId) |
1373 | { | 1373 | { |
1374 | lock (m_rootAgents) | 1374 | lock (m_rootAgents) |
1375 | { | 1375 | { |
@@ -1396,7 +1396,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1396 | /// <param name="avatar"></param> | 1396 | /// <param name="avatar"></param> |
1397 | /// <param name="localLandID"></param> | 1397 | /// <param name="localLandID"></param> |
1398 | /// <param name="regionID"></param> | 1398 | /// <param name="regionID"></param> |
1399 | private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, LLUUID regionID) | 1399 | private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) |
1400 | { | 1400 | { |
1401 | lock (m_rootAgents) | 1401 | lock (m_rootAgents) |
1402 | { | 1402 | { |
@@ -1404,8 +1404,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1404 | { | 1404 | { |
1405 | if (avatar.Scene.RegionInfo.originRegionID != m_rootAgents[avatar.UUID]) | 1405 | if (avatar.Scene.RegionInfo.originRegionID != m_rootAgents[avatar.UUID]) |
1406 | { | 1406 | { |
1407 | |||
1408 | |||
1409 | m_rootAgents[avatar.UUID] = avatar.Scene.RegionInfo.originRegionID; | 1407 | m_rootAgents[avatar.UUID] = avatar.Scene.RegionInfo.originRegionID; |
1410 | 1408 | ||
1411 | 1409 | ||
@@ -1527,7 +1525,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1527 | else | 1525 | else |
1528 | { | 1526 | { |
1529 | string killer = DeadAvatar.Scene.CommsManager.UUIDNameRequestString(part.OwnerID); | 1527 | string killer = DeadAvatar.Scene.CommsManager.UUIDNameRequestString(part.OwnerID); |
1530 | DeadAvatar.ControllingClient.SendAgentAlertMessage("You impailed yourself on " + part.Name + " owned by " + killer +"!", true); | 1528 | DeadAvatar.ControllingClient.SendAgentAlertMessage("You impaled yourself on " + part.Name + " owned by " + killer +"!", true); |
1531 | } | 1529 | } |
1532 | //DeadAvatar.Scene. part.ObjectOwner | 1530 | //DeadAvatar.Scene. part.ObjectOwner |
1533 | } | 1531 | } |
@@ -1564,8 +1562,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1564 | 1562 | ||
1565 | #endregion | 1563 | #endregion |
1566 | 1564 | ||
1567 | public void ObjectBuy(IClientAPI remoteClient, LLUUID agentID, | 1565 | public void ObjectBuy(IClientAPI remoteClient, UUID agentID, |
1568 | LLUUID sessionID, LLUUID groupID, LLUUID categoryID, | 1566 | UUID sessionID, UUID groupID, UUID categoryID, |
1569 | uint localID, byte saleType, int salePrice) | 1567 | uint localID, byte saleType, int salePrice) |
1570 | { | 1568 | { |
1571 | GetClientFunds(remoteClient); | 1569 | GetClientFunds(remoteClient); |