bool CDisposeEvent::onSerciveStartUp(void) { try { CSessionManager::getSingletonPtr()->setLua(m_pLua); luabridge::getGlobal(m_pLua, LUA_EVENT_ONSTARTUP)(CSessionManager::getSingletonPtr(), CSessionManager::getSingletonPtr()->getNetBinary(), CSessionManager::getSingletonPtr()->getSerializeBinary(), CEncrypt::getSingletonPtr()); } catch(luabridge::LuaException &e) { Q_Printf("%s", e.what()); Q_LOG(LOGLV_ERROR, "%s", e.what()); return false; } catch(CQException &e) { Q_Printf("exception. code %d, message %s", e.getErrorCode(), e.getErrorMsg()); Q_LOG(LOGLV_ERROR, "exception. code %d, message %s", e.getErrorCode(), e.getErrorMsg()); return false; } return true; }
void CDisposeEvent::onSerciveShutDown(void) { try { luabridge::getGlobal(m_pLua, LUA_EVENT_ONSHUTDOWN)(); } catch(luabridge::LuaException &e) { Q_Printf("%s", e.what()); Q_LOG(LOGLV_ERROR, "%s", e.what()); } catch(CQException &e) { Q_Printf("exception. code %d, message %s", e.getErrorCode(), e.getErrorMsg()); Q_LOG(LOGLV_ERROR, "exception. code %d, message %s", e.getErrorCode(), e.getErrorMsg()); } }
void CDisposeEvent::onLinkedOther(class CSession *pSession) { try { luabridge::getGlobal(m_pLua, LUA_EVENT_ONLINKEDOTHER)(pSession); } catch(luabridge::LuaException &e) { Q_Printf("%s", e.what()); Q_LOG(LOGLV_ERROR, "%s", e.what()); } catch(CQException &e) { Q_Printf("exception. code %d, message %s", e.getErrorCode(), e.getErrorMsg()); Q_LOG(LOGLV_ERROR, "exception. code %d, message %s", e.getErrorCode(), e.getErrorMsg()); } }
void CDisposeEvent::onHttpRead(class CHttpParser *pBuffer) { try { luabridge::getGlobal(m_pLua, LUA_EVENT_ONHTTPREAD)(pBuffer); } catch(luabridge::LuaException &e) { Q_Printf("%s", e.what()); Q_LOG(LOGLV_ERROR, "%s", e.what()); } catch(CQException &e) { Q_Printf("exception. code %d, message %s", e.getErrorCode(), e.getErrorMsg()); Q_LOG(LOGLV_ERROR, "exception. code %d, message %s", e.getErrorCode(), e.getErrorMsg()); } }
void CDisposeEvent::onDebug(const char *pszMsg, const size_t &iLens) { try { CSessionManager::getSingletonPtr()->getNetBinary()->setBuffer(pszMsg, iLens); luabridge::getGlobal(m_pLua, LUA_EVENT_ONDEBUG)(); } catch(luabridge::LuaException &e) { Q_Printf("%s", e.what()); Q_LOG(LOGLV_ERROR, "%s", e.what()); } catch(CQException &e) { Q_Printf("exception. code %d, message %s", e.getErrorCode(), e.getErrorMsg()); Q_LOG(LOGLV_ERROR, "exception. code %d, message %s", e.getErrorCode(), e.getErrorMsg()); } }
void Q_LuaLog(int iLV, const char *pszMsg) { Q_LOG((LOG_LEVEL)iLV, "%s", pszMsg); }