bogus item stats

Sync Blizzards' Armory data with WoWRoster (addon depreciated no longer works see ApiSync)

Moderators: Ulminia, poetter

bogus item stats

Postby Shell » Wed Aug 08, 2007 1:17 am

A good portion of the toons in my guild get the following under "Equipped Item Stats"


Set-Cookie: JSESSIONID=0AE025FFF41A03AC4BC9B6A29CBD6492.app08_06; Path=/

or something similar....

Some items are coming through okay, but the majority of stats are coming up like that.

This is with the latest version of ArmorySync & the Gradual Update mod....
Last edited by Shell on Wed Aug 08, 2007 1:19 am, edited 1 time in total.
Shell
WR.net Apprentice
WR.net Apprentice
 
Posts: 17
Joined: Mon Jul 23, 2007 10:36 am

bogus item stats

Postby Kristoff22 » Wed Aug 08, 2007 5:20 am

It's either the latest version of AS or the gradual update mod... not both. Which one was installed last?
Kristoff22
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 103
Joined: Mon Nov 13, 2006 5:54 am

bogus item stats

Postby Pugro » Wed Aug 08, 2007 6:11 am

I'll run a test tomorrow using non-curl on the same data with and without the mod
--------------------------------
Pugro_
Ice and Trinity Guilds, Nordrassil, EU PvE
www.iceguild.org.uk, www.trinityguild.net
Image
Pugro
WR.net Journeyman
WR.net Journeyman
 
Posts: 79
Joined: Fri Jul 07, 2006 2:14 pm
Location: London, UK

Re: bogus item stats

Postby Shell » Wed Aug 08, 2007 6:23 am

Pugro wrote:I'll run a test tomorrow using non-curl on the same data with and without the mod


Thanks, Pug....I'm gonna poke at it myself, I'm wondering if it's the changed parsing function that's giving problems...maybe a dropped " or something.
Shell
WR.net Apprentice
WR.net Apprentice
 
Posts: 17
Joined: Mon Jul 23, 2007 10:36 am

Re: bogus item stats

Postby Shell » Wed Aug 08, 2007 7:02 am

I think I found where the problem starts...just not sure where to kill it. My items are looking like this in the source code for the char page:

Code: Select all
var overlib_1 = "<span style=\"color:#0070dd;font-size:12px;font-weight:bold;\">HTTP/1.1 200 OK
<\/span><br \/>Date: Tue, 07 Aug 2007 16:54:09 GMT
<br \/>Server: Apache
<br \/><span style=\"color:#00ff00;\">Set-Cookie: JSESSIONID=AB53B8894E732B24A7915E22EF29398C.app02_05; Path=/
<\/span><br \/>Content-Language: en-US
<br \/>Vary: Accept-Encoding
<br \/>Connection: close
<br \/>Content-Type: text/html;charset=UTF-8
<br \/>
<br \/><br \/><br \/>Crown of Endless Knowledge <br \/>Binds when equippedHeadCloth<br \/>114 Armor<br \/>+22 Stamina<br \/>+30 Intellect<br \/>+23 Spirit<br \/>Durability: 43 / 50Requires Level 66<br \/><span style=\"color:#00ff00;\">Equip: Increases damage and healing done by magical spells and effects by up to 36.<\/span><br \/><br \/>Source: Drop<br \/>";


That's the overlib_1 variable....so it does look like something in the parser isn't stripping out the variables correctly.

for contrast, this is what one from a working site looks like:
Code: Select all
   var overlib_1 = "<span style=\"color:#0070dd;font-size:12px;font-weight:bold;\">Overlord\'s Helmet of Second Sight <\/span><br \/>Binds when picked upHeadPlate<br \/>898 Armor<br \/>+29 Strength<br \/>+22 Stamina<br \/>+4 Spell Damage and +4 Stamina<br \/>+8 Intellect<br \/>+8 Intellect<br \/>Socket Bonus: +4 Strength<br \/>Durability: 80 / 80<br \/><span style=\"color:#00ff00;\">Equip: Improves hit rating by 13.<\/span><br \/><span style=\"color:#00ff00;\">Equip: Improves critical strike rating by 24.<\/span><br \/><span style=\"color:#00ff00;\">Equip: Allows the bearer to see into the ghost world while in Shadowmoon Valley.<\/span><br \/><br \/>Source: Quest Reward<br \/>";


and not all items are looking like that. Just the first 8 overlib variables, then 26 through 37...
Shell
WR.net Apprentice
WR.net Apprentice
 
Posts: 17
Joined: Mon Jul 23, 2007 10:36 am

bogus item stats

Postby Pugro » Wed Aug 08, 2007 5:29 pm

Just tried it on my own guild with the gradual updates mod and everything was fine...until I disabled Curl. Seems that extra data is being returned that's being saved.

When I get a chance I'll see where it's comming from.

Pugs_
--------------------------------
Pugro_
Ice and Trinity Guilds, Nordrassil, EU PvE
www.iceguild.org.uk, www.trinityguild.net
Image
Pugro
WR.net Journeyman
WR.net Journeyman
 
Posts: 79
Joined: Fri Jul 07, 2006 2:14 pm
Location: London, UK

Re: bogus item stats

Postby Shell » Thu Aug 09, 2007 10:43 am

the annoying thing is, my webhost says curl is enabled, but I get 500 errors whenever I enable it:

