Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Updater Product_Updater  

Product_Updater

Server

Category: Updater
By : Mulligan Silversmith
Created: 2011-07-05 Edited: 2014-02-23
Worlds: Second Life

the Zip file

Download all files for Product_Updater
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Product_Updater_Client.lsl
Get file # 2. Product_Updater_Server.lsl
1
2 // mods by Ferd Frederix to make it work.
3 // wrong params passed by caller, diod not match server
4 // version should be a <, not a != and be floats, not strings
5 // sped up processing
6 // V 1.2 added message that your product is up to date
7
8
9 // IMPORTANT NOTE: Do not remove the prim from the world and re-rez, as you will be unable to send updates.
10 // The UUID will change and that means no more updates can be sent to any previous clients.
11
12 string password = "Your Password"; //This is the password for your server so others cannot get updates that haven't paid for them
13 // NOTE: This password needs to be the same on client!
14
15 float version = 1.0; //This is to give out updates only when needed. Best start off at 1.0 then go up
16
17 //Edit at your own risk!//
18
19 default
20 {
22 {
23 llSetTimerEvent(10); // go slow. no need for speed at this stage
24 llSay(0,"Put this key in all clients: " + (string)llGetKey());
25 llSay(0,"Do Not take and rerez this server, EVER, if you wish to give updates to those clients");
26 }
27 email(string time, string address, string subject,string message,integer num_left)
28 {
29 key requestorKey = (key) subject;
30 message = llDeleteSubString(message,0,llSubStringIndex(message, "\n\n") + 1);
31 list messagelist = llCSV2List(message);
32
33 string TheirPassword = llList2String(messagelist,0); // first param
34 float TheirVersion = (float) llList2String(messagelist,1); // second
36 if( (TheirPassword == password) && TheirVersion < version)
37 {
38 llOwnerSay("Updating " + address + " with " + ItemToGive); // This will give you the key of person looking for update!
39 llGiveInventory(requestorKey, ItemToGive);
40 llInstantMessage(requestorKey,"Your version of " + ItemToGive + " is old, sending you a new one.");
41 }
42 else if( (TheirPassword == password) && TheirVersion >= version)
43 {
44 llInstantMessage(requestorKey,"Your version of " + ItemToGive + " is up to date.");
45 }
46
47
48
49
50 // if more emails have arrived, go ahead and process them now
51 if(num_left)
52 llGetNextEmail("","");// This is use to keep checking for emails!
53
54 }
55 timer()
56 {
57 llGetNextEmail("","");// This is use to keep checking for emails!
58 }
59
60
61 }

Product_Updater

Client: Check for update when rezzed.

Category: Updater
By : Mulligan Silversmith
Created: 2011-07-05 Edited: 2014-02-23
Worlds: Second Life

1
2 // mods by Ferd Frederix to make it work.
3 // wrong params passed by caller, did not match server
4 // version should be a <, not a != and be floats, not strings
5
6
7 string server = "Server Key";// The Server ID Key... Get it from the server!
8 float version = 1.0; // The version of the object at the time! Don't forget to change when you update!
9 string password = "Your Password"; //Same password seen in the server script!
10
11 Checkupdate() {
12
13 llOwnerSay("Looking for update..");
14
15 // Subject is the Owner Key to give the update to
16 // Body is the password ^ Version strings.
17 llEmail((string)server+"@lsl.secondlife.com", (string) llGetOwner(),password + "," + (string) version);
18 }
19
20 default {
22 {
23 Checkupdate();
24 }
25
27 {
28 Checkupdate();
29 }
30 }

Back to the Best Free Tools in Second Life and OpenSim.