void CmdParse::PushAskTask(TCPConnection::Pointer conn, hf_uint32 taskID) { SessionMgr::SessionPointer smap = SessionMgr::Instance()->GetSession(); hf_uint32 roleid = (*smap)[conn].m_roleid; Queue_AskTask t_task(roleid, taskID); while(!m_AskTask->push(t_task)); }
void CmdParse::PushAskTaskData(TCPConnection::Pointer conn, hf_uint32 taskID, hf_uint16 flag) { SessionMgr::SessionPointer smap = SessionMgr::Instance()->GetSession(); hf_uint32 roleid = (*smap)[conn].m_roleid; Queue_AskTaskData t_task(roleid, taskID, flag); m_AskTaskData->push(t_task); }
void CmdParse::PushAskFinishTask(TCPConnection::Pointer conn, STR_FinishTask* finishTask) { SessionMgr::SessionPointer smap = SessionMgr::Instance()->GetSession(); hf_uint32 roleid = (*smap)[conn].m_roleid; Queue_AskFinishTask t_task(roleid, finishTask); m_AskFinishTask->push(t_task); }
//请求任务执行对话完成 void CmdParse::PushAskTaskExeDlgFinish(TCPConnection::Pointer conn, STR_AskTaskExeDlg* exeDlg) { SessionMgr::SessionPointer smap = SessionMgr::Instance()->GetSession(); hf_uint32 roleid = (*smap)[conn].m_roleid; Queue_AskTaskExeDlg t_task(roleid, exeDlg); m_AskTaskExeDlgFinish->push(t_task); }
void Session::reconsider(Server& server) { try { dbo::Transaction t(*this); createTables(); std::cerr << "Created database" << std::endl; t.commit(); } catch (std::exception& e) { std::cerr << e.what() << std::endl; std::cerr << "Using existing database" << std::endl; } { dbo::Transaction t(*this); UserPtr admin = add_user(server, "admin", "123"); if (admin) { admin.modify()->set_rights(ADMIN); } add_user(server, "user", "123"); } dbo::Transaction t2(*this); Games games = find<Game>().where("state < ?").bind(Game::MIN_ENDED); BOOST_FOREACH (const GamePtr& game, games) { t_task(GAME, game.id()); }
void User::check(Wt::Wc::notify::TaskPtr task) { task->set_notify_needed(check_vacation()); if (vacation_until_.isValid() && vacation_until_ > now()) { t_task(task, vacation_until_); } }
BOOST_FOREACH (const IpBanPtr& ban, ip_bans) { t_task(IP_BAN, ban.id()); }
BOOST_FOREACH (const UserPtr& user, users) { t_task(USER, user.id()); }
BOOST_FOREACH (const CompetitionPtr& c, cs) { t_task(COMPETITION, c.id()); }