$line['clid'], "ip" => $line['connection_client_ip'] ); } } foreach (array_count_values($ipList) as $ip => $count) { if($count > 3) { foreach ($collectionList as $value) { if($value['ip'] == $ip) { kick($value['clid'], $ip, 'Bir ip adresi ile maximum 3 bağlantı yapılabilir. [MyGameArea Güvenlik Botu]', true); } } } } } function getClients () { global $fp, $path; // Traitement des clients send("clientlist -ip -times -groups -info"); $clientList = null; while ($line = fgets($fp)) { $clientList .= $line; } $clientList = strstr($clientList, "error id=0 msg=ok"); $clientList = trim(str_replace(array('error id=0 msg=ok'), "", $clientList)); $clientsArray = explode("|", $clientList); $clients = array(); foreach ($clientsArray as $line) { $lineArray = explode(" ", $line); $tableTemp = array(); foreach ($lineArray as $txt) { $var = strstr($txt, '=', true); $value = substr(strstr($txt, '=', false), 1); $tableTemp[trim($var)] = trim($value); } // Récupération des informations supplémentaires sur l'utilisateur if(!empty($tableTemp['connection_client_ip'])) { if(file_exists($path . 'alreadyScan' . '/ip.' . $tableTemp['clid'] . '.' . $tableTemp['connection_client_ip']) === FALSE) { // Récupération des données sur l'utilisateur (unique ID) send("clientinfo clid=" . $tableTemp['clid']); $infoUserList = null; while ($line = fgets($fp)) { $infoUserList .= $line; } $infoUserListArray = explode(" ", $infoUserList); // Construction du tableau avec les informations utilisateurs foreach ($infoUserListArray as $txt) { $var = strstr($txt, '=', true); $value = substr(strstr($txt, '=', false), 1); if($var == "client_unique_identifier") { $tableTemp[trim($var)] = trim($value); break; } } // END } } $clients[] = $tableTemp; unset($tableTemp, $var, $value, $infoUserList, $infoUserListArray, $clientList); } return $clients; } function kick ($clid, $ip, $reason, $onlyKick = false) { global $fp; if($onlyKick === TRUE) { send("clientkick clid=" . $clid . " reasonid=5 reasonmsg=" . textMessage($reason)); return 0; } if(AntiFlood(3, (3600 * 24), $ip) === TRUE) { send("sendtextmessage targetmode=1 target=" . $clid . " msg=" . textMessage("ATTENTION : Vous avez été banni du serveur pour récidive !")); send("banclient clid=" . $clid . " time=" . (60 * 60) . " banreason=" . textMessage($reason)); } else { send("sendtextmessage targetmode=1 target=" . $clid . " msg=" . textMessage("ATTENTION : Vous avez éjecté du serveur et ceci est le *Premier avertissement* !")); send("clientkick clid=" . $clid . " reasonid=5 reasonmsg=" . textMessage($reason)); } } ?>