From: pk910 Date: Sun, 11 Dec 2011 14:17:45 +0000 (+0100) Subject: added recv_fakehost (FA) and recv_newfakehost (NFH) to Uplink.class.php X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=commitdiff_plain;h=778750b0a031844ca30b15d5838ddc1a42e8196c added recv_fakehost (FA) and recv_newfakehost (NFH) to Uplink.class.php --- diff --git a/Uplink/Uplink.class.php b/Uplink/Uplink.class.php index d90324b..c88c2ea 100644 --- a/Uplink/Uplink.class.php +++ b/Uplink/Uplink.class.php @@ -256,6 +256,12 @@ class Uplink { case "AC": $this->recv_account($from, $arguments); break; + case "FA": + $this->recv_fakehost($from, $arguments); + break; + case "NFH": + $this->recv_newfakehost($from, $arguments); + break; //default default: //unknown cmd @@ -730,6 +736,32 @@ class Uplink { if($this->eventHandler) $this->eventHandler->event_usermode($user, "+r ".$auth); } + + private function recv_fakehost($from, $args) { + $user = P10_User::getUserByNum($args[0]); + if($user == null) { + trigger_error("Server tries to send a fakehost change from an user that does not exist or was not found on recv_fakehost.", E_USER_ERROR); + return; + } + $fakehost = $args[1]; + $user->getModes()->setModes("+f ".$fakehost); + if($this->eventHandler) + $this->eventHandler->event_usermode($user, "+f ".$fakehost); + } + + private function recv_newfakehost($from, $args) { + $user = P10_User::getUserByNum($args[0]); + if($user == null) { + trigger_error("Server tries to send a fakehost change from an user that does not exist or was not found on recv_fakehost.", E_USER_ERROR); + return; + } + $fakeident = $args[1]; + $fakehost = $args[2]; + $user->setIdent($fakeident); + $user->getModes()->setModes("+f ".$fakehost); + if($this->eventHandler) + $this->eventHandler->event_usermode($user, "+f ".$fakehost); + } /******************************************************************************************** * SERVER FUNCTIONS *