diff options
Diffstat (limited to 'share/perl/test/OpenSimTest/UserTester.pm')
-rw-r--r-- | share/perl/test/OpenSimTest/UserTester.pm | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/share/perl/test/OpenSimTest/UserTester.pm b/share/perl/test/OpenSimTest/UserTester.pm new file mode 100644 index 0000000..194102a --- /dev/null +++ b/share/perl/test/OpenSimTest/UserTester.pm | |||
@@ -0,0 +1,53 @@ | |||
1 | package UserTester; | ||
2 | |||
3 | use strict; | ||
4 | use Digest::MD5; | ||
5 | use OpenSim::Utility; | ||
6 | |||
7 | my $user_server_url; | ||
8 | |||
9 | sub init { | ||
10 | &OpenSimTest::Config::registerHandler("login_to_simulator", \&_login_to_simulator); | ||
11 | &OpenSimTest::Config::registerHandler("get_user_by_name", \&_get_user_by_name); | ||
12 | &OpenSimTest::Config::registerHandler("get_user_by_uuid", \&_get_user_by_uuid); | ||
13 | &OpenSimTest::Config::registerHandler("get_avatar_picker_avatar", \&_get_avatar_picker_avatar); | ||
14 | } | ||
15 | |||
16 | sub _login_to_simulator { | ||
17 | my $url = shift || $OpenSimTest::Config::USER_SERVER_URL; | ||
18 | my @param = @_; | ||
19 | my %xml_rpc_param = ( | ||
20 | first => $param[0], | ||
21 | last => $param[1], | ||
22 | passwd => "\$1\$" . Digest::MD5::md5_hex($param[2]), | ||
23 | start => "last", | ||
24 | version => "1.18.3.5", | ||
25 | mac => "cc82e1e2bfd24e5424d66b4fd3f70d55", | ||
26 | ); | ||
27 | return &OpenSim::Utility::XMLRPCCall($url, "login_to_simulator", \%xml_rpc_param); | ||
28 | } | ||
29 | |||
30 | sub _get_user_by_name { | ||
31 | my $url = shift || $OpenSimTest::Config::USER_SERVER_URL; | ||
32 | my @param = @_; | ||
33 | my %xml_rpc_param = ( | ||
34 | avatar_name => $param[0], | ||
35 | ); | ||
36 | return &OpenSim::Utility::XMLRPCCall($url, "get_user_by_name", \%xml_rpc_param); | ||
37 | } | ||
38 | |||
39 | # sample uuid: | ||
40 | # db836502-de98-49c9-9edc-b90a67beb0a8 | ||
41 | sub _get_user_by_uuid { | ||
42 | my $url = shift || $OpenSimTest::Config::USER_SERVER_URL; | ||
43 | my @param = @_; | ||
44 | my %xml_rpc_param = ( | ||
45 | avatar_uuid => $param[0], | ||
46 | ); | ||
47 | return &OpenSim::Utility::XMLRPCCall($url, "get_user_by_uuid", \%xml_rpc_param); | ||
48 | } | ||
49 | |||
50 | sub _get_avatar_picker_avatar { | ||
51 | } | ||
52 | |||
53 | 1; | ||