fuyutsuki / Texter

Texter is a plugin for PocketMine-MP that supports multiple worlds and allows you to add, edit, move, and delete FloatingText.
https://poggit.pmmp.io/p/Texter
University of Illinois/NCSA Open Source License
61 stars 39 forks source link

Error when starting #145

Closed NdaruAjaa closed 1 year ago

NdaruAjaa commented 1 year ago
PocketMine-MP version: 5.1.3 [Protocol 589]
Git commit: 2278275505a7f9d768027673e699e6199575c8bc
PHP version: 8.1.19
OS: Linux, linux

A PLUGIN WAS INVOLVED IN THIS CRASH
BAD PLUGIN: Texter

Error: Invalid base version "", should contain at least 3 version digits
File: pmsrc/src/utils/VersionString
Line: 45
Type: InvalidArgumentException
Backtrace:
#0 plugins/Texter_v4.2.0.phar/src/jp/mcbe/fuyutsuki/Texter/task/CheckUpdateTask(50): pocketmine\utils\VersionString->__construct(string[0] )
#1 pmsrc/src/scheduler/AsyncPool(248): jp\mcbe\fuyutsuki\Texter\task\CheckUpdateTask->onCompletion()
#2 pmsrc/src/scheduler/AsyncPool(210): pocketmine\scheduler\AsyncPool->collectTasksFromWorker(int 1)
#3 pmsrc/src/Server(1786): pocketmine\scheduler\AsyncPool->collectTasks()
#4 pmsrc/src/Server(1671): pocketmine\Server->tick()
#5 pmsrc/src/Server(1063): pocketmine\Server->tickProcessor()
#6 pmsrc/src/PocketMine(334): pocketmine\Server->__construct(object pocketmine\thread\ThreadSafeClassLoader#6, object pocketmine\utils\MainLogger#3, string[16] /home/container/, string[24] /home/container/plugins/)
#7 pmsrc/src/PocketMine(357): pocketmine\server()
#8 pmsrc(11): require(string[60] phar:///home/container/PocketMine-MP.phar/src/PocketMine.php)

Code:
[36]    private string $suffix;
[37] 
[38]    public function __construct(
[39]        private string $baseVersion,
[40]        private bool $isDevBuild = false,
[41]        private int $buildNumber = 0
[42]    ){
[43]        preg_match('/^(\d+)\.(\d+)\.(\d+)(?:-(.*))?$/', $this->baseVersion, $matches);
[44]        if(count($matches) < 4){
[45]            throw new \InvalidArgumentException("Invalid base version \"$baseVersion\", should contain at least 3 version digits");
[46]        }
[47] 
[48]        $this->major = (int) $matches[1];
[49]        $this->minor = (int) $matches[2];
[50]        $this->patch = (int) $matches[3];
[51]        $this->suffix = $matches[4] ?? "";
[52]    }
[53] 
[54]    public static function isValidBaseVersion(string $baseVersion) : bool{
[55]        return preg_match('/^\d+\.\d+\.\d+(?:-(.*))?$/', $baseVersion, $matches) === 1;
scamaccas commented 1 year ago

pls fix this

note3crafter commented 1 year ago

same error here

xxFLORII commented 1 year ago

@fuyutsuki because of this, can we use "tag_name" instead of "name" from https://api.github.com/repos/fuyutsuki/Texter/releases/latest? It seems like the "name" variable is empty.

fuyutsuki commented 1 year ago

@xxFLORII Yes, I would be happy to modify it that way, as I dont have enough time for this project right now.

xxFLORII commented 1 year ago

@fuyutsuki i have pushed it into the dev/4.2 branch