Changeset 3264 for code/branches/netp6/src/core/IRC.cc
- Timestamp:
- Jul 1, 2009, 11:22:03 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/netp6/src/core/IRC.cc
r3196 r3264 47 47 { 48 48 RegisterRootObject(IRC); 49 this-> bundle_ = 0;49 this->interpreter_ = 0; 50 50 } 51 51 … … 54 54 unsigned int threadID = (unsigned int)IRC_TCL_THREADID; 55 55 TclThreadManager::createID(threadID); 56 this-> bundle_ = TclThreadManager::getInstance().getInterpreterBundle(threadID);56 this->interpreter_ = TclThreadManager::getInstance().getTclInterpreter(threadID); 57 57 58 58 try 59 59 { 60 this-> bundle_->interpreter_->def("orxonox::irc::say", IRC::tcl_say, Tcl::variadic());61 this-> bundle_->interpreter_->def("orxonox::irc::privmsg", IRC::tcl_privmsg, Tcl::variadic());62 this-> bundle_->interpreter_->def("orxonox::irc::action", IRC::tcl_action, Tcl::variadic());63 this-> bundle_->interpreter_->def("orxonox::irc::info", IRC::tcl_info, Tcl::variadic());60 this->interpreter_->def("orxonox::irc::say", IRC::tcl_say, Tcl::variadic()); 61 this->interpreter_->def("orxonox::irc::privmsg", IRC::tcl_privmsg, Tcl::variadic()); 62 this->interpreter_->def("orxonox::irc::action", IRC::tcl_action, Tcl::variadic()); 63 this->interpreter_->def("orxonox::irc::info", IRC::tcl_info, Tcl::variadic()); 64 64 } 65 65 catch (Tcl::tcl_error const &e) … … 68 68 { COUT(1) << "Error while initializing Tcl (IRC): " << e.what(); } 69 69 70 this->nickname_ = "orx" + getConvertedValue<int, std::string>( (unsigned int)rand());70 this->nickname_ = "orx" + getConvertedValue<int, std::string>(static_cast<unsigned int>(rand())); 71 71 TclThreadManager::execute(threadID, "set nickname " + this->nickname_); 72 72 TclThreadManager::execute(threadID, "source irc.tcl"); … … 81 81 bool IRC::eval(const std::string& command) 82 82 { 83 if (!IRC::getInstance(). bundle_)83 if (!IRC::getInstance().interpreter_) 84 84 { 85 85 IRC::getInstance().initialize(); … … 90 90 try 91 91 { 92 IRC::getInstance(). bundle_->interpreter_->eval(command);92 IRC::getInstance().interpreter_->eval(command); 93 93 return true; 94 94 }
Note: See TracChangeset
for help on using the changeset viewer.