Statistics
Latest topics
How to communicate with the region server
Page 1 of 1
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
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?");
- 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
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");
}
}
}
Similar topics
» How to set up your region server
» New feature announcement in region server 1.3
» Updates: region server 1.3, meter 1.14 and website
» ML region server 1.3 and ML 1.14 ready for beta testing
» REGION PRESET: standard (use this as template)
» New feature announcement in region server 1.3
» Updates: region server 1.3, meter 1.14 and website
» ML region server 1.3 and ML 1.14 ready for beta testing
» REGION PRESET: standard (use this as template)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Wed Feb 22, 2012 12:43 pm by 7Sins Admin
» MetaLife FAQ
Wed Feb 22, 2012 11:58 am by 7Sins Admin
» MetaLife License
Wed Feb 22, 2012 11:09 am by 7Sins Admin
» MetaLife Feature List, version 1.21
Fri Feb 17, 2012 11:19 am by 7Sins Admin
» NEU MetaLIfe 2 Bedienungsanleitung (deutsch)
Fri Feb 17, 2012 10:56 am by 7Sins Admin
» NOUVEAU MetaLife2 manuel d'instruction (français)
Fri Feb 17, 2012 10:53 am by 7Sins Admin
» NEW MetaLIfe 2 Manual (English)
Fri Feb 17, 2012 10:47 am by 7Sins Admin
» NUOVO MetaLIfe 2 - manuale di istruzioni (italiano)
Fri Feb 17, 2012 10:46 am by 7Sins Admin
» NUOVO - manuale di istruzioni (italiano)
Fri Feb 17, 2012 10:43 am by 7Sins Admin