Web Hosting Talk







View Full Version : Questions about making a chatroom


AdamCaine
11-28-2004, 09:10 PM
My plans are to make a chat room for a mud style game. I also would like to use the same script for a chat room for out of character conversations outside of the mud. Not a message board, but a live, real-time chat.

I've been looking into this for a while now, and I've even purchased a few books that might help me. The problem is that all the information out there is either conflicting or is just not detailed enough for me to get a good grasp on the subject.

My language of choice would be php, but I'm open to suggestions.

What I've seen so far is that utilizing sockets is the best way to go. I just open up a port and have the script listen to any activity on that port. When a user posts data, then the script instantly append and reloads the client's chat.

I'm still not 100% on how this works, but I think it calls for an infinite loop that listens to the port. That's a little scary too me. Too many problems and it seems like way too much bandwidth. I may be all wrong about this however.

Anyone else have any methods they might recommend?

I've already tried a meta-refresh style chat, and that's out. It was way too annoying to have the screen refresh itself, and it also had some strange bugs when a lot of people were talking at once.

Anyway, any input would be appreciated.

Akyriel
12-02-2004, 12:44 AM
There's no need to reinvent the wheel here. There are many free PHP scripts that will let you integrate a real-time chatroom into your site allowing you to adjust the look-and-feel to match your site:

www.phpopenchat.org
www.php-chat.org
[url]www.hotscripts.com/PHP/Scripts_and_Programs/Chat_Scripts[\url]
[url]php.resourceindex.com/Complete_Scripts/Chat[\url]

AdamCaine
12-02-2004, 12:46 AM
Okay, so after another bit of searching, I have found the answer.

I use flash to do most of the work with the chat room, but use php as a back end. One problem, which isn't too big of a deal, would be transporting variables between php and flash. That would allow for me to track the player's stats and such.

The biggest problem then is learning enough flash to be able to make a chat room. Anyone have some good tutorials and/or source code?

Akyriel
12-02-2004, 12:48 AM
You can try Flash Chat

http://www.tufat.com/script2.htm

AdamCaine
12-02-2004, 12:49 AM
Opps, didn't see that reply. I was just checking the front page and looking at times viewed / replied.

I'll take a look at those links. Thanks.