Recent Topics

Ads

Working on new Addon: GuildRosterExport - Need Advice

Here you can post addons, or anything related to addons.
Forum rules
Before posting on this forum, be sure to read the Terms of Use
User avatar
foghladha
Posts: 86
Contact:

Re: Working on new Addon: GuildRosterExport - Need Advice

Post#11 » Sun Feb 11, 2018 9:15 am

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>";
}
}
Foghladha
Founder & Activities Director
Gaiscioch Social Gaming Community
Discord | Twitch | YouTube | Twitter

Ads
User avatar
sullemunk
Addon Developer
Posts: 1213

Re: Working on new Addon: GuildRosterExport - Need Advice

Post#12 » Sun Feb 11, 2018 10:42 am

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
Image
Image Ethreal   Image Corque   Image Urgiz   Image Loxley   Image Chilli   Image Maduza

User avatar
foghladha
Posts: 86
Contact:

Re: Working on new Addon: GuildRosterExport - Need Advice

Post#13 » Sun Feb 11, 2018 10:30 pm

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.
Foghladha
Founder & Activities Director
Gaiscioch Social Gaming Community
Discord | Twitch | YouTube | Twitter

User avatar
sullemunk
Addon Developer
Posts: 1213

Re: Working on new Addon: GuildRosterExport - Need Advice

Post#14 » Sun Feb 11, 2018 10:46 pm

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
Image
Image Ethreal   Image Corque   Image Urgiz   Image Loxley   Image Chilli   Image Maduza

Who is online

Users browsing this forum: No registered users and 25 guests