Muqsit / PlayerVaults

Per-player GUI-based vaults plugin for PocketMine-MP
https://poggit.pmmp.io/p/PlayerVaults
GNU Lesser General Public License v2.1
41 stars 33 forks source link

mysql error #67

Closed Matthww closed 5 years ago

Matthww commented 5 years ago
[PlayerVaults] SQL PREPARE error: Unknown column 'data' in 'field list', for query SELECT data FROM vaults WHERE player=? AND number=1; | ["skyrantZ"]

Getting this when I updated to version 3

Database: image

A simple renaming the column inventory to data will result in a crashdump:

PocketMine-MP Crash Dump Fri Apr 5 04:31:39 CDT 2019

Error: Invalid argument supplied for foreach()
File: plugins/PlayerVaults.phar/src/muqsit/playervaults/database/Vault
Line: 90
Type: ErrorException

THIS CRASH WAS CAUSED BY A PLUGIN
BAD PLUGIN: PlayerVaults v3.0

Code:
[81]    }
[82] 
[83]    public function send(Player $player, ?string $custom_name = null) : void{
[84]        $this->menu->send($player, $custom_name);
[85]    }
[86] 
[87]    public function read(string $data) : void{
[88]        $contents = [];
[89]        $inventoryTag = self::$nbtSerializer->readCompressed($data)->getListTag(self::TAG_INVENTORY);
[90]        foreach($inventoryTag as $tag){
[91]            $contents[$tag->getByte("Slot")] = Item::nbtDeserialize($tag);
[92]        }
[93] 
[94]        $this->menu->getInventory()->setContents($contents);
[95]    }
[96] 
[97]    public function write() : string{
[98]        $contents = [];
[99]        foreach($this->menu->getInventory()->getContents() as $slot => $item){
[100]           $contents[] = $item->nbtSerialize($slot);

Backtrace:
#0 plugins/PlayerVaults.phar/src/muqsit/playervaults/database/Vault(90): pocketmine\utils\Utils::errorExceptionHandler(integer 2, string Invalid argument supplied for foreach(), string phar:///home/matthew/1.2/plugins/PlayerVaults.phar/src/muqsit/playervaults/database/Vault.php, integer 90, array Array())
#1 plugins/PlayerVaults.phar/src/muqsit/playervaults/database/Database(81): muqsit\playervaults\database\Vault->read(string ...........ZOO.G......!!!._.s..*.....n...-M....R.......5;.8..Uo....~.r..~.~..Z.}.;k.....R..$.v...~.y...v5.o...s.(......B.fQ.63K..o..'2YTh..t(r4...3.f.....L....(..8(.B{Q.Ye.TvF...q.4..0....h,m.r.|,mn.6.....a..Luz...5m...A..<!.E.....S.u..1u\*.xj.#nq..\B....7...mf.w..T.3*o.*... ..N..:.k..'Lc..... \P..O.7/..\...0U!....T..gG.v...L..J.......T;?.;.1..%.n.4I.-,....]..3xIq0..l.y.u..........+.~.^.-k-.E7c.K1{>f.1..lg.c....+...#.s#...$....tp0.Q4...#R....iQ..z..O..l.w....;T`NO.7.G...=..!....g...xq....m...{...F......T`...y...T.W...j.?'...3....1..]..i...X)7.....-.|.T)CN.c...../,..B}@w...c ........D...B..|.n....h.g1.<.#.B.}!.o.~.....1.4M.....>.dX.w.....G..i..S.kAe|..1f.......r]............%.s.2W...I9.:...Z.C;.......6.M.o..>..5.R...u...Q..cN8.$.......k...-...WV0.....x....4..O.....0.L..M.z....f..u|`Q....v ..8.;..K..<.T....C,.{L.m.q...p...o...?...)e'x..a3.V..]y...5.......?pS^...M...EMvK5...~...l.*{.........p,..Z.*..U2/.27,..`L..J.'.....W.]Ub/..=N...S...#.{*.G.q.+...&.-..H.y[......+...|.J.yOa?H.y?a...6..4m..n^.dy.9$.~....j.{0<.D.uU\.I{a.a.....hp .=.b#...@)L.E..H[..../.g....w....j.OO(w.1....J.....!...m....0*..... .. Y....pf.V..o:......5...^....R...NZ.u.$$1..X...8..2X.a.....@...*FI..pW.<E....U..8....ChuI1{a{!6..`...[.U...Bx[..F....}P.@...6`.2....o.._..!.!)......\..V..^.F..e5.w..3..^..4*z.....P.......J.FU.L....6..=b...j...ExGN..L.......'X......>C.*e}...j*.T.G.|y.*<$n...k...2.~...."V.NjCJ...(C.V..B.m ..:0...(>C.a'.#..) w.%.t6.|4.m.B7.WV.Q...V..&..G..LB....X.o.p.!|0.M..]...H.O.........S.Tv{Ta....*2.....xm.".!...,95....."5...H..t..h.u.aSu-..Z.k....v.t-..Z.k....v.t-..Z.k....v.tm&..T.R]Ku...Z^=..?.-.w....W..mS.K./..T....7|!..|%T......|.:.5....7...O..........[*..)
#2 plugins/PlayerVaults.phar/src/muqsit/playervaults/libs/poggit/libasynql/base/DataConnectorImpl(130): muqsit\playervaults\database\Database->muqsit\playervaults\database\{closure}(array Array(), array Array())
#3 plugins/PlayerVaults.phar/src/muqsit/playervaults/libs/poggit/libasynql/base/DataConnectorImpl(143): muqsit\playervaults\libs\poggit\libasynql\base\DataConnectorImpl->muqsit\playervaults\libs\poggit\libasynql\base\{closure}(muqsit\playervaults\libs\poggit\libasynql\result\SqlSelectResult object)
#4 plugins/PlayerVaults.phar/src/muqsit/playervaults/libs/poggit/libasynql/base/SqlThreadPool(91): muqsit\playervaults\libs\poggit\libasynql\base\DataConnectorImpl->muqsit\playervaults\libs\poggit\libasynql\base\{closure}(muqsit\playervaults\libs\poggit\libasynql\result\SqlSelectResult object)
#5 plugins/PlayerVaults.phar/src/muqsit/playervaults/libs/poggit/libasynql/base/DataConnectorImpl(227): muqsit\playervaults\libs\poggit\libasynql\base\SqlThreadPool->readResults(array Array())
#6 plugins/PlayerVaults.phar/src/muqsit/playervaults/libs/poggit/libasynql/CallbackTask(36): muqsit\playervaults\libs\poggit\libasynql\base\DataConnectorImpl->checkResults()
#7 src/pocketmine/scheduler/TaskHandler(159): muqsit\playervaults\libs\poggit\libasynql\CallbackTask->onRun(integer 21232)
#8 src/pocketmine/scheduler/TaskScheduler(199): pocketmine\scheduler\TaskHandler->run(integer 21232)
#9 src/pocketmine/plugin/PluginManager(688): pocketmine\scheduler\TaskScheduler->mainThreadHeartbeat(integer 21232)
#10 src/pocketmine/Server(2550): pocketmine\plugin\PluginManager->tickSchedulers(integer 21232)
#11 src/pocketmine/Server(2326): pocketmine\Server->tick()
#12 src/pocketmine/Server(2187): pocketmine\Server->tickProcessor()
#13 src/pocketmine/Server(1766): pocketmine\Server->start()
#14 src/pocketmine/PocketMine(250): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string /home/matthew/1.2/, string /home/matthew/1.2/plugins/)
#15 (1): require(string phar:///home/matthew/1.2/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
Muqsit commented 5 years ago

@Matthww that doesn't seem like the table created by PlayerVaults. Try deleting the sqlite database or changing the sqlite db filename in the config

Muqsit commented 5 years ago

Oh, I see you're using the database created by an older version of PlayerVaults. I'm currently working on a conversation tool for this

Muqsit commented 5 years ago

Done, try this plugin/tool: https://github.com/Muqsit/PlayerVaults-Converter