This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <T> Comparator<T> Compose( | |
final Comparator<? super T> primary, | |
final Comparator<? super T> secondary | |
) { | |
return (T a, T b) -> { | |
int result = primary.compare(a, b); | |
return result == 0 ? secondary.compare(a, b) : result; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kohana.game.entities.maps.pathfinding; | |
import java.awt.Point; | |
import java.util.Arrays; | |
import org.apache.commons.lang3.ArrayUtils; | |
/** | |
* | |
* @author MelanchoŁia MØ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (isset($_POST['login']) AND isset($_POST['password']) AND !empty($_POST['login']) AND !empty($_POST['password'])) { | |
if ($loginArray = Application::$cache->get('login')){ | |
var_dump($loginArray); | |
if(array_key_exists($_SERVER['REMOTE_ADDR'], $loginArray)){ | |
if($loginArray[$_SERVER['REMOTE_ADDR']]["nb"] >= 7){ | |
$timeLeft = (time () - $loginArray[$_SERVER['REMOTE_ADDR']]["lastTime"]) /60; | |
if($timeLeft >= 5) { | |
$loginArray[$_SERVER['REMOTE_ADDR']]["nb"] = 0; | |
User::login(); | |
} |
NewerOlder