Commit Graph

33 Commits (97bc6918b179fffc29d97908519d50140415b22c)

Author SHA1 Message Date
Giel van Schijndel f95bcd605b Move the IRC bot to the same directory as the lobby server
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7126 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:35 +02:00
Giel van Schijndel 1447766635 Whatever way we leave the bot's mainloop, make sure to terminate the lobby checking thread
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7125 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:35 +02:00
Giel van Schijndel 61d0fd23d0 Don't use Python 2.6 specific syntax (r7123)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7124 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:35 +02:00
Giel van Schijndel 2dc1bcfd12 * Catch and handle all socket errors, not just timeouts
- Don't just report failure to the user that request a lobby listing, report the error message (asociated with the exception) as well


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7123 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:35 +02:00
Giel van Schijndel e91765af19 * Notify all served IRC channels when shutting down
* Notify all served IRC channels when encoutering an unhandled exception (and shutting down as a result)


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7118 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:34 +02:00
Giel van Schijndel fef445101e * Rename the "help" command to "about"
* Change "commands" to dynamically look through the commands that are available and list them


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7117 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:34 +02:00
Giel van Schijndel a72e7d5288 * Move construction of BotCommands to its own class (__init__)
* Only attempt to call attributes of BotCommands if they're functions (rejecting __.*__ functions)
 * Return from readAndHandle as soon as we've handled a message


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7116 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:34 +02:00
Giel van Schijndel c9113f9730 * Pass the IRC write function as a lambda to BotCommands' functions
* When a user joins a served channel, send him a notice of the games currently present ("list" output)


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7113 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:33 +02:00
Giel van Schijndel b07a743f60 Properly store the gameFormat struct description in the class
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7112 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:33 +02:00
Giel van Schijndel d5cdfd7adb * Add channel operator support
* Add invite support
  - Invite users to all serviced channels when they make a request outside of a serviced channel (becmoing operator only for as long as necessary)


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7106 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:33 +02:00
Giel van Schijndel 6461dd0208 * Send replies only to the channel from which the request came
* Send general messages to all served channels
 * Prefix all replies with the nickname of the user who made the request


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7105 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:33 +02:00
Giel van Schijndel bbfe5e2abd Don't call the IRC command handling function in the try block (we don't want to protect against errors inside the IRC command function)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7104 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:33 +02:00
Giel van Schijndel f1b178e4b0 Add multi-channel support to wzlobbybot, one list of channels in which to serve requests, another just to be present in.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7103 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:32 +02:00
Giel van Schijndel e00035b75a Add the ability for wzlobbybot to identify against NickServ
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7102 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:32 +02:00
Giel van Schijndel 7261e3392a Update the lobbybot such that it can work both with 2.0,2.1 and 2.2 lobbies, defaulting to 2.1 (as that's the current release)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7101 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:32 +02:00
Giel van Schijndel d001fdbafc Notify the user when communication with the lobby fails
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7100 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:32 +02:00
Giel van Schijndel 88ddefb584 * Move the setup code of the lobby bot into a class of its own (Bot)
* Change to an event driven model for handling IRC commands
  - Add all IRC commands to a single class (BotCommands)
  - In class irc_connection.readAndHandle() call the corresponding function in BotCommands for the received IRC command


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7099 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:32 +02:00
Giel van Schijndel 5694b99b90 Set a timeout on the lobby client to prevent blocking on connections to the lobby
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7095 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-20 15:31:24 +02:00
Giel van Schijndel 846a21b8a7 Make sure that the change_notifier thread gets terminated when the user hits CTRL-C
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7094 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-20 15:31:24 +02:00
Giel van Schijndel f8f33d5424 * Interpolate __author__ in the "info" (about-style) message
* Use functions to join channels and send messages
 * Notify a user requesting for services from the bot in the wrong channel


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7093 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-20 15:31:24 +02:00
Giel van Schijndel 4beca8d487 Make the IRC bot executable
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7024 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-15 20:36:58 +02:00
Giel van Schijndel cd7edf0f88 Use a more sofisticated regular expression for channel messages to ensure we only match messages that are intented for us (i.e. the lobby IRC bot)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@6968 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-07 12:23:12 +02:00
Giel van Schijndel 74c3180bc3 Use a regular expression to extract messages intended for us (i.e. the lobby bot) instead of string manipulation with split & find
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@6967 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-07 12:23:12 +02:00
Giel van Schijndel 9dfa15c8f1 Move the bot to #warzone2100-games and change it's real name to indicate it's Warzone 2100 origin & purpose
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@6966 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-07 12:23:12 +02:00
Giel van Schijndel 3fea9dcbc3 Allow announcing to work properly still
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@6965 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-07 12:23:11 +02:00
Giel van Schijndel eb27d5987e Comment on why the endian swapping is performed (while on the protocol level it shouldn't be needed)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@6964 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-07 12:23:11 +02:00
Giel van Schijndel 693a2ab4b7 Use a contextmanager and python's with-statement to manage the socket's lifetime, this guarantees exception safety
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@6963 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-07 12:23:11 +02:00
Giel van Schijndel 05b1e21416 Externalise code specific to querying the lobby server into a separate module
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@6962 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-07 12:23:11 +02:00
Giel van Schijndel acfa601182 Fix syntax error in lobby IRC bot
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@6961 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-07 12:23:11 +02:00
Giel van Schijndel 020b66a959 Don't use an IRC specific string representation of games
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@6960 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-07 12:23:11 +02:00
Giel van Schijndel d02d2a01ab Committing on behalf of and with Gerard's permission:
The initial version of the IRC bot for Warzone's lobby with the GPLv2 added.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@6959 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-07 12:23:11 +02:00
Giel van Schijndel 0289e2664f Set executable bit, makes running the script a bit easier.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1278 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-21 00:39:11 +00:00
Christian Vest Hansen 521a12a00d * Initial upload of Python+JSON-RPC based lobby/master server.
I don't claim that this code is of outstanding quality >_>
  It was, after all, just written as a proof of concept prototype...



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1274 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-20 19:23:51 +00:00