I'm using mooclick to create an online multiplayer component to my top down shooter.
At the moment the user needs to type in the IP address of the host when they want to join a game. I would like to make it so that clicking a button will list the available hosts so that the user can simply pick one without having to faff about with ip addresses.
I've read Flava's mooclick articles but they don't really say how to do this. Could anyone give me some pointers, or possibly point me to an example file that shows how to do this?
Thanks
Stuckboy
JC Denton: "I know your UNATCO killphrase: Laputan Machine."
Gunther Hermann: "I - am - not - a - machi --"
JC Denton: "Sticks and stones..."
If you have an online database like a MySQL one you could make it so that each time a player creates a new game the game adds it to the database. When you want to show the serverlist just fetch the list of the database and list all the ips/servernames.
I guess you would have to have a cleaning function also which removes the old entries in the database. Maybe you could have something that cleans entries that are over 1 hours old + Making the clients removing their entries in the database on exit.
I haven't actually tried any of this but this is the way I would try to do it.
I was going to write an article on how to do this, however my methods are not exactly great, plus I have been a bit lazy lately. The best and only method would probably be to use MySQL and MooSock - use PHP to add servers to your database, and then use PHP to retrieve the servers that have been created. If the server has been inactive for say 10 minutes, then delete the server from the server list using PHP again.
If you have knowledge of MySQL, MooSock and PHP - then it isn't difficult.
If you do not have knowledge of them, then it'd probably be a bit more difficult!
I'll try and get round to writing an article on it - in fact I might start doing one now.
Cheers for the help guys! So in order to include this feature I would need a server running 24/7. Don't think sitesled supports PHP and MySQL, do you guys know if there is a free host that does? I can't really leave my home PC up 24/7.
Glad your writing an article Flava, the three you wrote on online multiplayer are really good!
Stuckboy
JC Denton: "I know your UNATCO killphrase: Laputan Machine."
Gunther Hermann: "I - am - not - a - machi --"
JC Denton: "Sticks and stones..."
No, shitesled doesn't have PHP/MySQL. I'm using funpic.org (which is ossumness), but they don't seem to do free accounts anymore (or the signup's broken or something, last time I checked...)
Aw shite. I thought they didn't, but now I see they've started with this annoying pop-up thing. They didn't do that before ._.
But does it really matter? As long as you're not planning on having your website hosted on funpic, you'll be fine. The PHP/MySQL still works...
n/a
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
22nd March, 2007 at 18:35:12 -
"Aw shite. I thought they didn't, but now I see they've started with this annoying pop-up thing. They didn't do that before ._. "
They still don't. There must be an element in the sitesled page you're trying to view that spans the pop-ups.