Introducing ArmorySync

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

Moderators: Ulminia, poetter

Re: Introducing ArmorySynch

Postby Kristoff22 » Wed Mar 21, 2007 1:21 am

niagairt wrote:
Kristoff22 wrote:
niagairt wrote:I guess my question would be, will this work woth WowRosterDF?


Not quite sure what WoWRosterDF is... link?


Its the version of WowRoster that works with the Dragonfly CMS.........

You can find it

here------http://www.wowroster.net/
here------http://www.wowroster.net/Downloads/c=9.html\

I want to aplogize for the lack of Signature.....my host is having a problem


Ahh ok, well I am just speculating here, because I have not worked with DF before, but you shouldn't have a problem with the addon in its current state. You may have a problem with the UI once I build a frontend to it, but we could certainly make a version for any CMS. But the meat of it should work just fine in theory.
Kristoff22
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 103
Joined: Mon Nov 13, 2006 5:54 am

Re: Introducing ArmorySynch

Postby niagairt » Wed Mar 21, 2007 3:42 am

Kristoff22 wrote:...........in theory.


Thats the part that ALWAYS gets me worried....LOL......as soon as my host gets my site back alive, I'll give it a shot and let you knpw
Rogues may do it from behind, but mages do it hard and fast.
Image
User avatar
niagairt
WR.net Apprentice
WR.net Apprentice
 
Posts: 36
Joined: Wed Jan 10, 2007 7:16 am
Location: Forks, WA

Introducing ArmorySynch

Postby PoloDude » Wed Mar 21, 2007 5:51 am

Just been trying it out a bit, but i've also got the error
Code: Select all
Fatal error: Call to a member function on a non-object in C:\Inetpub\vhosts\thesmoulderingforge.com\subdomains\roster\httpdocs\addons\ArmorySynch\functions.parsing.php on line 3