Code: Select all
CURL Information - libcurl/7.11.2 OpenSSL/0.9.7d ipv6 zlib/1.2.1.1
Shell
WR.net Apprentice
WR.net Apprentice
 
Posts: 17
Joined: Mon Jul 23, 2007 10:36 am

Re: bogus item stats

Postby Pugro » Thu Aug 09, 2007 4:12 pm

ok, think I've got it. Basically when using non-curl to get the item information from the armory it returns the HTML headers into the string when you are not using CURL..

So you get this:
Code: Select all
HTTP/1.1 200 OK
Date: Thu, 09 Aug 2007 08:07:10 GMT
Server: Apache
Set-Cookie: JSESSIONID=52039C707C70443FEE23F288A9EF6E57.app12_02; Path=/
Content-Language: en-GB
Connection: close
Content-Type: text/html;charset=UTF-8

<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<div class="myTable">
<span style="display:block; height:1px; width:150px; margin:0; _margin:-2px; padding:0; line-height:1px;"></span><span class="myWhite myBold myItemName">Neophyte's Shirt </span>
<br>Shirt<br>
<br>
<span style="float: left;" class="tooltipContentSpecial">Source: </span>Vendor</div>
</td>
</tr>
</tbody>
</table>


instead of this:
Code: Select all
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<div class="myTable">
<span style="display:block; height:1px; width:150px; margin:0; _margin:-2px; padding:0; line-height:1px;"></span><span class="myWhite myBold myItemName">Neophyte's Shirt </span>
<br>Shirt<br>
<br>
<span style="float: left;" class="tooltipContentSpecial">Source: </span>Vendor</div>
</td>
</tr>
</tbody>
</table>


To get around this you can add an extra bit to the getContentFileSocket function in functions.general.php so that if the first character of the returned data is not a "<" then strip of everything until the first "<".

Like so:

Code: Select all
function getContentFileSocket($host, $page, $args, $sendAsBrowser = true) {
   global $addon_conf;

   $request = "/" . $page . "?" . $args;
   $useragent = "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2";
//   $useragent = "User-Agent: Firefox/2";

   $cookie = "cookieLangId=".$addon_conf['ArmorySync']['ArmoryLocale'].";";
   $content = '';

   if ($addon_conf['ArmorySync']['DebugLevel'] >= 1) {
      print "GetContentFileSocket: " . $request. ", " . $sendAsBrowser . ", " . $useragent . "<br>";
   }

   if ($fp = fsockopen($host, 80, $errno, $errstr, 30)) {
      stream_set_timeout($fp, 30);
      $buffer = '';

      $headers =
         "GET $request HTTP/1.0\r\n" .
         "Host: $host\r\n".
         (($sendAsBrowser) ? $useragent : "") .
         //"Content-Length: " . strlen($request) . "\r\n" .
         "\r\nConnection: close\r\n".
         "Cookie: $cookie\r\n".
         "\r\n";

      if ($addon_conf['ArmorySync']['DebugLevel'] >= 1) {
         print $headers . "<br>";
      }

      fwrite($fp, $headers);
      while (!feof($fp)) {
        $content .= fread($fp, 8192);
    }
    fclose($fp);
   } else {
      //Throw Error
      print "CRITICAL ERROR - socket not connected";
   }

   if ($addon_conf['ArmorySync']['DebugLevel'] >= 2) {
      print $content. "<br>";
   }


   //If not using CURL we may get the header returned before the HTML table..

   $pos = stripos ($content, '<');
   if ($pos != 0){
      //Need to trim header off..
      $content = substr ($content, $pos);
   }
   
   

   //Now split off the HTML header..
   //anything up to the first <?xml need to go
   $pos = stripos ($content, '<?xml');
   if ($pos != 0){
      //Need to trim header off..
      $content = substr ($content, $pos);
   }
   
   

   return $content;
}


Again, anyone got a more elegent solution, please correct me!
--------------------------------
Pugro_
Ice and Trinity Guilds, Nordrassil, EU PvE
www.iceguild.org.uk, www.trinityguild.net
Image
Pugro
WR.net Journeyman
WR.net Journeyman
 
Posts: 79
Joined: Fri Jul 07, 2006 2:14 pm
Location: London, UK

bogus item stats

Postby PleegWat » Thu Aug 09, 2007 6:25 pm

That should work, but it would be better to look for the blank line after the headers (\r\n\r\n). That's defined as the end of the headers.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

bogus item stats

Postby Pugro » Thu Aug 09, 2007 6:41 pm

Cheers PleegWat, I was also fairly curious as to why the same call sometimes returned the headers and sometimes not. Guess it's up to the Blizz servers which headers they return for each call.
--------------------------------
Pugro_
Ice and Trinity Guilds, Nordrassil, EU PvE
www.iceguild.org.uk, www.trinityguild.net
Image
Pugro
WR.net Journeyman
WR.net Journeyman
 
Posts: 79
Joined: Fri Jul 07, 2006 2:14 pm
Location: London, UK

bogus item stats

Postby Shell » Thu Aug 09, 2007 7:20 pm

based on the fact that only certain variables were coming up with this garbage, it probably has something to do with the type of response required and where it was located on the toon...

But, the fixed worked again, Pugs, so thanks!

You've earned an extra pint on me!
Shell
WR.net Apprentice
WR.net Apprentice
 
Posts: 17
Joined: Mon Jul 23, 2007 10:36 am


Return to ArmorySync - Depreciated

Who is online

Users browsing this forum: No registered users and 0 guests

cron