function addPlayerMapping(string x1, string x2, uint key, uint timeAdd, uint hardCap ) private{
      if(potCntInfo[x1].last <= now){
        potCntInfo[x1].last = now;
      }

      if(keccak256(abi.encodePacked(x1)) == keccak256("d")) {
          if (potCntInfo[x1].gameTime == 0) {
              potCntInfo[x1].gameTime   = now%86400 == 0 ? (now-28800) : now-28800-(now%86400);
              potCntInfo[x1].gtime   = now;
              potCntInfo[x1].last = potCntInfo[x1].gameTime + 1 days;
          }
      }
      else if(keccak256(abi.encodePacked(x1)) == keccak256("365")) {
        if (potCntInfo[x1].gameTime == 0) {
            potCntInfo[x1].gameTime = now%86400 == 0 ? (now-28800) : now-28800-(now%86400);
            potCntInfo[x1].gtime = now;
            potCntInfo[x1].last = potCntInfo[x1].gameTime + 365 days;
            potCntInfo['l'].gameTime = potCntInfo[x1].gameTime;
            potCntInfo['r'].gameTime = potCntInfo[x1].gameTime;
            potCntInfo['l'].gtime   = now;
            potCntInfo['r'].gtime   = now;
        }
      }else  {
          if (potCntInfo[x1].gameTime == 0) {
              potCntInfo[x1].gameTime   = now%86400 == 0 ? (now-28800) : now-28800-(now%86400);
              potCntInfo[x1].gtime   = now;
              potCntInfo[x1].last = (now + (key * timeAdd))>=now+hardCap ? now + hardCap : now + (key * timeAdd);
          }
          else {
              potCntInfo[x1].last = (potCntInfo[x1].last + (key * timeAdd))>=now+hardCap ? now + hardCap : potCntInfo[x1].last + (key * timeAdd);
          }
      }

      if (idxStruct[x2].playerStruct[msg.sender].flag == 0) {
          potCntInfo[x1].player.push(msg.sender);
          idxStruct[x2].playerStruct[msg.sender] = PlayerStruct(key, 0, potCntInfo[x1].player.length, potCntInfo[x1].gtime, 1);
      }
      else if (idxStruct[x2].playerStruct[msg.sender].gametime != potCntInfo[x1].gtime){
          potCntInfo[x1].player.push(msg.sender);
          idxStruct[x2].playerStruct[msg.sender] = PlayerStruct(key, 0, potCntInfo[x1].player.length, potCntInfo[x1].gtime, 1);
      }
      else {
          idxStruct[x2].playerStruct[msg.sender].key += key;
      }
      potCntInfo[x1].keys += key;
      potCntInfo[x1].lastPlayer = msg.sender;
    }