Auto Server/Client for 2.137

News, Discussions, Questions and Answers

Auto Server/Client for 2.137

Postby thyme » 24 May 2008, 22:48

Open Source Seamless3d 2.137 (including French and English versions) is available for download from:

http://www.seamless3d.com/download

Seamless3d can now run as either server or as client when used for chat.
With a little help from PHP, who runs as the server or as the client is determined automatically.

To login it's the same as before:

Click Image from the toolbar (make sure the button has a spider web on it or it wont work)
Enter your nickname and click the go button.

You can see who is running the server by typing in the command:

server?

into the chat window and pressing enter.

You will notice that a smls file in the worldUrl field has been replaced with a php file.
The php file returns a saved IP address for the acting server when Seamless3d requests to join a world.
The script will save a new IP address whenever Seamless3d requests to act as the server (which happens when Seamless3d fails to log in with the IP address it was given).

The PHP script is currently very simple:

Code: Select all
<?php
$filename="server.txt";
if($_GET["session"]!="join"){
   if($handle = fopen($filename, "w")){
      $str = $_SERVER['REMOTE_ADDR'];
      fwrite($handle, $str);
      fclose($handle);
   }
}
if($handle = fopen($filename, "r")){
   $str = fread($handle, filesize($filename));
   fclose($handle);
   echo $str;
}
?>


It must be allowed to write files within the folder its in.

This PHP script will not prevent 2 people from becoming servers if they request to be servers at the same time but I am sure something simple can be done to stop this.

Seamless3d creates the world url for the smls file by simply replacing the php extension with a .smls extension
This means you must have the world smls and php filenames match and they must both be in the same folder.

I have made it so that you no longer have to click on the chat window to type but you will need to click on either the chat window or the 3d window to use the arrow keys because both windows use the arrow keys differently. No crashes should occur if you get it wrong however.


You can change the avatar url field with any of these tested urls:

http://www.seamless3d.com/wrl/test_mu/n ... ch_av.smls
http://www.seamless3d.com/wrl/test_mu/m ... ezier.smls
http://www.seamless3d.com/wrl/test_mu/f ... tudio.smls
http://www.seamless3d.com/wrl/test_mu/m ... tudio.smls
http://www.seamless3d.com/wrl/test_mu/n ... he_av.smls
http://www.seamless3d.com/wrl/test_mu/r ... he_av.smls


Many Thanks to Gil the B for testing this version out before I uploaded and thanks to all who gave feedback for the previous version.
I am now suspecting the only reason why people were unable to log in sometimes when I had the server running with the correct IP address was due to whether I had the server running on my computer or on Ep's (which both share the same IP address).

In addition to working on the chat:

I have made it so that any window that is outside the range of being visible is now automatically brought within view.
This will make it no longer necessary to edit a smls file using a text editor if you receive a smls file from someone who has a bigger screen than you ;)

I fixed a timing bug that would show up on some scripted animations.
User avatar
thyme
Site Admin
 
Posts: 1322
Joined: 21 Apr 2006, 16:39

Re: Auto Server/Client for 2.137

Postby thyme » 25 May 2008, 20:36

Although this new way can work because I was able to login to Gil this idea seems to have problems.
Isa Alain and Peter tried it out but failed to all meet up. They were in the world all by them selves meaning they were all in server mode.
The problem here is I can not know for sure if they exited before anyone joined.
This is the problem of testing like this, so many unknowns.
I need really to chat in a separate messenger with testers to know when someone has tried to join and when they have left.
I ran the stand alone console (an updated version that has not yet been uploaded) on Ep's computer which allowed me and Isa to join and chat.
But Alain and Peter failed to join us :(
I can see Alain and or Peter changed the IP address automatically but when ever I tried to join them I failed. (but how can I be sure they were waiting for me)
How their firewall configuration or how their network is set up may prevent server mode working for any of the clients.
To keep things simple I will go back to having the server and the client running in separately programs.
What I need to establish first is what works reliable and what does not for other users.
But I am wondering now if peer to peer or any hybrid p2p server/client arrangement will alway have problems if some can not run as servers.
How reliable is peer to peer in general?
User avatar
thyme
Site Admin
 
Posts: 1322
Joined: 21 Apr 2006, 16:39

Re: Auto Server/Client for 2.137

Postby thyme » 25 May 2008, 20:41

Arrrg I missed Peter while I was writting here:

Peter has joined this world
Peter : Hi Thyme :)
Peter : I was unable to connect with ISA and Alain... now it works
Peter : does the php run on your local machine?
Peter : server?
Peter : mhhhhh ... feeding the oppossums again? lol
Peter : catch you up later ... must finish some work. TC
Peter has left this world
you are alone in this world thyme

