* Make the lobby host and version configurable

* Use the "Protocol" instead of "BinaryProtocol" class to communicate with the lobby (in the IRC bot)


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7221 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2009-04-27 23:50:05 +00:00 committed by Git SVN Gateway
parent b5e6967f73
commit c2e33dc923
1 changed files with 4 additions and 2 deletions

View File

@ -38,16 +38,18 @@ irc_serve_channels = ['#warzone2100-games']
irc_silent_channels = ['#warzone2100']
irc_nick = "wzlobbybot"
irc_nickpass = None
lobby_host = 'lobby.wz2100.net'
lobby_version = '2.1'
def main():
bot = Bot(irc_server, irc_port, irc_serve_channels, irc_silent_channels, irc_nick, irc_nickpass, "lobby.wz2100.net", '2.1')
bot = Bot(irc_server, irc_port, irc_serve_channels, irc_silent_channels, irc_nick, irc_nickpass, lobby_host, lobby_version)
bot.start()
class Bot:
def __init__(self, ircServer, ircPort, ircServeChannels, ircSilentChannels, ircNick, nickPass, lobbyServer, lobbyVersion):
self.commands = BotCommands(self)
self.irc = bot_connection(self.commands, ircServer, ircPort, ircServeChannels, ircSilentChannels, ircNick, nickPass)
self.lobby = BinaryProtocol(lobbyVersion)
self.lobby = Protocol(lobbyVersion)
self.lobby.host = lobbyServer
self.check = change_notifier(self.irc, self.lobby)