From b21882eaa24e008fdb3c62b7b527336725d3fec3 Mon Sep 17 00:00:00 2001 From: Christopher Latza Date: Mon, 8 Jun 2020 21:13:20 +0200 Subject: [PATCH] dont rename assetType 24 --- cron/checkInventar.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/cron/checkInventar.php b/cron/checkInventar.php index aa209e4..b62d225 100644 --- a/cron/checkInventar.php +++ b/cron/checkInventar.php @@ -11,18 +11,26 @@ while($InventarObjektRow = $InventarObjektStatement->fetch()) if($AssetMetaDataStatement->rowCount() == 0) { - if(!(left($InventarObjektRow['inventoryName'], 8) == '[DEFEKT]')) + if($InventarObjektRow['assetType'] != '24') { - $renameQuery = $RUNTIME['PDO']->prepare("UPDATE inventoryitems SET inventoryName = ? WHERE inventoryID = ? AND assetID = ?"); - $renameQuery->execute(array(substr('[DEFEKT] '.$InventarObjektRow['inventoryName'], 0, 64), $InventarObjektRow['inventoryID'], $InventarObjektRow['assetID'])); - - echo "Found new missing asset for item '".$InventarObjektRow['inventoryName']."' from '".$RUNTIME['OPENSIM']->getUserName($InventarObjektRow['avatarID'])."'.\n"; - sendInworldIM("00000000-0000-0000-0000-000000000000", $InventarObjektRow['avatarID'], "Inventory", $RUNTIME['GRID']['HOMEURL'], "WARNUNG: Die Assetdaten von einem deiner Inventarobjekte wurden nicht in der DB gefunden! Item Name: '".$InventarObjektRow['inventoryName']."'."); + if(!(left($InventarObjektRow['inventoryName'], 8) == '[DEFEKT]')) + { + $renameQuery = $RUNTIME['PDO']->prepare("UPDATE inventoryitems SET inventoryName = ? WHERE inventoryID = ? AND assetID = ?"); + $renameQuery->execute(array(substr('[DEFEKT] '.$InventarObjektRow['inventoryName'], 0, 64), $InventarObjektRow['inventoryID'], $InventarObjektRow['assetID'])); + + echo "Found new missing asset for item '".$InventarObjektRow['inventoryName']."' from '".$RUNTIME['OPENSIM']->getUserName($InventarObjektRow['avatarID'])."'.\n"; + sendInworldIM("00000000-0000-0000-0000-000000000000", $InventarObjektRow['avatarID'], "Inventory", $RUNTIME['GRID']['HOMEURL'], "WARNUNG: Die Assetdaten von einem deiner Inventarobjekte wurden nicht in der DB gefunden! Item Name: '".$InventarObjektRow['inventoryName']."'."); + }else{ + echo "Found missing asset for item '".$InventarObjektRow['inventoryName']."' from '".$RUNTIME['OPENSIM']->getUserName($InventarObjektRow['avatarID'])."'.\n"; + } }else{ - echo "Found missing asset for item '".$InventarObjektRow['inventoryName']."' from '".$RUNTIME['OPENSIM']->getUserName($InventarObjektRow['avatarID'])."'.\n"; + if((left($InventarObjektRow['inventoryName'], 8) == '[DEFEKT]')) + { + echo " ==> Rename '".$InventarObjektRow['inventoryName']."' -> '".str_replace("[DEFEKT] ", "", $InventarObjektRow['inventoryName'])."'\n"; + } } }else{ - echo "Checking asset for item '".$InventarObjektRow['inventoryName']."' from '".$RUNTIME['OPENSIM']->getUserName($InventarObjektRow['avatarID'])."'.\n"; + //echo "Checking asset for item '".$InventarObjektRow['inventoryName']."' from '".$RUNTIME['OPENSIM']->getUserName($InventarObjektRow['avatarID'])."'.\n"; } }