From 778750b0a031844ca30b15d5838ddc1a42e8196c Mon Sep 17 00:00:00 2001 From: pk910 Date: Sun, 11 Dec 2011 15:17:45 +0100 Subject: [PATCH] added recv_fakehost (FA) and recv_newfakehost (NFH) to Uplink.class.php --- Uplink/Uplink.class.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) 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 * -- 2.20.1