Advertisement
Guest User

Untitled

a guest
May 19th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.54 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  * SimpleAuth plugin for PocketMine-MP
  5.  * Copyright (C) 2014 PocketMine Team <https://github.com/PocketMine/SimpleAuth>
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU Lesser General Public License as published by
  9.  * the Free Software Foundation, either version 3 of the License, or
  10.  * (at your option) any later version.
  11.  *
  12.  * This program is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  * GNU General Public License for more details.
  16. */
  17.  
  18. namespace SimpleAuth\provider;
  19.  
  20. use pocketmine\IPlayer;
  21. use pocketmine\Player;
  22. use pocketmine\OfflinePlayer;
  23. use pocketmine\utils\Config;
  24. use SimpleAuth\SimpleAuth;
  25.  
  26. interface DataProvider{
  27.  
  28.     /**
  29.      * @param IPlayer $player
  30.      *
  31.      * @return array, or null if it does not exist
  32.      */
  33.     public function getPlayer(IPlayer $player);
  34.  
  35.     /**
  36.      * @param string $name
  37.      *
  38.      * @return array, or null if it does not exist
  39.      */
  40.     public function getPlayerData(string $player);
  41.  
  42.     /**
  43.      * @param IPlayer $player
  44.      *
  45.      * @return bool
  46.      */
  47.     public function isPlayerRegistered(IPlayer $player);
  48.  
  49.     /**
  50.      * @param IPlayer $player
  51.      * @param string  $hash
  52.      *
  53.      * @return array, or null if error happened
  54.      */
  55.     public function registerPlayer(IPlayer $player, $hash);
  56.  
  57.     /**
  58.      * @param IPlayer $player
  59.      */
  60.     public function unregisterPlayer(IPlayer $player);
  61.  
  62.     /**
  63.      * @param string $name
  64.      * @param array  $config
  65.      */
  66.     public function savePlayer(string $name, array $config);
  67.  
  68.     /**
  69.      * @param IPlayer $player
  70.      * @param string  $lastIp
  71.      * @param string  $ip
  72.      * @param int     $loginDate
  73.      * @param string  $linkedign
  74.      * @return bool
  75.      */
  76.     public function updatePlayer(IPlayer $player, string $lastIp = null, string $ip = null, int $loginDate = null, string $linkedign = null) : bool;
  77.  
  78.     /**
  79.      * @param string $name
  80.      *
  81.      * @return string or null
  82.      */
  83.     public function getLinked(string $name);
  84.  
  85.     /**
  86.      * @param Player        $sender
  87.      * @param OfflinePlayer $oldPlayer
  88.      * @param string        $oldIGN
  89.      *
  90.      * @return bool $success
  91.      */
  92.     public function linkXBL(Player $sender, OfflinePlayer $oldPlayer, string $oldIGN);
  93.  
  94.     /**
  95.      * @param Player $player
  96.      *
  97.      * @return string or null if not linked
  98.      */
  99.     public function unlinkXBL(Player $player);
  100.  
  101.     /**
  102.      * @return bool for DB supports linking
  103.      */
  104.     public function isDBLinkingReady() : bool;
  105.  
  106.     public function close();
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement