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=a2144cb28a8fc440db8b0ff8d06d6c39b4b2b0d2;hp=0000000000000000000000000000000000000000;hb=e09bc77d2253058b7fe4c4952ec254d8e5e855a2;hpb=642e5fa114096506072cbc9ef6f16e31eecd7abf diff --git a/Uplink/P10_Server.class.php b/Uplink/P10_Server.class.php new file mode 100644 index 0000000..a2144cb --- /dev/null +++ b/Uplink/P10_Server.class.php @@ -0,0 +1,113 @@ +name = $name; + $this->numeric = $numeric; + $this->parent_server = $parent_server; + $this->start_time = $start_time; + $this->link_time = $link_time; + $this->description = $description; + + self::$static_servers[$numeric] = $this; + } + + public function disconnectServer($linked_only = false) { + if(!$linked_only) { + if($this->parent_server) { + $this->parent_server->delServer($this); + } + $this->disconnectUsers(); + unset(self::$static_servers[$this->numeric]); + } + foreach($this->servers as $server) { + $server->disconnectServer(); + } + } + + public function disconnectUsers() { + //disconnect all Users connected to the actual Server + } + + public function getNumeric() { + return $this->numeric; + } + + public function addServer($server) { + $this->servers[$server->getNumeric()] = $server; + } + + public function delServer($server) { + if(array_key_exists($server->getNumeric(), $this->servers)) { + unset($this->servers[$server->getNumeric()]); + } else { + trigger_error("Tried to remove a Server, that does NOT exist.", E_USER_WARNING); + } + } +} + +?> \ No newline at end of file