Beispiel #1
0
 public static function sendCommand($command)
 {
     if (self::$connection == null) {
         self::$connection = stream_socket_client("tcp://127.0.0.1:8989", $errno, $errorMessage);
         if (self::$connection === false) {
             throw new UnexpectedValueException("Failed to connect: {$errorMessage}");
         }
     }
     fwrite(self::$connection, $command);
 }
Beispiel #2
0
 public function withdrawExp($amount, $reason)
 {
     DataServer::withdrawExpAndMoney($this->username, $amount, 0, $reason);
 }