aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2013-05-25 01:58:50 +0200
committerMelanie2013-05-25 01:58:50 +0200
commit0086c3b5fb24f4a25fe2e28f9cedcaa41c70b36c (patch)
treea315dc4368a92f15b39d516f3a3dc5eea9eeeff8 /OpenSim
parentReset "Show in search" on parcels cut off other parcels that are in search (diff)
downloadopensim-SC-0086c3b5fb24f4a25fe2e28f9cedcaa41c70b36c.zip
opensim-SC-0086c3b5fb24f4a25fe2e28f9cedcaa41c70b36c.tar.gz
opensim-SC-0086c3b5fb24f4a25fe2e28f9cedcaa41c70b36c.tar.bz2
opensim-SC-0086c3b5fb24f4a25fe2e28f9cedcaa41c70b36c.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')
-rw-r--r--OpenSim/Addons/Groups/GroupsModule.cs2
-rw-r--r--OpenSim/Framework/IClientAPI.cs5
-rw-r--r--OpenSim/Framework/IMoneyModule.cs3
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs30
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs7
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs13
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs7
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs7
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 c88828b..ad3471a 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -1168,7 +1168,8 @@ namespace OpenSim.Framework
1168 void SendTeleportStart(uint flags); 1168 void SendTeleportStart(uint flags);
1169 void SendTeleportProgress(uint flags, string message); 1169 void SendTeleportProgress(uint flags, string message);
1170 1170
1171 void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance); 1171 void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item);
1172
1172 void SendPayPrice(UUID objectID, int[] payPrice); 1173 void SendPayPrice(UUID objectID, int[] payPrice);
1173 1174
1174 void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations); 1175 void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations);
@@ -1266,8 +1267,6 @@ namespace OpenSim.Framework
1266 void SendDialog(string objectname, UUID objectID, UUID ownerID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, 1267 void SendDialog(string objectname, UUID objectID, UUID ownerID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch,
1267 string[] buttonlabels); 1268 string[] buttonlabels);
1268 1269
1269 bool AddMoney(int debit);
1270
1271 /// <summary> 1270 /// <summary>
1272 /// Update the client as to where the sun is currently located. 1271 /// Update the client as to where the sun is currently located.
1273 /// </summary> 1272 /// </summary>
diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs
index 7378d2e..415b7df 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 void MoveMoney(UUID fromUser, UUID toUser, int amount, string text); 44 void MoveMoney(UUID fromUser, UUID toUser, int amount, string text);
44 45
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index d5b7ec8..7208f08 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -354,7 +354,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
354 354
355// protected HashSet<uint> m_attachmentsSent; 355// protected HashSet<uint> m_attachmentsSent;
356 356
357 private int m_moneyBalance;
358 private bool m_deliverPackets = true; 357 private bool m_deliverPackets = true;
359 private int m_animationSequenceNumber = 1; 358 private int m_animationSequenceNumber = 1;
360 private bool m_SendLogoutPacketWhenClosing = true; 359 private bool m_SendLogoutPacketWhenClosing = true;
@@ -438,7 +437,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
438 public string Name { get { return FirstName + " " + LastName; } } 437 public string Name { get { return FirstName + " " + LastName; } }
439 438
440 public uint CircuitCode { get { return m_circuitCode; } } 439 public uint CircuitCode { get { return m_circuitCode; } }
441 public int MoneyBalance { get { return m_moneyBalance; } }
442 public int NextAnimationSequenceNumber { get { return m_animationSequenceNumber++; } } 440 public int NextAnimationSequenceNumber { get { return m_animationSequenceNumber++; } }
443 441
444 /// <summary> 442 /// <summary>
@@ -502,7 +500,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
502 m_firstName = sessionInfo.LoginInfo.First; 500 m_firstName = sessionInfo.LoginInfo.First;
503 m_lastName = sessionInfo.LoginInfo.Last; 501 m_lastName = sessionInfo.LoginInfo.Last;
504 m_startpos = sessionInfo.LoginInfo.StartPos; 502 m_startpos = sessionInfo.LoginInfo.StartPos;
505 m_moneyBalance = 1000;
506 503
507 m_udpServer = udpServer; 504 m_udpServer = udpServer;
508 m_udpClient = udpClient; 505 m_udpClient = udpClient;
@@ -1526,7 +1523,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1526 OutPacket(tpProgress, ThrottleOutPacketType.Unknown); 1523 OutPacket(tpProgress, ThrottleOutPacketType.Unknown);
1527 } 1524 }
1528 1525
1529 public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) 1526 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)
1530 { 1527 {
1531 MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket)PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply); 1528 MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket)PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply);
1532 money.MoneyData.AgentID = AgentId; 1529 money.MoneyData.AgentID = AgentId;
@@ -1534,7 +1531,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1534 money.MoneyData.TransactionSuccess = success; 1531 money.MoneyData.TransactionSuccess = success;
1535 money.MoneyData.Description = description; 1532 money.MoneyData.Description = description;
1536 money.MoneyData.MoneyBalance = balance; 1533 money.MoneyData.MoneyBalance = balance;
1537 money.TransactionInfo.ItemDescription = Util.StringToBytes256("NONE"); 1534 money.TransactionInfo.TransactionType = transactionType;
1535 money.TransactionInfo.SourceID = sourceID;
1536 money.TransactionInfo.IsSourceGroup = sourceIsGroup;
1537 money.TransactionInfo.DestID = destID;
1538 money.TransactionInfo.IsDestGroup = destIsGroup;
1539 money.TransactionInfo.Amount = amount;
1540 money.TransactionInfo.ItemDescription = Util.StringToBytes256(item);
1541
1538 OutPacket(money, ThrottleOutPacketType.Task); 1542 OutPacket(money, ThrottleOutPacketType.Task);
1539 } 1543 }
1540 1544
@@ -2278,6 +2282,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2278 /// <returns></returns> 2282 /// <returns></returns>
2279 public AgentAlertMessagePacket BuildAgentAlertPacket(string message, bool modal) 2283 public AgentAlertMessagePacket BuildAgentAlertPacket(string message, bool modal)
2280 { 2284 {
2285 // Prepend a slash to make the message come up in the top right
2286 // again.
2287 // Allow special formats to be sent from aware modules.
2288 if (!modal && !message.StartsWith("ALERT: ") && !message.StartsWith("NOTIFY: ") && message != "Home position set." && message != "You died and have been teleported to your home location")
2289 message = "/" + message;
2281 AgentAlertMessagePacket alertPack = (AgentAlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AgentAlertMessage); 2290 AgentAlertMessagePacket alertPack = (AgentAlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AgentAlertMessage);
2282 alertPack.AgentData.AgentID = AgentId; 2291 alertPack.AgentData.AgentID = AgentId;
2283 alertPack.AlertData.Message = Util.StringToBytes256(message); 2292 alertPack.AlertData.Message = Util.StringToBytes256(message);
@@ -12217,17 +12226,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12217 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method); 12226 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method);
12218 } 12227 }
12219 12228
12220 public bool AddMoney(int debit)
12221 {
12222 if (m_moneyBalance + debit >= 0)
12223 {
12224 m_moneyBalance += debit;
12225 SendMoneyBalance(UUID.Zero, true, Util.StringToBytes256("Poof Poof!"), m_moneyBalance);
12226 return true;
12227 }
12228 return false;
12229 }
12230
12231 protected void HandleAutopilot(Object sender, string method, List<String> args) 12229 protected void HandleAutopilot(Object sender, string method, List<String> args)
12232 { 12230 {
12233 float locx = 0; 12231 float locx = 0;
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 686c605..dd72cfb 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -1055,7 +1055,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1055 { 1055 {
1056 } 1056 }
1057 1057
1058 public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) 1058 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)
1059 { 1059 {
1060 1060
1061 } 1061 }
@@ -1200,11 +1200,6 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1200 1200
1201 } 1201 }
1202 1202
1203 public bool AddMoney(int debit)
1204 {
1205 return true;
1206 }
1207
1208 public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition) 1203 public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition)
1209 { 1204 {
1210 1205
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index d764936..d0a5989 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 be020e4..0c9fdb9 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 7918c22..4674489 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -698,7 +698,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
698 { 698 {
699 } 699 }
700 700
701 public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) 701 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)
702 { 702 {
703 } 703 }
704 704
@@ -874,11 +874,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
874 { 874 {
875 } 875 }
876 876
877 public bool AddMoney(int debit)
878 {
879 return false;
880 }
881
882 public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) 877 public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase)
883 { 878 {
884 } 879 }
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 07de06c..dce2fd7 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -652,7 +652,7 @@ namespace OpenSim.Tests.Common.Mock
652 { 652 {
653 } 653 }
654 654
655 public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) 655 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)
656 { 656 {
657 } 657 }
658 658
@@ -880,11 +880,6 @@ namespace OpenSim.Tests.Common.Mock
880 880
881 } 881 }
882 882
883 public bool AddMoney(int debit)
884 {
885 return false;
886 }
887
888 public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) 883 public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase)
889 { 884 {
890 } 885 }