Emailing an object to an object, and other stuff
|
|
Androclese Antonelli
Org. B-Day: 05/11/04
Join date: 25 Apr 2006
Posts: 96
|
05-01-2006 13:54
I am trying to learn how to email an object to another object. I've searched the forums and I've seen a few things written about it, but nothing concrete. So.. here I am for help. Now, Starax's Magic Wand is the perfect example of a working version of this concept. However, a) asking him for his work is improper and, more importantly, b) I would never learn anything. What I want to do is: - Have a master "object" sitting someplace that has in its inventory, the latest versions of whatever I am building: scripts, notecards, objects, etc.
- Have an object issue a command to update itself. The object will contact a master object and update the contents of the inventory.
Here is what I have discovered through the forums and Wiki's - The email system has to be used for the objects to talk to each other
- The 'Master' object can never de-rez or its key will be lost and the 'slave' objects won't be able to update.
Here is where I get confused/have questions: - Is it better to have a master object on the grid and risk have it de-rez some day, or to have it talk to the outside world and use that as a perm-relay?
- How would I talk to the outside world to relay it to the 'master' object, even if its Key changes?
- How do I have an object email on object to another object and extract that sent object to put it into the receiving objects inventory?
- Is there an easier way to do that?
- Can anybody help me with the 'path' that I need to code down so I'm don't feel so in the dark?
Any and all help is greatly appreciated.
_____________________
The Sculpted Garden Originally Born 5/11/2004 - New AV, Old Player. If you leave the game, don't delete your account, just make it 'free'. You'll lose your inventory like I did. *sniff*
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
05-01-2006 13:57
Well, quite simply, you can't use email to send an object to another object. All you can send by email is text. You can use llGiveInventory to give an object to another object's owner, at any range, if that's what you're looking for.
If you want objects talking to outside servers, your best bet is to wait a little while for 1.9.1 to arrive, and then use HTTP requests to communicate with code there, which will be much easier to learn than the existing solution of XML-RPC requests.
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
05-01-2006 14:07
I'm in the process of building a networked vendor/voucher/updater system myself, and it sounds like you are going down the right path.
As Ordinal said, you can't email an object to another, just text, so your "server" has to be the one doing the llGiveInventory, and the client in the field (an updater object) has to request the object be delivered from the server.
I am using both in-world servers that are permanent, and out-of-world relays as backup. All you need is an email forwarder, but do it on a server (web hosting service). Don't try to do it from client-side or web-based email. It's probably unreliable that way.
|
|
Androclese Antonelli
Org. B-Day: 05/11/04
Join date: 25 Apr 2006
Posts: 96
|
05-01-2006 14:07
From: Ordinal Malaprop Well, quite simply, you can't use email to send an object to another object. All you can send by email is text. You can use llGiveInventory to give an object to another object's owner, at any range, if that's what you're looking for. If you want objects talking to outside servers, your best bet is to wait a little while for 1.9.1 to arrive, and then use HTTP requests to communicate with code there, which will be much easier to learn than the existing solution of XML-RPC requests. Thnaks for the advice on HTTP requests. I have a permenantly hosted server through Aplus.net, so I'll be able to use that in the future. So, event wise, is this a good roadmap? MO = Master Object SO = Slave Object SO Sends an email to MO. MO parses's the email and looks for the version number and compares it to the version number in its inventory. It also records the key of the sending object. If the MO serial number is greater, it uses 'llGiveInventory' to send the MO's inventory to SO. I quickly read llGiveInventory and llGiveInventoryList and noticed there it does not mention anything about replacing/overwriting existing objects. What happends under the condition where there are 5 objects being sent by MO but 3 of them are duplicates of existing items in SO?
_____________________
The Sculpted Garden Originally Born 5/11/2004 - New AV, Old Player. If you leave the game, don't delete your account, just make it 'free'. You'll lose your inventory like I did. *sniff*
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
05-01-2006 14:12
Er, I think something went wrong with that post, but I think I got the gist of it.
Basically, you want MO to send an object to SO's owner for an update, not to SO. Otherwise, you are restricted to having to be in the same sim. Objects can only give inventory to other objects in the same sim, but they can give inventory to avatars wherever they are.
Now, to send objects to SO's owner, you will need to have SO emailing the owner's key (obtained via llGetOwner) to MO, because otherwise MO can't easily work out what it is. The function to find out who the owner of another object is (llGetOwnerKey) only works if the owner is within the same sim.
|
|
Androclese Antonelli
Org. B-Day: 05/11/04
Join date: 25 Apr 2006
Posts: 96
|
05-01-2006 14:21
Ok. That created my first hurdle. I either have the end user travel to the sim where the master object exists, or I have to have a specific "updater object" that exists aside from the end item. The latter method would give the SO owner multiple versions of the same object (and its inventory) so long as they owned the "updater obect". ... or am I making this too complicated?
EDIT: Ok, wait, I think I got it now.
It would require multiple objects..
MO = Master Object SO = Slave Object UO = Updater Object
Same deal as before: SO talks to MO, checks the version number, but this time, it send UO to the SO Owner. The UO, now in the same sim as the SO, gives its inventory to the SO and then llDie();'s.
...Hrmm that might work.
_____________________
The Sculpted Garden Originally Born 5/11/2004 - New AV, Old Player. If you leave the game, don't delete your account, just make it 'free'. You'll lose your inventory like I did. *sniff*
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
05-01-2006 14:54
As it says in the Wiki, giving inventory items to an object that contains items already with same name will fail to transfer those items, so you need to either use new names (might be problematic with scripts, but there are ways to get around that), or have the object "clean" itself. You can't give scripts to an object and have them run with GiveInventory. You have to use RemoteLoadScriptPin/SetRemoteScriptAccessPin to give an object running scripts (which will overwrite any existing script with the same name, unlike with GiveInventory).
|