View Single Post
  #5  
Old 06-02-2008, 04:07 PM
nuttheawsome
Fire Beetle
 
Join Date: Apr 2008
Location: Knoxville
Posts: 3
Default

Sorry for the delay. Ive been moving for a few days, so my internet hasn't been up until today.

Anyway. I find it odd that its crashing the zone server..hmm. I haven't notice any crashes on the build over here. We run a much smaller player base though.

Here is the diff:

Code:
--- tradeskills.cpp   7 Jun 2007 07:03:46 -0000   1.18
+++ tradeskills.cpp   14 May 2008 23:52:27 -0000
@@ -885,7 +885,7 @@
        " WHERE tre.recipe_id IN (%s)"
        " GROUP BY tre.recipe_id HAVING sum(tre.componentcount) = %u"
        "  AND sum(tre.item_id * tre.componentcount) = %u", buf2, count, sum);
-      
+
       if (!RunQuery(query, qlen, errbuf, &result)) {
          LogFile->write(EQEMuLog::Error, "Error in GetTradeRecipe, re-query: %s", query);
          safe_delete_array(query);
@@ -896,14 +896,52 @@
    
       qcount = mysql_num_rows(result);
    }
+   
+   //updated this section to fix the tradeskill bug of multiple recipies, but different containers.
+   /*
    if (qcount != 1) {
       if(qcount > 1) {
          LogFile->write(EQEMuLog::Error, "Combine error: Recipe is not unique!");
+      
+      
       }
       //else, just not found i guess..
       return(false);
+   }*/
+   
+   if(qcount < 1)
+      return(false);
+   
+   
+   if(qcount > 1)
+   {
+      //The recipe is not unique, so we need to compare the container were using.
+      uint32 containerId = container->GetID();
+
+      qlen = MakeAnyLenString(&query,"SELECT tre.recipe_id FROM tradeskill_recipe_entries as tre WHERE tre.recipe_id IN (%s)"
+      " GROUP BY tre.item_id HAVING tre.item_id = %u;",buf2,containerId);
+      
+      if (!RunQuery(query, qlen, errbuf, &result)) {
+         LogFile->write(EQEMuLog::Error, "Error in GetTradeRecipe, re-query: %s", query);
+         safe_delete_array(query);
+         LogFile->write(EQEMuLog::Error, "Error in GetTradeRecipe, error: %s", errbuf);
+         return(false);
+      }
+      safe_delete_array(query);
+
+      
+      uint32 resultRowTotal = mysql_num_rows(result); 
+      
+      //If all the recipes were correct, but no container type matched, drop out.
+      if(resultRowTotal == 0 || resultRowTotal > 1){
+         LogFile->write(EQEMuLog::Error, "Combine error: Recipe is not unique OR incorrect container is being used!");
+         return(false);
+      }
+   
    }
    
+
+
    row = mysql_fetch_row(result);
    uint32 recipe_id = (uint32)atoi(row[0]);
    mysql_free_result(result);

Success, CVS operation completed
If this isn't what you needed, just let me know(Im a little new to using CVS and such)

Ill take some time and retrace the code and see if I can find any problems or paths that aren't being handled and see if I can get to the bottom of this.
Reply With Quote