RegionGenerator
From OpenSimulator
(→About) |
(→Download) |
||
(14 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Quicklinks}} | ||
== Region Generator == | == Region Generator == | ||
=== About === | === About === | ||
− | This is the all new version 2. | + | This is the all new version 2.1 of Region Generator. |
− | It now features support for multiple regions. | + | |
− | The password is also now optional in 2.00. | + | 2.1 Features: |
+ | * Fixed big bug preventing windows version from working. | ||
+ | |||
+ | 2.00 Features: | ||
+ | * It now features support for multiple regions. | ||
+ | * The password is also now optional in 2.00. | ||
It generates a square piece of land. | It generates a square piece of land. | ||
Line 13: | Line 19: | ||
I have made a .exe version of this program for windows, you can get it from these locations: | I have made a .exe version of this program for windows, you can get it from these locations: | ||
− | http://www.mediafire.com/? | + | http://www.mediafire.com/?0mdvexdgmxu |
+ | |||
+ | http://4rensics.com/regiongen21.zip | ||
− | + | * [https://github.com/BigManzai/OpenSim-Divers/tree/master/Web openSIMULATOR-Regions-Generator] - Regions-Generator for PHP, PHP7 Ready building with/for OpenSimulator 0.9.1(inc. var regions, position) not testet 0.9.0, 0.8.x. | |
=== How to use === | === How to use === | ||
Line 23: | Line 31: | ||
** You can Remove or Add as many regions as you like in this file. Region Generator 2.00 supports multiple regions. | ** You can Remove or Add as many regions as you like in this file. Region Generator 2.00 supports multiple regions. | ||
** The password is optional, when connecting into grids like osgrid, it is normally not needed. You need to decide if you need it or not, experiment! | ** The password is optional, when connecting into grids like osgrid, it is normally not needed. You need to decide if you need it or not, experiment! | ||
+ | ** If you give one region port 9000, give the next 9100 for example. | ||
* Run regiongen.exe | * Run regiongen.exe | ||
* Copy the Regions folder to your opensim/bin folder. | * Copy the Regions folder to your opensim/bin folder. | ||
Line 28: | Line 37: | ||
If using the python source code (Linux, mac etc), make sure you have the cheetah and python 2.5 dependency's installed and edit the configuration in regionconfig.py then run :) | If using the python source code (Linux, mac etc), make sure you have the cheetah and python 2.5 dependency's installed and edit the configuration in regionconfig.py then run :) | ||
+ | |||
+ | === Errors === | ||
+ | <pre> | ||
+ | Traceback (most recent call last): | ||
+ | File "regiongen.py", line xx, in <module> | ||
+ | ImportError: No module named regionconfig | ||
+ | </pre> | ||
+ | |||
+ | You are missing the regiongen config file, you can find it at the bottom of thispage | ||
=== Source Code === | === Source Code === | ||
+ | |||
It requires the Cheetah Templating module and python 2.5. | It requires the Cheetah Templating module and python 2.5. | ||
Line 36: | Line 55: | ||
You can get python from http://www.python.org/download/ | You can get python from http://www.python.org/download/ | ||
− | ==== regiongen.py ==== | + | ==== regiongen.py Python 2 ==== |
− | < | + | <source lang="python"> |
#!/usr/bin/python | #!/usr/bin/python | ||
− | # | + | # REGION GEN 2.1 |
+ | import os | ||
+ | import sys | ||
+ | sys.path.append(os.getcwd()) | ||
from Cheetah.Template import Template | from Cheetah.Template import Template | ||
import uuid | import uuid | ||
− | |||
import pickle | import pickle | ||
import regionconfig | import regionconfig | ||
Line 99: | Line 120: | ||
# Figure out password | # Figure out password | ||
− | if | + | if 'password' in s: |
password = "master_avatar_pass=\"%s\"" % s['password'] | password = "master_avatar_pass=\"%s\"" % s['password'] | ||
else: | else: | ||
Line 113: | Line 134: | ||
# Try to get UUID from settings | # Try to get UUID from settings | ||
# Generate + Save if not found | # Generate + Save if not found | ||
− | if | + | if regionname in settings: |
uid = settings[regionname] | uid = settings[regionname] | ||
else: | else: | ||
Line 137: | Line 158: | ||
except IOError: | except IOError: | ||
pass | pass | ||
− | </ | + | </source> |
− | ==== regionconfig.py ==== | + | ==== regiongen.py Python 3 ==== |
− | < | + | <source lang="python"> |
− | # REGIONGEN 2.00 CONFIGURATION FILE | + | #!/usr/bin/python |
+ | # REGION GEN 2.1 Python 3.8 | ||
+ | # pip install Cheetah3 | ||
+ | |||
+ | import os | ||
+ | import sys | ||
+ | sys.path.append(os.getcwd()) | ||
+ | from Cheetah.Template import Template | ||
+ | import uuid | ||
+ | import pickle | ||
+ | import regionconfig | ||
+ | |||
+ | regionsdir = 'Regions' | ||
+ | |||
+ | template = """<Root> | ||
+ | <Config sim_UUID="$uuid" sim_name="$regionname" sim_location_x="$x" sim_location_y="$y" internal_ip_address="$s.internalip" internal_ip_port="$port" allow_alternate_ports="false" external_host_name="$s.externalhost" master_avatar_uuid="$s.useruuid" estate_covenant_uuid="00000000-0000-0000-0000-000000000000" lastmap_refresh="0" master_avatar_first="$s.firstname" master_avatar_last="$s.lastname" $password /> | ||
+ | </Root> | ||
+ | |||
+ | """ | ||
+ | |||
+ | savefile = "regiongen_save.pkl" | ||
+ | |||
+ | def maketemplate(regionname, x, y, port, uid, password=None): | ||
+ | t = Template(template) | ||
+ | t.s = s | ||
+ | t.uuid = uid | ||
+ | t.password = password | ||
+ | t.regionname = regionname | ||
+ | t.x = x | ||
+ | t.y = y | ||
+ | t.port = port | ||
+ | return str(t) | ||
+ | |||
+ | # Make directory to put regions in if not there | ||
+ | try: | ||
+ | os.mkdir(regionsdir) | ||
+ | except OSError: | ||
+ | pass | ||
+ | |||
+ | settings = {} | ||
+ | |||
+ | # Load settings file | ||
+ | try: | ||
+ | settingsfile = open(savefile) | ||
+ | settings = pickle.load(settingsfile) | ||
+ | settingsfile.close() | ||
+ | except IOError: | ||
+ | pass | ||
+ | |||
+ | for s in regionconfig.configlist: | ||
+ | print(s) | ||
+ | counter = 0 | ||
+ | for xnum in range(s['x'][0], s['x'][1]): | ||
+ | for ynum in range(s['y'][0], s['y'][1]): | ||
+ | counter += 1 | ||
+ | default = False | ||
+ | |||
+ | # Figure out region name | ||
+ | if counter == 1: | ||
+ | default = True | ||
+ | regionname = s['regionname'] | ||
+ | else: | ||
+ | regionname = s['regionname'] + str(counter) | ||
+ | |||
+ | # Figure out password | ||
+ | if 'password' in s: | ||
+ | password = "master_avatar_pass=\"%s\"" % s['password'] | ||
+ | else: | ||
+ | password = '' | ||
+ | |||
+ | # Figure out paths | ||
+ | path = os.path.join(regionsdir,"%s.%s.%s.xml" % \ | ||
+ | (regionname, xnum, ynum)) | ||
+ | |||
+ | # Calculate port | ||
+ | port = s['startport'] + (counter - 1) | ||
+ | |||
+ | # Try to get UUID from settings | ||
+ | # Generate + Save if not found | ||
+ | if regionname in settings: | ||
+ | uid = settings[regionname] | ||
+ | else: | ||
+ | uid = str(uuid.uuid1()) | ||
+ | settings[regionname] = uid | ||
+ | |||
+ | # Make template | ||
+ | tmpldata = maketemplate(regionname, xnum, ynum, port, uid, password) | ||
+ | |||
+ | # Save file | ||
+ | tmplfile = open(path, 'w') | ||
+ | tmplfile.write(tmpldata) | ||
+ | tmplfile.close() | ||
+ | |||
+ | # Print progress | ||
+ | print(regionname) | ||
+ | |||
+ | # Save settings file | ||
+ | try: | ||
+ | settingsfile = open(savefile, 'w') | ||
+ | pickle.dump(settings, settingsfile) | ||
+ | settingsfile.close() | ||
+ | except IOError: | ||
+ | pass | ||
+ | |||
+ | </source> | ||
+ | ==== regionconfig.py Python 2+3 ==== | ||
+ | <source lang="python"> | ||
+ | # REGIONGEN 2.00 + 2.10 CONFIGURATION FILE | ||
configlist = [] # Dont touch this | configlist = [] # Dont touch this | ||
# START OF REGION | # START OF REGION | ||
− | s = {} | + | s = {} # Dont touch this |
# Region Configuration | # Region Configuration | ||
s['regionname'] = "RegionSetOne" # Type the name of your island | s['regionname'] = "RegionSetOne" # Type the name of your island | ||
− | s['x'] = [5100,5105] | + | s['x'] = [5100,5105] # X Position... From <------> To |
− | s['y'] = [5100,5105] | + | s['y'] = [5100,5105] # Y Position... From <------> To |
# User Configuration | # User Configuration | ||
− | s['firstname'] = "Tom" | + | s['firstname'] = "Tom" # Your First Name |
− | s['lastname'] = "Jones" | + | s['lastname'] = "Jones" # Your Last Name |
− | s['useruuid'] = 'get your clients uuid' | + | s['useruuid'] = 'get your clients uuid' # Your UUID, You can use a script in game to get this |
− | #s['password'] = 'pass' | + | #s['password'] = 'pass' # This is optional, it is commented out by default. |
# Network Configuration | # Network Configuration | ||
− | s['startport'] = 9000 | + | s['startport'] = 9000 # We recommend leaving this at 9000 for opensim |
# unless this isnt the first region. | # unless this isnt the first region. | ||
− | s['internalip'] = "123.123.123.123" | + | s['internalip'] = "123.123.123.123" # You need to get this to a internal wired/wireless lan ip address |
− | s['externalhost'] = "example.org" | + | s['externalhost'] = "example.org" # This is the address that people connect from the outside world to |
− | configlist.append(s) | + | configlist.append(s) # Dont touch this |
# END OF REGION | # END OF REGION | ||
# YOU MAY COPY AND PASTE MORE CONFIGURATIONS INTO THIS FILE TO ADD MORE REGIONS. | # YOU MAY COPY AND PASTE MORE CONFIGURATIONS INTO THIS FILE TO ADD MORE REGIONS. | ||
Line 168: | Line 296: | ||
# START OF REGION | # START OF REGION | ||
− | s = {} | + | s = {} # Dont touch this |
# Region Configuration | # Region Configuration | ||
s['regionname'] = "RegionSetTwo" # Type the name of your island | s['regionname'] = "RegionSetTwo" # Type the name of your island | ||
− | s['x'] = [5200,5205] | + | s['x'] = [5200,5205] # X Position... From <------> To |
− | s['y'] = [5200,5205] | + | s['y'] = [5200,5205] # Y Position... From <------> To |
# User Configuration | # User Configuration | ||
− | s['firstname'] = "Tom" | + | s['firstname'] = "Tom" # Your First Name |
− | s['lastname'] = "Jones" | + | s['lastname'] = "Jones" # Your Last Name |
− | s['useruuid'] = 'get your clients uuid' | + | s['useruuid'] = 'get your clients uuid' # Your UUID, You can use a script in game to get this |
− | #s['password'] = 'pass' | + | #s['password'] = 'pass' # This is optional, it is commented out by default. |
# Network Configuration | # Network Configuration | ||
− | s['startport'] = 9100 | + | s['startport'] = 9100 # We recommend leaving this at 9000 for opensim |
# unless this isnt the first region. | # unless this isnt the first region. | ||
− | s['internalip'] = "123.123.123.123" | + | s['internalip'] = "123.123.123.123" # You need to get this to a internal wired/wireless lan ip address |
− | s['externalhost'] = "example.org" | + | s['externalhost'] = "example.org" # This is the address that people connect from the outside world to |
− | configlist.append(s) | + | configlist.append(s) # Dont touch this |
# END OF REGION | # END OF REGION | ||
# YOU MAY COPY AND PASTE MORE CONFIGURATIONS INTO THIS FILE TO ADD MORE REGIONS. | # YOU MAY COPY AND PASTE MORE CONFIGURATIONS INTO THIS FILE TO ADD MORE REGIONS. | ||
− | </ | + | </source> |
Latest revision as of 01:01, 10 August 2020
Contents |
[edit] Region Generator
[edit] About
This is the all new version 2.1 of Region Generator.
2.1 Features:
- Fixed big bug preventing windows version from working.
2.00 Features:
- It now features support for multiple regions.
- The password is also now optional in 2.00.
It generates a square piece of land.
You can feed it the from-to X Postion and from-to Y position then it makes the xml files for you.
[edit] Download
I have made a .exe version of this program for windows, you can get it from these locations:
http://www.mediafire.com/?0mdvexdgmxu
http://4rensics.com/regiongen21.zip
- openSIMULATOR-Regions-Generator - Regions-Generator for PHP, PHP7 Ready building with/for OpenSimulator 0.9.1(inc. var regions, position) not testet 0.9.0, 0.8.x.
[edit] How to use
If using windows version
- Extract to somewhere on your computer, i.e. The desktop.
- Edit the regionconfig.py file.
- You can Remove or Add as many regions as you like in this file. Region Generator 2.00 supports multiple regions.
- The password is optional, when connecting into grids like osgrid, it is normally not needed. You need to decide if you need it or not, experiment!
- If you give one region port 9000, give the next 9100 for example.
- Run regiongen.exe
- Copy the Regions folder to your opensim/bin folder.
- If you run it again, it will update the regions but it will not delete the files. If you made a big screw up, delete the Regions folder.
If using the python source code (Linux, mac etc), make sure you have the cheetah and python 2.5 dependency's installed and edit the configuration in regionconfig.py then run :)
[edit] Errors
Traceback (most recent call last): File "regiongen.py", line xx, in <module> ImportError: No module named regionconfig
You are missing the regiongen config file, you can find it at the bottom of thispage
[edit] Source Code
It requires the Cheetah Templating module and python 2.5.
You can get cheetah from http://www.cheetahtemplate.org/
You can get python from http://www.python.org/download/
[edit] regiongen.py Python 2
#!/usr/bin/python # REGION GEN 2.1 import os import sys sys.path.append(os.getcwd()) from Cheetah.Template import Template import uuid import pickle import regionconfig regionsdir = 'Regions' template = """<Root> <Config sim_UUID="$uuid" sim_name="$regionname" sim_location_x="$x" sim_location_y="$y" internal_ip_address="$s.internalip" internal_ip_port="$port" allow_alternate_ports="false" external_host_name="$s.externalhost" master_avatar_uuid="$s.useruuid" estate_covenant_uuid="00000000-0000-0000-0000-000000000000" lastmap_refresh="0" master_avatar_first="$s.firstname" master_avatar_last="$s.lastname" $password /> </Root> """ savefile = "regiongen_save.pkl" def maketemplate(regionname, x, y, port, uid, password=None): t = Template(template) t.s = s t.uuid = uid t.password = password t.regionname = regionname t.x = x t.y = y t.port = port return str(t) # Make directory to put regions in if not there try: os.mkdir(regionsdir) except OSError: pass settings = {} # Load settings file try: settingsfile = open(savefile) settings = pickle.load(settingsfile) settingsfile.close() except IOError: pass for s in regionconfig.configlist: print s counter = 0 for xnum in range(s['x'][0], s['x'][1]): for ynum in range(s['y'][0], s['y'][1]): counter += 1 default = False # Figure out region name if counter == 1: default = True regionname = s['regionname'] else: regionname = s['regionname'] + str(counter) # Figure out password if 'password' in s: password = "master_avatar_pass=\"%s\"" % s['password'] else: password = '' # Figure out paths path = os.path.join(regionsdir,"%s.%s.%s.xml" % \ (regionname, xnum, ynum)) # Calculate port port = s['startport'] + (counter - 1) # Try to get UUID from settings # Generate + Save if not found if regionname in settings: uid = settings[regionname] else: uid = str(uuid.uuid1()) settings[regionname] = uid # Make template tmpldata = maketemplate(regionname, xnum, ynum, port, uid, password) # Save file tmplfile = open(path, 'w') tmplfile.write(tmpldata) tmplfile.close() # Print progress print regionname # Save settings file try: settingsfile = open(savefile, 'w') pickle.dump(settings, settingsfile) settingsfile.close() except IOError: pass
[edit] regiongen.py Python 3
#!/usr/bin/python # REGION GEN 2.1 Python 3.8 # pip install Cheetah3 import os import sys sys.path.append(os.getcwd()) from Cheetah.Template import Template import uuid import pickle import regionconfig regionsdir = 'Regions' template = """<Root> <Config sim_UUID="$uuid" sim_name="$regionname" sim_location_x="$x" sim_location_y="$y" internal_ip_address="$s.internalip" internal_ip_port="$port" allow_alternate_ports="false" external_host_name="$s.externalhost" master_avatar_uuid="$s.useruuid" estate_covenant_uuid="00000000-0000-0000-0000-000000000000" lastmap_refresh="0" master_avatar_first="$s.firstname" master_avatar_last="$s.lastname" $password /> </Root> """ savefile = "regiongen_save.pkl" def maketemplate(regionname, x, y, port, uid, password=None): t = Template(template) t.s = s t.uuid = uid t.password = password t.regionname = regionname t.x = x t.y = y t.port = port return str(t) # Make directory to put regions in if not there try: os.mkdir(regionsdir) except OSError: pass settings = {} # Load settings file try: settingsfile = open(savefile) settings = pickle.load(settingsfile) settingsfile.close() except IOError: pass for s in regionconfig.configlist: print(s) counter = 0 for xnum in range(s['x'][0], s['x'][1]): for ynum in range(s['y'][0], s['y'][1]): counter += 1 default = False # Figure out region name if counter == 1: default = True regionname = s['regionname'] else: regionname = s['regionname'] + str(counter) # Figure out password if 'password' in s: password = "master_avatar_pass=\"%s\"" % s['password'] else: password = '' # Figure out paths path = os.path.join(regionsdir,"%s.%s.%s.xml" % \ (regionname, xnum, ynum)) # Calculate port port = s['startport'] + (counter - 1) # Try to get UUID from settings # Generate + Save if not found if regionname in settings: uid = settings[regionname] else: uid = str(uuid.uuid1()) settings[regionname] = uid # Make template tmpldata = maketemplate(regionname, xnum, ynum, port, uid, password) # Save file tmplfile = open(path, 'w') tmplfile.write(tmpldata) tmplfile.close() # Print progress print(regionname) # Save settings file try: settingsfile = open(savefile, 'w') pickle.dump(settings, settingsfile) settingsfile.close() except IOError: pass
[edit] regionconfig.py Python 2+3
# REGIONGEN 2.00 + 2.10 CONFIGURATION FILE configlist = [] # Dont touch this # START OF REGION s = {} # Dont touch this # Region Configuration s['regionname'] = "RegionSetOne" # Type the name of your island s['x'] = [5100,5105] # X Position... From <------> To s['y'] = [5100,5105] # Y Position... From <------> To # User Configuration s['firstname'] = "Tom" # Your First Name s['lastname'] = "Jones" # Your Last Name s['useruuid'] = 'get your clients uuid' # Your UUID, You can use a script in game to get this #s['password'] = 'pass' # This is optional, it is commented out by default. # Network Configuration s['startport'] = 9000 # We recommend leaving this at 9000 for opensim # unless this isnt the first region. s['internalip'] = "123.123.123.123" # You need to get this to a internal wired/wireless lan ip address s['externalhost'] = "example.org" # This is the address that people connect from the outside world to configlist.append(s) # Dont touch this # END OF REGION # YOU MAY COPY AND PASTE MORE CONFIGURATIONS INTO THIS FILE TO ADD MORE REGIONS. # START OF REGION s = {} # Dont touch this # Region Configuration s['regionname'] = "RegionSetTwo" # Type the name of your island s['x'] = [5200,5205] # X Position... From <------> To s['y'] = [5200,5205] # Y Position... From <------> To # User Configuration s['firstname'] = "Tom" # Your First Name s['lastname'] = "Jones" # Your Last Name s['useruuid'] = 'get your clients uuid' # Your UUID, You can use a script in game to get this #s['password'] = 'pass' # This is optional, it is commented out by default. # Network Configuration s['startport'] = 9100 # We recommend leaving this at 9000 for opensim # unless this isnt the first region. s['internalip'] = "123.123.123.123" # You need to get this to a internal wired/wireless lan ip address s['externalhost'] = "example.org" # This is the address that people connect from the outside world to configlist.append(s) # Dont touch this # END OF REGION # YOU MAY COPY AND PASTE MORE CONFIGURATIONS INTO THIS FILE TO ADD MORE REGIONS.