function WithdrawEther(address player) external
    {
        uint256 startday;
        uint256 ethBal;
        uint256 eth;
        CITYDATA storage cdata = cityData[player];

        require(owner == msg.sender || admin == msg.sender || (enabled && city == msg.sender));

        ethBal = ethBalance[player];

        startday = cdata.withdrawSS;
        for(uint256 day = nowday() - 1; day >= startday; day--)
        {
            WORLDSNAPSHOT storage wss = ValidateWorldSnapshotInternal(day);
            CITYSNAPSHOT storage css = ValidateCitySnapshotInternal(player, day);

            if (wss.ethRankFundRemain > 0)
            {
                eth = Math.min256(SafeMath.muldiv(wss.ethRankFund, css.population, wss.population), wss.ethRankFundRemain);
                wss.ethRankFundRemain -= eth;
                ethBal += eth;
            }
        }

        require(0 < ethBal);

        ethBalance[player] = 0;
        cdata.withdrawSS = nowday() - 1;

        player.transfer(ethBal);
    }