2012年07月16日

OpenSim.ini

MySQLが準備できたらつぎはmonoとOpenSimをインストールします。

Ubuntuでのmonoのインストールはすでに「DTIにOpenSimをインストール」で説明しているのでここでは繰り返しません。

いっぽうOpenSimのほうはいままで(OSgridヘの接続を前提とした設定)と少し違います。

まずダウンロードしてくるページはOSgridではなくOpenSim本家のほうのサイトです。スタンドアロンで使ったのと同じものを(できれば最新版を)持ってきてください。

OpenSim.ini
cdで/usr/localディレクトリに移動し、wgetのあとに上のページのリンク先をコピーして貼り付けるやりかたは(OSgrid公開時と)同じですが、今回はわざわざ「opensim」というディレクトリをつくる必要はありません。

OpenSim.ini
ダウンロードしてきたzipファイル(あるいはtar.gzファイル)をその場で展開すればパッケージをふくむ「フォルダ」(上のSSの場合はopensim-0.7.3.1)自体が作られます。

OpenSim.ini
展開したzipファイルは削除してしまってもかまいませんが、あとあと何かまずくなったときのために残しておいてもいいでしょう。

OpenSim.ini
ぎゃくに「opensim-0.7.3.1」などのディレクトリ名は(のちのちバックグラウンド起動用書類を使うときなどのため)「opensim」に直しておいたほうが面倒がありません。

問題はここからです。いよいよいままで触れずにすませてきたOpenSimの各種設定書類を編集していかなければなりません。

とりあえずopensim/binディレクトリを開いて中身を調べてみましょう。

各種の書類や下位ディレクトリがうんざりするほどずらりと並んでいますね。でも恐れることはありません。今回関係してくるのは(編集したり起動したりする書類は)以下のものだけです。

[基本設定]
OpenSim.ini
Robust.HG.ini
config-include/GridCommon.ini
(複数シムを作る場合)
Regions/Regions.ini

[monoとともに起動]
Robust.exe
OpenSim.exe

[バックグラウンド起動設定書類]
/etc/init.d/opensim_server
/etc/init.fd/opensim_region


要するにあなたのやることはーーこれらを慌てず騒がず順序良くひとつづつ片づけていくーーそれだけです。
というわけでまず最初にOpenSim.iniをさがしてみましょう。見つかりましたか?

(まんいち見つからないときはOpenSim.ini.exampleというファイルをさがしましょう。そしてそれをcp OpenSim.ini.example OpenSim.iniとやってコピーしてiniファイルを作り、それをviエディターで編集する、もしくはexampleファイル全部をコピーしデスクトップでたちあげたエディターに読み込んで編集してからvi OpenSim.iniとして新規に書類を作成する、のいずれかの方法をとりましょう。(ただし「メモ帳」はあまりお薦めできません。もうすこし多機能のエディターを入手してください。ちなみにわたしは「サクラ・エディター」をつかっています)
以上はOpenSim.iniにかぎらず、これからとりあつかうすべての書類に対しても同じです。)

というわけでハイパーグリッドモード向けにOpenSim.iniを編集します。

じつのところこの設定は拍子抜けするほど簡単です。
(注)追加の設定があります。(2014. 10.17)

書類を開いたらひたすらスクロールアップしていちばん最後の部分を画面にだしてください。

OpenSim.ini
[Architecture]と書かれている箇所です。


Include-Architecture = "config-include/Standalone.ini"

; Include-Architecture = "config-include/StandaloneHypergrid.ini"

; Include-Architecture = "config-include/Grid.ini"

; Include-Architecture = "config-include/GridHypergrid.ini"

; Include-Architecture = "config-include/SimianGrid.ini"

; Include-Architecture = "config-include/HyperSimianGrid.ini"

OpenSimからダウンロードしたものはスタンドアロンで立ち上がる設定になっているので、こうなっているはずです。
で、これをハイパーグリッドモードで立ち上がるよう以下にようにコメントアウトの箇所を書きかえます。

; Include-Architecture = "config-include/Standalone.ini"

; Include-Architecture = "config-include/StandaloneHypergrid.ini"

; Include-Architecture = "config-include/Grid.ini"

Include-Architecture = "config-include/GridHypergrid.ini"

; Include-Architecture = "config-include/SimianGrid.ini"

; Include-Architecture = "config-include/HyperSimianGrid.ini"


OpenSim.ini

書き換えたらwqで保存します。

(注) opensimのバージョン0.8.0.1(あるいはそれ以前も?)ではOpenSim.iniのスクリプト・エンジンであるXEngineの設定がコメントアウトされています。設定書類の[Startup]内で最初から1/5ぐらいのところに以下のような設定があります。

