Web delivery

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Web delivery

Jeff Kelley
I am looking for a way to programmatically create an inventory item
such as it appears immediately, as in the case of llGiveInventory. It
can be either in the avatar's inventory, or in an object's inventory
(since the object can give to the avatar). It can't be assumed that
the container be scripted, so it is not possible to use
llGiveInventory.

I can INSERT a row into database or POST to the InventoryService. The
former needs the simulator to be stopped, and the later the avatar to
relog. None meets the "immediate delivery" requirement.

This would be used to deliver things from the web, as in the
following application :
http://www.pescadoo.net/tmp/texture_browser.png

My avatar selects a ROBUST texture on a web page. The web then calls
an object, passing the name and uuid of the texture. The box under is
painted by uuid.

Any idea?


-- Jeff
_______________________________________________
Opensim-users mailing list
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Web delivery

M.E. Verhagen
The post to the inventoryService updates the opensim side immediately.

Most viewers will load the inventory from opensim on login.

I think the direct delivery from LL uses a special type of folder type which can push to the viewer. 
You would look that up in for instance the firestorm viewer source how that is implemented in the viewer. I doubt it is reverse engineered into opensim.

_______________________________________________
Opensim-users mailing list
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Web delivery

Luisillo Contepomi-2
May be is a stupid idea but..
Diva has a function for show the inventory items in the wifi pages.
May be modifying the sources and show in a web as media on a prim.. You can do a web for give inventory to a uuid when is selected in this web.
or do some with all items... i dont know.



El 31/10/2014 a las 10:57, M.E. Verhagen escribió:
The post to the inventoryService updates the opensim side immediately.

Most viewers will load the inventory from opensim on login.

I think the direct delivery from LL uses a special type of folder type
which can push to the viewer.
You would look that up in for instance the firestorm viewer source how that
is implemented in the viewer. I doubt it is reverse engineered into opensim.



_______________________________________________
Opensim-users mailing list
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users


_______________________________________________
Opensim-users mailing list
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Web delivery

Jeff Kelley
In reply to this post by M.E. Verhagen
At 10:57 AM +0100 31/10/14, M.E. Verhagen wrote:

>  The post to the inventoryService updates the opensim side immediately.
>  Most viewers will load the inventory from opensim on login.

That's the case of Firestorm. The inventory is not supposed to change
in the background, except when the change is pushed by the simulator.


>  I think the direct delivery from LL uses a special type of folder
>type which can push to
>the viewer.  You would look that up in for instance the firestorm
>viewer source how that
>is implemented in the viewer. I doubt it is reverse engineered into opensim.

Worth a try.

Thanks.


-- Jeff
_______________________________________________
Opensim-users mailing list
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Web delivery

Jeff Kelley
In reply to this post by Luisillo Contepomi-2
At 3:23 PM +0100 31/10/14, Luisillo Contepomi wrote:

>  Diva has a function for show the inventory items in the wifi pages.
>  May be modifying the sources and show in a web as media on a prim..
>  You can do a web for give inventory to a uuid when is selected in this web.
>  or do some with all items... i dont know.


Yes, what I'm doing is similar to Diva's wifi, although much more
limited and extended to in-world containers (boxes of textures). And
what you see in my example is actually a web page on a prim. It is a
grid-global texture browser. I stumble against the delivery problem.


-- Jeff




_______________________________________________
Opensim-users mailing list
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Web delivery

justincc
In reply to this post by Jeff Kelley
You may want to look at
OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveModule.UpdateClientWithLoadedNodes().

This is the method that tells the viewer about the new inventory folder/items after a "load iar".

In fact, you might be able to do this with less work by actually uploading an IAR, though you will have to be careful
about security.  Assuming that your picture shows media on a prim here are my naive thoughts.

1) Extend RemoteAdmin [RADMIN] with an "admin_load_iar" command in the same fashion as the existing "admin_load_oar"
command.  The admin_load_oar can only pick up from the filesystem (though this can also be an URL).  I'm not sure how
easy this approach is to error handle (though it may be easier than load oar since it's not asynchronous).  If you do
this then a patch for the command would be very welcome.

2) Encode the region UUID in the MOAP url.  Getting the user UUID is more complicated with no scripting.  Immediate
thought is require them to have an account in the web application.

3) Either only allow them to pick individual folders or items with pre-created IARs, or create an IAR on the fly from an
arbitrary selection (much more involved).  Either way the IAR has to end up in a location that all regions can access
(e.g. a shared filesystem or an url).

4) Get the user's current region via the PresenceService getagents call [PRESENCE].

5) Use the GridService get_region_by_uuid call [GRID] to retrieve the server URI.  As RemoteAdmin has to run on a
different port you will need to hardcode that part.

6) Use the URL to invoke admin_load_iar with the user uuid and iar location.

