Commit 0935ee57 authored by DerddyDert's avatar DerddyDert Committed by GitHub
Browse files

Merge pull request #821 from CortexPE/patch-2

Bypass SpoonDetector xD
parents 6a3f3526 ee9957a1
......@@ -321,7 +321,24 @@ class Server{
* @return string
*/
public function getName() : string{
return "GenisysPro";
$class = $this->get_calling_class();
if(strchr($class,"SpoonDetector")){
$this->logger->debug("HAHA! BYPASSED " . $class . "'s SPOON DETECTOR!");
return "PocketMine-MP"; // lol
}
return "GenisysPro";
}
private function get_calling_class() : string {
// tnx https://stackoverflow.com/a/6927569/7126351
$trace = debug_backtrace();
$class = $trace[1]['class'];
for ( $i=1; $i<count( $trace ); $i++ ) {
if ( isset( $trace[$i] ) )
if ( $class != $trace[$i]['class'] )
return $trace[$i]['class'];
}
return "null";
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment