前回のスクリプトでRegionがバックグラウンドでうまく動いているでしょうか。
ブラウザーでログインして、まず地形を編集すると思うのですが、遅延で思うように変化してくれません、そこでRegionサーバーを直接編集できるコマンドを使いたいのですが、バックグラウンドではコマンド入力出来ません、再起動してもいいのですが、便利なツールが用意されてます。OpenSim.ConsoleClient.exeを使って、必要な時だけRegionサーバーのコマンドラインにアクセスできます。立ち上げるとバッファーに残ったメッセージも表示されます。
準備はOpenSim.iniとOpenSim.ConsoleClient.iniのユーザーとパスワードを設定します。
OpenSim.iniの変更個所、コメントを解除してユーザーとパスワードを設定します。
[Network] ;; Configure the remote console user here. This will not actually be used ;; unless you use -console=rest at startup. ConsoleUser = "username" ;;ここに名前を記入します。 ConsolePass = "**********" ;;ここにパスワード登録 console_port = 8003 ;# {http_listener_port} {} {TCP Port for this simulator to listen on? (This must be unique to the simulator!)} {} 9000 ;; Simulator HTTP port. This is not the region port, but the port the ;; entire simulator listens on. This port uses the TCP protocol, while ;; the region ports use UDP. ; http_listener_port = 9000 ;# {ExternalHostNameForLSL} {} {Hostname to use for HTTP-IN URLs. This should be reachable from the internet.} {} ;; Hostname to use in llRequestURL/llRequestSecureURL ;; if not defined - default machine name is being used ;; (on Windows this mean NETBIOS name - useably only inside local network) ; ExternalHostNameForLSL = "127.0.0.1" ;# {shard} {} {Name to use for X-Secondlife-Shard header? (press enter if unsure)} {} OpenSim ;; What is reported as the "X-Secondlife-Shard" ;; Defaults to the user server url if not set ;; The old default is "OpenSim", set here for compatibility ;; The below is not commented for compatibility. shard = "OpenSim" ;# {user_agent} {} {User agent to report to web servers?} {} OpenSim LSL (Mozilla Compatible) ;; What is reported as the "User-Agent" when using llHTTPRequest ;; Defaults to not sent if not set here. See the notes section in the wiki ;; at http://wiki.secondlife.com/wiki/LlHTTPRequest for comments on adding ;; " (Mozilla Compatible)" to the text where there are problems with a web server ; user_agent = "OpenSim LSL (Mozilla Compatible)"
OpenSim.ConsoleClient.iniは、OpenSim.ConsoleClient.ini.exampleから複製します。
修正箇所は
[Startup] ; Set here or use the -user command-line switch user = username ;;ここをOpenSim.iniに書いた名前にする ; Set here or use the -host command-line switch host = localhost ; Set here or use the -port command-line switch port = 8003 ; Set here or use the -pass command-line switch ; Please be aware that this is not secure since the password is in the clear ; we recommend the use of -pass wherever possible pass = ********** ;;ここをOpenSim.iniに書いたパスワードにする
準備が終わったら起動してみる。
/usr/local/opensim/bin$ sudo mono OpenSim.ConsoleClient.exe
うまくいけば OpenSim.exeの時と同じRegionサーバーのコマンド待ち状態になります。
Region(MichieIsland)>
ここでコマンドを入力するのですが、qはConsoleClientの終了になります、Region serverを止めるにはshutdownの方をつかいます。
さて、サーバーコマンドはどのような物があるのでしょうか、詳細は本家を参照してください。
私がすぐ使ったコマンドは土地の整地に関する物でした。
とにかく平らな土地にしたかった(25mの平地をつくる)
terrain fill 25
全体をかさ上げする(全体を3m上げる)
terrain elevate 3
全体を一律に低くする(全体を1m下げる)
terrain lower 1
現在の地形に乗算する(現在の地形の高さを半分にする)
terrain multiply 0.5
指定したファイルから地形を読み込みます。(myterrain.bmpという地形ファイルを読み込みます)
terrain load myterrain.bmp
余談ですが、いろんなファイルフォーマットに対応してるのですが、私の環境ではBMPがいちばん綺麗に読み込めました、もっと調べる必要がありますね。
9連シムなど簡単にできるのですから、それを大きな地形ファイル一つで管理したくなります。画像をシムの数で格子状に分割して一部を読み込むコマンド
terrain load-tile
<filename> <imageX> <imageY> <bottomleftsimX> <bottomleftsimY>
これが理解しにくいのですが3x3の9連シムで考えると
NW,N,NE
W,C,E
SW,S,SE
このような配列の場合南西のはずれが原点となりますので
SWのサーバーの場合
terrain load-tile <filename> 3 3 0 0
Wのサーバーの場合
terrain load-tile <filename> 3 3 0 -1
と3分割X3分割して画像の原点のXは同じ、Yが自分より一つ下の区画にあると指定すると理解したのですが、ウエーブ上を探してみると何種類かの説明がみつかるので、何度か仕様がかわってるのか、私が勘違いしてるのかなー未検証:-)