IsAdmin())) { die('bababooey'); } adminPanelStats(); $alert = ''; if (isset($_POST['submitrobloxasset'])) { $requestedassetid = $_POST['requestedrobloxassetid']; $prodinfo = getRobloxProductInfo($requestedassetid); $assetname = ""; $assetdescription = ""; $assetprice = (int)$_POST['itemprice']; if (isset($_POST['manualinput_checkbox_assetuploader'])) { $assetname = ($_POST['item']); $assetdescription = cleanInput($_POST['itemdesc']); } else { $assetname = cleanInput($prodinfo->Name); $assetdescription = cleanInput($prodinfo->Description); } $onsale = 0; if (isset($_POST['onsale_checkbox_assetuploader'])) { $onsale = 1; } $price = 0; if (!empty($assetprice)) { $price = $assetprice; } $worker = submitRobloxAssetWorker($requestedassetid, $prodinfo->AssetTypeId, $assetname, $assetdescription, $price, $onsale); if ($worker !== TRUE) { $alert = ""; } else { $alert = ""; } } elseif (isset($_POST['submithat'])) { $b = $GLOBALS['pdo']->prepare("SELECT * FROM assets"); $b->execute(); if ($b->rowCount() > 0) //check if the assets auto increment query succeeds { if (file_exists($_FILES['xml_file']['tmp_name']) || file_exists($_FILES['mesh_file']['tmp_name']) || file_exists($_FILES['texture_file']['tmp_name'])|| is_uploaded_file($_FILES['xml_file']['tmp_name']) || is_uploaded_file($_FILES['mesh_file']['tmp_name']) || is_uploaded_file($_FILES['texture_file']['tmp_name'])) //check if all files exist { //setup the new asset in the DB, lock it! $GLOBALS['pdo']->exec("LOCK TABLES assets WRITE"); //lock since this stuff is sensitive //grab auto increment values $autoincrement = $b->rowCount() + 1; //initial auto increment value $autoincrement2 = $autoincrement+1; //initial auto increment value + 1 $autoincrement3 = $autoincrement2+1; //initial auto increment value + 2 // ... //generate new hashes for the assets $xmlhash = genAssetHash(16); $meshhash = genAssetHash(16); $texturehash = genAssetHash(16); // ... $onsale = 0; if (isset($_POST['onsale_checkbox'])) { $onsale = 1; } else { $onsale = 0; } $price = 0; if (!empty(isset($_POST['itemprice']))) { $price = (int)$_POST['itemprice']; } $stock = 0; $maxstock = 0; //add XML (hat) to assets $m = $GLOBALS['pdo']->prepare("INSERT INTO `assets`(`id`, `AssetTypeId`, `Name`, `Description`, `Created`, `Updated`, `CreatorId`, `TargetId`, `PriceInAlphabux`, `Sales`, `IsNew`, `IsForSale`, `IsPublicDomain`, `IsLimited`, `IsLimitedUnique`, `IsApproved`, `Remaining`, `MinimumMembershipLevel`, `ContentRatingTypeId`, `Favorited`, `Visited`, `MaxPlayers`, `UpVotes`, `DownVotes`, `Hash`) VALUES (:aid,8,:aname,:adesc,UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),1,:aid2,:price,0,0,:onsale,1,0,0,1,0,0,0,0,0,8,0,0,:hash)"); $m->bindParam(":aid", $autoincrement, PDO::PARAM_INT); $m->bindParam(":aname", $_POST['item'], PDO::PARAM_STR); $m->bindParam(":adesc", $_POST['itemdesc'], PDO::PARAM_STR); $m->bindParam(":aid2", $autoincrement, PDO::PARAM_INT); $m->bindParam(":price", $price, PDO::PARAM_INT); $m->bindParam(":onsale", $onsale, PDO::PARAM_INT); $m->bindParam(":hash", $xmlhash, PDO::PARAM_STR); $m->execute(); // ... //add mesh to assets $name = $_POST['item'] . " Mesh"; $t = $GLOBALS['pdo']->prepare("INSERT INTO `assets`(`id`, `AssetTypeId`, `Name`, `Description`, `Created`, `Updated`, `CreatorId`, `TargetId`, `PriceInAlphabux`, `Sales`, `IsNew`, `IsForSale`, `IsPublicDomain`, `IsLimited`, `IsLimitedUnique`, `IsApproved`,`Remaining`, `MinimumMembershipLevel`, `ContentRatingTypeId`, `Favorited`, `Visited`, `MaxPlayers`, `UpVotes`, `DownVotes`, `Hash`) VALUES (:aid,4,:aname,'',UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),1,:aid2,0,0,0,0,1,0,0,1,0,0,0,0,0,8,0,0,:hash)"); $t->bindParam(":aid", $autoincrement2, PDO::PARAM_INT); $t->bindParam(":aname", $name, PDO::PARAM_STR); $t->bindParam(":aid2", $autoincrement2, PDO::PARAM_INT); $t->bindParam(":hash", $meshhash, PDO::PARAM_STR); $t->execute(); // ... //add texture to assets $name = $_POST['item'] . " Texture"; $x = $GLOBALS['pdo']->prepare("INSERT INTO `assets`(`id`, `AssetTypeId`, `Name`, `Description`, `Created`, `Updated`, `CreatorId`, `TargetId`, `PriceInAlphabux`, `Sales`, `IsNew`, `IsForSale`, `IsPublicDomain`, `IsLimited`, `IsLimitedUnique`, `IsApproved`, `Remaining`, `MinimumMembershipLevel`, `ContentRatingTypeId`, `Favorited`, `Visited`, `MaxPlayers`, `UpVotes`, `DownVotes`, `Hash`) VALUES (:aid,1,:aname,'',UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),1,:aid2,0,0,0,0,1,0,0,1,0,0,0,0,0,8,0,0,:hash)"); $x->bindParam(":aid", $autoincrement3, PDO::PARAM_INT); $x->bindParam(":aname", $name, PDO::PARAM_STR); $x->bindParam(":aid2", $autoincrement3, PDO::PARAM_INT); $x->bindParam(":hash", $texturehash, PDO::PARAM_STR); $x->execute(); // ... $GLOBALS['pdo']->exec("UNLOCK TABLES"); //unlock since we are done with sensitive asset stuff //give the hat to the user Alphaland $c = $GLOBALS['pdo']->prepare("INSERT into owned_assets (uid, aid, stock, when_sold, givenby) VALUES(1, :a, 0, UNIX_TIMESTAMP(), 1)"); //give asset 8 $c->bindParam(":a", $autoincrement, PDO::PARAM_INT); //catalog asset id $c->execute(); // ... //upload parameters $uploadDirectory = $GLOBALS['assetCDNPath']; //directory where the xml and mesh assets are stored $textureUploadDirectory = $GLOBALS['thumbnailCDNPath']; //directory where the textures are stored // ... //temp file locations $xmlfileTmpName = $_FILES['xml_file']['tmp_name']; //location of the uploaded xml file (temp directory) $meshfileTmpName = $_FILES['mesh_file']['tmp_name']; //location of the uploaded mesh file (temp directory) $texturefileTmpName = $_FILES['texture_file']['tmp_name']; //location of the uploaded texture file (temp directory) // ... //upload and edit files $str = file_get_contents($xmlfileTmpName); $str=str_replace("MESHURLPLACEHOLDER", $url . "/asset/?id=" . $autoincrement2, $str); $str=str_replace("TEXTUREURLPLACEHOLDER", $url . "/asset/?id=" . $autoincrement3, $str); file_put_contents($xmlfileTmpName, $str); move_uploaded_file($xmlfileTmpName, $uploadDirectory . $xmlhash); move_uploaded_file($meshfileTmpName, $uploadDirectory . $meshhash); move_uploaded_file($texturefileTmpName, $textureUploadDirectory . $texturehash); // ... //render if (!Render::RenderHat($autoincrement)) { $alert = ""; } else { $alert = ""; if ($onsale) { WebContextManager::HttpGetPing("localhost:4098/?type=itemrelease&assetid=".$autoincrement."&name=".urlencode($_POST['item'])."&description=".urlencode($_POST['itemdesc'])."&price=".$price."&image=".$GLOBALS['renderCDN']."/".getAssetInfo($autoincrement)->ThumbHash, 8000); } } // ... } else { $alert = ""; } } } elseif (isset($_POST['submitface'])) { $b = $GLOBALS['pdo']->prepare("SELECT * FROM assets"); $b->execute(); if ($b->rowCount() > 0) //check if the assets auto increment query succeeds { if (file_exists($_FILES['texture_file']['tmp_name']) || is_uploaded_file($_FILES['texture_file']['tmp_name'])) //check if all files exist { //setup the new asset in the DB, lock it! $GLOBALS['pdo']->exec("LOCK TABLES assets WRITE"); //lock since this stuff is sensitive //grab auto increment values $autoincrement = $b->rowCount() + 1; //initial auto increment value $autoincrement2 = $autoincrement+1; //initial auto increment value + 1 // ... //generate new hashes for the assets $xmlhash = genAssetHash(16); $texturehash = genAssetHash(16); // ... $onsale = 0; if (isset($_POST['onsale_face_checkbox'])) { $onsale = 1; } else { $onsale = 0; } $price = 0; if (!empty(isset($_POST['itemprice']))) { $price = (int)$_POST['itemprice']; } $stock = 0; $maxstock = 0; //add XML (face) to assets $m = $GLOBALS['pdo']->prepare("INSERT INTO `assets`(`id`, `AssetTypeId`, `Name`, `Description`, `Created`, `Updated`, `CreatorId`, `TargetId`, `PriceInAlphabux`, `Sales`, `IsNew`, `IsForSale`, `IsPublicDomain`, `IsLimited`, `IsLimitedUnique`, `IsApproved`, `Remaining`, `MinimumMembershipLevel`, `ContentRatingTypeId`, `Favorited`, `Visited`, `MaxPlayers`, `UpVotes`, `DownVotes`, `Hash`) VALUES (:aid,18,:aname,:adesc,UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),1,:aid2,:price,0,0,:onsale,1,0,0,1,0,0,0,0,0,8,0,0,:hash)"); $m->bindParam(":aid", $autoincrement, PDO::PARAM_INT); $m->bindParam(":aname", $_POST['item'], PDO::PARAM_STR); $m->bindParam(":adesc", $_POST['itemdesc'], PDO::PARAM_STR); $m->bindParam(":aid2", $autoincrement, PDO::PARAM_INT); $m->bindParam(":price", $price, PDO::PARAM_INT); $m->bindParam(":onsale", $onsale, PDO::PARAM_INT); $m->bindParam(":hash", $xmlhash, PDO::PARAM_STR); $m->execute(); // ... //add texture to assets $name = $_POST['item'] . " Texture"; $x = $GLOBALS['pdo']->prepare("INSERT INTO `assets`(`id`, `AssetTypeId`, `Name`, `Description`, `Created`, `Updated`, `CreatorId`, `TargetId`, `PriceInAlphabux`, `Sales`, `IsNew`, `IsForSale`, `IsPublicDomain`, `IsLimited`, `IsLimitedUnique`, `IsApproved`, `Remaining`, `MinimumMembershipLevel`, `ContentRatingTypeId`, `Favorited`, `Visited`, `MaxPlayers`, `UpVotes`, `DownVotes`, `Hash`) VALUES (:aid,1,:aname,'',UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),1,:aid2,0,0,0,0,1,0,0,1,0,0,0,0,0,8,0,0,:hash)"); $x->bindParam(":aid", $autoincrement2, PDO::PARAM_INT); $x->bindParam(":aname", $name, PDO::PARAM_STR); $x->bindParam(":aid2", $autoincrement2, PDO::PARAM_INT); $x->bindParam(":hash", $texturehash, PDO::PARAM_STR); $x->execute(); // ... $GLOBALS['pdo']->exec("UNLOCK TABLES"); //unlock since we are done with sensitive asset stuff // ... //give the face to the user Alphaland $c = $GLOBALS['pdo']->prepare("INSERT into owned_assets (uid, aid, stock, when_sold, givenby) VALUES(1, :a, 0, UNIX_TIMESTAMP(), 1)"); //give asset 8 $c->bindParam(":a", $autoincrement, PDO::PARAM_INT); //catalog asset id $c->execute(); // ... //upload parameters $uploadDirectory = $GLOBALS['assetCDNPath']; //directory where the assets are stored $textureUploadDirectory = $GLOBALS['thumbnailCDNPath']; //directory where the textures are stored $faceTemplate = "../default_xmls/faces"; //path to default face // ... //temp file locations $xmlfileTmpName = $uploadDirectory . "xml_templates/faces"; //location of the uploaded xml file (temp directory) $texturefileTmpName = $_FILES['texture_file']['tmp_name']; //location of the uploaded texture file (temp directory) // ... //copy and stored edited xml $strr = file_get_contents($faceTemplate); $strr=str_replace("TEXTUREURLPLACEHOLDER", $url . "/asset/?id=" . $autoincrement2, $strr); // ... //move files file_put_contents($uploadDirectory . $xmlhash, $strr); //copy xml hash to assets cdn move_uploaded_file($texturefileTmpName, $textureUploadDirectory . $texturehash); //copy the uploaded texture to thumb cdn // ... //render if (!Render::RenderFace($autoincrement)) { $alert = ""; } else { $alert = ""; if ($onsale) { WebContextManager::HttpGetPing("localhost:4098/?type=itemrelease&assetid=".$autoincrement."&name=".urlencode($_POST['item'])."&description=".urlencode($_POST['itemdesc'])."&price=".$price."&image=".$GLOBALS['renderCDN']."/".getAssetInfo($autoincrement)->ThumbHash, 8000); } } // ... } else { $alert = ""; } } } elseif(isset($_POST['submithead'])) { $b = $GLOBALS['pdo']->prepare("SELECT * FROM assets"); $b->execute(); if ($b->rowCount() > 0) //check if the assets auto increment query succeeds { $xmlexists = false; $meshexists = false; $textureexists = false; if (file_exists($_FILES['xml_file']['tmp_name']) || is_uploaded_file($_FILES['xml_file']['tmp_name'])) { $xmlexists = true; } if (file_exists($_FILES['mesh_file']['tmp_name']) || is_uploaded_file($_FILES['mesh_file']['tmp_name'])) { $meshexists = true; } if (file_exists($_FILES['texture_file']['tmp_name']) && is_uploaded_file($_FILES['texture_file']['tmp_name'])) { $textureexists = true; } if ($xmlexists && !(!$meshexists && $textureexists)) //XML required { //setup the new asset in the DB, lock it! $GLOBALS['pdo']->exec("LOCK TABLES assets WRITE"); //lock since this stuff is sensitive //grab auto increment values $autoincrement = $b->rowCount() + 1; //initial auto increment value (XML) $autoincrement2 = $autoincrement+1; //MESH $autoincrement3 = $autoincrement2+1; //TEXTURE // ... //generate new hashes for the assets $xmlhash = genAssetHash(16); $meshhash = genAssetHash(16); $texturehash = genAssetHash(16); // ... $onsale = 0; if (isset($_POST['onsale_checkbox'])) { $onsale = 1; } else { $onsale = 0; } $price = 0; if (!empty(isset($_POST['itemprice']))) { $price = (int)$_POST['itemprice']; } $stock = 0; $maxstock = 0; //add XML (head) to assets $m = $GLOBALS['pdo']->prepare("INSERT INTO `assets`(`id`, `AssetTypeId`, `Name`, `Description`, `Created`, `Updated`, `CreatorId`, `TargetId`, `PriceInAlphabux`, `Sales`, `IsNew`, `IsForSale`, `IsPublicDomain`, `IsLimited`, `IsLimitedUnique`, `IsApproved`, `Remaining`, `MinimumMembershipLevel`, `ContentRatingTypeId`, `Favorited`, `Visited`, `MaxPlayers`, `UpVotes`, `DownVotes`, `Hash`) VALUES (:aid,17,:aname,:adesc,UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),1,:aid2,:price,0,0,:onsale,1,0,0,1,0,0,0,0,0,8,0,0,:hash)"); $m->bindParam(":aid", $autoincrement, PDO::PARAM_INT); $m->bindParam(":aname", $_POST['item'], PDO::PARAM_STR); $m->bindParam(":adesc", $_POST['itemdesc'], PDO::PARAM_STR); $m->bindParam(":aid2", $autoincrement, PDO::PARAM_INT); $m->bindParam(":price", $price, PDO::PARAM_INT); $m->bindParam(":onsale", $onsale, PDO::PARAM_INT); $m->bindParam(":hash", $xmlhash, PDO::PARAM_STR); $m->execute(); // ... if ($meshexists) { //add mesh to assets $name = $_POST['item'] . " Mesh"; $t = $GLOBALS['pdo']->prepare("INSERT INTO `assets`(`id`, `AssetTypeId`, `Name`, `Description`, `Created`, `Updated`, `CreatorId`, `TargetId`, `PriceInAlphabux`, `Sales`, `IsNew`, `IsForSale`, `IsPublicDomain`, `IsLimited`, `IsLimitedUnique`, `IsApproved`,`Remaining`, `MinimumMembershipLevel`, `ContentRatingTypeId`, `Favorited`, `Visited`, `MaxPlayers`, `UpVotes`, `DownVotes`, `Hash`) VALUES (:aid,4,:aname,'',UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),1,:aid2,0,0,0,0,1,0,0,1,0,0,0,0,0,8,0,0,:hash)"); $t->bindParam(":aid", $autoincrement2, PDO::PARAM_INT); $t->bindParam(":aname", $name, PDO::PARAM_STR); $t->bindParam(":aid2", $autoincrement2, PDO::PARAM_INT); $t->bindParam(":hash", $meshhash, PDO::PARAM_STR); $t->execute(); // ... } if ($textureexists) { //add texture to assets $name = $_POST['item'] . " Texture"; $x = $GLOBALS['pdo']->prepare("INSERT INTO `assets`(`id`, `AssetTypeId`, `Name`, `Description`, `Created`, `Updated`, `CreatorId`, `TargetId`, `PriceInAlphabux`, `Sales`, `IsNew`, `IsForSale`, `IsPublicDomain`, `IsLimited`, `IsLimitedUnique`, `IsApproved`, `Remaining`, `MinimumMembershipLevel`, `ContentRatingTypeId`, `Favorited`, `Visited`, `MaxPlayers`, `UpVotes`, `DownVotes`, `Hash`) VALUES (:aid,1,:aname,'',UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),1,:aid2,0,0,0,0,1,0,0,1,0,0,0,0,0,8,0,0,:hash)"); $x->bindParam(":aid", $autoincrement3, PDO::PARAM_INT); $x->bindParam(":aname", $name, PDO::PARAM_STR); $x->bindParam(":aid2", $autoincrement3, PDO::PARAM_INT); $x->bindParam(":hash", $texturehash, PDO::PARAM_STR); $x->execute(); // ... } $GLOBALS['pdo']->exec("UNLOCK TABLES"); //unlock since we are done with sensitive asset stuff // ... //give the Head to the user Alphaland $c = $GLOBALS['pdo']->prepare("INSERT into owned_assets (uid, aid, stock, when_sold, givenby) VALUES(1, :a, 0, UNIX_TIMESTAMP(), 1)"); //give asset $c->bindParam(":a", $autoincrement, PDO::PARAM_INT); //catalog asset id $c->execute(); // ... //upload parameters $uploadDirectory = $GLOBALS['assetCDNPath']; //directory where the xml and mesh assets are stored $textureUploadDirectory = $GLOBALS['thumbnailCDNPath']; //directory where the textures are stored // ... //temp file locations $xmlfileTmpName = $_FILES['xml_file']['tmp_name']; //location of the uploaded xml file (temp directory) $meshfileTmpName = $_FILES['mesh_file']['tmp_name']; //location of the uploaded mesh file (temp directory) $texturefileTmpName = $_FILES['texture_file']['tmp_name']; //location of the uploaded texture file (temp directory) // ... //upload and edit files if ($meshexists || $textureexists) { $str = file_get_contents($xmlfileTmpName); if ($meshexists) { $str=str_replace("MESHURLPLACEHOLDER", $url . "/asset/?id=" . $autoincrement2, $str); } if ($textureexists) { $str=str_replace("TEXTUREURLPLACEHOLDER", $url . "/asset/?id=" . $autoincrement3 ,$str); } file_put_contents($xmlfileTmpName, $str); } move_uploaded_file($xmlfileTmpName, $uploadDirectory . $xmlhash); if ($meshexists) { move_uploaded_file($meshfileTmpName, $uploadDirectory . $meshhash); } if ($textureexists) { move_uploaded_file($texturefileTmpName, $textureUploadDirectory . $texturehash); } // ... if (!Render::RenderHead($autoincrement)) { $alert = ""; } else { $alert = ""; } // ... } else { $alert = ""; } } } $body = << {$alert}
Create Asset

ROBLOX Automatic Asset Uploader

Supports Hats, Faces and Gears in XML format with mesh version 2.00 and below

1. Download the hat's XML file with the URL: "https://assetdelivery.roblox.com/v1/asset/?id=ASSETID"

2. Open the file with notepad or file editor of choice, and download the asset data, found easily with "MeshId" and "TextureId"

3. Edit the URL's in the opened XML file, replace the MeshID URL, found with "MeshId" with "MESHURLPLACEHOLDER" (NO SPACES BEFORE OR AFTER)

4. Edit the URL's in the opened XML file, replace the TextureID URL, found with "TextureId" with "TEXTUREURLPLACEHOLDER" (NO SPACES BEFORE OR AFTER)

5. Select the Mesh, Texture and the edited XML file under the correct file selectors

6. Fill out the rest of the required data, and create

1. Download the faces's XML file with the URL: "https://assetdelivery.roblox.com/v1/asset/?id=ASSETID"

2. Open the file with notepad or file editor of choice, and download the Texture, found easily with "Texture"

3. Select the Texture under the correct file selector

4. Fill out the rest of the required data, and create

1. Download the Head's XML file with the URL: "https://assetdelivery.roblox.com/v1/asset/?id=ASSETID" (if the item isn't in XML Format, open it in studio and Export as XML)

2. Open the file with notepad or file editor of choice, and download the asset data, found easily with "MeshId" and "TextureId"

3. Edit the URL's in the opened XML file, replace the MeshID URL, found with "MeshId" with "MESHURLPLACEHOLDER" (NO SPACES BEFORE OR AFTER)

4. Edit the URL's in the opened XML file, replace the TextureID URL, found with "TextureId" with "TEXTUREURLPLACEHOLDER" (NO SPACES BEFORE OR AFTER)

5. Select the Mesh, Texture and the edited XML file under the correct file selectors

6. Fill out the rest of the required data, and create

EOT; pageHandler(); $ph->pagetitle = ""; $ph->navbar = ""; $ph->body = $body; $ph->footer = ""; $ph->output();