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

Console is spammed with errors and warnings, but still continues running

Comments in 'Plugin Development' started by jasonwynn10, Feb 2, 2016.

  1. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    Soooooo, I have been developing this plugin recently for a player AFK mode. I have made the plugin work several times properly until I added in the last partition for automatic player movement checking and automatic AFK placement. I have the error on github here: https://github.com/jasonwynn10/AFK/issues/11
    Please help if you can :)
  2. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    Maybe if you send us the errors we'll be able to help you as well.
    jasonwynn10 and TheDeibo like this.
  3. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    [Server thread/WARNING]: RuntimeException: "Illegal offset type" (E_WARNING) in "/AFK/src/AFK/Main" at line 142
    [Server thread/CRITICAL]: Could not execute task AFK\AFKTimeout: Illegal offset type

    Sorry, I forgot to put those in the initial post...
    Last edited: Feb 3, 2016
  4. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    so, I picked out the issue into this bit of code here:

    public function checkTime() {
    if ($this->afk) {
    foreach ($this->afk as $p) {
    $time = $this->time[$p]; //I think this is the error but I'm not sure...
    if (time()-$time>=10) {
    if (!($this->isAFK($p))) {
    $this->getServer()->broadcastMessage(Color::YELLOW . $p . " is now AFK");
    }
    }
    }
    }
    }

    So, the error is that I'm trying to access an array index using a Player object as the key. what do I change the player object to in order to fix the error?
  5. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    i had same* error with [ ] these characters on various plugins, and on ClearSky, so try changing them to ( ) ?
    idk if it would work, just new on the Newest API

    EDIT: i placed seed and it was Same*
    Last edited: Feb 4, 2016
  6. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    no, on ClearSky they were extra things, which creates array in an array.
    applqpak likes this.
  7. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    Oh, Well, Then He should try that, and if it keeps doing so, might the $p have problems being defined as afk. but is there,
    so he could change it to $plyr or something, or i am wrong?
  8. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    That isn't the error that I am having, I need to know what to replace player object $p with to prevent the error from occuring.
  9. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    Can someone please explain to me what the problem is or what I need to replace the variable with?
  10. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    is $p set as Player? and i think that $this->time[$p] is not getting the players time, you should change the code,
    you should get another player´s time Getting (get the Time from player [of afk])
  11. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    $p should be set to the player's name. That's how it is set up in the coding...
  12. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    Run the plugin and show me the errors
  13. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    -5 Years Later...-
    jasonwynn10 likes this.
  14. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    The errors are the same as before:
    [Server thread/WARNING]: RuntimeException: "Illegal offset type" (E_WARNING) in "/AFK/src/AFK/Main" at line 142
    [Server thread/CRITICAL]: Could not execute task AFK\AFKTimeout: Illegal offset type
    Sorry for the late reply, I'm on Eastern time
    Last edited: Feb 9, 2016
  15. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    , so you took 23 hours and 59 minutes to respond, k
  16. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    Not possible. I looked at the plugin on GitHub and line 142 is empty?. xD
  17. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    Had you checked for any extra characters? ( { } ), etc?
  18. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    That's not the problem. The problem is he's trying to access an array index using an object as the index key.
    PEMapModder likes this.
  19. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    I'm only 15, I have to go to school all day.
    So, what do I do to fix it?
  20. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Don't you think that one of your posts is redundant and should be deleted or merged?
    applqpak likes this.

Share This Page

Advertisement