If you do end up simply adding inventory items directly, I recommend invoking service calls [SERVICES] rather than
editing the database directly.  They are not very nice interfaces (being meant originally for OpenSim use only in many
cases) but it would save you a lot of grief if the database changes or if one wanted to use an alternative service
implementation that had the same interfaces but different storage structure.  I have some working example PHP for
invoking services at [INTEGRATION] though at some point I need to make the connectors proper objects.

[GRID] http://opensimulator.org/wiki/GridService#get_region_by_uuid
[INTEGRATION] https://github.com/justincc/opensimulator-tools/tree/master/integration/php
[PRESENCE] http://opensimulator.org/wiki/PresenceService
[RADMIN] http://opensimulator.org/wiki/RemoteAdmin
[SERVICES] http://opensimulator.org/wiki/Services

On 31/10/14 08:37, Jeff Kelley wrote:

> I am looking for a way to programmatically create an inventory item such as it appears immediately, as in the case of
> llGiveInventory. It can be either in the avatar's inventory, or in an object's inventory (since the object can give to
> the avatar). It can't be assumed that the container be scripted, so it is not possible to use llGiveInventory.
>
> I can INSERT a row into database or POST to the InventoryService. The former needs the simulator to be stopped, and the
> later the avatar to relog. None meets the "immediate delivery" requirement.
>
> This would be used to deliver things from the web, as in the following application :
> http://www.pescadoo.net/tmp/texture_browser.png
>
> My avatar selects a ROBUST texture on a web page. The web then calls an object, passing the name and uuid of the
> texture. The box under is painted by uuid.
>
> Any idea?
>
>
> -- Jeff
> _______________________________________________
> Opensim-users mailing list
> [hidden email]
> http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users
> .
>


--
Justin Clark-Casey (justincc)
OSVW Consulting
http://justincc.org
http://twitter.com/justincc
_______________________________________________
Opensim-users mailing list
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Web delivery

Jeff Kelley
At 11:45 PM +0000 31/10/14, Justin Clark-Casey wrote:

>You may want to look at
>OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveModule.UpdateClientWithLoadedNodes().

That's the method I need, although it is not exposed externally. I
can call it from inside the simulator, not via HTTP. Correct me if I
am wrong.


>In fact, you might be able to do this with less work by actually
>uploading an IAR, though
>you will have to be careful about security.  Assuming that your
>picture shows media on
>a prim here are my naive thoughts.

Yes, the picture shows media on a prim. It's pure PHP+SQL+jQuery. It
gots the .jp2. There should be no difficulty building an IAR (except
headache).


>1) Extend RemoteAdmin [RADMIN] with an "admin_load_iar" command

My ability to code in C# is low and I never had a look to the
sources, so this one will be tough. Let's suppose I succeed.


>2) Encode the region UUID in the MOAP url.  Getting the user UUID is
>more complicated with no scripting.  Immediate thought is require
>them to have an account in the web application.

ATM, the delivery is trigerred by JavaScript inside the web page. It
can be replaced by a script doing HTTP. I get the region name
(X-SecondLife-Region) which I should be able to translate to UUID
using the database or calling GridService. The user UUID is trivial.


>3) Either only allow them to pick individual folders or items with
>pre-created IARs, or create an IAR on the fly from an arbitrary
>selection (much more involved).  Either way the IAR has to end up in
>a location that all regions can access (e.g. a shared filesystem or
>an url).

The selection goes as low as a single texture. On-the-fly is
mandatory. Create the folder structure, generate the XML and tar.


>4) Get the user's current region via the PresenceService getagents
>call [PRESENCE].

Ah! I see you have documented a new batch of services. More API to
play with :))


>5) Use the GridService get_region_by_uuid call [GRID] to retrieve
>the server URI.

I already get the serverURI from the 'regions' table.


>6) Use the URL to invoke admin_load_iar with the user uuid and iar location.

You made my roadmap. However, if I manage to call
UpdateClientWithLoadedNodes, I can skip the IAR step.


>If you do end up simply adding inventory items directly, I recommend
>invoking service calls [SERVICES] rather than editing the database
>directly.

Yes, using InventoryService is cleaner than inserting a row in the
table. However, the items will not be available until relog.


>  I have some working example PHP for invoking services at [INTEGRATION]

You just saved me a lot of work.

Thanks so much.


-- Jeff
_______________________________________________
Opensim-users mailing list
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Web delivery

Jeff Kelley
In reply to this post by justincc
At 11:45 PM +0000 31/10/14, Justin Clark-Casey wrote:

>[GRID] http://opensimulator.org/wiki/GridService#get_region_by_uuid

GetRegionRange is a godsend. Try:

GetRegionRange($GRID_SERVICE_URI, 0, 0, 2147483647, 2147483647, TRUE);

I was waiting that for years. I now can get rid of the database stuff.

Woot !


-- Jeff


_______________________________________________
Opensim-users mailing list
[hidden email]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users