Net::CyanChat::Server - Perl interface for running a CyanChat server.
use Net::CyanChat::Server; our $cho = new Net::CyanChat::Server ( host => 'localhost', port => 1812, debug => 1, ); # Start the server. $cho->connect(); # Loop. $cho->start();
Net::CyanChat::Server is a Perl interface for running your own CyanChat server (or, rather, to run a chat server based on the CyanChat protocol that other CC clients would recognize).
Constructor for a new CyanChat server. Pass in the host, port, and debug. All are optional. host defaults to localhost, port defaults to 1812, debug defaults to 0. With debug on, all the server/client conversation is printed.
Returns a CyanChat server object.
Returns the version number.
Called by the module itself for debug messages.
Open the server socket and listen for connections.
Start a loop of do_one_loop's.
Perform a single loop of checking for new connections and events from existing connections.
Set the Welcome Messages that are displayed when a user connects to the chat. The default messages are:
Welcome to Net::CyanChat::Server v. <VERSION> There are only a few simple rules: 1. Be respectful to other users. 2. Keep the dialog "G" rated. 3. And HAVE FUN! Termination of use can happen without warning!
Define the password that is required to authenticate as a staff member. A client would use this password by sending the command below before logging in to the chat room:
50|password
Note that this part of the protocol support is not official. The administrative commands in the CyanChat protocol is not public knowledge and so this support was just speculated on based on the gaps in the protocol documentation. This probably only works with clients using the Net::CyanChat module.
Returns the host/port to your CyanChat server (i.e. "localhost:1812")
Send data to the specified SOCKET object.
Get the socket of a username signed into the chat room.
Broadcasts commands to all logged-in users.
Sends the Who List to all users. This should be called when a user joins or exits the room.
Version 0.03
- Cleaned up the documentation a bit.
Version 0.02
- Messages can contain pipes in them now. - Removed the "staff protocol" number; replaced it with "staff password" - Changed the socket end-of-lines to CrLf instead of just Lf.
Version 0.01
- Initial release.
- Add support for built in profanity filters and bans. - Add IP encryption algorythm similar to Cyan's. - Display user's ISP as their home Age, rather than their IP address.
Net::CyanChat
CyanChat Protocol Documentation: http://cho.cyan.com/chat/programmers.html
Casey Kirsle, http://www.cuvou.com/
Net::CyanChat - Perl interface to CyanChat. Copyright (C) 2007 Casey Kirsle This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
To install Net::CyanChat, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::CyanChat
CPAN shell
perl -MCPAN -e shell install Net::CyanChat
For more information on module installation, please visit the detailed CPAN module installation guide.