X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=blobdiff_plain;f=Uplink%2FP10_Server.class.php;fp=Uplink%2FP10_Server.class.php;h=41bf281d4c58ede41fd3fc2b90b397986a22a737;hp=1603e4c84722a6455b7187e001a0e254addcab2f;hb=8fc32c585446865b73c89859c35d1387fadbf9af;hpb=7b3f5a75e7bba8bd536cd0cbbaa595113765a15e diff --git a/Uplink/P10_Server.class.php b/Uplink/P10_Server.class.php index 1603e4c..41bf281 100644 --- a/Uplink/P10_Server.class.php +++ b/Uplink/P10_Server.class.php @@ -76,6 +76,7 @@ class P10_Server { private $link_time; private $description; private $servers = array(); //all Servers connected to this Server + private $users = array(); //all Users connected to this Server public function __construct($name, $numeric, $parent_server, $start_time, $link_time, $description) { $this->name = $name; @@ -103,6 +104,9 @@ class P10_Server { public function disconnectUsers() { //disconnect all Users connected to the actual Server + foreach($this->users as $user) { + $user->quit("*.net *.split"); + } } public function getNumeric() { @@ -136,6 +140,18 @@ class P10_Server { trigger_error("Tried to remove a Server, that does NOT exist.", E_USER_WARNING); } } + + public function addUser($user) { + $this->users[$user->getNumeric()] = $user; + } + + public function delUser($user) { + if(array_key_exists($user->getNumeric(), $this->users)) { + unset($this->users[$user->getNumeric()]); + } else { + trigger_error("Tried to remove a User, that does NOT exist.", E_USER_WARNING); + } + } } ?> \ No newline at end of file