Changeset 7361 for code/branches/doc/src/libraries/core/command/IRC.cc
- Timestamp:
- Sep 5, 2010, 10:51:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/doc/src/libraries/core/command/IRC.cc
r7284 r7361 27 27 */ 28 28 29 /** 30 @file 31 @brief Implementation of the IRC class and the IRC console commands. 32 */ 33 29 34 #include "IRC.h" 30 35 … … 39 44 namespace orxonox 40 45 { 41 static const unsigned int IRC_TCL_THREADID = 1421421421; 46 static const unsigned int IRC_TCL_THREADID = 1421421421; ///< The ID of the thread in TclThreadManager that is used for the IRC connection 42 47 43 48 SetConsoleCommand("IRC", "say", &IRC::say); … … 45 50 SetConsoleCommand("IRC", "nick", &IRC::nick); 46 51 52 /** 53 @brief Returns the only existing instance of IRC. 54 */ 55 IRC& IRC::getInstance() 56 { 57 static IRC instance; 58 return instance; 59 } 60 61 /** 62 @brief Constructor: Doesn't yet connect to IRC nor does it create a Tcl interpreter. 63 The IRC object will automatically connect to the IRC server if one of the registered 64 console commands is used the first time. 65 */ 47 66 IRC::IRC() 48 67 { … … 50 69 } 51 70 71 /** 72 @brief Creates and initializes a new multithreaded Tcl-interpreter and defines some callbacks to display IRC-messages in the console. 73 */ 52 74 void IRC::initialize() 53 75 { … … 70 92 } 71 93 72 IRC& IRC::getInstance() 73 { 74 static IRC instance; 75 return instance; 76 } 77 94 /** 95 @brief Executes a Tcl-command on the Tcl-interpreter. 96 */ 78 97 bool IRC::eval(const std::string& command) 79 98 { … … 96 115 } 97 116 117 /// Console command: Sends a message to the current channel on the IRC server. 98 118 void IRC::say(const std::string& message) 99 119 { … … 102 122 } 103 123 124 /// Console command: Sends a message to a given channel or nickname on the IRC server. 104 125 void IRC::msg(const std::string& channel, const std::string& message) 105 126 { … … 108 129 } 109 130 131 /// Console command: Changes the nickname on the IRC server. 110 132 void IRC::nick(const std::string& nickname) 111 133 { … … 114 136 } 115 137 138 /// Tcl-callback: Prints a message that was received from the current IRC channel to the console. 116 139 void IRC::tcl_say(Tcl::object const &channel, Tcl::object const &nick, Tcl::object const &args) 117 140 { … … 119 142 } 120 143 144 /// Tcl-callback: Prints a private message that was received from a user to the console. 121 145 void IRC::tcl_privmsg(Tcl::object const &query, Tcl::object const &nick, Tcl::object const &args) 122 146 { … … 124 148 } 125 149 150 /// Tcl-callback: Prints an action-message (usually /me ...) that was received from the current IRC channel to the console. 126 151 void IRC::tcl_action(Tcl::object const &channel, Tcl::object const &nick, Tcl::object const &args) 127 152 { … … 129 154 } 130 155 156 /// Tcl-callback: Prints all kinds of information that were received from the IRC server or channel (connection info, join, part, modes, ...) to the console. 131 157 void IRC::tcl_info(Tcl::object const &channel, Tcl::object const &args) 132 158 {
Note: See TracChangeset
for help on using the changeset viewer.