diff options
Diffstat (limited to '')
-rw-r--r-- | share/perl/lib/OpenSim/AssetServer/AssetManager.pm | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/share/perl/lib/OpenSim/AssetServer/AssetManager.pm b/share/perl/lib/OpenSim/AssetServer/AssetManager.pm new file mode 100644 index 0000000..f36ab1a --- /dev/null +++ b/share/perl/lib/OpenSim/AssetServer/AssetManager.pm | |||
@@ -0,0 +1,34 @@ | |||
1 | package OpenSim::AssetServer::AssetManager; | ||
2 | |||
3 | use strict; | ||
4 | use Carp; | ||
5 | use OpenSim::Utility; | ||
6 | use OpenSim::AssetServer::Config; | ||
7 | |||
8 | |||
9 | sub getAssetByUUID { | ||
10 | my $uuid = shift; | ||
11 | my $result = &OpenSim::Utility::getSimpleResult($OpenSim::AssetServer::Config::SYS_SQL{select_asset_by_uuid}, $uuid); | ||
12 | my $count = @$result; | ||
13 | if ($count > 0) { | ||
14 | return $result->[0]; | ||
15 | } | ||
16 | Carp::croak("can not find asset($uuid)"); | ||
17 | } | ||
18 | |||
19 | sub saveAsset { | ||
20 | my $asset = shift; | ||
21 | my $result = &OpenSim::Utility::getSimpleResult( | ||
22 | $OpenSim::AssetServer::Config::SYS_SQL{insert_asset}, | ||
23 | $asset->{id}, | ||
24 | $asset->{name}, | ||
25 | $asset->{description}, | ||
26 | $asset->{assetType}, | ||
27 | $asset->{invType}, | ||
28 | $asset->{"local"}, | ||
29 | $asset->{temporary}, | ||
30 | $asset->{data} | ||
31 | ); | ||
32 | } | ||
33 | |||
34 | 1; | ||