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

Reload Whitelist

Comments in 'Plugin Development' started by Falk, Oct 25, 2013.

  1. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    If I have a plugin editing the server whitelist will I need to reload the whitelist every time an edit is made? How is this accomplished in a plugin?
  2. JWhy
    Offline

    JWhy New Member

    Joined:
    Oct 21, 2013
    Posts:
    13
    Minecraft User:
    I don't play MCPE :P
    As far as I see the whitelist is only being loaded from two locations.
    1. From the BanAPI constructor: Go to line
    2. From the BanAPI command handler: Go to line
    You can't use the constructor of BanAPI to reload the whitelist, so you'll have to run '/whitelist reload' from your plugin.
    PHP:
    <?php
    private function reloadWhitelist(){
      
    $this->api->ban->commandHandler('whitelist', array('reload'), null'whitelist');
    }
    ?>
    (I haven't tested this!)
  3. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Thanks! I will test it out when I get a chance
  4. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Would this work?
    $this->api->console->run(whitelist reload);
  5. JWhy
    Offline

    JWhy New Member

    Joined:
    Oct 21, 2013
    Posts:
    13
    Minecraft User:
    I don't play MCPE :P
    Oh, even better... Didn't use the ConsoleAPI yet, but your approach is to be preferred

Share This Page

Advertisement