Tuesday, September 14, 2010

Lohri Invitation Sample

hacking opensimulator

Beginning tonight a series of postings on my OpenSimulator experiments, experiments that, in reality, began a year ago, but I `suspended because the platform was at the time of a disaster, too immature even for an old hacker like me.

For the uninitiated OpensSimulator is the Open Source server for virtual worlds like Second Life. For those who do not know What Is Second Life, however, I can only say that the dinosaurs as big, they are extinct, and the case is to evolve, otherwise we risk the same fate:) I installed the

My most recent version of the server socket OSGrid , namely the post-0.6.9-patches, and I have configured as a standalone server, which is not linked to any particular grid. However hypergrid is enabled, this means that if I open the appropriate ports on my firewall, would be able to connect from the outside and visit the places of my virtual hacking. Better than not with a adsl like mine, anyway. The configuration is

was quite a bloodbath, then resolved by downloading a prepackaged distribution already (Diva), the config files and re-adapting to my needs.

OpenSimulator is written in C #, and then having to run on a linux server (You do not think seriously that uses a Windows server) I had to install the latest version of mono. Download, fill out short, the usual thing to linux geek. `I will talk about all this in detail (thinking of doing something pleasing to many) in another post, for the time being I prefer to throw some downward while stamping service so ugly my personal island, a diary of the sadistic perfect hacker In short.

First, I created a prim with a script that will show me in real time the key statistics in the region (FPS, number of first, the occupation of RAM):

 
vector <0,1,0> = color1, color2 =
vector <1,1,0>;
vector colorw = <1,0,0>;
integer color = 1;

default
{
state_entry () {

llSay (0, "monitor running");
llSetTimerEvent( 2.0 );
}

timer()
{
string tstr = "";
list tlist = osGetRegionStats();
vector tcolor;

tstr += "Dilatn: " + llList2String(tlist,0) + "\n";
tstr += "SimFPS: " + llList2String(tlist,1) + "\n";
tstr += "PhyFPS: " + llList2String(tlist,2) + "\n";
tstr += "Prims: " + llList2String(tlist,6) + "\n";
tstr += ".\n";
tstr += "RAM: " + (string)(osGetSimulatorMemory() / 1024 / 1204) + " Mb\n";
tstr + = ". \\ N. \\ n. \\ n";

if (color == 1) {
tcolor = color2;
color = 2;} else {

color = 1;
if (llList2Integer ( tlist, 0) 44 000 <>) = {
tcolor colorw;} else {

tcolor = color1;}

}

llSetText (tstr, tcolor, 1.0);
}}



So I wore the prim (see it on my head) and I started to first create a gogo, a thousand at a time, until you reach the maximum permitted in the region, which is 45000. For the truth prims in the region are 45,000 + 1, but what I have on my head does not count with respect to the maximum number.
`I did not understand why, but the info window of the region (from the client, I'm using imprudencia), I Dike the maximum number of objects on the land is 15000, which is obviously not true. He adds that 30 thousand objects in more will be deleted. It is not true either.

I continued to create prim (another 1000 to be precise), and let me create. At this point, I was puzzled. After a restart things are clarified, to reload the region have been refilled only 45,000 prim, the other ... poof, gone. The fact that they have been able to create is also probably because I'm using the master's Avatar (The super admin, in short). That gives me is the power to create things that will be swept away but then `. There must be a profound message in this matter, but it is not the time to think about it now.

Instead, some figures: 45 thousand prims with the occupation of RAM reported is about 372Mb, but I do not know why I created them while I have reached a maximum of 90MB. Only after a restart of the region, when he charged the content, the occupation is in schiz PROVIDING 372Mb.
    
Employment
real process, in accordance with said top, is of 438 Mb, single takes his hoverhead, of course. Get on that data in principle, if you want to experiment with you, and you do not want send in your poor cow linux machine for want of RAM:)

a curiosity, the command "show stats" from the OpenSim console shows an occupation of 297Mb of ram .. since it would contain the same values \u200b\u200bof the function used in the script (the others are in fact equal) it's not clear which one is right.

Probably neither, since the real occupation is that given by the system, which is what counts in the end.

Another curiosity: the first on land is stored in MySQL database, in the two tables "prims" and "primshapes. If you take them up and put them in the inventory, however, end up in the "assets". We are going to be a reason for which they have chosen to store the same things in two different places, instead of creating appropriate links, but it escapes me. The assets have a link that connects them, where appropriate, to your inventory. One thing is certain, the prims in the first two tables are only those actually on the land, while the assets are never deleted, I can see that inside there are 15 or 20 versions of the script that I changed many times. This thing makes no sense, and I think works the same way in Second Life. This explains why is this technology is not scalable. " Obviously, if the basic design flaws SO gross. I hope at least that there is around a task that allows the cleaning of the database, but what `which I doubt much (after days of trials on this software, I'm starting to get sick in the logic of the developers).

During the creation of the first, the physics engine is left in mona, I could go through the locks as well not exist. After the restart, things have settled, now the prim on the ground are solid as rocks. Given the history of initial employment RAM rather small, I imagine that when creating the former are placed in the scene been so, well, in part, and I suppose there is a task of consolidation deals, from time to time , to make "real" created things, but that task must be left in `Mona along with the physics engine to create too much stuff (or too much in too short time). The viewer takes his d el, when I try to logout it takes about a quarter of an hour to get out. We would. He did the first time. Now I killo the first:)

at this time I created 4 other prim on land, and 4 over the limit. No problem, even the physics engine. `You see them on the ground, beautiful color. Now I do a restart of the region and see what happens to.
    

Well done. In the sense that the "restart" recharged 45,000 prims, and brought employment to about 600Mb of the process. Series, Manage e are properly reset the variables, or is mono (C #) that has a garbage collection that sucks, or maybe en trambe things. On the other hand, a language born in the house could not be much injured Microsozz `, and the fact that it was chosen as the basis for the development of this project explains many of the problems that afflict him. I speak of the twisted mind of the developers, not the language itself;)

Seriously, it passes the monastery, however OpenSimulator is a project of all respect, I doubt you can do better when working "on the edge, in a field such as this is innovative.

Ok, we avoid the restart. I do a "quit" and restart the application from scratch, which is better. Surely if you are going to put this monster on a production server to think of a better watchdog just saw him eat more ram than necessary, tak!, a blow to the neck and that way we leave, the better the crash of an island that dell'interso crash the system.

Ah ... 4 breakfasts or more are still there '. Again, this is interesting in the sense that I'd like to know how the controls are logical limits on the simulator. I can think of only colorful expressions and rather obscene, and then we fly over.

For now I'll stop here, I've hacked enough for tonight. I invite you to take a ride on our islands public here: KUBiC HyperKUBiC , are empty for now but as soon as I can to regain possession of my stuff in Second Life (this `will talk in another post), will be filled.

Good meta-navigation.