void NFCLoginLogicModule::OnLoginProcess(const NFSOCK nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen) { NFGUID nPlayerID; NFMsg::ReqAccountLogin xMsg; if (!m_pNetModule->ReceivePB( nMsgID, msg, nLen, xMsg, nPlayerID)) { return; } NetObject* pNetObject = m_pNetModule->GetNet()->GetNetObject(nSockIndex); if (pNetObject) { if (pNetObject->GetConnectKeyState() == 0) { if (!m_pAccountRedisModule->ExistAccount(xMsg.account())) { m_pAccountRedisModule->AddAccount(xMsg.account(), xMsg.password()); } int nState = m_pAccountRedisModule->VerifyAccount(xMsg.account(), xMsg.password()); if (0 != nState) { std::ostringstream strLog; strLog << "Check password failed, Account = " << xMsg.account() << " Password = "******"Login successed :", xMsg.account().c_str()); } } }
int NFCLoginNet_ServerModule::OnLoginProcess( const NFIPacket& msg ) { NFIDENTID nPlayerID; NFMsg::ReqAccountLogin xMsg; if (!RecivePB(msg, xMsg, nPlayerID)) { return 0; } NetObject* pNetObject = GetNet()->GetNetObject(msg.GetFd()); if (pNetObject) { //还没有登录过 if (pNetObject->GetConnectKeyState() == 0) { NFCDataList val; val << pNetObject->GetClientID()<< xMsg.account() << xMsg.password(); m_pEventProcessModule->DoEvent(NFIDENTID(), NFED_ON_CLIENT_LOGIN, val); } } return 0; }