View Single Post
  #1  
Old 07-29-2009, 09:48 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,450
Default EQEmu ChatServer w/ IRC (Win32)

Here's the source for what i've been working on the last few days. You will need to add some entries to the chatserver section of eqemu_config.xml or it will *not* work.

The IRC.cpp and IRC.h are modified versions of iainsheppard's IRC class.
You can download the original copy at: http://www.nongnu.org/cpirc/

Also, if it never joins your channel, just PM the bot saying !rejoin and it will rejoin the channel from the XML file.

It does NOT do automatic reconnection. The support for auto-reconnect is in the class, though.

Nickserv stuff can also be added in the triggers function, if needed.

Here's the bot:

http://www.sendspace.com/file/w3an9e

The needed XML stuff examples:

Code:
		<channeltooutput>#EQEmu</channeltooutput>
		<eqchanneltooutput>General</eqchanneltooutput>
		<chatirchost>eqnet.eqemulator.net</chatirchost>
		<chatircport>6667</chatircport>
		<chatircnick>SecretsBot</chatircnick>
First, channeltooutput. This puts all chat from the application to this IRC channel.

Next, EQChannelToOutput. This channel must already exist, otherwise it will crash on the iterator. It outputs all IRC talk to this channel in-game.

Next, ChatIRCHost. This field specifies which IRC server to connect to. I suggest using eqnet.eqemulator.net.

Next, ChatIRCPort. This tells which port to connect to on ChatIRCHost.

Finally, ChatIRCNick. This is your bot's nickname. Currently, there is no nickserv support, however that can be added at a later date.



Note: Win32 is only supported because it uses Winsock & windows threading. I am willing to bet if you use the source from http://www.nongnu.org/cpirc/ it will compile with the files replaced. (the reason i'm doing this is because Winsock does not support fdopen) I do not have a linux box otherwise i'd make a linux version.

Enjoy!

(ps: thanks for the help on this KLS and AndMetal!)

(ps: it's my first hack, so be easy on me :P)

Last edited by Secrets; 07-30-2009 at 05:53 AM..
Reply With Quote