roster_players vs. roster_members table

This addon will synchronize the resistances of your guild with phpRaid

Moderator: Diska

roster_players vs. roster_members table

Postby Kaite » Tue Feb 27, 2007 6:52 pm

I've been running into some problems with the WoWRoster phpRaid synchronization addon. When I run a sync, some of my guild member's levels aren't being updated properly.

The reason why - the addon is grabbing the current level of the character from the "level" column of the roster_players table. I just realized that level is also stored in a second "level" column in the roster_members table. The roster_players table is updated when an individual updates their player information using the characterprofiler. The roster_members table is updated when an officer updates with data from guildprofiler.

I would like to have a member's level be updated in phpraid with the most current information available - from either the most recent guild update, or character update. Is this possible? Can the addon look in both tables and use the highest level it sees? Or the one that was updated most recently? Or should I post a request in the roster dev forums to make update.php update both level columns on guild and character updates?

I'm just not sure what the "best" way to get the result I want.
Kaite
WR.net Apprentice
WR.net Apprentice
 
Posts: 10
Joined: Fri Nov 17, 2006 2:49 am

roster_players vs. roster_members table

Postby zanix » Wed Feb 28, 2007 4:01 am

When a character uploads their data, the columns in the members table are also updated
Or it may be just the level, I'm not sure without looking at the code
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

roster_players vs. roster_members table

Postby PleegWat » Wed Feb 28, 2007 1:19 pm

No, it isn't. I'm not sure how it IS done but I know character updates don't change the members table.
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

roster_players vs. roster_members table

Postby Diska » Wed Feb 28, 2007 2:04 pm

Kaite is completely right afaik. Character level is stored in 2 locations, 1 gets updated by a character upload, the other by a guild upload.
Throughout roster the displayed level is the level that is determined by the guild upload, probably as this information can be trusted because it's password protected.

Kaite, I don't intend to make any changes to this addon. As far as I'm concerned it's a dead project. I made it compatible with roster 1.7 and that's basically it.
The best "solution" I can give you is to use uniuploader to do automatic guild uploads. I use that for my own guild so our guild listing is updated almost daily and almost always reflects the most recent changes.
User avatar
Diska
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 179
Joined: Tue Jul 04, 2006 2:05 pm

Re: roster_players vs. roster_members table

Postby Carasak » Wed Feb 28, 2007 2:55 pm

look for line 97:
Code: Select all
$sql = "SELECT * FROM ".$db_prefix."players WHERE name='" . $phpraid_chars['name'] . "'";

replace with:
Code: Select all
$sql = "SELECT p.name, p.class, p.sex, p.race, p.level, p.max_res_arc, p.max_res_fire, p.max_res_fro, p.max_res_nat, p.max_res_shad, m.level as mlevel, m.name FROM ".$db_prefix."players as p, ".$db_prefix."members as m WHERE p.name='" . $phpraid_chars['name'] . "' and m.name='" . $phpraid_chars['name'] . "'";


look for line 115:
Code: Select all
$level = $char['level'];

replace with:
Code: Select all
   if ($char['level']>=$char['mlevel']){
               $level = $char['level'];
            } else {
               $level = $char['mlevel'];
            }



not tested but should work

it checks just for which level is higher, should be sufficient since characters normally dont delevel.
Last edited by Carasak on Wed Feb 28, 2007 2:59 pm, edited 1 time in total.
User avatar
Carasak
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 114
Joined: Tue Aug 15, 2006 2:33 am
Location: Spain

roster_players vs. roster_members table

Postby zanix » Thu Mar 01, 2007 2:35 am

Character's level in the members table is updated on character upload
wowdb.php

Code: Select all
        // update level in members table
        
$querystr "UPDATE `".ROSTER_MEMBERSTABLE."` SET `level` = '".$data['Level']."' WHERE `member_id` = $memberId LIMIT 1 ";
        
$result $this->query($querystr);
        if( !
$result )
        {
            
$this->setError('Cannot update Level in Members Table',$this->error());
        } 
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

Re: roster_players vs. roster_members table

Postby Kaite » Sat Mar 03, 2007 5:23 pm

Thanks for the replies everyone. You've all been a big help.

I ended up adding some code to the phpraid sync addon which grabs the character level from both tables, and then selects which one is higher. I figure I can safely assume that is the most current one.

Zanix - yes the members table IS updated when a character uploads his/her data. The problem was that the players table is not updated when a guild update is performed. All is good now though.

Thanks again.
Kaite
WR.net Apprentice
WR.net Apprentice
 
Posts: 10
Joined: Fri Nov 17, 2006 2:49 am


Return to phpRaid Synchronization

Who is online

Users browsing this forum: No registered users and 0 guests

cron