Bug Fixes / Features - 6/19/15

Discussion in 'Empire Updates' started by Aikar, Jun 19, 2015.

  1. Small thing for your bug tracker, placing a block in the town thats not on my residence says &&/town&& as was previously reported by staff. I thought the bug tracker said it was fixed but maybe this is another bug.
  2. Stop trying to place blocks in town then! Fixed means we have it fixed in our code, not necessarily running on the servers.
    ShelLuser and Kephras like this.
  3. Lol Okay. I Just seen it by accident and remembered it was on the list. Thought i would alert yalls to a potential screw up.
  4. Sky's Original (Not very well made) Comic: Disobeying the Chickeneer
    Kephras likes this.
  5. Taking a while to fix it because we have massive 'hope residence permissions dont totally blow up' changes pending for name change support that we have to extensively test first...

    Gigantic amount of code changed yet again for next update.
  6. what do you mean?
  7. reworded, means you cant pay a banned player, otherwise you would just simply lose the rupees.
  8. Aikar, name changes sounded good an all but the existing shop-signs sounds like a drag :p. Goodluck though.
  9. Code:
    this.ownerUserId = isAdminShop(sign.getLine(0)) ? 0L : BlockUtil.getUserIdFromOldNameBasedSign(sign, 0);
    public static Long getUserIdFromOldNameBasedSign(Sign sign, int line) {
        if (sign == null) {
            return null;
        }
        String sline = sign.getLine(line);
        Long userId = getUserIdFromSign(sline);
        if (userId == null) {
            userId = Caches.oldNameHistoryLookup.getIfPresent(sline);
    
            if (userId == null) {
                Residence residence = Residence.getResidence(sign.getLocation());
                if (residence != null && residence.getOwner().startsWith(sline)) {
                    userId = residence.ownerUserId;
                    setUserIdOnSign(sign, line, userId);
                    return userId;
                }
    
                try {
                    // Try direct name
                    userId = EmpireDb.getFirstColumn(
                        "SELECT user_id FROM user_identity_history WHERE name = ? ORDER BY first_seen LIMIT 1",
                        sline);
                    // Try loose if 16 char name
                    if (userId == null && sline.length() == 15) {
                        userId = EmpireDb.getFirstColumn(
                            "SELECT user_id FROM user_identity_history WHERE name like ? ORDER BY first_seen LIMIT 1",
                            sline + "%");
                    }
                    Caches.oldNameHistoryLookup.put(sline, userId != null ? userId : 0L);
                } catch (SQLException e) {
                    Util.printException(e);
                }
            } else if (userId == 0L) {
                userId = null;
            }
    
            if (userId != null) {
                setUserIdOnSign(sign, line, userId);
            }
        }
        return userId;
    }
    
    It's handled :) And even supports case of "User A Changed to B, C changed to A" still attributing to A instead of C
    jkjkjk182, jrm531 and krysyyjane9191 like this.
  10. Nice indeed. Not much of a java guru, if any at all, but i do understand the SQL and the fundamentals behind it :)
  11. I don't even know where I should post this, so I'll post it here.

  12. *sees nothing wrong*
  13. B4DMAN5IMON's username is both green and lime green. I'm about to post something else on the wiki forums.
  14. It's still lime green in the TAB list; it's just a bit faded and at the very end because he's performing magic.
  15. /gamemode 3