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. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    Bruhhh -_-
    Search it on php.net, I always tell people but they never do it.
    PHP:
    $this->time[spl_object_hash($player)] = null;//null SHOULD be string/object/int/bool/etc
    Edit: I made a pull request
    Last edited: Feb 11, 2016
    jasonwynn10 likes this.
  2. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    Thank you! I'll test it as soon as I can!
  3. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    There is still another issue...
    [15:50:56] [Server thread/NOTICE]: UndefinedVariableException: "Undefined variable: name" (E_NOTICE) in "/AFK/src/AFK/Main" at line 149
    [15:50:57] [Server thread/CRITICAL]: Could not execute task AFK\AFKTimeout: Undefined variable: name
    Easy fix?
  4. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    Hold up, I'll fix it for you.
    jasonwynn10 likes this.
  5. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    na, I got this one.
  6. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    K. I forgot that you make $this->afk a string and I put it as a player, serry :oops:
    Also, I don't know your coding style, so I'm confused with it, you do it.
  7. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    lol, k
  8. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    @xBeastMode There is a new error:
    [16:55:34] [Server thread/CRITICAL]: Could not execute task AFK\AFKTimeout: spl_object_hash() expects parameter 1 to be object, string given
    [16:55:34] [Server thread/WARNING]: InvalidArgumentException: "spl_object_hash() expects parameter 1 to be object, string given" (E_WARNING) in "/AFK/src/AFK/Main" at line 152

    This seems to happen only when a player enters AFK mode.
    Last edited: Feb 10, 2016
  9. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    spl_object_hash() requires the parameter passed through to be an object, while the parameter you are passing is a string.
    Last edited: Feb 10, 2016
  10. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    ok. Thanks!
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Don't use null if you want a placeholder there. Use anything but null (conventionally a boolean true). If you are using the isset() function, it will consider null as unset.

    Edit: isset() is not a function. It is more like a control.
    Last edited: Feb 11, 2016
    jasonwynn10 and applqpak like this.
  12. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    Yes :)

Share This Page

Advertisement