OSDN Git Service

improved error handling on ADDPRODUCT
[radegast/radegast.git] / plugins / Radegast.Plugin.EVOVend / EVOvendPlugin.cs
index 28b733a..0e08253 100644 (file)
@@ -111,15 +111,17 @@ namespace Radegast.Plugin.EVOVend
             else
                 param.Add("price", "0");
             param.Add("texture", "");
-
+            param.Add("botUUID", client.Self.AgentID.ToString());
             string str = this.RequestVendor("ADDPRODUCT", param);
-            int result = Int32.Parse(str);
+            int result;
+
+            Int32.TryParse(str, out result);
 
             if(result > 0){
                 instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": Product " + e.Item.Name + " from Agent " + offeredAgent.ToString() + " accepted and inserted", ChatBufferTextStyle.StatusBlue);
-                client.Self.InstantMessage(offeredAgent, "Your Object has been transfered successfully. Please visit " + this.loginURL + " for further steps"); 
+                client.Self.InstantMessage(offeredAgent, "Your Object has been transfered successfully. Please visit " + this.loginURL + " for further steps"); 
             } else
-                instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": Failed to insert " + e.Item.Name + " from Agent " + offeredAgent.ToString(), ChatBufferTextStyle.Error);
+                instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": ADDPRODUCT FAILED: "+str+" [ITEM: " + e.Item.Name + " AGENT: " + offeredAgent.ToString() + "]", ChatBufferTextStyle.Error);
 
             offeredAgent = UUID.Zero;
         }
@@ -426,8 +428,10 @@ namespace Radegast.Plugin.EVOVend
             isSending = true;
             
             Inventory.RootFolder.OwnerID = client.Self.AgentID;
-
-            var strContent = this.RequestVendor("GETOUTSTANDING");
+            
+            Dictionary<string, string> param = new Dictionary<string, string>();
+            param.Add("botUUID", client.Self.AgentID.ToString());
+            var strContent = this.RequestVendor("GETOUTSTANDING", param);
             List<DeliveryQueue> queue = this.parseResponse(strContent);
             instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": " + queue.Count + " Items in Queue List");