1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Compatibility problem.

Discussion in 'Facepalm' started by Daniel Pereira, Aug 23, 2017.

Thread Status:
Not open for further replies.
  1. Daniel Pereira

    Daniel Pereira Silverfish

    Messages:
    22
    GitHub:
    Undentified
    I've been for days looking at the crash on my Terminal but still dont know where / how to change anything to solve this problem. Here's the crash:


    Fatal error: Declaration of ServerAuth\Commands\Commands::eek:nCommand(pocketmine\command\CommandSender $sender, pocketmine\command\Command $cmd, $label, array $args) must be compatible with pocketmine\command\CommandExecutor::eek:nCommand(pocketmine\command\CommandSender $sender, pocketmine\command\Command $command, string $label, array $args): bool in phar:///home/Swords/plugins/ServerAuth_v2.11.phar/src/ServerAuth/Commands/Commands.php on line 24

    [13:35:14] [Server thread/EMERGENCY]: An unrecoverable error has occurred and the server has crashed. Creating a crash dump
    [13:35:14] [Server thread/EMERGENCY]: Please upload the "/home/Swords/crashdumps/Wed_Aug_23-13.35.14-EDT_2017.log" file to the Crash Archive and submit the link to the Bug Reporting page. Give as much info as you can.

    The api i updated myself , just opening the plugin and changing api's (allways worked). And this time this happens and i dont even think it's from the api. It's something about the commands thats what i see xd , Thanks for anyone that can solve this for me. My big thank you. :)
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    You would know what it is already if you had fully read PHP,
    consider looking into interfaces and abstract /implementing and extending classes
    or just wait for someone to say give you the code if reading is not your thing
     
  3. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    clearly you have no idea what "API" means.
     
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    This is probably the most obvious and easy to read error and still people don't get it :facepalm:
     
  5. RumDaDuMCPE

    RumDaDuMCPE Witch

    Messages:
    67
    GitHub:
    RumDaDuMCPE
    Hey Man.
    The fix to this is quite simple.
    But you CANNOT fix it without converting your ServerAuth.phar into source code (as you can't modify .phar files).

    Im assuming that you're using pocketmine-mp api 3.0.0-ALPHA7.

    If you would like to fix this, follow the steps given below.

    * Remove ServerAuth.phar (Please do not do this if you'd not like to follow my steps.)
    * Get the source code from here: https://github.com/EvolSoft/ServerAuth/archive/master.zip
    * Unzip it.
    * cd into ServerAuth-master/ and MOVE the folder 'ServerAuth' to your plugins directory.
    * MAKE SURE THAT YOU'VE GOT DEVTOOLS FOR API 3.0.0-ALPHA7 INSTALLED.
    * Open the file: ServerAuth-master/src/ServerAuth/Commands/Commands.php

    Now, In the file Commands.php, head over to LINE 30.
    On line 30, you'll be able to see this:
    PHP:
    public function onCommand(CommandSender $senderCommand $cmd$label, array $args) {
    Now, This is important. You'll have to remove that line and replace it with the following:
    PHP:
    public function onCommand(CommandSender $senderCommand $cmdstring $label, array $args) : bool {
    Now do the same with:
    - ServerAuth-master/src/ServerAuth/Commands/Login.php at LINE 32
    - ServerAuth-master/src/ServerAuth/Commands/Logout.php at LINE 32
    - ServerAuth-master/src/ServerAuth/Commands/Register.php at LINE 32
    - ServerAuth-master/src/ServerAuth/Commands/Unregister.php at LINE 32
    and,
    - ServerAuth-master/src/ServerAuth/Commands/ChangePassword.php at LINE 31


    Oh, and, by the way, make sure that you've added 3.0.0-ALPHA7 to the api list in ServerAuths plugin.yml file.

    This PROBABLY fixes the issue. I do not give you any guarantee that it will.

    I hope I've helped you with this and in-case you're still having issues, feel free to message me. I'd be happy to help you out :)
     
    Last edited: Aug 23, 2017
  6. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    andddd all you say is, do this then that and that but not why
    dosent really help anyone learn other then follow instructions, and this "mysterious" fix which somehow magically fixes unknow crashes
     
  7. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    You could have made a fork of ServerAuth fixing the issue by the time you finished writing this post.
     
    XdmingXD likes this.
  8. RumDaDuMCPE

    RumDaDuMCPE Witch

    Messages:
    67
    GitHub:
    RumDaDuMCPE
    I was trying to help him learn. I should've written down the cause XP
     
  9. RumDaDuMCPE

    RumDaDuMCPE Witch

    Messages:
    67
    GitHub:
    RumDaDuMCPE
    Oh, Yes, The mysterious fix is for the OP. He's having the issue. I'm just telling him how exactly to solve his issue. It is his purpose to follow the instructions if he wants to get it fixed by himself. I should've rather created a fork out of ServerAuth and modified it myself but I thought it'd be better if he did it by himself. He could learn something :) and maybe fix the same issues on other plugins as well.
     
  10. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    That's not learning anything. I can change my variable names to "lbl" or "l" or "alias" or "a" or anything else, and does your "teaching" still work?
    You taught someone how to become a robot, and a robot still does not know what's going on.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.