diff options
author | Adam Frisby | 2008-03-25 16:29:54 +0000 |
---|---|---|
committer | Adam Frisby | 2008-03-25 16:29:54 +0000 |
commit | 8c05b81d6860d8e0da4098cc6f59f630d7c53037 (patch) | |
tree | 3325e09660ee8ad5a12cc19c8da6c4bd8bff5c21 /share/perl/lib/OpenSim/InventoryServer/InventoryManager.pm | |
parent | * On Ray casting. Now returning the face normal of the collision face. (diff) | |
download | opensim-SC_OLD-8c05b81d6860d8e0da4098cc6f59f630d7c53037.zip opensim-SC_OLD-8c05b81d6860d8e0da4098cc6f59f630d7c53037.tar.gz opensim-SC_OLD-8c05b81d6860d8e0da4098cc6f59f630d7c53037.tar.bz2 opensim-SC_OLD-8c05b81d6860d8e0da4098cc6f59f630d7c53037.tar.xz |
* Committing Lulurun's Cgi/Perl implementation of the UGAI servers.
* I love you long time.
Diffstat (limited to '')
-rw-r--r-- | share/perl/lib/OpenSim/InventoryServer/InventoryManager.pm | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/share/perl/lib/OpenSim/InventoryServer/InventoryManager.pm b/share/perl/lib/OpenSim/InventoryServer/InventoryManager.pm new file mode 100644 index 0000000..97111b7 --- /dev/null +++ b/share/perl/lib/OpenSim/InventoryServer/InventoryManager.pm | |||
@@ -0,0 +1,86 @@ | |||
1 | package OpenSim::InventoryServer::InventoryManager; | ||
2 | |||
3 | use strict; | ||
4 | use Carp; | ||
5 | use OpenSim::Utility; | ||
6 | use OpenSim::InventoryServer::Config; | ||
7 | |||
8 | sub saveInventoryFolder { | ||
9 | my $folder = shift; | ||
10 | my $result = &OpenSim::Utility::getSimpleResult($OpenSim::InventoryServer::Config::SYS_SQL{save_inventory_folder}, | ||
11 | $folder->{"folderID"}, | ||
12 | $folder->{"agentID"}, | ||
13 | $folder->{"parentFolderID"}, | ||
14 | $folder->{"folderName"}, | ||
15 | $folder->{"type"}, | ||
16 | $folder->{"version"}); | ||
17 | } | ||
18 | |||
19 | sub saveInventoryItem { | ||
20 | my $item = shift; | ||
21 | my $result = &OpenSim::Utility::getSimpleResult($OpenSim::InventoryServer::Config::SYS_SQL{save_inventory_item}, | ||
22 | $item->{"inventoryID"}, | ||
23 | $item->{"assetID"}, | ||
24 | $item->{"type"}, | ||
25 | $item->{"parentFolderID"}, | ||
26 | $item->{"avatarID"}, | ||
27 | $item->{"inventoryName"}, | ||
28 | $item->{"inventoryDescription"}, | ||
29 | $item->{"inventoryNextPermissions"}, | ||
30 | $item->{"inventoryCurrentPermissions"}, | ||
31 | $item->{"assetType"}, | ||
32 | $item->{"invType"}, | ||
33 | $item->{"creatorID"}, | ||
34 | $item->{"inventoryBasePermissions"}, | ||
35 | $item->{"inventoryEveryOnePermissions"}); | ||
36 | } | ||
37 | |||
38 | sub getRootFolder { | ||
39 | my $agent_id = shift; | ||
40 | my $result = &OpenSim::Utility::getSimpleResult($OpenSim::InventoryServer::Config::SYS_SQL{get_root_folder}, | ||
41 | &OpenSim::Utility::ZeroUUID(), | ||
42 | $agent_id); | ||
43 | my $count = @$result; | ||
44 | if ($count > 0) { | ||
45 | return $result->[0]; | ||
46 | } else { | ||
47 | return undef; | ||
48 | } | ||
49 | } | ||
50 | |||
51 | sub getChildrenFolders { | ||
52 | my $parent_id = shift; | ||
53 | my $result = &OpenSim::Utility::getSimpleResult($OpenSim::InventoryServer::Config::SYS_SQL{get_children_folders}, $parent_id); | ||
54 | return $result; | ||
55 | } | ||
56 | |||
57 | sub getUserInventoryFolders { | ||
58 | my $agent_id = shift; | ||
59 | my $result = &OpenSim::Utility::getSimpleResult($OpenSim::InventoryServer::Config::SYS_SQL{get_user_inventory_folders}, | ||
60 | $agent_id); | ||
61 | return $result; | ||
62 | } | ||
63 | |||
64 | sub getUserInventoryItems { | ||
65 | my $agent_id = shift; | ||
66 | my $result = &OpenSim::Utility::getSimpleResult($OpenSim::InventoryServer::Config::SYS_SQL{get_user_inventory_items}, | ||
67 | $agent_id); | ||
68 | return $result; | ||
69 | } | ||
70 | |||
71 | sub deleteInventoryItem { | ||
72 | my $item_id = shift; | ||
73 | &OpenSim::Utility::getSimpleResult($OpenSim::InventoryServer::Config::SYS_SQL{delete_inventory_item}, | ||
74 | $item_id); | ||
75 | } | ||
76 | |||
77 | sub moveInventoryFolder { | ||
78 | my $info = shift; | ||
79 | &OpenSim::Utility::getSimpleResult($OpenSim::InventoryServer::Config::SYS_SQL{move_inventory_folder}, | ||
80 | $info->{parentID}->{UUID}, # TODO: not good | ||
81 | $info->{folderID}->{UUID}, # TODO: not good UUID should be extracted in the higher level | ||
82 | ); | ||
83 | } | ||
84 | |||
85 | 1; | ||
86 | |||