The Daily Click ::. Forums ::. Klik Coding Help ::. Creating a list of online hosts
 

Post Reply  Post Oekaki 
 

Posted By Message

ben mercer

Possibly Insane

Registered
  11/07/2004
Points
  2538
18th March, 2007 at 09:48:04 -

Hi,

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..."

CsaR

Old tdc fart

Registered
  16/09/2002
Points
  742

Game of the Week WinnerVIP MemberWii OwnerHas Donated, Thank You!
18th March, 2007 at 10:22:27 -

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.

 
(9*_*)9 o-(*_*o)
www.hoghar.com

Flava



Registered
  30/07/2002
Points
  684

Has Donated, Thank You!Code MonkeyVIP MemberThe Cake is a LieThe Spinster
18th March, 2007 at 10:38:44 -

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.

 
This is a signature. Have this one on me.

ben mercer

Possibly Insane

Registered
  11/07/2004
Points
  2538
22nd March, 2007 at 13:53:00 -

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..."

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
22nd March, 2007 at 14:05:26 -

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...)

Image Edited by the Author.

 
n/a

ben mercer

Possibly Insane

Registered
  11/07/2004
Points
  2538
22nd March, 2007 at 14:38:48 -

Cheers axel, I registered a free account with funpic. It looks pretty cool... It doesnt have ad banners does it?

 
Stuckboy

JC Denton: "I know your UNATCO killphrase: Laputan Machine."
Gunther Hermann: "I - am - not - a - machi --"
JC Denton: "Sticks and stones..."

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
22nd March, 2007 at 15:02:42 -

It says it hasn't everywhere, lol.

 
Old member (~2004-2007).

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
22nd March, 2007 at 16:02:14 -

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

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
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.

Image
http://www.sitesled.com/images/concept_uses_04b.gif

 
Old member (~2004-2007).
   

Post Reply



 



Advertisement

Worth A Click