New UU Screenshot Protocol (now in 2.6.8 beta 3)

Support and feedback for UniUploader
UniUploader requires microsoft .net runtimes!

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby MattM » Tue Sep 09, 2008 3:56 am

Edit: I don't know if this protocol will play nice with addon triggers. Could someone please give me some insight to addon triggers and how this might work with them? I believe the plain text format output of roster for UU should work fine. UU will parse the results from step 2 below, and any clean line with a matching md5 will cause the corresponding shot to upload.


1. UU posts OPERATION=CHECKSHOTS and data={a '\n' separated list of md5 hashes of the screenshots }
2. Interface responds with which a '\n' separated list of md5 hashes for screenshots not uploaded yet
3. UU posts OPERATION=UPSHOTS and the screenshot files (.jpg) to the same url.

All of this only happens with the Primary Interface URL (the one that shows up on first tab in UU)

The contents of the PHP variable $_FILES after the post is complete in step 3 could be:

Code: Select all
{Array
(
    [ef1c521103e556db3fd2bca88c83bdea] => Array
        (
            [name] => WoWScrnShot_080908_155425.jpg
            [type] => application/octet-stream
            [tmp_name] => /data/tmp/phpvhE5Wb
            [error] => 0
            [size] => 276956
        )

    [2c8d6246ac055ae73f16732cabffa6c3] => Array
        (
            [name] => WoWScrnShot_070908_193502.jpg
            [type] => application/octet-stream
            [tmp_name] => /data/tmp/phpkychLn
            [error] => 0
            [size] => 219529
        )

    [b6f1b8513db505c1020b9a5dd7564644] => Array
        (
            [name] => WoWScrnShot_070908_123015.jpg
            [type] => application/octet-stream
            [tmp_name] => /data/tmp/phpBlm81H
            [error] => 0
            [size] => 279754
        )

    [39eba34370e3f807f21ad1f4d648ef6d] => Array
        (
            [name] => WoWScrnShot_072108_153128.jpg
            [type] => application/octet-stream
            [tmp_name] => /data/tmp/phpslVrFc
            [error] => 0
            [size] => 257439
        )

    [fb375723cac8987467fa0aefca1dfffd] => Array
        (
            [name] => WoWScrnShot_081408_184603.jpg
            [type] => application/octet-stream
            [tmp_name] => /data/tmp/phpHGScxQ
            [error] => 0
            [size] => 263177
        )

    [1c36c83b9d8a1fbe62800a749acaca8b] => Array
        (
            [name] => WoWScrnShot_072908_165635.jpg
            [type] => application/octet-stream
            [tmp_name] => /data/tmp/phpoH67OD
            [error] => 0
            [size] => 265767
        )

    [bf3c4e2b3b394d53711f40964123e248] => Array
        (
            [name] => WoWScrnShot_080908_155427.jpg
            [type] => application/octet-stream
            [tmp_name] => /data/tmp/phphJUyDA
            [error] => 0
            [size] => 277724
        )

    [84533f8745cc8be0d933538d92b64444] => Array
        (
            [name] => WoWScrnShot_070908_130729.jpg
            [type] => application/octet-stream
            [tmp_name] => /data/tmp/phpsypXmH
            [error] => 0
            [size] => 238509
        )

    [e861ee80f47a556b7cc708433345db3a] => Array
        (
            [name] => WoWScrnShot_070908_175043.jpg
            [type] => application/octet-stream
            [tmp_name] => /data/tmp/phplG698W
            [error] => 0
            [size] => 210960
        )

    [e2c89b7fed66a04f01d3297c22a40b2e] => Array
        (
            [name] => WoWScrnShot_071608_164046.jpg
            [type] => application/octet-stream
            [tmp_name] => /data/tmp/phpCSNquk
            [error] => 0
            [size] => 259982
        )

    [05c4cbc15a9da3101ac505daf8a9a328] => Array
        (
            [name] => WoWScrnShot_071508_003950.jpg
            [type] => application/octet-stream
            [tmp_name] => /data/tmp/phpFiYjXR
            [error] => 0
            [size] => 239832
        )

    [f4567f52e44f29f867dffc9e8f533c87] => Array
        (
            [name] => WoWScrnShot_072908_165426.jpg
            [type] => application/octet-stream
            [tmp_name] => /data/tmp/php0HxM1x
            [error] => 0
            [size] => 228742
        )

    [6ac7694044d49a996742f37996c03e4e] => Array
        (
            [name] => WoWScrnShot_071508_003942.jpg
            [type] => application/octet-stream
            [tmp_name] => /data/tmp/phpVnPBfm
            [error] => 0
            [size] => 245675
        )

)
}


Here is a script I made for testing:


Code: Select all
<?php

 
// CREATE TABLE `screenshots` (
// `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
// `fingerprint` VARCHAR( 32 ) NOT NULL ,
// `data` LONGBLOB NOT NULL ,
// PRIMARY KEY ( `id` )
// ) ENGINE = MYISAM 


$op=get_var("OPERATION");
$db=mysql_connect("localhost""??????""??????");
mysql_select_db("test",$db);

switch(
$op){
    
    case 
'CHECKSHOTS':
        
check_shots();
    break;
    
    case 
'UPSHOTS':
        
up_shots();
    break;
    
    default:
    break;
}

function 
up_shots(){
    global 
$db;
    
//print_r($_FILES);
    
foreach($_FILES as $file){
        
//do whatever with them
        //always insert into db so user does not have to upload same screenshots again indefinitley
    
}
}

function 
check_shots(){
    
$data get_var("data");
    
$rows explode("\n",$data);
    
$donthaveyet = array();
    foreach(
$rows as $row){
        if (!
doihave($row)){
            
$donthaveyet[] = $row;
        }
    }
    
$out implode("\n",$donthaveyet);
    echo 
$out;    
}

function 
doihave($fingerprint){
    global 
$db;
    
$result mysql_query("select * from screenshots where fingerprint='".$fingerprint."'",$db);
    return (
mysql_num_rows($result)< 1) ? false true;
}


function 
get_var($var){
    
$out '';
    if (isset(
$_POST[$var]))
        
$out $_POST[$var];
    
    if (isset(
$_REQUEST[$var]))
        
$out $_REQUEST[$var];
        
    return 
$out;
}



?>
Last edited by MattM on Tue Sep 09, 2008 4:18 am, edited 2 times in total.
MattM
UA/UU Developer
UA/UU Developer
Gimpy Developer
Gimpy Developer
 
Posts: 886
Joined: Tue Jul 04, 2006 9:53 pm
Location: USA

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby Anaxent » Wed Sep 10, 2008 1:36 pm

hmm well this sure opens up a few good ideas...(especially when accounts addon is complete so we have user auth in roster)
would there be away to browse for an image defaulting to the screenshots directory if it exists?
User avatar
Anaxent
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 642
Joined: Tue Jul 04, 2006 6:27 am
Location: Phoenix, Az

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby Ulminia » Wed Sep 10, 2008 5:07 pm

im working with matt to make a update_hook file for roster gallery so the screenshots upload to its database and show the image just need to finish the file setting update hook's dont seem to like the images bcause they are not lua files...
Ulminia of Zangarmarsh
Zonous of Zangarmarsh
Author of Roster Gallery
WoWRoster-Profiler Redesigner
User avatar
Ulminia
WoWRoster.net Dev Team
WoWRoster.net Dev Team
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 1223
Joined: Tue Jul 04, 2006 4:41 pm
Location: New Brunswick, Canada
Realm: Zangarmarsh (PvE) - US
gmail/gtalk: ulminia@gmail.com

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby MattM » Wed Sep 10, 2008 9:54 pm

is $_FILES still intact? Why can't you bypass the roster LUA file handling?
MattM
UA/UU Developer
UA/UU Developer
Gimpy Developer
Gimpy Developer
 
Posts: 886
Joined: Tue Jul 04, 2006 9:53 pm
Location: USA

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby Ulminia » Wed Sep 10, 2008 11:45 pm

it is but uu is not posting any data on form submit for some reason ...
Ulminia of Zangarmarsh
Zonous of Zangarmarsh
Author of Roster Gallery
WoWRoster-Profiler Redesigner
User avatar
Ulminia
WoWRoster.net Dev Team
WoWRoster.net Dev Team
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 1223
Joined: Tue Jul 04, 2006 4:41 pm
Location: New Brunswick, Canada
Realm: Zangarmarsh (PvE) - US
gmail/gtalk: ulminia@gmail.com

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby MattM » Thu Sep 11, 2008 4:24 am

