Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Online Aplication.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
copthesaint




PostPosted: Tue Mar 17, 2009 10:36 pm   Post subject: Online Aplication.

Im just wondering but could everyone connect to a webpage using a turing program then see who's online on the webpage in turing and get there ip address from the people who are online?
I have read shadowdan's online tutorial
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Mar 17, 2009 11:32 pm   Post subject: RE:Online Aplication.

I suspect there's a fundamental lack of understanding, on your part, as to what a "webpage" is.

Lets pretend that I'm a web server and we'll use a standard http://en.wikipedia.org/wiki/Request-response model; though for the sake of exaggerating the point, we'll communicate with email, instead of http.

You ask me for a page.
I email you the .html file you ask to see.

Now, what else do you need, to find out who else had asked me for the same file?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
copthesaint




PostPosted: Wed Mar 18, 2009 10:02 am   Post subject: RE:Online Aplication.

Sorry I don't understand your help. I would like to know what you are talking about, Email or http.
All I was wondering is that by useing turing to connect to a web page could everyone connected to the web page get each others Ip address. That way I could see who's online then I would let a user create a server for there game and using the web page the other clinents can see the Ip address of the hosting server. My idea was that Everyone would connect to a base server at first then into a persons server to play a game.

The other thing I thought was maybe to have a (BASE) server it would have to just be a computer with a static Ip address that would run 24/7 and would be the first connection for everyone. Then after people could host a server/game where the base server would tell other users on the base server that a game is being hosted on this, someone elses, server.

What I'm asking is would the first option work, or would just the second one work?
DemonWasp




PostPosted: Wed Mar 18, 2009 12:20 pm   Post subject: RE:Online Aplication.

You're thinking of a master server. Using a master server looks like this:

1. Whenever you host a server / game, it registers itself with the well-known master server (or list of master servers, for a full-blown production game). They keep a record of that server's IP address and possibly some other data (server name, game type, etc).

2. Whenever you go to join a game, the game asks the master server for a list of all the servers, then takes the resulting list of IP addresses and starts talking to the individual servers (getting your ping to the server, for example).

At no point do webpages come into the equation - the display is done by the game, or sometimes by an external application. In very very rare circumstances, this may be done with a "webpage" in the sense that the display is done with HTML, but usually the HTML would be hosted locally.
copthesaint




PostPosted: Wed Mar 18, 2009 7:00 pm   Post subject: RE:Online Aplication.

Hmm ok then what would be needed to have a master server?
copthesaint




PostPosted: Fri Mar 20, 2009 4:21 pm   Post subject: RE:Online Aplication.

Is anyone going to answer this? If no one does in the next 5 days I'll just close this topic as answered
Dan




PostPosted: Fri Mar 20, 2009 4:55 pm   Post subject: RE:Online Aplication.

Well you need to make a server program that waits for connections and then replies with a list of game server ips when a command is given asking for them. You should look in to the turing Net commands.

DemonWasp gave a good description of how to do this.

All you need is to make the master server in turing (or any lang you want) and then write the clients to connect to it, and request the data. You also need to code the game servers to connect to the master server and list them self with it and periodically tell it that it's still there and online.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
copthesaint




PostPosted: Fri Mar 20, 2009 5:01 pm   Post subject: RE:Online Aplication.

But wouldn't I need an Ip address for the master server, one that everyone would have to connect to? I want to know If a computer would have t be running the master server 24/7 for a master server to work forever.
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Fri Mar 20, 2009 5:09 pm   Post subject: Re: RE:Online Aplication.

copthesaint @ 20th March 2009, 5:01 pm wrote:
But wouldn't I need an Ip address for the master server, one that everyone would have to connect to? I want to know If a computer would have t be running the master server 24/7 for a master server to work forever.


Yes it would. As for IPs you should use a hostname for the master server so the DNS can be changed if the IP changes.


You are going to need a very creative mesh and/or p2p type network set up if the servers (master and game) are not going to be up 24/7.


That or just have a list of game server ips on a webpage and let game server admins apply to be on the list. Then have the webpage send a ping out to each server peridoicly (this would need a server side scripting lang of some kind and cron jobs) or have clients send a ping to each serve to see if it is online or not. The problem with this method is it will not be live and the server list will not be up to date. Also game server admins would have to submit there game to the webserver (or some auotmated process would) and the list would contain offline or dead game servers (unless you did some kind of pureing method to remove servers that have not been online in X amount of time). Realy this is just replcing the need for a master server with a master server coded in PHP or some other scripting langue that outputs a webpage rather then it's own protocal and would still need to be up 24/7 and the clients would need it's ip or hostname.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
copthesaint




PostPosted: Fri Mar 20, 2009 6:50 pm   Post subject: RE:Online Aplication.

ok thanks
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: