Statistics
Latest topics
How to communicate with the region server
Page 1 of 1 • Share •
How to communicate with the region server
The ML region server provides a way to tell a script about some sim settings. This is e.g. useful for weapon which want to test if the region is ML-enabled, or need more information on the combat settings. The communication channel for this is -399422. The only possible request is the string "info?", which will result in an answer string on the same channel.
In a script you would poll the data by
The answer will be something like
This string consists of a '|'-separated list whose first entry is always 'info', the second is the UUID of the object which has sent the request and the third is a free form data string. The data string is a newline-separated list with obvious syntax. Please note the data string might change in future version (i.e. there might be more settings accessible).
ATTENTION: IF YOU USE THIS COMMUNICATION CHANNEL THEN PLEASE REMOVE THE LISTENER AFTER YOU HAVE RECEIVED AN ANSWER OR AFTER A TIMEOUT, IN ORDER TO FREE SIM RESOURCES!
Here is an example script:
In a script you would poll the data by
- Code:
llRegionSay(-399422, "info?");
The answer will be something like
- Code:
info|5fa6a4d6-86b5-3ec3-10cc-a9a505880300|melee_factor=1.300000
ranged_factor=1.000000
splash=1
roles with defence points
breathlessness=1
ranged_distance_restr.=110.000000
unconsciousness=15
randomize=0
This string consists of a '|'-separated list whose first entry is always 'info', the second is the UUID of the object which has sent the request and the third is a free form data string. The data string is a newline-separated list with obvious syntax. Please note the data string might change in future version (i.e. there might be more settings accessible).
ATTENTION: IF YOU USE THIS COMMUNICATION CHANNEL THEN PLEASE REMOVE THE LISTENER AFTER YOU HAVE RECEIVED AN ANSWER OR AFTER A TIMEOUT, IN ORDER TO FREE SIM RESOURCES!
Here is an example script:
- Code:
integer iHandle;
default
{
state_entry()
{
iHandle=llListen(-399422, "", "", "");
llRegionSay(-399422, "info?");
llSetTimerEvent(5);
}
timer()
{
//tineout, no region server present
llSetTimerEvent(0);
llListenRemove(iHandle);
}
listen(integer ch, string name, key id, string msg)
{
list lInfo=llParseStringKeepNulls(msg, ["|"], []);
if(llList2String(lInfo,0)!="info") return;
if(llList2Key(lInfo,1)!=llGetKey()) return;
// this is the answer we requested
// let's turn off the listener!
llSetTimerEvent(0);
llListenRemove(iHandle);
string sData=llList2String(lInfo,2);
list lData=llParseString2List(sData, ["=", "\n"], []);
//look for a specific setting, e.g. splash
integer iEntry=llListFindList(lData, ["splash"]);
string sValue;
if(iEntry>=0) sValue =llList2String(lData, iEntry+1);
if(sValue=="1")
{
//splash is on
llOwnerSay("splash is on");
}
else
{
//splash is off
llOwnerSay("splash is off");
}
}
}
Tala- Admin
- Posts: 59
Join date: 2008-06-27

Permissions of this forum:
You cannot reply to topics in this forum
Home



» Nahrungsaufnahme und Stamina
» Unterstützung von Heilen
» uHUD - Fragen
» Realistic Bow System....
» Wettkampfsystem
» Vorschlag Regio-Server
» Weapon Tester
» Suggestions for handling of shield&armour