GridTester.pm 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package GridTester;
  2. use strict;
  3. use OpenSim::Utility;
  4. sub init {
  5. &OpenSimTest::Config::registerHandler("simulator_login", \&_simulator_login);
  6. &OpenSimTest::Config::registerHandler("simulator_data_request", \&_simulator_data_request);
  7. &OpenSimTest::Config::registerHandler("simulator_after_region_moved", \&_simulator_after_region_moved);
  8. &OpenSimTest::Config::registerHandler("map_block", \&_map_block);
  9. }
  10. sub _simulator_login {
  11. my $url = shift || $OpenSimTest::Config::GRID_SERVER_URL;
  12. my @param = @_;
  13. my %xml_rpc_param = (
  14. "authkey" => "null",
  15. "UUID" => $param[0],
  16. "sim_ip" => $param[1],
  17. "sim_port" => $param[2],
  18. "region_locx" => 1000,
  19. "region_locy" => 1000,
  20. "sim_name" => "OpenTest",
  21. "http_port" => 9000,
  22. "remoting_port" => 8895,
  23. "map-image-id" => "0e5a5e87-08d9-4b37-9b8e-a4c3c4e409ab",
  24. );
  25. return &OpenSim::Utility::XMLRPCCall($url, "simulator_login", \%xml_rpc_param);
  26. }
  27. sub _map_block {
  28. my $url = shift || $OpenSimTest::Config::GRID_SERVER_URL;
  29. my @param = @_;
  30. my %xml_rpc_param = (
  31. xmin => $param[0],
  32. ymin => $param[1],
  33. xmax => $param[2],
  34. ymax => $param[3],
  35. );
  36. return &OpenSim::Utility::XMLRPCCall($url, "map_block", \%xml_rpc_param);
  37. }
  38. sub _simulator_data_request {
  39. my $url = shift || $OpenSimTest::Config::GRID_SERVER_URL;
  40. my @param = @_;
  41. my %xml_rpc_param = (
  42. region_handle => $param[0],
  43. authkey => undef,
  44. );
  45. return &OpenSim::Utility::XMLRPCCall($url, "simulator_data_request", \%xml_rpc_param);
  46. }
  47. sub _simulator_after_region_moved {
  48. my $url = shift || $OpenSimTest::Config::GRID_SERVER_URL;
  49. my @param = @_;
  50. my %xml_rpc_param = (
  51. UUID => $param[0],
  52. );
  53. return &OpenSim::Utility::XMLRPCCall($url, "simulator_after_region_moved", \%xml_rpc_param);
  54. }
  55. 1;