aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/share/perl/inventory.cgi
diff options
context:
space:
mode:
authorAdam Frisby2008-03-25 16:29:54 +0000
committerAdam Frisby2008-03-25 16:29:54 +0000
commit8c05b81d6860d8e0da4098cc6f59f630d7c53037 (patch)
tree3325e09660ee8ad5a12cc19c8da6c4bd8bff5c21 /share/perl/inventory.cgi
parent* On Ray casting. Now returning the face normal of the collision face. (diff)
downloadopensim-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 'share/perl/inventory.cgi')
-rw-r--r--share/perl/inventory.cgi39
1 files changed, 39 insertions, 0 deletions
diff --git a/share/perl/inventory.cgi b/share/perl/inventory.cgi
new file mode 100644
index 0000000..0542436
--- /dev/null
+++ b/share/perl/inventory.cgi
@@ -0,0 +1,39 @@
1#!/usr/bin/perl -w
2
3use strict;
4use MyCGI;
5use OpenSim::Config;
6use OpenSim::InventoryServer;
7use Carp;
8
9my $request_uri = $ENV{REQUEST_URI} || Carp::croak($OpenSim::Config::SYS_MSG{FATAL});
10my $request_method = "";
11if ($request_uri =~ /([^\/]+)\/$/) {
12 $request_method = $1;
13} else {
14 &MyCGI::outputXml("utf-8", $OpenSim::Config::SYS_MSG{FATAL});
15}
16my $param = &MyCGI::getParam();
17my $post_data = $param->{'POSTDATA'};
18&OpenSim::Utility::Log("inv", "request", $request_uri, $post_data);
19my $response = "";
20eval {
21 $response = &handleRequest($request_method, $post_data);
22};
23if ($@) {
24 $response = "<ERROR>$@</ERROR>";
25}
26&OpenSim::Utility::Log("inv", "response", $response);
27&MyCGI::outputXml("utf-8", $response);
28
29sub handleRequest {
30 my ($methodname, $post_data) = @_;
31 my $handler_list = &OpenSim::InventoryServer::getHandlerList();
32 if (!$handler_list->{$methodname}) {
33 Carp::croak("unknown method name");
34 } else {
35 my $handler = $handler_list->{$methodname};
36 return $handler->($post_data);
37 }
38}
39