Corporate America and I seem to have come to a mutual understanding. Since they have discovered that I am well into my seventh decade on this miserable planet, they deem that a reason to treat me like a leper. For my part, I find working for them to be, at its very best like being trapped in a gigantic Dilbert cartoon, and at worst like being captured by the Borg. Twenty five to thirty years ago America was filled with a generation of children who could be found slack-jawed, bugeyed, and drooling in front of the TV set watching cartoons on a Saturday morning. Now, having grown up and gotten their MBA degrees, they can be found on any workday, slack-jawed, bugeyed, and drooling, managing corporations. They consider dealing with me only slightly less desirable than going down on Eleanor Roosevelt. Need I add that the feeling is mutual?
With this turn of events, and realizing that my stash of cash from previous software contracting is not inexhaustable, my search for something to keep red beans and rice on the table has now gotten me to developing applications for the iPhone. Still having a great love for playing with OpenSim, I have been looking for some way to bring these two activities together. That has resulted in the creation of a new project which will generate a series of posts of which this will be the first.
Maria Korolov left a comment to a prior post regarding an iPhone app which received streaming video from an OpenSim world. That would be a great app, but just a bit complex for a first try. Instead, I am going to embark on the development of an app which will tell me who is on my OpenSim world.
To the extent possible, it is desirable to limit interrogation of an OpenSim instance to what is contained in its database. The reason is that a completely separate application can be created on the server hosting the OpenSim instance which can access the database. In this way, no code modifications and additions need be made to the OpenSim code itself. This is desirable since the folks at OpenSim keep turning out new versions every few months. Downloading the new version of OpenSim, then once again adding code to it can be something of a hassle. However, each time you upgrade OpenSim, you keep the same database that the previous build had. Since the evolution of the database schema seems to have more or less stabilized with OpenSim upgrades, the separate application used to access the database need not change as a rule.
This does present something of a problem for xorgrid, however. Information as to which of the users who have an account on xorgrid can be read from a table in the database. The problem is, except for me, the only people who get on xorgrid do so by means of hypergridding. There doesn’t seem to be any information about hypergrid visitors in the database. That information is held by objects created by the code, and is not persisted. So, at least this first iPhone app will only tell me if one of my accounts is active, which I will sort of already know. Still, the project will have its value as yet another learning experience, and may yet spawn some other ideas which can be exploited later.
The project will thus have two components. One will reside on the server which is hosting xorgrid and will receive requests for information over the internet, in response to which it will access the OpenSim database and return the results. The second will be an iPhone app which will connect over the internet to the xorgrid server, request information, and display it on its screen. This app will actually reside on my iPod Touch, but could well be installed on an iPhone as well.
There are a couple of possibilities for the application running on the server. Perhaps the simplest would be to get the webserver running, set up port forwarding to allow web access, and just create a web page. For privacy sake, a login page could be added so the whole world couldn’t see who is running around on xorgrid. This would eliminate any need to write something for the iPhone, since it and the iPod Touch come with Safari, Apple’s web browser, already installed. Sort of takes all the learning out of the learning experience, doesn’t it?
So, the first step will be to crank up Visual Studio Express (you don’t think I would actually pay for Visual Studio do you?) and whip out a C# application with a server socket and an ODBC connection to OpenSim’s MySQL database. I’ll be doing that during the coming week and give you a report in my next post. Those of you faithful readers who have been with me for a while will recall that xorgrid runs on a dedicated server which is one of several computers connected to the internet through a LinkSys router, and uses dynamic DNS to maintain a permanent domain name. This will result in the need to edit the port forwarding in the router, and I’ll talk about that as well.