bool NFCPVPMatchRedisModule::SetPlayerRoomIDList(const std::vector<NFGUID>& xPlayerList, std::vector<NFGUID>& vecRoomIDList)
{
	NF_SHARE_PTR<NFINoSqlDriver> pNoSqlDriver = m_pNoSqlModule->GetDriverBySuitConsistent();
    if (pNoSqlDriver)
    {
        std::string strKey = MakePlayerRoomKey();
        std::vector<std::string> vFields;
        std::vector<std::string> vValues;

        if (xPlayerList.size() != vecRoomIDList.size())
        {
            return false;
        }

        for (int i = 0; i < xPlayerList.size(); i ++)
        {
            vFields.push_back(xPlayerList[i].ToString());
            vValues.push_back(vecRoomIDList[i].ToString());
        }

        return pNoSqlDriver->HMSet(strKey, vFields, vValues);
    }

    return false;
}
bool NFCPVPMatchRedisModule::SetRoomInfoList(const std::vector<NFGUID>& xRoomIDList, std::vector<NFMsg::PVPRoomInfo>& vecRoomInfoList)
{
	NF_SHARE_PTR<NFINoSqlDriver> pNoSqlDriver = m_pNoSqlModule->GetDriverBySuitConsistent();
    if (pNoSqlDriver)
    {
        std::vector<std::string> vFields;
        std::vector<std::string> vValues;
        std::string strKey = MakePvpRoomRedisKey();

        if (xRoomIDList.size() != vecRoomInfoList.size())
        {
            return false;
        }

        for (int i = 0; i < xRoomIDList.size(); ++i)
        {
            std::string strData;
            if (vecRoomInfoList[i].SerializeToString(&strData))
            {
                vFields.push_back(xRoomIDList[i].ToString());
                vValues.push_back(strData);
            }
        }

        if (pNoSqlDriver->HMSet(strKey, vFields, vValues))
        {
            return true;
        }
    }

    return false;
}