bool NFCPVPMatchRedisModule::PopSinglePlayer(NFGUID& self, const int nPVPMode, const int nGrade) { NF_SHARE_PTR<NFINoSqlDriver> pNoSqlDriver = m_pNoSqlModule->GetDriverBySuitConsistent(); if (pNoSqlDriver) { std::string strKey = MakeSingleWaitRedisKey(nPVPMode, nGrade); std::string strData; if (pNoSqlDriver->ListPop(strKey, strData)) { return self.FromString(strData); } } return false; }
bool NFCPVPMatchRedisModule::PopSinglePlayerList(const int nPVPMode, const int nGrade, const int nCount, std::vector<NFGUID>& xPlayerList) { NF_SHARE_PTR<NFINoSqlDriver> pNoSqlDriver = m_pNoSqlModule->GetDriverBySuitConsistent(); if (pNoSqlDriver) { std::string strKey = MakeSingleWaitRedisKey(nPVPMode, nGrade); std::string strData; for (int i = 0; i < nCount; i++) { if (pNoSqlDriver->ListPop(strKey, strData)) { NFGUID xIdent; xIdent.FromString(strData); xPlayerList.push_back(xIdent); } } } return false; }