;# {DefaultScriptEngine} {} {Default script engine} {XEngine} XEngine
;; Default script engine to use. Currently, we only have XEngine
; DefaultScriptEngine = "XEngine"


まず最期の行「; DefaultScriptEngine = "XEngine"」の「;」を外してください。

つぎにずっと下って[XEngine]の場所を探します。

[XEngine]
;# {Enabled} {} {Enable the XEngine scripting engine?} {true false} true
;; Enable this engine in this OpenSim instance
; Enabled = true

;; How many threads to keep alive even if nothing is happening
; MinThreads = 2

;; How many threads to start at maximum load
; MaxThreads = 100

;; Time a thread must be idle (in seconds) before it dies
; IdleTimeout = 60

;# {Priority} {Enabled:true} {Priority for script engine threads?} {Lowest BelowNormal Normal AboveNormal Highest} BelowNormal
;; Thread priority ("Lowest", "BelowNormal", "Normal", "AboveNormal",
;; "Highest")
; Priority = "BelowNormal"

;; Maximum number of events to queue for a script (excluding timers)
; MaxScriptEventQueue = 300

;; Stack size per script engine thread in bytes.
;; If you are experiencing StackOverflowExceptions you may want to increase this (e.g. double it).
;; The trade-off may be increased memory usage by the script engine.
; ThreadStackSize = 262144

;; Set this to true (the default) to load each script into a separate
;; AppDomain.
;;
;; Setting this to false will load all script assemblies into the
;; current AppDomain, which will significantly improve script loading times.
;; It will also reduce initial per-script memory overhead.
;;
;; However, setting this to false will also prevent script DLLs from being unloaded from memory if the script is deleted.
;; This may cause an OutOfMemory problem over time when avatars with scripted attachments move in and out of the region.
;; Some Windows users have also reported script loading problems when AppDomainLoading = false
; AppDomainLoading = true

;; Controls whether scripts are stopped by aborting their threads externally (abort) or by co-operative checks from the compiled script (co-op)
;; co-op will be more stable but this option is currently experimental.
;; If moving from co-op to abort, existing script DLLs will need to be recompiled.
;; This currently can only be done manually, either by setting DeleteScriptsOnStartup = true for one run
;; or by deleting the script DLL* files in bin/ScriptEngines//
;; One can move from co-op back to abort without recompilation, but reverting back to co-op again will need script recompile
;; Current valid values are "abort" and "co-op"
; ScriptStopStrategy = abort


;# {DeleteScriptsOnStartup} {} {Delete previously compiled script DLLs on startup?} {true false} true
;; Controls whether previously compiled scripts DLLs are deleted on sim restart. If you set this to false
;; then startup will be considerably faster since scripts won't need to be recompiled. However, then it becomes your responsibility to delete the
;; compiled scripts if you're recompiling OpenSim from source code and internal interfaces used
;; by scripts have changed.
DeleteScriptsOnStartup = false

;# {DefaultCompileLanguage} {Enabled:true} {Default script language?} {lsl vb cs} lsl
;; Default language for scripts
; DefaultCompileLanguage = "lsl"

;# {AllowedCompilers} {Enabled:true} {Languages to allow (comma separated)?} {} lsl
;; List of allowed languages (lsl,vb,cs)
;; AllowedCompilers=lsl,cs,vb
;; *warning*, non lsl languages have access to static methods such as
;; System.IO.File. Enable at your own risk.
; AllowedCompilers = "lsl"

;; Compile debug info (line numbers) into the script assemblies
; CompileWithDebugInformation = true

;; Allow the user of mod* functions. This allows a script to pass messages
;; to a region module via the modSendCommand() function
;; Default is false
; AllowMODFunctions = false

;# {AllowOSFunctions} {Enabled:true} {Allow OSFunctions? (DANGEROUS!)} {true false} false
;; Allow the use of os* functions (some are dangerous)
; AllowOSFunctions = false

;# {AllowLightShareFunctions} {Enabled:false [LightShare]enable_windlight:true} {Allow LightShare functions?} {true false} false
; Allow the use of LightShare functions.
; The setting enable_windlight = true must also be enabled in the [LightShare] section.
; AllowLightShareFunctions = false

;# {OSFunctionThreatLevel} {Enabled:true AllowOSFunctions:true} {OSFunction threat level? (DANGEROUS!)} {None VeryLow Low Moderate High VeryHigh Severe} VeryLow
;; Threat level to allow, one of None, VeryLow, Low, Moderate, High, VeryHigh, Severe
;; See http://opensimulator.org/wiki/Threat_level for more information on these levels.
;; We do not recommend that use set a general level above Low unless you have a high level of trust
;; in all the users that can run scripts in your simulator. It is safer to explicitly
;; allow certain types of user to run higher threat level OSSL functions, as detailed later on.
OSFunctionThreatLevel = VeryLow

; OS Functions enable/disable
; For each function, you can add one line, as shown
; The default for all functions allows them if below threat level

; true allows the use of the function unconditionally
; Allow_osSetRegionWaterHeight = true

; false disables the function completely
; Allow_osSetRegionWaterHeight = false

; Comma separated list of UUIDS allows the function for that list of UUIDS
; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb

; Comma separated list of owner classes that allow the function for a particular class of owners. Choices are
; - PARCEL_GROUP_MEMBER: allow if the object group is the same group as the parcel
; - PARCEL_OWNER: allow if the object owner is the parcel owner
; - ESTATE_MANAGER: allow if the object owner is an estate manager
; - ESTATE_OWNER: allow if the object owner is the estate owner
; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb, PARCEL_OWNER, ESTATE_OWNER>, ...

; You can also use script creators as the uuid
; Creators_osSetRegionWaterHeight = , ...

; If both Allow_ and Creators_ are given, effective permissions
; are the union of the two.

;# {EventLimit} {} {Amount of time a script can spend in an event handler} {} 30
;; Time a script can spend in an event handler before it is interrupted
; EventLimit = 30

;# {KillTimedOutScripts} {} {Kill script in case of event time overruns?} {true false} false
;; If a script overruns it's event limit, kill the script?
; KillTimedOutScripts = false

;# {ScriptDelayFactor} {} {Multiplier for scripting delays} {} 1.0
;; Sets the multiplier for the scripting delays
; ScriptDelayFactor = 1.0

;# {ScriptDistanceLimitFactor} {} {Multiplier for 10.0m distance limits?} {}
;; The factor the 10 m distances limits are multiplied by
; ScriptDistanceLimitFactor = 1.0

;# {NotecardLineReadCharsMax} {} {Maximum length of notecard line?} {} 255
;; Maximum length of notecard line read
;; Increasing this to large values potentially opens
;; up the system to malicious scripters
; NotecardLineReadCharsMax = 255

;# {SensorMaxRange} {} {Sensor range} {} 96.0
;; Sensor settings
; SensorMaxRange = 96.0
;# {SensorMaxResults} {} {Max sensor results returned?} {}
; SensorMaxResults = 16

;# {DisableUndergroundMovement} {} {Disable underground movement of prims} {true false} true
;; Disable underground movement of prims (default true); set to
;; false to allow script controlled underground positioning of
;; prims
; DisableUndergroundMovement = true

;# {ScriptEnginesPath} {} {Path to script assemblies} {} ScriptEngines
;; Path to script engine assemblies
;; Default is ./bin/ScriptEngines
; ScriptEnginesPath = "ScriptEngines"


ちょっと長い引用ですが肝心なところは赤字の二カ所だけです。

;# {Enabled} {} {Enable the XEngine scripting engine?} {true false} true
;; Enable this engine in this OpenSim instance
; Enabled = true

;# {DefaultCompileLanguage} {Enabled:true} {Default script language?} {lsl vb cs} lsl
;; Default language for scripts
; DefaultCompileLanguage = "lsl"

このそれぞれのコメントアウトをはずしてください。それでひととおりスクリプトが作れるはずです。

同じカテゴリー(OpenSim(オープンシム))の記事画像
JOG - ジャパンオープングリッドへの入り方その2
JOG - ジャパンオープングリッドへの入り方
JOG -ジャパンオープングリッド- とは?
OpenSimとWebの連携 (その4)
OpenSimとWebの連携 (その3)
OpenSimとWebの連携 (その2)
同じカテゴリー(OpenSim(オープンシム))の記事
 JOG - ジャパンオープングリッドへの入り方その2 (2014-09-24 20:38)
 JOG - ジャパンオープングリッドへの入り方 (2014-09-24 20:37)
 JOG -ジャパンオープングリッド- とは? (2014-09-24 20:37)
 OpenSimとWebの連携 (その4) (2014-07-04 16:18)
 OpenSimとWebの連携 (その3) (2014-07-04 16:17)
 OpenSimとWebの連携 (その2) (2014-07-04 15:29)
Posted by もとちゃ at 11:05│Comments(0)OpenSim(オープンシム)
 
<ご注意>
書き込まれた内容は公開され、ブログの持ち主だけが削除できます。