Page 2 of 2

Re: Working on new Addon: GuildRosterExport - Need Advice

Posted: Sun Feb 11, 2018 9:15 am
by foghladha
Also of note when you read the export.txt using PHP you should:

$filedata = preg_replace('/\\0/', "", $filedata);

// $filedate = the text file data. This removes NULL characters aka \0 from the file which are everywhere.

--- My Processor Code: ---

if(isset($_FILES['file'])) {

$file = $_FILES['file']['tmp_name']; // XML feed file/URL
$filedata = file_get_contents($file);
$filedata = preg_replace('/\\0/', "", $filedata);
$guilddata = explode(PHP_EOL, $filedata);

foreach ($guilddata as &$gd) {
if($i==0) {
$gdata = explode("|", $gd);
$guild['id'] = $gdata[1];
$guild['name'] = $gdata[2];
$guild['rank'] = $gdata[3];
$guild['renown'] = $gdata[4];
$guild['exp'] = $gdata[5];
$guild['nextlevel'] = $gdata[6];

// UPDATE GUILD QUERY
print "<pre>";
print_r($guild);
print "</pre>";

} else {

$cdata = explode("|", $gd);
$character['mythid'] = $cdata[0];
$character['character'] = $cdata[1];
$character['level'] = $cdata[2];
$character['type'] = $cdata[3];
$character['gamerank'] = $cdata[4];
$character['gamerankname'] = $cdata[5];
$character['lastlogin'] = date("Y-m-d", strtotime($cdata[6]));

// UPDATE/ADD CHARACTER
print "<pre>";
print_r($character);
print "</pre>";
}
}

Re: Working on new Addon: GuildRosterExport - Need Advice

Posted: Sun Feb 11, 2018 10:42 am
by sullemunk
foghladha wrote:I was wondering if anyone new a way to pull the current renown and exp of each player in the roster.
That data isn't shared in the API, so you can't get other players exp or renown

Re: Working on new Addon: GuildRosterExport - Need Advice

Posted: Sun Feb 11, 2018 10:30 pm
by foghladha
So for that i need to create a mod that individual players can run and upload. Your script gave a great foundation to making that happen. Youve opened so many doors for me :). Thanks again!

P.S. is there a way to run an external app from the lua interface to upload the export file automatically? I think curse or wardb.com used to have one. From a security standpoint i think that would be bad but might still be possible.

Re: Working on new Addon: GuildRosterExport - Need Advice

Posted: Sun Feb 11, 2018 10:46 pm
by sullemunk
foghladha wrote:So for that i need to create a mod that individual players can run and upload. Your script gave a great foundation to making that happen. Youve opened so many doors for me :). Thanks again!

P.S. is there a way to run an external app from the lua interface to upload the export file automatically? I think curse or wardb.com used to have one. From a security standpoint i think that would be bad but might still be possible.
You needed a program to run in the background that checked for a file (like the one above that gets created) and upladed the results from that file