Tutorial04

From Osgrid Wiki
Jump to: navigation, search

This lesson we'll be going over some of the common configuration options. Some of these settings are Mono (linux/mac) or .NET (windows) specific. Let start this class by explaining that all ini files in the OSgrid download are pre-configured and more or less setup & configured to work with OSgrid, whether your on windows, MAC or Linux. As we have learned in the previous courses, an environment is specific, and OpenSim can thus be tweaked / adjusted with settings that possibly work better for your specific configuration / environment.

 * Goals for this class : 
 * learning to understand how data from ini filed is processed and what you can configure 
 * learn the functions of the various INI files and and use them for fine tuning & configuring your region setup on OSgrid
 * Understanding OSSL functions & permissions

If you open your INI files with Notepad++ you get readable formatted text on what does what, so lets pick out some highlights that can be of use. We will cover only the files you "need to be in" for the use and goal of this course. There are plenty of other ini files in your installation, but unless you know what you're doing, we suggest you leave them as they are, changes there are likely you break things / make them give unexpected results. We do encourage you to open them, check what it does, if your interested in getting more "clues" on how things "work" on the inside. In the configuration files, ;; in front of a line means it is a comment, and a ; in front of a line means it's a selectable value. Values without ; are selected and active currently.

OpenSim.ini

async_call_method has multiple methods but below is the two most common that are known to work best for a specific operating system.

[Startup]
   ;works well with mono (linux/mac)
   async_call_method = SmartThreadPool
[Startup]
   ;works well with .NET (windows)
   async_call_method = UnsafeQueueUserWorkItem

The mesher and physics engines can also be configured under [Startup]. Please note you can only use 1 mesher and 1 physics engine.

   ;can be used with BulletSim, ODE or ubODE
   meshing = Meshmerizer
   ;use with ubODE
   meshing = ubODEMeshmerizer
   ;; Default is BulletSim. Uncomment one of the other physics engines below to enable it
   ; physics = ubODE ;no ubODE lib for Mac osx at this time* 
   ; physics = OpenDynamicsEngine
   ; physics = BulletSim

Maptiles can be configured under [Map] pretty tiles use more memory.

 [Map]
   ;pretty maptiles
   MapImageModule = "Warp3DImageModule"

Save a little ram by using MapImageModule.

[Map]	
   ;normal maptiles, uses less memory
   MapImageModule = "MapImageModule"

The OSgrid OpenSim.ini files have some conservative throttles configured to help smoother performance on slower connections, These may be increased as show below or disabled entirely if you have a server on large bandwidth.

[ClientStack.LindenUDP]
   scene_throttle_max_bps = 2500000
   client_throttle_max_bps = 187500
   enable_adaptive_throttles = false
   TextureSendLimit = 40

The http_listener_port allows you to change the TCP port your simulator uses. Handy if you want to run multiple simulators.

[Network]
   ;change the tcp listener port the simulator uses
   http_listener_port = 9000

Your default chat distances can be changed easily. Some venues or areas need expanded chat distance.

[Chat]
   ;change local chat variables
   whisper_distance = 10
   say_distance = 20
   shout_distance = 100

AppDomainLoading can help with better script memory management. Mono (linux/mac) will want to use false only.

[XEngine]
   ;use with mono (linux/mac) and .NET (windows)
   AppDomainLoading = false

Only .NET works correctly with true. This is also known to fix some issues where scripts stop working on .NET(windows).

   ;This only works reliably for .NET (windows)
   AppDomainLoading = true

If you have special need for faster script timing you can configure MinTimerInterval (0.08 is the lowest possible value)

   ;can help with script timing
   MinTimerInterval = 0.08

If you want voice you can apply for a free account with Vivox at http://support.vivox.com/opensim/

[VivoxVoice]
 (paste config here that vivox emails you)


GridCommon.ini

This is the file where you can configure external storage like MySql. We will cover this again next week, when we install it, but it boils down to commenting out 1 line (the SQL lite one) by putting a ; in front of it, enabling 2 others (StorageProvider and ConnectionString), and database name, username and password (the one of your MySQL/Mariadb/PgSql database).


[DatabaseService]
   ; SQLite (comment out the line below if you're using MySql or PGSQL)
   Include-Storage = "config-include/storage/SQLiteStandalone.ini";

If you have MySql installed and configured:

[DatabaseService]
   ; SQLite (comment out the line below if you're using MySql or PGSQL)
   ;Include-Storage = "config-include/storage/SQLiteStandalone.ini";
   ; MySql
   ; Uncomment these lines if you want to use mysql storage
   ; Change the connection string to your db details
   StorageProvider = "OpenSim.Data.MySQL.dll"
   ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;"

If you have PGSQL installed and configured:

[DatabaseService]
   ; SQLite (comment out the line below if you're using MySql or PGSQL)
   ;Include-Storage = "config-include/storage/SQLiteStandalone.ini";
   ; PGSQL
   ; Uncomment these lines if you want to use PGSQL storage
   ; Change the connection string to your db details
   StorageProvider = "OpenSim.Data.PGSQL.dll"
   ConnectionString = "Server=localhost;Database=opensim;User Id=opensim; password=***;"

osslEnable.ini

This is the file in which you can configure the threat level of scripts, users, and owners. It is a permissions system, which allows the use of potential harmful scripts. And no, your PC will not explode, but for example, a script that can control your avatar, could be used to grief. Certain script functions can be used to potentially crash a region. So the default threat level does not allow this. (It's configured relatively "safe", you are server host now, and need to decide on what you allow or not in your regions.). However, you will need both, if you desire to allow a dance ball to control your movement, and rez a dance partner / dance ball. The permissions system knows threat levels (the higher the more risky) and "owners" who you can assign permissions to. These functions can be individually configured to allow all users(true), parcel owners, estate owners and even assign a single UUID to allow you/ someone else to do stuff nobody else can / should be able to. If you allow a feature and do not specify who/what you allow, (script engine or person) you will still get an error on use.

If a script presents a permissions related error, its typically very clear. The threat level does not allow this (fill in whatever" function). You can edit OSSL, check what it is, if you actually want to override, and configure accordingly. (True / false to enable or disable a function, and behind it, who is allowed to use it). Mind it checks this against the Owner of the script.

The example below shows some various ways to enable osTeleportAgent. The Allow list can be true or false to enable or disable the ossl function or you may include a specific avatar's uuid.

 OSFunctionThreatLevel = VeryLow
 ; Each of the OSSL functions can be enabled or disabled individually.
 ; To disable, set the value to 'false'.
 ; To enable for everyone, set the value to 'true'.
 ; To enable for individuals or groups, set it to a comma separated list. This checks
 ;    against the owner of the object containing the script.
 ;    The comma separated entries in the list may be one of:
 ;           "ESTATE_MANAGER" -- enable for estate manager
 ;           "ESTATE_OWNER" -- enable for estate owner
 ;           "PARCEL_OWNER" -- enable for parcel owner
 ;           "PARCEL_GROUP_MEMBER" -- enable for any member of the parcel group
 ;           uuid -- enable for specified ID (may be avatar or group ID)

An example of an error message about ossl permissions such as the one below can indicate you may need to enable a specific function.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --->  OpenSim.Region.ScriptEngine.Shared.ScriptException: OSSL Runtime Error: osAgentSaveAppearance permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.

The OSSL Runtime Error: osAgentSaveAppearance can be resolved several ways to "Allow" this function.

Allow estate manager, estate owner and user with uuid c6527070-01c7-11e6-a837-0800200c9a66

Allow_osAgentSaveAppearance = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER,c6527070-01c7-11e6-a837-0800200c9a66

Allow all users

Allow_osAgentSaveAppearance = true   

Allow only the user with uuid c6527070-01c7-11e6-a837-0800200c9a66

Allow_osAgentSaveAppearance = c6527070-01c7-11e6-a837-0800200c9a66

To prevent the function from working at all for anyone

Allow_osAgentSaveAppearance = false


Regions.ini

The Regions.ini is the first place you check if something is wrong. ( Typically a crash at startup, or dysfunctional simulator that always worked, is due to IP changes, ports already in use, map space coordinates etc, and that is all configured in this file). Remember what typo's gave you in last class ? Exactly. A crash. Still applies.

The static UUID allows you to load an image / texture to use as the maptile, rather than a generated maptile or textures. Mind that your OpenSim.ini needs to be configured for that as well. MaxPrims above 15000 is possible to set, but pointless. No viewer will display more than 45000 prims simultaneously. Also if you exceeded the MaxPrims on your region a warning can be issued in the viewer (about land), that some prims will be returned. This does not happen. To get rid of such message, increase MaxPrims in the Regions.ini file. MaxPrims may also be set globally across all regions in a simulator by adding it to [Startup] section of your OpenSim.ini.

[Region Name]
RegionUUID = d41f4e80-01c7-11e6-a837-0800200c9a66
Location = 1000,1000
SizeX = 1024
SizeY = 1024
SizeZ = 256
InternalAddress = 192.168.1.4
InternalPort = 9000
AllowAlternatePorts = False
ExternalHostName = ddns.name.com / Or External Ip adress
MaptileStaticUUID = 00000000-0000-0000-0000-000000000000
MaxPrims = 15000