I can see the importance of having a sound alarm to notify when ever someone joins (when there is no one else in the world) especially for testing
User avatar
thyme
Site Admin
 
Posts: 1322
Joined: 21 Apr 2006, 16:39

Re: Auto Server/Client for 2.137

Postby Peter » 26 May 2008, 05:04

Hi Thyme,

don't desperate : you're doing great work and I know how much the "unexpected behaviour" of beta-testers challenges the developer.

I'm running seamless3d on a laptop, connected via WLAN to a router. Probably I should open a port there and set up some port-forwarding for seamless3d?

Which are the ports used by the Seamless3d server?

The server & client solution is worth to work on. Keep on doing.

Would it be possible to have all the servers of the server-list displayed on a window, may be working as a server selector?

TC

Peter
Peter
 
Posts: 24
Joined: 23 May 2006, 23:23
Location: Germany

Re: Auto Server/Client for 2.137

Postby Alain » 26 May 2008, 07:08

(but how can I be sure they were waiting for me)


trust on us LOL

( joke :)

good luck , you will succeed

ps dont know if my avast was a prob ....
User avatar
Alain
 
Posts: 387
Joined: 29 Apr 2006, 14:26
Location: France

Re: Auto Server/Client for 2.137

Postby thyme » 08 Jun 2008, 21:30

Alain wrote:good luck , you will succeed

Thanks Alain :)
So long as Seamless3d is developed for the fun of it, it will continue to grow with no fear of it all coming to an end due to a bankruptcy.

Alain wrote:ps dont know if my avast was a prob ....


We have not made enough tests to be able to conclude much but Alain does your computer share an internet connection with another computer? This can be a reason why no client can login if you are running the server.


Peter wrote:I'm running seamless3d on a laptop, connected via WLAN to a router. Probably I should open a port there and set up some port-forwarding for seamless3d?


Thanks much Peter :) It would be very good to test the seamless3d server on a range of different computers.

Its easy to run the server to make a test:
Hosting a World Using the Seamless3d Server
Let me know when you want to make a test, there is no urgency right now, I am back to being content making content using my new NURBS features :)


Peter wrote:Which are the ports used by the Seamless3d server?


Currently it is hardwired to 7778 but I could easily make it so that it can be set to any port if the need arises.

Peter wrote:Would it be possible to have all the servers of the server-list displayed on a window, may be working as a server selector?



Because 2.136 lets html browsers read directly from a Seamless3d server (for information on who is in a world) a html page can be set up to display a number of multi user worlds. Each multi user world can be hosted by a different server and the world's hosting can change without editing the html page.

Seamless3d Chat
Hosting a World Using the Seamless3d Server
How to Let Others Chat In Your SMLS File
User avatar
thyme
Site Admin
 
Posts: 1322
Joined: 21 Apr 2006, 16:39

Re: Auto Server/Client for 2.137

Postby Alain » 08 Jun 2008, 21:36

hummm

does your computer share an internet connection with another computer?


all my crazy family is connected at the same time here , 25h/24 :(
3 o 4 puters it depends where are my sons , at home or not :)

it is just a prob to feed the dogs , btw , normaly :)
User avatar
Alain
 
Posts: 387
Joined: 29 Apr 2006, 14:26
Location: France

Re: Auto Server/Client for 2.137

Postby thyme » 08 Jun 2008, 21:48

Hey Alain :)
I can't run the server from my computer while Ep's computer is the computer connected to the net.
But it's easy to run just the server from the computer that is connected if you have access to it and run the client (the modeller) from whatever computer you like.
This is one of the reasons I now rather have the server in a separate program to the client.
This should also make things more reliable than a peer to peer arrangement.
The server should not upset the user of the computer that runs it since it uses very few resources when left running in the background.
User avatar
thyme
Site Admin
 
Posts: 1322
Joined: 21 Apr 2006, 16:39


Return to Seamless3d Forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron