UserTester.pm 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package UserTester;
  2. use strict;
  3. use Digest::MD5;
  4. use OpenSim::Utility;
  5. my $user_server_url;
  6. sub init {
  7. &OpenSimTest::Config::registerHandler("login_to_simulator", \&_login_to_simulator);
  8. &OpenSimTest::Config::registerHandler("get_user_by_name", \&_get_user_by_name);
  9. &OpenSimTest::Config::registerHandler("get_user_by_uuid", \&_get_user_by_uuid);
  10. &OpenSimTest::Config::registerHandler("get_avatar_picker_avatar", \&_get_avatar_picker_avatar);
  11. }
  12. sub _login_to_simulator {
  13. my $url = shift || $OpenSimTest::Config::USER_SERVER_URL;
  14. my @param = @_;
  15. my %xml_rpc_param = (
  16. first => $param[0],
  17. last => $param[1],
  18. passwd => "\$1\$" . Digest::MD5::md5_hex($param[2]),
  19. start => "last",
  20. version => "1.18.3.5",
  21. mac => "cc82e1e2bfd24e5424d66b4fd3f70d55",
  22. );
  23. return &OpenSim::Utility::XMLRPCCall($url, "login_to_simulator", \%xml_rpc_param);
  24. }
  25. sub _get_user_by_name {
  26. my $url = shift || $OpenSimTest::Config::USER_SERVER_URL;
  27. my @param = @_;
  28. my %xml_rpc_param = (
  29. avatar_name => $param[0],
  30. );
  31. return &OpenSim::Utility::XMLRPCCall($url, "get_user_by_name", \%xml_rpc_param);
  32. }
  33. # sample uuid:
  34. # db836502-de98-49c9-9edc-b90a67beb0a8
  35. sub _get_user_by_uuid {
  36. my $url = shift || $OpenSimTest::Config::USER_SERVER_URL;
  37. my @param = @_;
  38. my %xml_rpc_param = (
  39. avatar_uuid => $param[0],
  40. );
  41. return &OpenSim::Utility::XMLRPCCall($url, "get_user_by_uuid", \%xml_rpc_param);
  42. }
  43. sub _get_avatar_picker_avatar {
  44. }
  45. 1;