diff options
author | Melanie | 2013-05-25 02:08:54 +0100 |
---|---|---|
committer | Melanie | 2013-05-25 02:08:54 +0100 |
commit | 533bbf033df88fd231eb0e7d2b0aa5a0058163ea (patch) | |
tree | 31d4c19218b254faea81da0338085691e3580260 /OpenSim | |
parent | Meshmerizer: remember to add the copied hull verts to the list of hulls. (diff) | |
download | opensim-SC-533bbf033df88fd231eb0e7d2b0aa5a0058163ea.zip opensim-SC-533bbf033df88fd231eb0e7d2b0aa5a0058163ea.tar.gz opensim-SC-533bbf033df88fd231eb0e7d2b0aa5a0058163ea.tar.bz2 opensim-SC-533bbf033df88fd231eb0e7d2b0aa5a0058163ea.tar.xz |
Update the money framework to allow sending the new style linden "serverside is now viewerside" messages regarding currency
This will require all money modules to be refactored!
Diffstat (limited to 'OpenSim')
9 files changed, 32 insertions, 44 deletions
diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index 10bfa8f..f805d69 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs | |||
@@ -766,7 +766,7 @@ namespace OpenSim.Groups | |||
766 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "Insufficient funds to create a group."); | 766 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "Insufficient funds to create a group."); |
767 | return UUID.Zero; | 767 | return UUID.Zero; |
768 | } | 768 | } |
769 | money.ApplyCharge(remoteClient.AgentId, money.GroupCreationCharge, "Group Creation"); | 769 | money.ApplyCharge(remoteClient.AgentId, money.GroupCreationCharge, MoneyTransactionType.GroupCreate); |
770 | } | 770 | } |
771 | string reason = string.Empty; | 771 | string reason = string.Empty; |
772 | UUID groupID = m_groupData.CreateGroup(remoteClient.AgentId, name, charter, showInList, insigniaID, membershipFee, openEnrollment, | 772 | UUID groupID = m_groupData.CreateGroup(remoteClient.AgentId, name, charter, showInList, insigniaID, membershipFee, openEnrollment, |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 1fffeff..65f8395 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -1159,7 +1159,8 @@ namespace OpenSim.Framework | |||
1159 | void SendTeleportStart(uint flags); | 1159 | void SendTeleportStart(uint flags); |
1160 | void SendTeleportProgress(uint flags, string message); | 1160 | void SendTeleportProgress(uint flags, string message); |
1161 | 1161 | ||
1162 | void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance); | 1162 | void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item); |
1163 | |||
1163 | void SendPayPrice(UUID objectID, int[] payPrice); | 1164 | void SendPayPrice(UUID objectID, int[] payPrice); |
1164 | 1165 | ||
1165 | void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations); | 1166 | void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations); |
@@ -1254,8 +1255,6 @@ namespace OpenSim.Framework | |||
1254 | void SendDialog(string objectname, UUID objectID, UUID ownerID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, | 1255 | void SendDialog(string objectname, UUID objectID, UUID ownerID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, |
1255 | string[] buttonlabels); | 1256 | string[] buttonlabels); |
1256 | 1257 | ||
1257 | bool AddMoney(int debit); | ||
1258 | |||
1259 | /// <summary> | 1258 | /// <summary> |
1260 | /// Update the client as to where the sun is currently located. | 1259 | /// Update the client as to where the sun is currently located. |
1261 | /// </summary> | 1260 | /// </summary> |
diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs index 1e09728..52f3e83 100644 --- a/OpenSim/Framework/IMoneyModule.cs +++ b/OpenSim/Framework/IMoneyModule.cs | |||
@@ -38,7 +38,8 @@ namespace OpenSim.Framework | |||
38 | int GetBalance(UUID agentID); | 38 | int GetBalance(UUID agentID); |
39 | bool UploadCovered(UUID agentID, int amount); | 39 | bool UploadCovered(UUID agentID, int amount); |
40 | bool AmountCovered(UUID agentID, int amount); | 40 | bool AmountCovered(UUID agentID, int amount); |
41 | void ApplyCharge(UUID agentID, int amount, string text); | 41 | void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type); |
42 | void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData); | ||
42 | void ApplyUploadCharge(UUID agentID, int amount, string text); | 43 | void ApplyUploadCharge(UUID agentID, int amount, string text); |
43 | 44 | ||
44 | int UploadCharge { get; } | 45 | int UploadCharge { get; } |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index dd8ef9c..e47397d 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -345,7 +345,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
345 | 345 | ||
346 | // protected HashSet<uint> m_attachmentsSent; | 346 | // protected HashSet<uint> m_attachmentsSent; |
347 | 347 | ||
348 | private int m_moneyBalance; | ||
349 | private int m_animationSequenceNumber = 1; | 348 | private int m_animationSequenceNumber = 1; |
350 | private bool m_SendLogoutPacketWhenClosing = true; | 349 | private bool m_SendLogoutPacketWhenClosing = true; |
351 | 350 | ||
@@ -420,7 +419,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
420 | public string Name { get { return FirstName + " " + LastName; } } | 419 | public string Name { get { return FirstName + " " + LastName; } } |
421 | 420 | ||
422 | public uint CircuitCode { get { return m_circuitCode; } } | 421 | public uint CircuitCode { get { return m_circuitCode; } } |
423 | public int MoneyBalance { get { return m_moneyBalance; } } | ||
424 | public int NextAnimationSequenceNumber { get { return m_animationSequenceNumber++; } } | 422 | public int NextAnimationSequenceNumber { get { return m_animationSequenceNumber++; } } |
425 | 423 | ||
426 | /// <summary> | 424 | /// <summary> |
@@ -483,7 +481,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
483 | m_firstName = sessionInfo.LoginInfo.First; | 481 | m_firstName = sessionInfo.LoginInfo.First; |
484 | m_lastName = sessionInfo.LoginInfo.Last; | 482 | m_lastName = sessionInfo.LoginInfo.Last; |
485 | m_startpos = sessionInfo.LoginInfo.StartPos; | 483 | m_startpos = sessionInfo.LoginInfo.StartPos; |
486 | m_moneyBalance = 1000; | ||
487 | 484 | ||
488 | m_udpServer = udpServer; | 485 | m_udpServer = udpServer; |
489 | m_udpClient = udpClient; | 486 | m_udpClient = udpClient; |
@@ -1538,7 +1535,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1538 | OutPacket(tpProgress, ThrottleOutPacketType.Unknown); | 1535 | OutPacket(tpProgress, ThrottleOutPacketType.Unknown); |
1539 | } | 1536 | } |
1540 | 1537 | ||
1541 | public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) | 1538 | public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item) |
1542 | { | 1539 | { |
1543 | MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket)PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply); | 1540 | MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket)PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply); |
1544 | money.MoneyData.AgentID = AgentId; | 1541 | money.MoneyData.AgentID = AgentId; |
@@ -1546,7 +1543,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1546 | money.MoneyData.TransactionSuccess = success; | 1543 | money.MoneyData.TransactionSuccess = success; |
1547 | money.MoneyData.Description = description; | 1544 | money.MoneyData.Description = description; |
1548 | money.MoneyData.MoneyBalance = balance; | 1545 | money.MoneyData.MoneyBalance = balance; |
1549 | money.TransactionInfo.ItemDescription = Util.StringToBytes256("NONE"); | 1546 | money.TransactionInfo.TransactionType = transactionType; |
1547 | money.TransactionInfo.SourceID = sourceID; | ||
1548 | money.TransactionInfo.IsSourceGroup = sourceIsGroup; | ||
1549 | money.TransactionInfo.DestID = destID; | ||
1550 | money.TransactionInfo.IsDestGroup = destIsGroup; | ||
1551 | money.TransactionInfo.Amount = amount; | ||
1552 | money.TransactionInfo.ItemDescription = Util.StringToBytes256(item); | ||
1553 | |||
1550 | OutPacket(money, ThrottleOutPacketType.Task); | 1554 | OutPacket(money, ThrottleOutPacketType.Task); |
1551 | } | 1555 | } |
1552 | 1556 | ||
@@ -2279,6 +2283,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2279 | /// <returns></returns> | 2283 | /// <returns></returns> |
2280 | public AgentAlertMessagePacket BuildAgentAlertPacket(string message, bool modal) | 2284 | public AgentAlertMessagePacket BuildAgentAlertPacket(string message, bool modal) |
2281 | { | 2285 | { |
2286 | // Prepend a slash to make the message come up in the top right | ||
2287 | // again. | ||
2288 | // Allow special formats to be sent from aware modules. | ||
2289 | if (!modal && !message.StartsWith("ALERT: ") && !message.StartsWith("NOTIFY: ") && message != "Home position set." && message != "You died and have been teleported to your home location") | ||
2290 | message = "/" + message; | ||
2282 | AgentAlertMessagePacket alertPack = (AgentAlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AgentAlertMessage); | 2291 | AgentAlertMessagePacket alertPack = (AgentAlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AgentAlertMessage); |
2283 | alertPack.AgentData.AgentID = AgentId; | 2292 | alertPack.AgentData.AgentID = AgentId; |
2284 | alertPack.AlertData.Message = Util.StringToBytes256(message); | 2293 | alertPack.AlertData.Message = Util.StringToBytes256(message); |
@@ -11933,17 +11942,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11933 | m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method); | 11942 | m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method); |
11934 | } | 11943 | } |
11935 | 11944 | ||
11936 | public bool AddMoney(int debit) | ||
11937 | { | ||
11938 | if (m_moneyBalance + debit >= 0) | ||
11939 | { | ||
11940 | m_moneyBalance += debit; | ||
11941 | SendMoneyBalance(UUID.Zero, true, Util.StringToBytes256("Poof Poof!"), m_moneyBalance); | ||
11942 | return true; | ||
11943 | } | ||
11944 | return false; | ||
11945 | } | ||
11946 | |||
11947 | protected void HandleAutopilot(Object sender, string method, List<String> args) | 11945 | protected void HandleAutopilot(Object sender, string method, List<String> args) |
11948 | { | 11946 | { |
11949 | float locx = 0; | 11947 | float locx = 0; |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 118635d..3726191 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -1056,7 +1056,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1056 | { | 1056 | { |
1057 | } | 1057 | } |
1058 | 1058 | ||
1059 | public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) | 1059 | public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item) |
1060 | { | 1060 | { |
1061 | 1061 | ||
1062 | } | 1062 | } |
@@ -1196,11 +1196,6 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1196 | 1196 | ||
1197 | } | 1197 | } |
1198 | 1198 | ||
1199 | public bool AddMoney(int debit) | ||
1200 | { | ||
1201 | return true; | ||
1202 | } | ||
1203 | |||
1204 | public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition) | 1199 | public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition) |
1205 | { | 1200 | { |
1206 | 1201 | ||
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 29f9591..32fb54b 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -764,7 +764,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
764 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got insufficient funds to create a group."); | 764 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got insufficient funds to create a group."); |
765 | return UUID.Zero; | 765 | return UUID.Zero; |
766 | } | 766 | } |
767 | money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, "Group Creation"); | 767 | money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, MoneyTransactionType.GroupCreate); |
768 | } | 768 | } |
769 | UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient)); | 769 | UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient)); |
770 | 770 | ||
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 35f44d0..1345db9 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | |||
@@ -191,9 +191,14 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
191 | // Please do not refactor these to be just one method | 191 | // Please do not refactor these to be just one method |
192 | // Existing implementations need the distinction | 192 | // Existing implementations need the distinction |
193 | // | 193 | // |
194 | public void ApplyCharge(UUID agentID, int amount, string text) | 194 | public void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData) |
195 | { | 195 | { |
196 | } | 196 | } |
197 | |||
198 | public void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type) | ||
199 | { | ||
200 | } | ||
201 | |||
197 | public void ApplyUploadCharge(UUID agentID, int amount, string text) | 202 | public void ApplyUploadCharge(UUID agentID, int amount, string text) |
198 | { | 203 | { |
199 | } | 204 | } |
@@ -322,7 +327,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
322 | client.SendAlertMessage(e.Message + " "); | 327 | client.SendAlertMessage(e.Message + " "); |
323 | } | 328 | } |
324 | 329 | ||
325 | client.SendMoneyBalance(TransactionID, true, new byte[0], returnfunds); | 330 | client.SendMoneyBalance(TransactionID, true, new byte[0], returnfunds, 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty); |
326 | } | 331 | } |
327 | else | 332 | else |
328 | { | 333 | { |
@@ -385,12 +390,12 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
385 | { | 390 | { |
386 | if (sender != null) | 391 | if (sender != null) |
387 | { | 392 | { |
388 | sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(senderID)); | 393 | sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(senderID), 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty); |
389 | } | 394 | } |
390 | 395 | ||
391 | if (receiver != null) | 396 | if (receiver != null) |
392 | { | 397 | { |
393 | receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(receiverID)); | 398 | receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(receiverID), 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty); |
394 | } | 399 | } |
395 | } | 400 | } |
396 | } | 401 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 553443f..592e4e1 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -694,7 +694,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
694 | { | 694 | { |
695 | } | 695 | } |
696 | 696 | ||
697 | public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) | 697 | public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item) |
698 | { | 698 | { |
699 | } | 699 | } |
700 | 700 | ||
@@ -866,11 +866,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
866 | { | 866 | { |
867 | } | 867 | } |
868 | 868 | ||
869 | public bool AddMoney(int debit) | ||
870 | { | ||
871 | return false; | ||
872 | } | ||
873 | |||
874 | public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) | 869 | public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) |
875 | { | 870 | { |
876 | } | 871 | } |
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 09e751a..c660501 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -651,7 +651,7 @@ namespace OpenSim.Tests.Common.Mock | |||
651 | { | 651 | { |
652 | } | 652 | } |
653 | 653 | ||
654 | public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) | 654 | public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item) |
655 | { | 655 | { |
656 | } | 656 | } |
657 | 657 | ||
@@ -875,11 +875,6 @@ namespace OpenSim.Tests.Common.Mock | |||
875 | 875 | ||
876 | } | 876 | } |
877 | 877 | ||
878 | public bool AddMoney(int debit) | ||
879 | { | ||
880 | return false; | ||
881 | } | ||
882 | |||
883 | public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) | 878 | public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) |
884 | { | 879 | { |
885 | } | 880 | } |