Check inventory script/de

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
{{Quicklinks|Check inventory script}}{{ReleaseInfo}}
 
{{Quicklinks|Check inventory script}}{{ReleaseInfo}}
  
== Check Inventory Script ==
+
== Überprüfen des Inventarskript ==
  
Prior to 2022 the viewers accepted any form of inventory outside of completely malformed setups. This has now changed with new code added to viewers designed to validate whether the inventory structure is properly setup. Unfortunately due to bugs and changes in OpenSim some older inventories of users created prior to 2015 exhibit problematic structures that can cause inventory failing to load or login to be blocked entirely. This script aims to give grid operators a way to validate the inventory of a user or all users to see which are likely to encounter issues and what exactly is wrong. We also outline the steps and tools on how to fix these issues here.
+
Vor 2022 akzeptierten die Viewer jede Form von Inventar.  
  
=== The script ===
+
Dies hat sich nun geändert, da Viewern neuer Code hinzugefügt wurde, um zu überprüfen, ob die Bestandsstruktur ordnungsgemäß eingerichtet ist.
  
Currently a github gist for convenience, please direct issues or requests at [http://opensimulator.org/wiki/IRC IRC]
+
Leider weisen aufgrund von Fehlern und Änderungen in OpenSim einige ältere Inventare von Benutzern, die vor 2015 erstellt wurden,  
  
[https://gist.github.com/Tampa/7e7cd34703b889b046af75238308cd25 Check Inventory Script]
+
problematische Strukturen auf, die dazu führen können, dass das Inventar nicht geladen oder die Anmeldung vollständig blockiert wird.  
  
=== Usage ===
+
Dieses Skript soll Grid-Betreibern eine Möglichkeit geben, das Inventar eines Benutzers oder aller Benutzer zu validieren,
  
The script requires a server with PHP7.4 installed on it.
+
um zu sehen bei welchen wahrscheinlich Probleme auftreten und was genau falsch ist.  
  
* Open the script with your favorite editor and check the top setup for $database_info variables. Set them to connect to your grid database containing the inventoryfolders table.
+
Wir beschreiben hier auch die Schritte und Tools zur Behebung dieser Probleme.
  
* Run the script via <pre style="color: red"> php check_inventory.php FirstName LastName </pre> This will run the script looking for fatal inventory errors.
+
=== Das Skript ===
  
* Run the script via <pre style="color: red"> php check_inventory.php FirstName LastName true</pre> Will run the script looking for optional duplicate folders of the same type.
+
Derzeit ein Github-Gist der Einfachheit halber, bitte richten Sie Probleme oder Anfragen an [http://opensimulator.org/wiki/IRC IRC]
  
 +
[https://gist.github.com/Tampa/7e7cd34703b889b046af75238308cd25 Check Inventory Script]
  
The script can also be run for all users, but the output will be quite large. It is best to pipe the output to file if possible.
+
=== Verwendungszweck ===
  
<pre style="color: red"> php check_inventory.php everyone true</pre> Will run the script looking for optional duplicate folders of the same type for all users in UserAccounts table.
+
Das Skript erfordert einen Server, auf dem PHP7.4 installiert ist.
 +
 
 +
* Öffnen Sie das Skript mit Ihrem bevorzugten Editor und überprüfen Sie das oberste Setup auf $database info Variablen. Stellen Sie sie so ein, dass sie sich mit Ihrer Grid-Datenbank verbinden, die die Inventoryfolder-Tabelle enthält.
 +
 
 +
* Führen Sie das Skript über aus <pre style="color: red"> php check_inventory.php FirstName LastName </pre> Dadurch wird das Skript ausgeführt, das nach schwerwiegenden Inventarfehlern sucht.
 +
 
 +
* Führen Sie das Skript über aus <pre style="color: red"> php check_inventory.php FirstName LastName true</pre> Führt das Skript aus und sucht nach optionalen doppelten Ordnern desselben Typs.
 +
 
 +
Das Skript kann auch für alle Benutzer ausgeführt werden, aber die Ausgabe wird ziemlich groß sein. Es ist am besten, wenn möglich, die Ausgabe in eine Datei zu leiten.
 +
 
 +
<pre style="color: red"> php check_inventory.php everyone true</pre> Führt das Skript aus und sucht nach optionalen doppelten Ordnern desselben Typs für alle Benutzer in der UserAccounts-Tabelle.
  
  
Line 30: Line 41:
  
 
<div style="background-color:#FFA0A0; padding:10px; padding-bottom:5px; border: 1px #FF544F solid">
 
<div style="background-color:#FFA0A0; padding:10px; padding-bottom:5px; border: 1px #FF544F solid">
'''If this seems complicated or dangerous that is because making changes to the database directly usually is. If this is something you rather leave to someone with more knowledge feel free to reach out to people on IRC for help or contact one of the many [http://opensimulator.org/wiki/FAQ#OpenSimulator_in_the_Wild providers of OpenSim hosted services].'''
+
'''Wenn dies kompliziert oder gefährlich erscheint, liegt dies daran, dass Änderungen in der Datenbank normalerweise direkt vorgenommen werden. Wenn Sie dies lieber jemandem mit mehr Wissen überlassen möchten, können Sie sich gerne an die Leute im IRC wenden, um Hilfe zu erhalten, oder einen der vielen [http://opensimulator.org/wiki/FAQ#OpenSimulator_in_the_Wild providers of OpenSim hosted services].'''
 
</div>
 
</div>
  
Line 94: Line 105:
  
 
These queries can, but probably should not be, run for all users by omitting the where clause specifying the agent UUID. '''We strongly suggest you look at each users inventory separately and make changes as required!!'''
 
These queries can, but probably should not be, run for all users by omitting the where clause specifying the agent UUID. '''We strongly suggest you look at each users inventory separately and make changes as required!!'''
 +
 +
[[Category:German Translations]]

Revision as of 22:57, 12 May 2022

Contents

Überprüfen des Inventarskript

Vor 2022 akzeptierten die Viewer jede Form von Inventar.

Dies hat sich nun geändert, da Viewern neuer Code hinzugefügt wurde, um zu überprüfen, ob die Bestandsstruktur ordnungsgemäß eingerichtet ist.

Leider weisen aufgrund von Fehlern und Änderungen in OpenSim einige ältere Inventare von Benutzern, die vor 2015 erstellt wurden,

problematische Strukturen auf, die dazu führen können, dass das Inventar nicht geladen oder die Anmeldung vollständig blockiert wird.

Dieses Skript soll Grid-Betreibern eine Möglichkeit geben, das Inventar eines Benutzers oder aller Benutzer zu validieren,

um zu sehen bei welchen wahrscheinlich Probleme auftreten und was genau falsch ist.

Wir beschreiben hier auch die Schritte und Tools zur Behebung dieser Probleme.

Das Skript

Derzeit ein Github-Gist der Einfachheit halber, bitte richten Sie Probleme oder Anfragen an IRC

Check Inventory Script

Verwendungszweck

Das Skript erfordert einen Server, auf dem PHP7.4 installiert ist.

  • Öffnen Sie das Skript mit Ihrem bevorzugten Editor und überprüfen Sie das oberste Setup auf $database info Variablen. Stellen Sie sie so ein, dass sie sich mit Ihrer Grid-Datenbank verbinden, die die Inventoryfolder-Tabelle enthält.
  • Führen Sie das Skript über aus
     php check_inventory.php FirstName LastName 
    Dadurch wird das Skript ausgeführt, das nach schwerwiegenden Inventarfehlern sucht.
  • Führen Sie das Skript über aus
     php check_inventory.php FirstName LastName true
    Führt das Skript aus und sucht nach optionalen doppelten Ordnern desselben Typs.

Das Skript kann auch für alle Benutzer ausgeführt werden, aber die Ausgabe wird ziemlich groß sein. Es ist am besten, wenn möglich, die Ausgabe in eine Datei zu leiten.

 php check_inventory.php everyone true
Führt das Skript aus und sucht nach optionalen doppelten Ordnern desselben Typs für alle Benutzer in der UserAccounts-Tabelle.



Wenn dies kompliziert oder gefährlich erscheint, liegt dies daran, dass Änderungen in der Datenbank normalerweise direkt vorgenommen werden. Wenn Sie dies lieber jemandem mit mehr Wissen überlassen möchten, können Sie sich gerne an die Leute im IRC wenden, um Hilfe zu erhalten, oder einen der vielen providers of OpenSim hosted services.

How to resolve issues

Inventory setup was meant to have a single root folder, called "My Inventory". All folders should be sorted underneath this folder.

The usual folders for Clothing, Objects and even Trash have specific types designed to give them their icons and provide a way to sort incoming items accordingly. Only one set of these is meant to exist, but OpenSim adds a second set of these folders to the inventory under the "My Suitcase" folder used for the HG1.0 protocol.

You can read more about the folder types in the Database documentation

To resolve issues the inventory structure needs to be returned to the proper setup accepted by the viewers. To do this you will need to edit the inventoryfolders database table. This can be done from the command line or via external programs such as DBeaver or Navicat whichever you prefer.


Create a backup

Using tools like sqldump or the aforementioned database tools create a backup of the inventoryfolders table first before making edits to the table!


Find the user

Using either filters or an SQL query to select just the user we are concerned with filter for the "AgentID" in inventoryfolders.

 SELECT * FROM inventoryfolders WHERE `AgentID` = 'user-uuid' ;

Check the specific folders

The script will check for folders that are not "-1" of type, which signifies a normal folder a user might create. To fetch just these folders add a filter to only show folders not of this type.

 SELECT * FROM inventoryfolders WHERE `AgentID` = 'user-uuid' AND `type` != '-1' ;

Find the duplicates

To find the folders under "My Suitcase" is easy now. You should see the "My Inventory" folder in the selected set of rows showing also the parentFolderID, which should be a null key i.e. "00000000-0000-0000-0000-000000000000". You can see it's folderID as well here. This UUID will be what all proper other inventory folders, such as Clothing, Objects and Trash, will show in their respective parentFolderID. This creates a hierarchy starting with "My Inventory" and cascading down to all folders in the inventory structure.

Now sorting the query by the folderName will easily show the duplicates and their parentFolderID pointing not to "My Inventory" but the "My Suitcase" folder and its folderID.

 SELECT * FROM inventoryfolders WHERE `AgentID` = 'user-uuid' AND `type` != '-1' ORDER BY folderName DESC;

Observe, the "My Suitcase" folder's parent folder is also "My Inventory" folder.

Remove duplicates

Unless you are running the HG1.0 protocol using the "My Suitcase" folder to share items on the hypergrid without exposing your entire inventory you don't actually need the folder or it's sub-folders.

However, removing the folder entirely when it might contain items the user placed there might not be the best idea. Instead simply change the type of each duplicate folder to "-1" to make them regular folders.

 UPDATE inventoryfolders SET `type` = '-1' WHERE `AgentID` = 'user-uuid' AND `parentFolderID` != 'folderID of My Inventory' AND `parentFolderID` != '00000000-0000-0000-0000-000000000000'; 

This will set all folders to type "-1" for that specific user if the parent folder is not "My Inventory", which will change all "My Suitcase" sub-folders.

Checking bad root folders

Newer versions of OpenSim will put the "My Suitcase" folder as a type that does not conflict, usually type "100", but older versions will have put it as type "8" or "9", which causes a fatal error. To resolve this change the type to "100".

 UPDATE inventoryfolders SET `type` = '100' WHERE `AgentID` = 'user-uuid' AND `folderName` = 'My Suitcase'; 

In some cases the "My Inventory" folder might still be of the old type "9", which will also causes issues. To resolve this it needs to be changed to type "8".

 UPDATE inventoryfolders SET `type` = '8' WHERE `AgentID` = 'user-uuid' AND `folderName` = 'My Inventory'; 

These queries can, but probably should not be, run for all users by omitting the where clause specifying the agent UUID. We strongly suggest you look at each users inventory separately and make changes as required!!

Personal tools
General
About This Wiki