From Edutechwiki - Reading time: 5 min<pageby/>
Flux multi-user server (alias Hydra) is Open Virtual Worlds Web Server made by Media Machines. Currently as on July 2007 in late alpha/early beta.
For the moment, this page is only of interest to technical folks. Hydra is not ready for the masses as on July 2007.
Daniel K. Schneider tried on his personal Linux Desktop (Ubuntu 6.10). Disclaimer: I am not a programmer nor a sysadmin. Also, I use root to do command-line installations (can't get myself to type sudo in repetition).
In progress so to speak ...
I took:
mysql-server libmysqlclient15-dev
If don't want to type command-lines to mysql, you also may want to install a mysql administration client. I tried (but then only used it to change the root password of the mysql server).
mysqladmin
This tool then will show up under Applications/Systems tools. First time you connect you can use 'root' without password.
Then, open a terminal and become root:
su
Currently (July 2007) you have to compile Hydras and HawkNL it yourself.
/usr/local/flux/hydra
(&hydra_db, "localhost", "user", "password", "database", 0, NULL, 0) != NULL);
to:
(&hydra_db, "localhost", "hydrausr", "SECRET", "hydra", 0, NULL, 0) != NULL);
char *url = "http://worlds.webers.org/content/testbed/";
by something of your own
/usr/local/flux/HawkNL
unzip HawkNL17b1src.zip [-d "flux directory"] cd "flux directory" ln -s HawkNL1.70 HawkNL
/usr/local/flux lrwxrwxrwx 1 root root 10 2007-07-06 15:28 HawkNL -> HawkNL1.70 drwxr-xr-x 7 root root 4096 2007-07-06 15:27 HawkNL1.70 drwxr-xr-x 2 root root 4096 2007-07-06 15:40 hydra drwxr-xr-x 2 root root 4096 2007-07-06 15:39 src
cd HawkNL make -f makefile.linux make -f makefile.linux install
It will also copy the libraries in /usr/local/lib and header to /usr/local/include/nl.h
cd hydra make
Result:
gcc -I/usr/include/mysql -DUSE_MYSQL -c scenemodel.c gcc -I/usr/include/mysql -DUSE_MYSQL -c netcontroller.c gcc -c netview.c gcc -c -ggdb swamp.c gcc -o hydras -pthread hydras.o clients.o scenemodel.o netcontroller.o netview.o swamp.o ../HawkNL/src/libNL.a -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient gcc -c -ggdb hydrac.c gcc -o hydrac -pthread hydrac.o swamp.o ../HawkNL/src/libNL.a hydrac.o: In function `printErrorExit': /usr/local/flux/hydra/hydrac.c:76: warning: the `gets' function is dangerous and should not be used. make: *** No rule to make target `hydrabot', needed by `all'. Stop.
This doesn't seem to be harmful (for the moment) since hydras (the server) is built.
I presuppose that both MySQL and your Hydra will run on the same machine.
(I used the command line since I couldn't figure out how to use the GUI.)
mysql -p
hydramysql> create database hydra;
mysql> create user hydrausr identified by 'secret';
mysql > GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON hydra.* TO 'hydrausr'@'localhost';
mysql > flush privileges;
This is needed for avatars, else you get something like:
Client connected with yourid=1, mytoken=/MM-6-12345678, uid=6 SELECT login_name,avatar FROM users WHERE uid=6 wrote 61 bytes to 1 Segmentation fault (core dumped)
So you go:
mysql -p use hydra
Copy/paste this:
CREATE TABLE `users` ( `login_name` varchar(32) default NULL, `password_hash` varchar(128) default NULL, `uid` int(10) unsigned NOT NULL auto_increment, `avatar` varchar(128) default NULL, `email` varchar(255) default NULL, `iconurl` varchar(255) default '/users/media/defaulticon.jpg', terms smallint unsigned default 0, /* signifies which terms user agreed to, should always be > 0 */ mailings smallint unsigned default 0, /* signifies the level of mailings user agreed to, 0 is only essential */ PRIMARY KEY (`uid`) );
To check it:
mysqlshow hydra -p Enter password: Database: hydra +--------+ | Tables | +--------+ | users | +--------+
mysqlshow hydra users -p .....
Type: hypdras
./hydras
You may see:
port is 13214 url is http://tecfa.unige.ch/guides/x3d/ex/hydra/testbed.html connected to database Listening on 13214
Note: if you didn't edit the *.c files as told above, you will get
url is http://worlds.webers.org/content/testbed/
From another terminal you also may launch a text client.
./hydrac -d
You may see:
read 4 bytes, messlen is 6 read 6 bytes, messlen is 6 hello yourid=0, mytoken=NA
... though I can't figure out how one could use this to test other things.
To test, get the Flux Multi-user test files from media machines and dezip on some webserver.
Then edit files localplane.x3d and testbed.x3d etc. and change from:
url="'swmp://localhost:13214/MM-6-12345678'"/>
to the URL of your Hydra server (not the webserver !)
The try with a Flux Player. E.g. enter a URL like
http://tecfa.unige.ch/guides/x3d/ex/hydra/localplane.html http://tecfa.unige.ch/guides/x3d/ex/hydra/testbed.html
Note: The hydra URL runs on my desktop and will be mostly down ... So don't bet on the files / server I installed.
If you correctly created the MySQL users table you'll see something like:
./hydras -d port is 13214 url is http://tecfa.unige.ch/guides/x3d/ex/hydra/testbed.html connected to database Listening on 13214 Client connected from 129.194.112.101:1032 on socket 1 read 18 bytes from 1 wrote 6 bytes to 1 Client connected with yourid=1, mytoken=/MM-6-12345678, uid=6 SELECT login_name,avatar FROM users WHERE uid=6 wrote 61 bytes to 1 read 35 bytes from 1 read 35 bytes from 1 read 35 bytes from 1 .....
I think I got it working somewhat. But the test scene has missing files and is sluggish (even on a good Dell XPS II laptop). I seem to wake up in the middle of an avatar etc. At some point I think I have seen 2 avatars, but it may have been a fatamorgana.
Maybe something to do with client stuff like avatars being identical from 2 different machines or so .... will look at it again at some point. Maybe something not correctly installed.