SLUniverse Forums - View Single Post - How to run a serious OpenSim grid at home
View Single Post
Old 04-10-2009, 05:38 AM   #10 (permalink)
Makoto
Scripter Most Ordinary
 
Makoto's Avatar
 
Join Date: Mar 2009
Location: Where ever i lay my hat, that's my home
Posts: 413
My Mood:
SL Join Date: 14/03/09 this AV
Business: None
Send a message via MSN to Makoto Send a message via Yahoo to Makoto
I just completed a perl script to allow you to create all the regions easily and quickly with a single config file.

Here it is.

input file has to be as follows
Code:
YOUREXTERNALIP,YOURINTERNALIP,GODFIRSTNAME,GODLASTNAME,GODPASS
REGIONGUID,REGIONNAME,REGIONX,REGIONY,REGIONPORT
Repeat the second line of that ad infinitum then it will create the correct XML files using the script below in about 2 seconds (i did 25 in one go) 5x5 grid.

Code:
$inputfile = "D:\\opensimprod\\regionguids.txt";
$outputdir = "D:\\opensimprod\\Regions\\";

#First read in the first line of the input file which will contain the 
#internal and external ip addresses as well as the realm god name and password
open(INP,$inputfile)|| die("Cannot open input file\n");
$line = <INP>;
chomp($line);
@information = split(/,/,$line);
$externalip = $information[0];
$internalip = $information[1];
$godfirst = $information[2];
$godlast = $information[3];
$godpass = $information[4];

#Open the output files on the fly to match the information loaded in the next part
while($line = <INP>)
{
    chomp($line);
    @information = split(/,/,$line);
    $guid = $information[0];
    $region = $information[1];
    $region_x = $information[2];
    $region_y = $information[3];
    $region_port = $information[4];
    
    open(OUTP,">$outputdir$region_x\-$region_y\-$region.xml") || die("Cannot Create Output File $outputdir\_$region_x\-$region_y\-$region.xml\n");
    print OUTP "\<Root\>\n<Config sim_UUID=\"$guid\" sim_name=\"$region\" sim_location_x=\"$region_x\" sim_location_y=\"$region_y\" ";
    print OUTP " internal_ip_address=\"$internalip\" internal_ip_port=\"$region_port\" allow_alternate_ports=\"false\" external_host_name=\"$externalip\" ";
    print OUTP "master_avatar_uuid=\"00000000-0000-0000-0000-000000000000\" master_avatar_first=\"$godfirst\" master_avatar_last=\"$godlast\" master_avatar_pass=\"$godpass\" "; 
    print OUTP "lastmap_uuid=\"964797ed-84d4-4878-8a2c-2123e0ac3d03\" lastmap_refresh=\"1239303914\" nonphysical_prim_max=\"0\" ";
    print OUTP "physical_prim_max=\"0\" clamp_prim_size=\"false\" object_capacity=\"0\" \/\>\n\<\/Root\>\n";
    close OUTP;
}
close INP;

Last edited by Makoto; 04-10-2009 at 06:26 AM.
Makoto is offline   Reply With Quote