Communication Between LSL and .NET
In order to enhance the power of scripted objects with .NET applications located outside Second Life, you need means of communication. Fortunately these are provided for in the Linden Scripting Language (LSL).
LSL provides the capability for objects to both send and receive email. This is in addition to the feature which will forward in-world instant messages to your email address while you are offline. It doesn’t present a very tightly coupled communication link, but can be useful.
HTTP
Objects can initiate HTTP requests to websites not located on Linden servers, and receive HTTP requests. This can be useful for collecting information and transmitting it to a site for storage in a database. Of course, since HTTP is platform neutral, it doesn’t matter what is on the receiving end, so your preference might be Linux, PHP, and MySQL. However, this being a .NET oriented site, we’ll be describing communication with Windows servers running ASP and/or ASP.NET pages and SQL Server.
XML-RPC
Unlike the communication method above, in which communication is initiated by the scripted object, XML-RPC originates from another server and will elicit a response from the scripted object. This is more tightly coupled than email, but still has quite a bit of lag. Initial experiments with it have shown that you must allow 2-3 minutes between transmissions to the scripted object for this to work. Still, it is one way to go.
Bots
A .NET assembly DLL is available which can be used as the basis for an application you can write, either in C# or VB.Net to run on your own computer. The application will be able to log on as a Second Life account and have much of the functionality you have logged on with the SL Viewer. The source code is also available so it can be modified to your tastes if you have the ambition for it. You can log such an application on with one of your alts while you are on in your principal SL identity and the application can communicate with scripted objects, or other avatars for that matter. Since there is no video involved, it doesn’t eat up bandwidth like two SL viewers on the same high speed web account would.
It Isn’t Expensive
The nice part about integrating LSL and .NET is that it doesn’t have to cost you much, or at all. Oh, there is a lot of “sweat equity” involved if you don’t speak the .NET languages, but you can do all this with little or no extra out of pocket expense.
You’ll need something to build .NET applications, but that’s free. Visual Studio 2008 Express doesn’t have the full ensemble of features of full fledged Visual Studio, but it has enough to do anything we will describe. And, you can’t beat the price, because it is free for the download at Microsoft.com. If you need a database on your own computer, download Microsoft’s SQL Server Express, and its Management Studio free of charge as well.
If you want web space, that does cost, but you can get that fairly cheaply from a lot of web space providers. We use 1and1.com. We don’t get any referral fees for that plug, but so far we’ve been fairly happy with it. After all, if you are willing to pay for an SL premium membership, and probably some land use fees if you have a big site (or your own island!), it’s not much more to spend for a means of enhancing that enormous mall you own.
We’ll be covering each of these techniques in quite a bit more detail in the coming weeks and months. We’d like to hear your experiences as well.