After printing around i think it might be because there's a space in our guildname, on armory there's a + instead of it.
I also had to change it to the armory to the one of europe :)
[url=http://eu.wowarmory.com/character-sheet.xml?r=Emerald+Dream&n=Calaglin]Calaglin @ Emerald Dream [EU]
User avatar
PoloDude
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 134
Joined: Tue Jul 04, 2006 3:17 pm
Location: Belgium - Gent

Introducing ArmorySynch

Postby PoloDude » Wed Mar 21, 2007 6:13 am

So just tested it out by replacing the space by a +, worked like a charm, but i think i messed up somewhere when updating guild as it was giving no xml root error.
Also noticed that players updated from armory their tier gear tooltips are messed up, or any item within a set, can see here

What i'd like to suggest also is, even while it's still beta, to add password thingy, so not every1 can click on the damn thing ;)
Last edited by PoloDude on Wed Mar 21, 2007 6:15 am, edited 1 time in total.
[url=http://eu.wowarmory.com/character-sheet.xml?r=Emerald+Dream&n=Calaglin]Calaglin @ Emerald Dream [EU]
User avatar
PoloDude
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 134
Joined: Tue Jul 04, 2006 3:17 pm
Location: Belgium - Gent

Re: Introducing ArmorySynch

Postby Kristoff22 » Wed Mar 21, 2007 8:32 am

You are correct PoloDude. I'm now urlencoding the realm name and the guild name. I'll be uploading an update after I run a final test.

I don't have password protection yet, but I did something just as effective... in a very hacktastic sort of way. When you go to the addon, simply append &Activate=true to your browsers URL bar. i.e. http://www.domainname.com/roster/addon. ... ivate=true

While that is hardly secure, it will keep the average user from poking around and crashing your web server...
Kristoff22
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 103
Joined: Mon Nov 13, 2006 5:54 am

Introducing ArmorySynch

Postby fewyn » Wed Mar 21, 2007 10:01 am

So how would we go about getting it to convert the guild name to have an +?
User avatar
fewyn
WR.net Apprentice
WR.net Apprentice
 
Posts: 25
Joined: Wed Jul 05, 2006 8:38 am

Introducing ArmorySynch

Postby zeryl » Wed Mar 21, 2007 10:05 am

str_replace would work
User avatar
zeryl
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 194
Joined: Tue Jul 04, 2006 12:59 pm
Location: Saint Louis

Introducing ArmorySynch

Postby zanix » Wed Mar 21, 2007 10:06 am

Use rawurlencode http://www.php.net/rawurlencode
Not on the whole url, just the guildname part
Last edited by zanix on Wed Mar 21, 2007 10:06 am, edited 1 time in total.
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Introducing ArmorySync

Postby DopeFish » Wed Mar 21, 2007 4:22 pm

great code, works like a charm. I had a go with it yesterday and changed/added some things that might be useful for other people too (didn't post last night, page was in maintenence mode):

  • urlencode of realm, guildname und charname, and armory.wow-europe.com (already mentioned, possibly add a config file that asks if the realm is US or EU, didnt get around to that yet).
  • password protection: I just shamelessly copy&pasted the password protection from siggen since it asks for the admin password.
  • optionally updating a single player:
Added following code into the index.php:
Code: Select all
if (isset($_REQUEST['syncplayer'])) {
  
synchPlayer(null$_REQUEST['syncplayer']);    
} else {
 ... 
password protection ...
 ... 
guild update ...
}
 

then added a icon before the player name like in this thread that points to addon.php?roster_addon_name=ArmorySynch&syncplayer=Playername Now players can sync single chars by themself, or I can sync the whole guild (Syncing single chars is preferred since guild snycing overwrites charprofiler uploaded data).
  • Since we have around 280 members, grabbing the iteminfo for each char was resulting in a major performance hit. I replaced the second "getArmoryContent" call in the function "parseEquipment" with following code. It's of course not as nice as a real tooltip, but it's pretty close, and it saves you one http request per item. (if a member complains, he can always use charprofiler :p
Original Code
functions.parsing.php - around line 87
Code: Select all

    $item
["Tooltip"] = getArmoryContent("item-tooltip.xml""i=" $equipmentItem->id "&r=" $player["Server"] . "&n="$player["Name"] ."&lang=" $player["Locale"], "table"false);
    
$item["Tooltip"] = trim(str_replace("\n\n""\n"str_replace("<br />""\n"strip_tags(nl2br($item["Tooltip"]), "<br>"))));
 



Modified Code
Code: Select all

    
//$item["Tooltip"] = getArmoryContent("item-tooltip.xml", "i=" . $equipmentItem->id . "&r=" . $player["Server"] . "&n=". $player["Name"] ."&lang=" . $player["Locale"], "table", false);
    //$item["Tooltip"] = trim(str_replace("\n\n", "\n", str_replace("<br />", "\n", strip_tags(nl2br($item["Tooltip"]), "<br>"))));
    
$item["Tooltip"] = $item["Name"]."<br />\n";
    
$spelltrigger[0]='Use: ';
    
$spelltrigger[1]='Equip: ';
    
$spelltrigger[2]='Chance on hit: ';
    foreach (
$armoryItem->itemTooltip->properties as $key => $value) {
      if (
$key ) {
        switch (
$value) {
          case 
'equipData':
            
$tmpdata $armoryItem->itemTooltip->$value->subclassName->_CDATA;
            if (
trim($tmpdata) != ''$item["Tooltip"] .= ucfirst(strtolower($tmpdata))."<br />";
            break;
          case 
'requiredLevel':
            
$tmpdata $armoryItem->itemTooltip->$value->_CDATA;
            if (
trim($tmpdata) != ''$item["Tooltip"] .= 'Requires Level '.$tmpdata."<br />";
            break;
          case 
'spellData':
            if (
is_array($armoryItem->itemTooltip->spellData->spell)) {
              foreach (
$armoryItem->itemTooltip->spellData->spell as $value) {                        
                
$tmpdata $value->desc->_CDATA;
                if (
trim($tmpdata) != ''$item["Tooltip"] .= $spelltrigger[$value->trigger->_CDATA].$tmpdata."<br />";  
              }
            } else {
              
$tmpdata $armoryItem->itemTooltip->spellData->spell->desc->_CDATA;
              if (
trim($tmpdata) != ''$item["Tooltip"] .= $spelltrigger[$armoryItem->itemTooltip->spellData->spell->trigger->_CDATA].$tmpdata."<br />";
            }
          break;              
          default:
            
$tmpdata $armoryItem->itemTooltip->$value->_CDATA;
            if (
trim($tmpdata) != '') {
              if (
strstr($value,'bonus')) { 
                
$value substr($value5);
              }
              if (
trim($tmpdata) != ''$item["Tooltip"] .= '+'.$tmpdata.' '.  ucfirst(strtolower($value))."<br />";
            }
        }
      }
    }
 

It just takes the info and tries to make a nice tooltip out of it, would be shorter if the spelldata wasn't such a pain.

TODO: Enchants appear with two "+" as a prefix in the tooltips, didnt' get around to fixing that before I went to bed, can be easily checked and fixedwith a strstr()

Hope the posting was useful for someone. If anyone wants to have a look: http://www.sun-tzu.info/roster/

Edit: fixed indents in php code
Last edited by DopeFish on Wed Mar 21, 2007 4:35 pm, edited 3 times in total.
DopeFish
WR.net Apprentice
WR.net Apprentice
 
Posts: 10
Joined: Thu Jul 06, 2006 2:44 am

Re: Introducing ArmorySync

Postby Kristoff22 » Wed Mar 21, 2007 8:06 pm

Finally updated the codebase, sorry for the delay! The major changes are:

1. Instead of synching the guild list with Armory, which is out of date anyway, by default it grabs all of the names of the members in Roster and synchs them. This seems to work a lot smoother and less buggy.

2. Added urlencode to realm/guild name's when making callout to Armory.

3. Added very temporary authentication. Simply add &Activate=true to your URL. Directions and examples are in index.php.

Thanks to all who have helped!

Also DopeFish, thanks very much for the code snippets, I'll try to add them ASAP.
Kristoff22
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 103
Joined: Mon Nov 13, 2006 5:54 am

Introducing ArmorySync

Postby PleegWat » Wed Mar 21, 2007 11:24 pm

I'm not sure how exactly this could be implemented, but maybe it's an idea to send the armory requests earlier. EG send the request for items 1 and 2, process item 1 once it comes in, send request for item 3 when done with item 1, send request for item 4 when done with item 2, etc. This may decrease the runtime, since currently it's waiting for the armory response each time a page is requested.
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

Re: Introducing ArmorySync

Postby niagairt » Thu Mar 22, 2007 12:07 am

DopeFish wrote:[*] password protection: I just shamelessly copy&pasted the password protection from siggen since it asks for the admin password.


Doing this will cause it to not work with WoWRosterDF........unless I am missing something
Rogues may do it from behind, but mages do it hard and fast.
Image
User avatar
niagairt
WR.net Apprentice
WR.net Apprentice
 
Posts: 36
Joined: Wed Jan 10, 2007 7:16 am
Location: Forks, WA

Introducing ArmorySync

Postby PleegWat » Thu Mar 22, 2007 1:40 am

Siggen uses the roster login class for auth. That class is modified in the DF version to use DF auth instead. So it should work fine. Anyway siggen is compatible with DF unmodded, so the auth should be fine there anyway.
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

Re: Introducing ArmorySync

Postby niagairt » Thu Mar 22, 2007 1:59 am

PleegWat wrote:Siggen uses the roster login class for auth. That class is modified in the DF version to use DF auth instead. So it should work fine. Anyway siggen is compatible with DF unmodded, so the auth should be fine there anyway.


I was having flashbacks when everyone was having the Password Issues......lol
Rogues may do it from behind, but mages do it hard and fast.
Image
User avatar
niagairt
WR.net Apprentice
WR.net Apprentice
 
Posts: 36
Joined: Wed Jan 10, 2007 7:16 am
Location: Forks, WA

Introducing ArmorySync

Postby niagairt » Thu Mar 22, 2007 2:35 am

OK, I installed this with WoWRosterDF.....worked ALMOST like a charm, but not quite......

While syncing, Internet Explorer timed out and I had to completly close IE and restart it before I could even get back to my main site.......(Honestly, I am not sure if this is and addon problem or an Internet Explorer problem)

I'll keep trying and see if I can trace the issue
Rogues may do it from behind, but mages do it hard and fast.
Image
User avatar
niagairt
WR.net Apprentice
WR.net Apprentice
 
Posts: 36
Joined: Wed Jan 10, 2007 7:16 am
Location: Forks, WA

PreviousNext

Return to ArmorySync - Depreciated

Who is online

Users browsing this forum: No registered users and 1 guest

cron