aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/share/perl/lib/OpenSim/GridServer/GridManager.pm
diff options
context:
space:
mode:
Diffstat (limited to 'share/perl/lib/OpenSim/GridServer/GridManager.pm')
-rw-r--r--share/perl/lib/OpenSim/GridServer/GridManager.pm57
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 @@
1package OpenSim::GridServer::GridManager;
2
3use strict;
4use Carp;
5use OpenSim::Utility;
6use OpenSim::GridServer::Config;
7
8sub 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
18sub 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
28sub 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
38sub 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
48sub 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
571;