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/GridServer/GridManager.pm | |
parent | * On Ray casting. Now returning the face normal of the collision face. (diff) | |
download | opensim-SC-8c05b81d6860d8e0da4098cc6f59f630d7c53037.zip opensim-SC-8c05b81d6860d8e0da4098cc6f59f630d7c53037.tar.gz opensim-SC-8c05b81d6860d8e0da4098cc6f59f630d7c53037.tar.bz2 opensim-SC-8c05b81d6860d8e0da4098cc6f59f630d7c53037.tar.xz |
* Committing Lulurun's Cgi/Perl implementation of the UGAI servers.
* I love you long time.
Diffstat (limited to 'share/perl/lib/OpenSim/GridServer/GridManager.pm')
-rw-r--r-- | share/perl/lib/OpenSim/GridServer/GridManager.pm | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/share/perl/lib/OpenSim/GridServer/GridManager.pm b/share/perl/lib/OpenSim/GridServer/GridManager.pm new file mode 100644 index 0000000..2170d74 --- /dev/null +++ b/share/perl/lib/OpenSim/GridServer/GridManager.pm | |||
@@ -0,0 +1,57 @@ | |||
1 | package OpenSim::GridServer::GridManager; | ||
2 | |||
3 | use strict; | ||
4 | use Carp; | ||
5 | use OpenSim::Utility; | ||
6 | use OpenSim::GridServer::Config; | ||
7 | |||
8 | sub getRegionByUUID { | ||
9 | my $uuid = shift; | ||
10 | my $result = &OpenSim::Utility::getSimpleResult($OpenSim::GridServer::Config::SYS_SQL{select_region_by_uuid}, $uuid); | ||
11 | my $count = @$result; | ||
12 | if ($count > 0) { | ||
13 | return $result->[0]; | ||
14 | } | ||
15 | Carp::croak("can not find region"); | ||
16 | } | ||
17 | |||
18 | sub getRegionByHandle { | ||
19 | my $handle = shift; | ||
20 | my $result = &OpenSim::Utility::getSimpleResult($OpenSim::GridServer::Config::SYS_SQL{select_region_by_handle}, $handle); | ||
21 | my $count = @$result; | ||
22 | if ($count > 0) { | ||
23 | return $result->[0]; | ||
24 | } | ||
25 | Carp::croak("can not find region # $handle"); | ||
26 | } | ||
27 | |||
28 | sub getRegionList { | ||
29 | my ($xmin, $ymin, $xmax, $ymax) = @_; | ||
30 | my $result = &OpenSim::Utility::getSimpleResult($OpenSim::GridServer::Config::SYS_SQL{select_region_list}, $xmin, $xmax, $ymin, $ymax); | ||
31 | my $count = @$result; | ||
32 | if ($count > 0) { | ||
33 | return $result; | ||
34 | } | ||
35 | Carp::croak("can not find region"); | ||
36 | } | ||
37 | |||
38 | sub getRegionList2 { | ||
39 | my ($xmin, $ymin, $xmax, $ymax) = @_; | ||
40 | my $result = &OpenSim::Utility::getSimpleResult($OpenSim::GridServer::Config::SYS_SQL{select_region_list2}, $xmin, $xmax, $ymin, $ymax); | ||
41 | my $count = @$result; | ||
42 | if ($count > 0) { | ||
43 | return $result; | ||
44 | } | ||
45 | Carp::croak("can not find region"); | ||
46 | } | ||
47 | |||
48 | sub deleteRegions { | ||
49 | my $result = &OpenSim::Utility::getSimpleResult($OpenSim::GridServer::Config::SYS_SQL{delete_all_regions}); | ||
50 | my $count = @$result; | ||
51 | if ($count > 0) { | ||
52 | return $result; | ||
53 | } | ||
54 | Carp::croak("failed to delete regions"); | ||
55 | } | ||
56 | |||
57 | 1; | ||