Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Minecraft{
- private $whitelistDir='survival-server/white-list.txt';
- private $blacklistDir='survival-server/banned-players.txt';
- private $serverUpdateLog='survival-server/server-update-log.txt';
- public function updateWhitelist($action,$u){
- $whitelist=file($this->whitelistDir);
- $data=1;
- $exists=false;
- if($action=='add'){
- foreach($whitelist as $filenr){
- if(strpos($filenr, $u)===false){continue;}
- $exists=true;
- break;
- }
- if($exists){$data='Brukar er allereie lagt til!';}else{
- file_put_contents($this->whitelistDir,$u."\r\n",FILE_APPEND);
- $data='Brukaren har blitt lagt til!';
- }
- }elseif($action=='remove'){
- //ations
- }elseif($action=='fresh'){
- //actions
- }elseif($action=='displayList'){
- //actions
- }
- return $data;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement