mirror of
https://github.com/justinccdev/opensimulator-tools.git
synced 2026-08-14 01:07:50 +00:00
Add set last location example program.
This commit is contained in:
@@ -26,4 +26,17 @@ function SetHome($serviceUri, $userId, $regionId, $posX, $posY, $posZ, $lookAtX,
|
||||
return PostToService($serviceUri, http_build_query($params), $debug);
|
||||
}
|
||||
|
||||
function SetLastLocation($serviceUri, $userId, $regionId, $posX, $posY, $posZ, $lookAtX, $lookAtY, $debug = FALSE)
|
||||
{
|
||||
$params
|
||||
= array(
|
||||
'UserID' => $userId,
|
||||
'RegionID' => $regionId,
|
||||
'Position' => "<$posX,$posY,$posZ>",
|
||||
'LookAt' => "<$lookAtX,$lookAtY,0>",
|
||||
'METHOD' => "setposition");
|
||||
|
||||
return PostToService($serviceUri, http_build_query($params), $debug);
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
require_once 'Console/CommandLine.php';
|
||||
require_once "../../config.php";
|
||||
require_once "../../utils.php";
|
||||
require_once "$IP/connectors/grid-user-service-connector.php";
|
||||
|
||||
############
|
||||
### MAIN ###
|
||||
############
|
||||
|
||||
$parser = new Console_CommandLine();
|
||||
|
||||
$parser->addArgument('userID');
|
||||
$parser->addArgument('regionID');
|
||||
$parser->addArgument('posX');
|
||||
$parser->addArgument('posY');
|
||||
$parser->addArgument('posZ');
|
||||
$parser->addArgument('lookAtX');
|
||||
$parser->addArgument('lookAtY');
|
||||
|
||||
try
|
||||
{
|
||||
$params = $parser->parse();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
$parser->displayError($e->getMessage());
|
||||
}
|
||||
|
||||
$userId = $params->args['userID'];
|
||||
|
||||
if (!IsUuid($userId))
|
||||
{
|
||||
print "ERROR: [$userId] is not a well-formed user UUID.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$regionId = $params->args['regionID'];
|
||||
|
||||
if (!IsUuid($userId))
|
||||
{
|
||||
print "ERROR: [homeRegionID] is not a well-formed user UUID.\n";
|
||||
exit(2);
|
||||
}
|
||||
|
||||
$posX = $params->args['posX'];
|
||||
$posY = $params->args['posY'];
|
||||
$posZ = $params->args['posZ'];
|
||||
$lookAtX = $params->args['lookAtX'];
|
||||
$lookAtY = $params->args['lookAtY'];
|
||||
|
||||
SetLastLocation($GRID_USER_SERVICE_URI, $userId, $regionId, $posX, $posY, $posZ, $lookAtX, $lookAtY, TRUE);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user