X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=Uplink%2FUplink.class.php;h=9f3eb52c211e13eacc59fb3a8d24f29fcbffbd08;hb=612c2da61421761d4f7797eacb33783dbc31f316;hp=f83c7e35a85cb3e64f0cd49efba41edb60be1704;hpb=7288d3417adb446166a53374152227a62e3516ff;p=PHP-P10.git diff --git a/Uplink/Uplink.class.php b/Uplink/Uplink.class.php index f83c7e3..9f3eb52 100644 --- a/Uplink/Uplink.class.php +++ b/Uplink/Uplink.class.php @@ -61,6 +61,7 @@ require_once("P10_User.class.php"); require_once("P10_Channel.class.php"); require_once("P10_ModeSets.class.php"); require_once("EventHandler.interface.php"); +require_once("IPAddr.class.php"); $e=1; define("ERR_NICK_IN_USE", $e++); @@ -394,7 +395,7 @@ class Uplink { $host = $args[4]; $modes = implode(" ",array_slice($args, 5, count($args)-8)); $modes = new P10_UserModeSet($modes); - $ip = Numerics::parseIP($args[count($args)-3]); + $ip = new IPAddr($args[count($args)-3]); $realname = $args[count($args)-1]; $user = new P10_User($nick, $numeric, $server, $connect_time, $ident, $host, $ip, $realname, $modes); if($this->eventHandler) @@ -690,7 +691,7 @@ class Uplink { if($this->eventHandler) $this->eventHandler->event_chanmode($user, $channel, $modes); } else { - $targetUser = P10_User::getUserByNum($args[0]); + $targetUser = P10_User::getUserByNick($args[0]); if($targetUser == null) { trigger_error("Server tries to send a mode to an user that does not exist or was not found on recv_mode.", E_USER_ERROR); return; @@ -785,9 +786,10 @@ class Uplink { } $this->last_local_numeric++; $modes = new P10_UserModeSet($modes); + $ip = new IPAddr($ip); $user = new P10_User($nick, $numeric, $this->server, time(), $ident, $host, $ip, $realname, $modes); if(($this->flags & self::FLAG_CONNECTED)) { - $ip = Numerics::numericFromIP($user->getIP()); + $ip = $user->getIP()->getNumeric(); $this->send("N", $nick, $user->getConnectTime(), $ident, $host, $user->getModes()->getModeString(), $ip, $numeric, $realname); } return $user;