jOpenSimWorld

Grid Status: Online
Total Regions: 23
Visitors (30 Days): 12
Total Residents: 485
Online Now: 0
Hypergriders online: 0

Adult Rated Regions in jOpenSim? my Snippets here

10 years 6 months ago #2092 by rico87
Just wanted to ask if jOpenSim could get age verification for inworld regions?

i successfully managed to do this without any additional Modules, i post them here maybe they are of use to jOpenSim?
<?php
$test = mysql_connect("localhost","xxx","xxx");
$data = mysql_select_db("xxx");
$check = "SELECT UserID,LastRegionID FROM GridUser WHERE Online='True'";
$prepare = mysql_query($check);
while($result = mysql_fetch_array($prepare))
{
$user = mysql_fetch_array(mysql_query("SELECT FirstName,LastName FROM UserAccounts WHERE PrincipalID='$result[0]'"));
$age = mysql_fetch_array(mysql_query("SELECT age FROM agecheck WHERE UUID='$result[0]'"));
$rating = mysql_fetch_array(mysql_query("SELECT maturity FROM regionsettings WHERE regionUUID='$result[1]'"));
if ($rating[0] == "2" && (int)$age[0] < 18)
{
echo exec("sudo /opt/open/bin/test.sh $user[0] $user[1]");
}
}

?>
this is the PHP

now comes the bash
#!/bin/sh
screen -S open -p 0 -X stuff "`printf "change region root\r"`";
screen -S open -p 0 -X stuff "`printf "alert-user $1 $2 Sorry $1 $2 this Region is Adult Rated and you are not Age Verified\r"`";
sleep 5s;
screen -S open -p 0 -X stuff "`printf "teleport user $1 $2 Welcome/128/128/21\r"`";

and the cronjob (i use a 5 seconds loop but not all servers can handle this so the workaround is a 1 minute cronjob)
*/1 * * * * php /var/www/agecheck.php
and last but not least the SQL
CREATE TABLE IF NOT EXISTS `agecheck` (
  `UUID` varchar(255) NOT NULL,
  `age` varchar(255) NOT NULL,
  UNIQUE KEY `UUID` (`UUID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

right now this is not comparing birthdate to current date, however thats probably the best solution, also giving apache sudo rights is not a good idea, however in my setup only my server ip has access to port 80

Please Log in or Create an account to join the conversation.

Time to create page: 0.069 seconds

Search

Donate jOpenSim

Please consider supporting our efforts.

Amount

Our Regions

Region: Loc X: Loc Y:
Agora 1000 998
BareBad… 997 997
Bohemas 996 998
BoraBor… 1002 999
Crystal… 1001 1000
DeepTho… 1005 998
FoToSan… 999 995
jCity 1001 997
jOpenWe… 1000 999
JuniorT… 1002 1001
Kanadah… 1002 1000
LindaKe… 1000 997
LittleC… 996 997
MonteSc… 1001 1001
Naos 999 999
Pangaea 1005 1003
RiverSi… 999 1000
Sakani 999 998
Snambin 1001 998
Tartola 997 998
ViewerH… 1002 998
WaterWo… 1001 999
WilderK… 1000 1000

jOpenSimWorld

Grid Status: Online
Total Regions: 23
Visitors (30 Days): 12
Total Residents: 485
Online Now: 0
Hypergriders online: 0