Figuring out your online status in Real World

Now, on your web site, first download Keith Devens’ library, save it as “xmlrpc.inc” where you can include it, and then use the following code somewhere inside your web site (you have to manually change the channel id below, and don’t forget to place the PHP tags before and after the code, which I cannot display here inside WordPress):

require("xmlrpc.inc");
$channel = "your-channel-id";
$strValue = ""; $intValue = 0;
$array["Channel"] = $channel;
$array["IntValue"] = $intValue;
$array["StringValue"] = $strValue;

list($success, $response) = XMLRPC_request('xmlrpc.secondlife.com', '/cgi-bin/xmlrpc.cgi', 'llRemoteData', array(XMLRPC_prepare($array)));
print "I am ";
if ($success) {
  print $response["StringValue"];
}
else
{
print "having problems contacting RPC server...";
}

You could do much more with this! Each message can send an integer and a string, and this means you could set up handlers for several different things, like tracking your position, listing your inventory, see what you’ve got attached, see who is nearby, etc. Basically, all information that you can collect inline, you can provide off-world, too! It’s just a question of replying to requests properly. Residents seem to be using this to track the status of their vending machines. Hmm, what a nifty idea!

| ← Previous | | | Next → |
%d bloggers like this: