-
Notifications
You must be signed in to change notification settings - Fork 3
Events API
Madpeter edited this page Sep 29, 2021
·
22 revisions
The following events can be enabled via the eventsQ (and SL eventsQ server).
Event Name | Triggered on | Requires version |
---|---|---|
RentalStart | Renting a stream (even if they have a stream) | 1.0.2.2 |
RentalEnd | Rental revoked | 1.0.2.2 |
RentalExpire | Expired notice level [via notice server] | 1.0.2.2 |
RentalRenew | Leaving expired notice level [via renew/proxy only] | 1.0.2.2 |
RentalRenewAny | when renewing but not triggering the RentalRenew event [via renew/proxy only] | 1.0.2.3 |
{
package: Full package name,
port: Assigned port number,
server: ServerIP,
uuid: rental owner avatar UUID,
name: rental owner avatar Name,
unixtime: EventHappened@unixtime,
UID: rental UID,
amount: amount paid
}
Extended object values:
- Renewing a stream for someone else. [From: 1.0.2.4]
viaProxy: true
uuidProxy: avatar UUID who paid.
nameProxy: avatar name who paid.
these are all the fields that could be in a event, please note depending on the event some fields maybe missing.
string getValueOrDefault(string json,string index,string defaultValue)
{
string type = llJsonValueType(json,[index]);
if (type == JSON_INVALID) {
return defaultValue;
}
return (string)llJsonGetValue(json,[index]);
}
default
{
link_message(integer sender,integer channel,string eventMessage,key eventName)
{
if(channel == 123)
{
// events channel
string package = getValueOrDefault(eventMessage,"package","No package");
string port = getValueOrDefault(eventMessage,"port","No port");
string server = getValueOrDefault(eventMessage,"server","No server");
string uuid = getValueOrDefault(eventMessage,"uuid","No uuid");
string name = getValueOrDefault(eventMessage,"name","No name");
string unixtime = getValueOrDefault(eventMessage,"unixtime","No unixtime");
string uid = getValueOrDefault(eventMessage,"uid","No uid");
string amount = getValueOrDefault(eventMessage,"amount","-");
list bits = [package,port,server,uuid,name,unixtime,uid];
if ((eventName == "RentalStart") || (eventName == "RentalRenew") || (eventName == "RentalRenewAny"))
{
string useEventName = "New";
if((eventName == "RentalRenew") || (eventName == "RentalRenewAny")) useEventName = "Renew";
string message = ""+
"Streamadmin record\n"+
"["+useEventName+" account]\n"+
"IP:"+server+"\n"+
"Port:"+port+"\n"+
"Name:"+name+"\n"+
"L$"+amount+"";
llInstantMessage(llGetOwner(),message);
}
}
}
}
save as a new script and add to the server along with: sa7.eventq.[Version]