Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Plugin Crashes

Comments in 'Plugin Development' started by iFootball, Jun 21, 2014.

  1. iFootball
    Offline

    iFootball Active Member

    Joined:
    Jun 9, 2014
    Posts:
    84
    Minecraft User:
    iFootball
    I'm making a simple plugin (This is my first one), and when I run any of the commands my client crashes. I'm wondering, mabey it's not right to use $player in console run commands? Please comment if you see any errors, and this is my first one.

    Please do not use this code. And their is a lot of personalized code in here, and some of the purposes of the commands are hard to explain.
    PHP:
    <?php

    /*
    __Pocketmine Plugin__
    name=HungerGamesAPI
    description=Hunger Games API. Made for TheUnitedBallers
    version=1.01
    author=mclover152 & iFootball
    class=HGAPI
    apiversion=10,11,12
    */

    class HGAPI implements Plugin{
    private 
    $api;

        public function 
    __construct(ServerAPI $api$server false){
            
    $this->api $api;
        }
       
        public function 
    init(){
            
    $this->api->addHandler("HungerGames", array($this"HungerGames"));
            
    $this->api->console->register("hg""starts a match of hunger games", array($this"commandhandler")); Games", array($this, "commandHandler");
            
    $this->api->console->register("hgadmin", "Bypasses hungergames limitations", array($this, "commandHandler2");
            
    $this->api->console->register("hglobby", "Resets lobby game and allows players to go into the game", array($this, "commandHandler3");
            
    $this->api->console->register("hgstop", "Stops the HungerGames match", array($this, "commandHandler4");
            
    $this->api->addHandler("player.death", array($this, "eventHandler"), 100);
            
    $this->api->addHandler("player.gamemode.change", array($this, "eventHandler"), 100);
            
    $this->api->addHandler("player.quit", array($this, "eventHandler"), 100);
        }
       
        public function HungerGames(
    $data$event$player){
        switch(
    $event){
        
    $player = $data['player'];
            if(
    $data['player']->entity->level->getname() === "HungerGames"){
                
    $this->api->console->run("t f $player");
                
    $data['player']->sendChat("You have joined this Hunger GamesThe match will start soon.");
        }
        break;
        }
        }
       
        public function commandHandler(
    $data$player){
                
    $this->api->console->run("t f @all off");
                
    $this->api->console->run("mine reset hglobby1");
                
    $this->api->console->run("mine reset hglobby2");
                
    $this->api->console->run("mine reset hglobby3");
                
    $this->api->console->run("mine reset hglobby4");
                
    $this->api->chat->broadcast("[TheUnitedBallersThe HungerGames match as started!");
                
    $data['player']->sendChat("Let the games begin!");
        }
        break;
        }
        }
        public function commandHandler2(
    $data$player){
                
    $this->api->console->run("t f $player off");
                
    $this->api->chat->broadcast("[TheUnitedBallers$player is no longer in the game.");
                
    $data['player']->sendChat("Admin bypass mode on");
        }
        break;
        }
        }
        public function commandHandler3(
    $data$player){
                
    $this->api->console->run("hgstop");
                
    $this->api->chat->broadcast("[TheUnitedBallersYou can now enter the HungerGames arena!");
                
    $this->api->console->run("mine reset hglobby11");
                
    $this->api->console->run("mine reset hglobby21");
                
    $this->api->console->run("mine reset hglobby31");
                
    $this->api->console->run("mine reset hglobby41");
               
        }
        break;
        }
        }
        public function commandHandler4(
    $data$player){
                if(
    $data["player"]->entity->level->getName() === "HugerGames"){
                
    $this->api->console->run("tp $player w:MainSpawn");
                
    $data["player"]->sendChat("The game has been declared a tieEither the game went on to long or a Administrator has stoped the game");
                
    $this->api->chat->broadcast("[TheUnitedBallersThe HungerGames match has been declared a tie!");
               
        }
        break;
        }
        }
        public function eventHandler(
    $data$event){
        switch(
    $event){
            case 'player.death':
                if(
    $data["player"]->entity->level->getName() === "HugerGames"){
            
    $data["player"]->sendChat("Thank you for playing HungerGamesyou have been killed and eliminated from the game");
            
    $this->api->chat->broadcast("[TheUnitedBallers$player has been eliminated from the HungerGames!");
            
    $this->api->console->run("tp $player w:MainSpawn");
        }
        break;
        }
        }
        public function eventHandler(
    $data$event)
        {
        switch(
    $event)
        {
            case 'player.gamemode.change':
                if(
    $data['player']->entity->level->getname() === "HungerGames"){
                
    $data['player']->sendChat("NO CHEATINGPlayers/Staff are not allowed to change gamemode in this world.");
                
    $this->api->console->run("tp $player w:MainSpawn");
        }
    break;
        }
        }
       
        public function eventHandler(
    $data$event)
        {
        switch(
    $event)
        {
            case 'player.quit':
                if(
    $data['player']->entity->level->getname() === "HungerGames"){
                
    $this->api->chat->broadcast("[TheUnitedBallers$player has left HungerGames.");
                
    $this->api->console->run("tp $player w:MainSpawn");
            }
            break;
        }

        }

        public function __destruct(){
        }
        }
        ?>
  2. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    386
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    Your client crashes? Do you get any errors on the PocketMine Console?
  3. iFootball
    Offline

    iFootball Active Member

    Joined:
    Jun 9, 2014
    Posts:
    84
    Minecraft User:
    iFootball
    I got a error report I put it in the spoiler below.
    ```
    # PocketMine-MP Error Dump Sat Jun 21 12:02:03 KST 2014
    Error: array (
    'type' => 'E_ERROR',
    'message' => 'Cannot use object of type Player as array',
    'file' => '/home/tcagame_svc93/********/93/plugins/hgapi.php',
    'line' => 98,
    )

    THIS ERROR WAS CAUSED BY A PLUGIN. REPORT IT TO THE PLUGIN DEVELOPER.
    Code:
    [89] $data['player']->sendChat("NO CHEATING! Players/Staff are not allowed to change gamemode in this world.");
    [90] $this->api->console->run("tp $player w:MainSpawn");
    [91] }
    [92] }
    [93] }
    [94]
    [95] public function eventHandler3($data, $event){
    [96] switch($event){
    [97] case 'player.quit':
    [98] if($data['player']->entity->level->getname() === "HungerGames"){
    [99] $this->api->chat->broadcast("[TheUnitedBallers] $player has left HungerGames.");
    [100] $this->api->console->run("tp $player w:MainSpawn");
    [101] }
    [102] }
    [103] }
    [104]
    [105] public function __destruct(){
    [106] }
    [107] }
    [108] ?>


    PocketMine-MP version: Alpha_1.3.12 #620 [Protocol 14; API 12]
    Git commit: 0000000000000000000000000000000000000000
    Source SHA1 sum: e5f2f82202587903385681486b0d3626ae31b569
    uname -a: Linux host.colocrossing.com 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_64
    PHP Version: 5.5.9
    Zend version: 2.5.0
    OS : Linux, linux
    Debug Info: array (
    'tps' => 19.2562,
    'memory_usage' => '25.99MB',
    'memory_peak_usage' => '26.39MB',
    'entities' => 290,
    'players' => 1,
    'events' => 1,
    'handlers' => 55,
    'actions' => 220,
    'garbage' => 0,
    )


    Parameters: array (
    'input' =>
    array (
    ),
    'commands' =>
    array (
    'enable-ansi' => 'false',
    ),
    'flags' =>
    array (
    ),
    )


    server.properties: array (
    'server-name' => 'The United Ballers',
    'description' => 'This server brings you the most fun and entertainment with professionalism, and gives you factions, Hungergames, and minigames.',
    'motd' => 'Welcome to The United Ballers Factions, Hungergames, Minigames, and creative server!',
    'server-type' => 'normal',
    'last-update' => 1403319678,
    'white-list' => false,
    'announce-player-achievements' => false,
    'spawn-protection' => '0',
    'view-distance' => '10',
    'max-players' => 35,
    'allow-flight' => true,
    'spawn-animals' => true,
    'spawn-mobs' => true,
    'gamemode' => 0,
    'hardcore' => false,
    'pvp' => true,
    'difficulty' => 1,
    'generator-settings' => '',
    'level-name' => 'mainspawn',
    'level-seed' => '',
    'level-type' => 'DEFAULT',
    'enable-query' => true,
    'enable-rcon' => false,
    'rcon.password' => '',
    'send-usage' => true,
    'auto-save' => true,
    'debug' => 1,
    'server-ip' => '23.94.45.161',
    'server-port' => 19132,
    'memory-limit' => '768M',
    )


    Loaded plugins:
    HideMe 1.0.1 by shoghicp
    TrollPlus 1.2 by LDX
    SimpleWorlds 0.3.1 by PocketMine Team
    TimeCommander 1.0 by LDX
    NotSoFlat 0.3 by Alex
    PluginLoader 1.1 by onebone
    SimpleWarp 0.2.3 by Falk
    XTi-RankManager 1.2.3-OFFICIAL by XKTiVerz
    tapToDo 0.4 by Falk
    MineReset 0.4.1 by Falk
    PVPWorld 1.0 by Dinokiller
    HungerGamesAPI 1.01 by mclover152 & iFootball
    PeacefulSpawn 1.4 by LDX
    ArmorSpawn 1.0 by LDX
    ChestShop 1.9 by MinecrafterJPN
    SimpleAuth 0.3.9 by shoghicp
    Portal 2.6 by ljy
    PerWorldGamemode 1.0 by tschrock
    RealTime 1.2.2 by Guillaume351
    beAreaGuard 1.1 by Blue Electric // TNPXXSHEEPDOG
    AdminArmor 1.6 by LDX
    Disguise 0.0.1 by Falk
    PocketMoney 2.2.2 by MinecrafterJPN
    Factions+ 1.1.2-Alpha by UnknownPlayer
    Spawn+ 1.2 by Topic
    ChestRefill 0.1 by Falk
    TPCompass 0.6 by BlinkSun
    Alias 1.0.1 by ZacHack
    AdminTelePreLoader 0.0.1 by Junyi00
    WorldEditor 0.9.1 by shoghicp


    Loaded Modules: array (
    'Core' => '5.5.9',
    'date' => '5.5.9',
    'ereg' => false,
    'pcre' => false,
    'sqlite3' => '0.7-dev',
    'zlib' => '2.0',
    'bcmath' => false,
    'ctype' => false,
    'curl' => false,
    'fileinfo' => '1.0.5-dev',
    'filter' => '0.11.0',
    'hash' => '1.0',
    'json' => '1.2.1',
    'standard' => '5.5.9',
    'SPL' => '0.2',
    'pcntl' => false,
    'posix' => false,
    'pthreads' => '0.1.0',
    'Reflection' => '$Id: 31d836a7ac92a37b5c580836d91ad4736fe2f376 $',
    'shmop' => false,
    'sockets' => false,
    'mysqlnd' => 'mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $',
    'mysqli' => '0.1',
    'tokenizer' => '0.1',
    'yaml' => '1.1.1',
    'zip' => '1.11.0',
    )
    Memory Usage Tracking:
    AwA=


    phpinfo():
    7V17c+O4kf+fn4K1yd3upmxJ1NP2xKmTZXmsWslSJHkms6krFkRCEsd8LR+y7MqHv24AJECKkj1b
    SV2qMjs7UhP9Q+PVQHcDoCbcho6/Dn76WZvdz/RPNIqdwNev/6J3ap3apaYtXuKEepgwdvx0r2+D
    OKlZgRtYURDHjr+BB09v1rq1VvO83TJqhlFr1qjbre0vuma3rf/B0BeTmb5MqT4hkd7s6MblVQf+
    7+iPy4HebBhtnUO1m9Rxbf2WJBTLu6Mr3WhyQMO4ahpXrYY2CPy1s0kjqg8CzyO+jUj9x1rdyhg/
    wuP5OfXJyqXnju86Pj0PwsTxnFeSQNt+RHYY0bWzv65vA4/WE4tsiEfNeGe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FyEzCUECYtxP58tJ/C308HjhMUV0+nBaiom
    nbkcoZrBopwFLu1Gq2Vcdnud2mWncVGdoQyVKPwZFs5lFxG0nzQd/vt740hdGdNgzPyXS4kfO9dc
    IX/WCpItLrmpmcOHT++MbhnydGjLIP/GcS2r30FQyxtWGdHKBlWFs7zvKmJZLvG9gWyhY49GsQz1
    LSFsXonK+JV3xYnglQHeHbmKNpwIWxmiHLOq2aoDVob4Hq1+j1a/R6vfo9X/6GhV2qJSqMqXyH9G
    nJoZhd8fpKoLelWEqvLL4SnjvSs2LdmmysCUd9cbUSkD/X+GpHJQD+JRXrdvsvbvj0S5zlSHobJO
    p2PQgt9yJADNXaSj0acs7XjoKTw0Ne4Uhb836BRu7rsjzoKGHQk3qzykI7Emgx4EmnwQDqPMSvU+
    CDG5fvxyKPH3B5e8Qu+MLBn4SFjJeG/HlLmIckDJGMejSXZwNwZRPnRE4TfggcS3dPU4WCfPEHR8
    0F+CVMd/5QD0zcHX21b4NpGT4O931YMIL0Y76xcNElK8fM1+Nx7Dgjj7EXmlKJ1AQenKdfBXE/TV
    S87/GAVpqOHPYojfcEWCcfMy8SqhSMPfFbrSdeib4cNiqB00QNYzF7MNQqjWliRY82d802tF8Zfu
    16l7pgFS/zxa3uPvcPcfvuif+3OIHJZfPuji3/jQ6Y5yOeytcRALXRMRP3mBRmqT4XwA6+yyfzMa
    j5ZfdOiUu9HyAbRAv5vO9b4Oy9JyNHgc9+f67HE+my6GNU0brVnP2o7Nfu1GvOykEx1/H0DtO5f3
    3RnK3eJbX8R/0diPgrL37skKKyiBEOed6aFL8cfxrMBPiJVkIv4H/0EMnyY17f8A


    ```
  4. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    useless tip : use $player = $data["player"];
    and then do $player->entity->level->getname() == bala bala
  5. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    is the current world named "HungerGames", cuz if not, it might be the reason.
  6. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    i don't think that matter's
  7. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    386
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    How would that be the case since its checking if $data['player'] is in the world HungerGames?

    It might be because your trying to get the world name of a player that isnt on the server....
  8. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    if that is the case it well not crash the server
  9. iFootball
    Offline

    iFootball Active Member

    Joined:
    Jun 9, 2014
    Posts:
    84
    Minecraft User:
    iFootball
    How
    I don't understand, how is it trying to get the world name of a player that isn't on the server? It's checking if a player is in the world then performing a command.
  10. iFootball
    Offline

    iFootball Active Member

    Joined:
    Jun 9, 2014
    Posts:
    84
    Minecraft User:
    iFootball
    So like is?
    PHP:
    public function HungerGames($data$event$player){
        switch(
    $event){
        
    $player $data["player"];
            if(
    $player->entity->level->getname() == "HungerGames"){
                
    $this->api->console->run("t f $player");
                
    $data['player']->sendChat("You have joined this Hunger Games. The match will start soon.");
        }
        break;
        }
        }
    And yes the world name is "HungerGames".
  11. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    if(($p = $this->api->player->get($params[0])) == false) return "Player not found.";
    yes but you forgot the case
  12. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    can you give us more info so we can help you . give us what event you are trying to do ?
  13. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    for some reason you have arrayed hg twice and you have big problem which is you have put " with out closing it
    iFootball likes this.
  14. iFootball
    Offline

    iFootball Active Member

    Joined:
    Jun 9, 2014
    Posts:
    84
    Minecraft User:
    iFootball
    So as soon as the player is teleported to the world the player is frozen in place at their podium, and the server sends a message to the player, and using a timer plugin every 10 mins the console runs /hg which starts the game, which runs "/t f @all off" and sends messages from their.
  15. iFootball
    Offline

    iFootball Active Member

    Joined:
    Jun 9, 2014
    Posts:
    84
    Minecraft User:
    iFootball
    Oh ok, missed that XD.
  16. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    i saw TONS of mistakes ( no offense ) and i would like to get your permission to fix them and run your plugin on my testing server to look for crashes .
    iFootball likes this.
  17. Renzo
    Offline

    Renzo Active Member

    Joined:
    Mar 12, 2014
    Posts:
    96
    Minecraft User:
    Renzo_4
    PHP:
      $this->api->addHandler("HungerGames", array($this"HungerGames"));
    addHandler is meant for events like console.command or player.block.place etc!
    Exaple:
    PHP:
    $this->api->addHandler('player.block.break');
    //or
    $this->api->addHandler('player.chat', array($this"eventHandler"));
    //and there are more events
  18. iFootball
    Offline

    iFootball Active Member

    Joined:
    Jun 9, 2014
    Posts:
    84
    Minecraft User:
    iFootball
    Yes you can. That would be great. I would like to learn from my mistakes. It is my first plugin.
    Last edited: Jun 21, 2014
  19. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    here. i fixed the "crash" but not all of it because i don't know what you are going to use it for. simple note : mine reset is not for reset-ing a room or lobby. use rollback

    Attached Files:

    iFootball likes this.
  20. iFootball
    Offline

    iFootball Active Member

    Joined:
    Jun 9, 2014
    Posts:
    84
    Minecraft User:
    iFootball
    Thank you very much. I don't think RollBack would work for my situation. I'm using MineReset to cover the Tapcmd buttons so players cant join the game while its in progress, and it seems like MineReset is the best plugin for that use. I heard you can use World Edit but that might be more complex for what I need. I'll go test it on my server.
    swagboy47 likes this.

Share This Page

Advertisement