public function __construct($initial_value) {
for($i = 0; $i < 8; $i++) {
- $ip6[$i] = 0;
+ $this->ip6[$i] = 0;
}
if($initial_value == null) {
//nothing
$i += 3;
}
}
+ $this->addr_is_ipv6 = true;
}
}
$this->ip6[$j++] = hexdec($block);
}
}
+ $this->addr_is_ipv6 = true;
}
public function parseIPv4($ipv4) {
$this->ip6[6] |= intval($ipv4blocks[1]);
$this->ip6[7] = intval($ipv4blocks[2]) << 8;
$this->ip6[7] |= intval($ipv4blocks[3]);
+ $this->addr_is_ipv6 = false;
}
public function isIPv6() {
private static $base64charsLength = 64;
public static function intToNum($int, $length) {
- //fix a small "bug": normaly 0 = AAAAA but we need 1 = AAAAA
- $int = $int - 1;
-
$numeric = "";
for($pos = $length-1; $pos >= 0; $pos--) {
//current position represents floor($int / ($base64charsLength ^ $pos))
$int = ($posValue * $base);
$base = $base * self::$base64charsLength;
}
-
- //fix a small "bug": normaly 0 = AAAAA but we need 1 = AAAAA
- $int = $int + 1;
-
return $int;
}
private $settings = array();
private $server;
private $eventHandler = null;
- private $last_local_numeric = 1;
+ private $last_local_numeric = 0;
const FLAG_P10SESSION = 0x0001; //connection is in P10 mode (server is connected)
const FLAG_SECURITY_QUIT = 0x0002; //local connection abort because of security issues
$ident = $user->getIdent();
$host = $user->getHost();
$modes = $user->getModes()->getModeString();
- $ip = Numerics::numericFromIP($user->getIP());
+ $ip = $user->getIP()->getNumeric();
$numeric = $user->getNumeric();
$realname = $user->getRealname();
$this->send("N", $nick, $connect_time, $ident, $host, $modes, $ip, $numeric, $realname);