Olympiad question
Posted: Sat Sep 19, 2009 10:04 pm
Is it possible to limit one char entry per IP to olympiad?
to prevent self-feeding
to prevent self-feeding
Code: Select all
//Anti FARM same Ip String ip1 = this.getClient().getConnection().getSocket().getInetAddress().getHostAddress(); String ip2 = target.getClient().getConnection().getSocket().getInetAddress().getHostAddress(); if (ip1.equals(ip2)) { // return; }
Code: Select all
/** Begin Olympiad Restrictions */ String ip1 = noble.getClient().getConnection().getSocket().getInetAddress().getHostAddress(); String ip2 = ""; for (L2PcInstance registeredChar : _nonClassBasedRegisters) { ip2 = registeredChar.getClient().getConnection().getSocket().getInetAddress().getHostAddress(); if (ip1.equals(ip2) { sm = new SystemMessage(SystemMessageId.GAME_REQUEST_CANNOT_BE_MADE); sm.addPcName(noble); noble.sendPacket(sm); break; } } for (L2PcInstance registeredChar : _ClassBasedRegisters) { ip2 = registeredChar.getClient().getConnection().getSocket().getInetAddress().getHostAddress(); if (ip1.equals(ip2) { sm = new SystemMessage(SystemMessageId.GAME_REQUEST_CANNOT_BE_MADE); sm.addPcName(noble); noble.sendPacket(sm); break; } }