the hooks don't fire when there are no valid lua uploads
MattM
UA/UU Developer
UA/UU Developer
Gimpy Developer
Gimpy Developer
 
Posts: 886
Joined: Tue Jul 04, 2006 9:53 pm
Location: USA

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby MattM » Fri Sep 12, 2008 1:26 am

since the ss protocol requires a response from the server, and the update hooks only fire when valid LUA files are uploaded, I may have to have UU upload the checked SVs when it wants to do screenshots.

This will cause Roster to process the uploaded SVs twice. But at least the process will work.

The reason for this hiccup is 2 fold.

1. I don't want to make another setting in UU for the "screenshot URL".
2. Roster only hooks into addons when valid LUA (SV) files are uploaded.

Crappy, but at least it will work.
MattM
UA/UU Developer
UA/UU Developer
Gimpy Developer
Gimpy Developer
 
Posts: 886
Joined: Tue Jul 04, 2006 9:53 pm
Location: USA

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby zanix » Fri Sep 12, 2008 6:27 am

Well, the upload page was really meant for lua processing, so we lock it down to accept only lua uploads

It could probably be changed to accept other types of files though
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

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby zanix » Fri Sep 12, 2008 6:29 am

Or, you can just upload a fake .lua file
An empty CharacterProfiler.lua file might do the trick
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

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby MattM » Fri Sep 12, 2008 11:01 am

I don't want to take the roster specific features of UU that far though. presetting certain SVs checked in the SV list is bad enough.

I can't imagine the multitude of "why does it not work" threads from that learning curve alone. "answer: check the right sv's". and then of course the reply "which ones", then the final answer "characterprofiler". Meh, I don't want grey hair just yet.


ok enough of my ranting...

Perhaps the screenshot stuff needs to be hidden until the roster update interface can allow this kind of protocol. Beta 4 is hacked so it runs an sv upload alongside each protocol step. This should be sufficient, although nauseating. :eek:
Last edited by MattM on Fri Sep 12, 2008 11:08 am, edited 3 times in total.
MattM
UA/UU Developer
UA/UU Developer
Gimpy Developer
Gimpy Developer
 
Posts: 886
Joined: Tue Jul 04, 2006 9:53 pm
Location: USA

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby zanix » Fri Sep 12, 2008 11:59 am

You are right, the Roster interface does need to be modified to allow this, not UU's

I finally wondered into the realm of "make UU Roster specific"

... I am sooo sorry :cry:
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

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby Anaxent » Sat Sep 13, 2008 2:23 pm

Well, the upload page was really meant for lua processing, so we lock it down to accept only lua uploads

It could probably be changed to accept other types of files though


I would think if it were to be changed it would be because a roster addon required it. With that said we should allow such an ability via the
addon|framework... in fact allow addons to do maybe do much more out of what we really think should be available for addon devs.., but still keep to our addon coding standards allowing more addons to be certified
Last edited by Anaxent on Sat Sep 13, 2008 2:32 pm, edited 4 times in total.
User avatar
Anaxent
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 642
Joined: Tue Jul 04, 2006 6:27 am
Location: Phoenix, Az

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby MattM » Sun Sep 14, 2008 6:01 am

MattM
UA/UU Developer
UA/UU Developer
Gimpy Developer
Gimpy Developer
 
Posts: 886
Joined: Tue Jul 04, 2006 9:53 pm
Location: USA

New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby zanix » Sun Sep 14, 2008 6:28 am

Nice quick addon there Matt
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: New UU Screenshot Protocol (now in 2.6.8 beta 3)

Postby MattM » Sun Sep 14, 2008 8:33 am

zanix wrote:Nice quick addon there Matt


It wasn't even painful either! :glad:
MattM
UA/UU Developer
UA/UU Developer
Gimpy Developer
Gimpy Developer
 
Posts: 886
Joined: Tue Jul 04, 2006 9:53 pm
Location: USA

Next

Return to UniUploader

Who is online

Users browsing this forum: No registered users and 1 guest

cron