GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
ServerKiller Class Reference

Public Member Functions

 __construct ($time=15)
 
 run ()
 
 getThreadName ()
 
- Public Member Functions inherited from Thread
 getClassLoader ()
 
 setClassLoader (\ClassLoader $loader=null)
 
 registerClassLoader ()
 
 start (int $options=PTHREADS_INHERIT_ALL)
 
 quit ()
 
 getThreadName ()
 
- Public Member Functions inherited from Thread
 getCreatorId ()
 
 getThreadId ()
 
 isJoined ()
 
 isStarted ()
 
 join ()
 
 start (int $options=PTHREADS_INHERIT_ALL)
 
- Public Member Functions inherited from Threaded
 chunk ($size, bool $preserve=false)
 
 count ()
 
 isRunning ()
 
 isTerminated ()
 
 merge ($from, $overwrite=true)
 
 notify ()
 
 notifyOne ()
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 pop ()
 
 run ()
 
 shift ()
 
 synchronized (\Closure $function, $args=null)
 
 wait ($timeout)
 
 getRefCount ()
 
 addRef ()
 
 delRef ()
 
 isGarbage ()
 

Data Fields

 $time
 

Additional Inherited Members

- Static Public Member Functions inherited from Thread
static getCurrentThread ()
 
static getCurrentThreadId ()
 
- Static Public Member Functions inherited from Threaded
static extend ($obj)
 
- Protected Attributes inherited from Thread
 $classLoader
 
 $isKilled = false
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $time = 15)

ServerKiller constructor.

Parameters
int$time
35  {
36  $this->time = $time;
37  }

Member Function Documentation

◆ getThreadName()

getThreadName ( )
Returns
string
53  {
54  return "Server Killer";
55  }

◆ run()

run ( )
39  {
40  $start = time() + 1;
41  $this->synchronized(function(){
42  $this->wait($this->time * 1000000);
43  });
44  if(time() - $start >= $this->time){
45  echo "\nTook too long to stop, server was killed forcefully!\n";
46  @\pocketmine\kill(getmypid());
47  }
48  }

Field Documentation

◆ $time

$time

The documentation for this class was generated from the following file: