Banlist , Spawn

Technická podpora k herním serverům Minecraft a Tekkit
Message
Autor
Uživatelský avatar
R4d0n
Příspěvky: 61
Registrován: 09 pro 2013, 18:29
Reputation: 0

Banlist , Spawn

#1 Příspěvekod R4d0n » 07 úno 2014, 00:35

Server: 93.91.250.140:27806

čauko ...
chcem sa len opýtať že si v Banliste od Mysterii sa dajú zmazať tieto veci :
Varovania
Kicky
Jail
A ponechať tam:
IPBAN
BAN
Link na banlist http://www.mine-pro.6f.sk/banlist/ Všetko je pôvobné len som zmazal pár vecí čo sa mi tam napáčili..
-------------------------------------
A ešte jedna otázka..
Som na mojom spawne a keď príde hráč a zaregistruje sa ho to hodí na strechu spawnu ale pritom keď sa registruje je normal na spawne ... používam pluginy EssentialsSpawn , FirstJoinPlus
....
Ďakujem predom za odpovede 8-)
Obrázek
93.91.250.140:27806

Uživatelský avatar
Mysteria
Příspěvky: 9122
Registrován: 26 pro 2009, 15:40
Reputation: 7
Bydliště: Česká republika
Kontaktovat uživatele:

Re: Banlist , Spawn

#2 Příspěvekod Mysteria » 07 úno 2014, 01:05

V banlist/classes/Database.php budeš muset přidat ke všem větvím metody getAllPunishments podmínku

Kód: Vybrat vše

->where('type', array(x,y,z))
kde místo x,y,z dej čísla, který odpovídají těm typům, který chceš zobrazovat.

Uživatelský avatar
R4d0n
Příspěvky: 61
Registrován: 09 pro 2013, 18:29
Reputation: 0

Re: Banlist , Spawn

#3 Příspěvekod R4d0n » 07 úno 2014, 08:27

Prosím nemohol by si mi to spraviť ? ;) Lebo ja som s toho vôl :lol:
Spoiler: zobrazit

Kód: Vybrat vše

<?php
namespace App;
use Nette, Model;
class Database extends Nette\Object {
   private $db;
   private $sf;
   private $tbl;
   /* Vytvoří SelectionFactory pro tvorbu dotazĹŻ */
   public function __construct(Nette\Database\Connection $db, $tbl) {
      $this->sf = new Nette\Database\SelectionFactory($db);
      $this->db = $db;
      $this->tbl = $tbl;
   }
   
   /* Vybere všechny dostupnĂ© informace o všech trestech odpovĂ­dajĂ­cĂ­ch filtru */
   public function getAllPunishments($showPunishments, $filter = null) {
      if (empty($filter)) {
         if (empty($showPunishments)) {
            $punishments = $this->sf->table($this->tbl)->fetchAll();
            if (empty($punishments)) return false;
         } else {
            $punishments = $this->sf->table($this->tbl)->where('type', $showPunishments)->fetchAll();
            if (empty($punishments)) return false;
         }
      } else {
         if (empty($showPunishments)) {
            $punishments = $this->sf->table($this->tbl)->where('admin', $filter)->fetchAll();
            if (empty($punishments)) return false;
         } else {
            $punishments = $this->sf->table($this->tbl)->where('type', $showPunishments)->where('admin', $filter)->fetchAll();
            if (empty($punishments)) return false;
         }
      }
      foreach ($punishments as $punishment) {
         $userPunishments[] = array(
            'id' => $punishment->id,
            'active' => $this->isPunishmentActive($punishment->type, time(), $punishment->temptime),
            'type' => $this->getTypeAsString($punishment->type),
            'name' => $punishment->name,
            'admin' => $punishment->admin,
            'reason' => $punishment->reason,
            'startTime' => date('d.m.Y H:i:s', $punishment->time),
         );
      }
      return $userPunishments;
   }
   
   /* Vybere všechny dostupnĂ© informace o jednom urÄŤitĂ©m trestu */
   public function getPunishment($id, $filter = null) {
      $punishments = $this->sf->table($this->tbl)->where('id', (int)$id)->fetchAll();
      if (empty($punishments)) return false;
      foreach ($punishments as $punishment) $punishment->toArray();
      if (!empty($filter) && $punishment['admin'] !== $filter) return false;
      return array(
         'id' => $punishment['id'],
         'active' => $this->isPunishmentActive($punishment['type'], time(), $punishment['temptime']),
         'type' => $this->getTypeAsString($punishment['type']),
         'intType' => $punishment['type'],
         'name' => $punishment['name'],
         'admin' => $punishment['admin'],
         'reason' => $punishment['reason'],
         'startTime' => date('d. m. Y H:i:s', $punishment['time']),
         'intStartTime' => $punishment['time'],
         'endTime' => $this->getEndTimeAsString($punishment['type'], $punishment['time'], $punishment['temptime']),
         'length' => $this->getLengthAsString($punishment['type'], $punishment['time'], $punishment['temptime']),
         'remainingLength' => $this->getRemainingLengthAsString($punishment['type'], time(), $punishment['temptime'])
      );
   }
   
   /* PĹ™idá novĂ˝ trest */
   public function addPunishment($type, $name, $reason, $admin, $endTime) {
      return $this->sf->table($this->tbl)->insert(array('type' => $type, 'name' => $name, 'reason' => $reason, 'admin' => $admin, 'time' => time(), 'temptime' => $endTime));
   }
   
   /* UpravĂ­ stávajĂ­cĂ­ trest */
   public function editPunishment($id, $type, $name, $reason, $admin, $endTime) {
      if (empty($id)) return false;
      return $this->sf->table($this->tbl)->where('id', $id)->update(array('type' => $type, 'name' => $name, 'reason' => $reason, 'admin' => $admin, 'time' => time(), 'temptime' => $endTime));
   }
   
   /* SmaĹľe stávajĂ­cĂ­ trest */
   public function deletePunishment($id, $type, $name, $reason, $admin) {
      if (empty($id)) return false;
      if ($type === 0 || $type === 1 || $type === 9) {
         return $this->sf->table($this->tbl)->insert(array('type' => 5, 'name' => $name, 'reason' => $reason, 'admin' => $admin, 'time' => time(), 'temptime' => 0));
      } else { return $this->sf->table($this->tbl)->where('id', $id)->delete(); }
   }
   
   /* Vybere všechny dostupnĂ© informace o všech adminech */
   public function getAllAdmins($filter = null) {
      if (empty($filter)) {
         $admins = $this->sf->table('ubewb_admins')->fetchAll();
         if (empty($admins)) return false;
      } else {
         $admins = $this->sf->table('ubewb_admins')->where('id', $filter)->fetchAll();
         if (empty($admins)) return false;
      }
      foreach ($admins as $admin) {
            $userAdmins[] = array(
            'id' => $admin->id,
            'name' => $admin->name,
            'password' => $admin->password,
            'email' => $admin->email,
            'access' => $admin->access,
            'lastLogin' => date('d.m.Y H:i:s', $admin->lastlogin)
         );
      }
      return $userAdmins;
   }
   
   /* VrátĂ­ poÄŤet adminĹŻ s plnĂ˝m přístupem */
   public function getCountFullAdmins() {
      return $this->sf->table('ubewb_admins')->where('access', 'fullAdmin')->count('*');
   }

   /* Vybere všechny dostupnĂ© informace o jednom urÄŤitĂ©m adminovi */   
   public function getAdmin($id, $filter = null) {
      $admins = $this->sf->table('ubewb_admins')->where('id', $id)->fetchAll();
      if (empty($admins)) return false;
      foreach ($admins as $admin) $admin->toArray();
      if (!empty($filter) && $admin['id'] !== $filter) return false;
      return array(
         'id' => $admin->id,
         'name' => $admin->name,
         'password' => $admin->password,
         'email' => $admin->email,
         'access' => $admin->access,
         'lastLogin' => date('d.m.Y H:i:s', $admin->lastlogin)
      );
   }
   
   /* PĹ™idá novĂ©ho admina */
   public function addAdmin($name, $password, $email, $access) {
      return $this->sf->table('ubewb_admins')->insert(array('name' => $name, 'password' => hash('SHA512', hash('SHA512', $password) .  hash('SHA512', $name)), 'email' => $email, 'access' => $access, 'lastlogin' => time()));
   }
   
   /* UpravĂ­ stávajĂ­cĂ­ho admina */
   public function editAdmin($id, $name, $password, $email, $access) {
      if (empty($id)) return false;
      if (empty($password)) return $this->sf->table('ubewb_admins')->where('id', $id)->update(array('name' => $name, 'email' => $email, 'access' => $access, 'lastlogin' => time()));
      return $this->sf->table('ubewb_admins')->where('id', $id)->update(array('name' => $name, 'password' => hash('SHA512', hash('SHA512', $password) .  hash('SHA512', $name)), 'email' => $email, 'access' => $access, 'lastlogin' => time()));
   }
   
   /* SmaĹľe stávajĂ­cĂ­ho admina */
   public function deleteAdmin($id) {
      if (empty($id)) return false;
      return $this->sf->table('ubewb_admins')->where('id', $id)->delete();
   }
   
   /* UpravĂ­ datum a ÄŤas poslednĂ­ho pĹ™ihlášenĂ­ admina */
   public function updateAdminLastLogin($id) {
      if (empty($id)) return false;
      return $this->sf->table('ubewb_admins')->where('id', $id)->update(array('lastlogin' => time()));
   }
   
   /* ZĂ­ská statistiky databáze trestĹŻ */
   public function getPunishmentsStats() {
      $punishments = $this->db->query("SELECT type, count(*) as count FROM $this->tbl GROUP BY type ORDER BY count ASC;")->fetchAll();
      if (empty($punishments)) return false;
      foreach ($punishments as $punishment) $userPunishments[] = array('type' => $this->getTypeAsString($punishment['type']), 'count' => $punishment['count']);
      return $userPunishments;
   }
   
   /* ZĂ­ská jmĂ©na všech adminĹŻ, kteří udÄ›lali nÄ›jakĂ˝ trest */
   public function getAllAdminNames() {
      $admins = $this->db->query("SELECT admin FROM $this->tbl GROUP BY admin ORDER BY admin;")->fetchAll();
      if (empty($admins)) return array();
      foreach ($admins as $admin) $userAdmins[$admin['admin']] = $admin['admin'];
      return $userAdmins;
   }
   
   /* Ověří, zda je zadán platnĂ˝ email pĹ™i obnovenĂ­ hesla */
   public function checkEmail($email) {
      $emails = $this->sf->table('ubewb_admins')->where('email', $email)->fetchAll();
      if (empty($emails)) return false;
      return true;
   }
   
   /* Zapíše žádost o obnovenĂ­ hesla */
   public function addNewLostPassword($id, $email) {
      $admins = $this->sf->table('ubewb_admins')->where('email', $email)->fetchAll();
      if (empty($admins)) return false;
      foreach ($admins as $admin) $userAdmin = $admin->toArray();
      return $this->sf->table('ubewb_lostpasswords')->insert(array('verifyid' => hash('SHA512', $id), 'name' => $userAdmin['name'], 'email' => $email, 'time' => time()));
   }
   
   /* ZĂ­ská Ăşdaje o adminovi, kterĂ˝ si obnovil heslo */
   public function getAdminLostPasswordInfo($id) {
      $admins = $this->sf->table('ubewb_lostpasswords')->where('verifyid', hash('SHA512', $id))->fetchAll();
      if (empty($admins)) return false;
      foreach ($admins as $admin) return $admin->toArray();
   }
   
   /* ObnovĂ­ heslo admina a smaĹľe záznam s IDÄŤkem */
   public function changeAdminPassword($id, $password) {
      $admins = $this->sf->table('ubewb_lostpasswords')->where('verifyid', hash('SHA512', $id))->fetchAll();
      if (empty($admins)) return false;
      foreach ($admins as $admin) $userAdmin = $admin->toArray();
      if ($this->sf->table('ubewb_admins')->where('email', $userAdmin['email'])->update(array('password' => hash('SHA512', hash('SHA512', $password) .  hash('SHA512', $userAdmin['name'])))) !== 0) {
         return $this->sf->table('ubewb_lostpasswords')->where('verifyid',  hash('SHA512', $id))->delete();
      } else { return false; }
      
      
   }
   
   /* Vygeneruje kompletnĂ­ SQL zálohu databáze */
   public function generateBackup() {
      $backupContent = '-- Záloha MySQL databáze byla vygenerována dne ' . date("d. m. Y v H:i", time()) . ' aplikacĂ­ UltraBans Extended Web Banlist.
-- Pokud by došlo k jakémukoliv problému s databází UltraBans pluginu tak ji můžete pomocí toho SQL dumpu obnovit do funkčního stavu.

-- Vypisuji SQL kĂłd pro tabulku ' . $this->tbl . '
CREATE TABLE banlist (
   name varchar(32) NOT NULL,
   reason text NOT NULL,
   admin varchar(32) NOT NULL,
   time bigint(20) NOT NULL,
   temptime bigint(20) NOT NULL,
   id int PRIMARY KEY NOT NULL AUTO_INCREMENT,
   type int(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=0;' . PHP_EOL . PHP_EOL;
      $backups = $this->sf->table($this->tbl)->order('id')->fetchAll();
      if (empty($backups)) return $backupContent;
      foreach ($backups as $backup) {
         $backupContent .= "INSERT INTO banlist (type, name, reason, admin, time, temptime) VALUES ($backup[type], '$backup[name]', '$backup[reason]', '$backup[admin]', $backup[time], $backup[temptime]);" . PHP_EOL;
      }
      $backupContent .= PHP_EOL . '-- Vypisuji SQL kĂłd pro tabulku ubewb_admins
CREATE TABLE ubewb_admins (
   id int PRIMARY KEY NOT NULL AUTO_INCREMENT,
   name varchar(255) UNIQUE KEY NOT NULL,
   password varchar(255) NOT NULL,
   email varchar(255) UNIQUE KEY NOT NULL,
   access varchar(255) NOT NULL,
   lastlogin bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;' . PHP_EOL . PHP_EOL;
      $backups = $this->sf->table('ubewb_admins')->order('id')->fetchAll();
      if (empty($backups)) return $backupContent;
      foreach ($backups as $backup) {
         $backupContent .= "INSERT INTO ubewb_admins (name, password, email, access, lastlogin) VALUES ('$backup[name]', '$backup[password]', '$backup[email]', $backup[access], $backup[lastlogin]);" . PHP_EOL;
      }
      $backupContent .= PHP_EOL . '-- Vypisuji SQL kĂłd pro tabulku ubewb_lostpasswords
CREATE TABLE ubewb_lostpasswords (
   id int PRIMARY KEY NOT NULL AUTO_INCREMENT,
   verifyid varchar(255) NOT NULL,
   name varchar(255) NOT NULL,
   email varchar(255) NOT NULL,
   time bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;';
      return $backupContent;
   }
   
   /* Ověří, zda je danĂ˝ terst aktivnĂ­ ÄŤi nikoliv */
   private function isPunishmentActive($type, $nowTime, $endTime) {
      if ($type === 0 || $type === 1 || $type === 6 || $type === 7 || $type ===9) {
         if ($endTime === 0 || $nowTime <= $endTime) { return true; }
      }
      if ($nowTime >= $endTime) return false;
      return true;
   }
   
   /* PĹ™evede ÄŤĂ­selnĂ© oznaÄŤenĂ­ trestĹŻ na textovĂ© */
   private function getTypeAsString($type) {
      switch ($type) {
         case 0: return 'Ban';
         case 1: return 'IP ban';
         case 5: return 'Unban';
         case 9: return 'TrvalĂ˝ ban';
      }   
   }
   
   /* PĹ™evede datum vypršenĂ­ trestu na text */
   private function getEndTimeAsString($type, $startTime, $endTime) {
      if ($type === 0 || $type === 1 || $type === 6 || $type === 7 || $type ===9) {
         if ($endTime === 0) return 'Nikdy';
         return date('d. m. Y H:i:s', $endTime);
      } else { return 'Ihned'; }
   }
   
   /* VypoÄŤte a pĹ™evede dĂ©lku trestu na text */
   private function getLengthAsString($type, $startTime, $endTime) {
      if ($type === 0 || $type === 1 || $type === 6 || $type === 7 || $type ===9) {
         if ($endTime === 0) return 'Trvalá';
         return $this->getCzechDateDifference(date_diff(date_create(date('c', $startTime)), date_create(date('c', $endTime))));
      } else { return 'Žádná'; }
   }
   
   /* VypoÄŤte a pĹ™evede zbĂ˝vajĂ­cĂ­ ÄŤas do vypršenĂ­ trestu na text */
   private function getRemainingLengthAsString($type, $nowTime, $endTime) {
      if ($type === 0 || $type === 1 || $type === 6 || $type === 7 || $type ===9) {
         if ($endTime === 0) return 'Nikdy';
         if ($nowTime <= $endTime) return $this->getCzechDateDifference(date_diff(date_create(date('c', $nowTime)), date_create(date('c', $endTime))));
         return 'Vypršel';
      } else { return 'Vypršel'; }
   }
   
   /* PĹ™evede datum a ÄŤas na text */
   private function getCzechDateDifference($length) {
      $lengthAsString = '';
      if ($length->y !== 0) {
         switch ($length->y) {
            case 1: $lengthAsString .= $length->y . ' rok '; break;
            case 2: $lengthAsString .= $length->y . ' roky '; break;
            case 3: $lengthAsString .= $length->y . ' roky '; break;
            case 4: $lengthAsString .= $length->y . ' roky '; break;
            default: $lengthAsString .= $length->y . ' rokĹŻ '; break;
         }   
      }
      if ($length->m !== 0) {
         switch ($length->m) {
            case 1: $lengthAsString .= $length->m . ' mÄ›sĂ­c '; break;
            case 2: $lengthAsString .= $length->m . ' mÄ›sĂ­ce '; break;
            case 3: $lengthAsString .= $length->m . ' mÄ›sĂ­ce '; break;
            case 4: $lengthAsString .= $length->m . ' mÄ›sĂ­ce '; break;
            default: $lengthAsString .= $length->m . ' mÄ›sĂ­cĹŻ '; break;
         }   
      }
      if ($length->d !== 0) {
         switch ($length->d) {
            case 1: $lengthAsString .= $length->d . ' den '; break;
            case 2: $lengthAsString .= $length->d . ' dny '; break;
            case 3: $lengthAsString .= $length->d . ' dny '; break;
            case 4: $lengthAsString .= $length->d . ' dny '; break;
            default: $lengthAsString .= $length->d . ' dnĹŻ '; break;
         }   
      }
      if ($length->h !== 0) {
         switch ($length->h) {
            case 1: $lengthAsString .= $length->h . ' hodina '; break;
            case 2: $lengthAsString .= $length->h . ' hodiny '; break;
            case 3: $lengthAsString .= $length->h . ' hodiny '; break;
            case 4: $lengthAsString .= $length->h . ' hodiny '; break;
            default: $lengthAsString .= $length->h . ' hodin '; break;
         }   
      }
      if ($length->i !== 0) {
         switch ($length->i) {
            case 1: $lengthAsString .= $length->i . ' minuta '; break;
            case 2: $lengthAsString .= $length->i . ' minuty '; break;
            case 3: $lengthAsString .= $length->i . ' minuty '; break;
            case 4: $lengthAsString .= $length->i . ' minuty '; break;
            default: $lengthAsString .= $length->i . ' minut '; break;
         }   
      }
      if ($length->s !== 0) {
         switch ($length->s) {
            case 1: $lengthAsString .= $length->s . ' sekunda'; break;
            case 2: $lengthAsString .= $length->s . ' sekundy'; break;
            case 3: $lengthAsString .= $length->s . ' sekundy'; break;
            case 4: $lengthAsString .= $length->s . ' sekundy'; break;
            default: $lengthAsString .= $length->s . ' sekund'; break;
         }   
      }
      return $lengthAsString;
   }
}
Obrázek
93.91.250.140:27806

Uživatelský avatar
zikl
Příspěvky: 1123
Věk: 31
Registrován: 28 led 2012, 15:44
Reputation: 3
Kontaktovat uživatele:

Re: Banlist , Spawn

#4 Příspěvekod zikl » 07 úno 2014, 09:25

Vy chuligani co my odstranuje te patičku :evil: http://www.mine-pro.6f.sk/server/stastiky-hlasovania/
ObrázekObrázek
Obrázek
Moje sestava:Seznam na CZC.CZ

Uživatelský avatar
Arcas
Příspěvky: 1406
Věk: 27
Registrován: 13 bře 2012, 19:15
Reputation: 0

Re: Banlist , Spawn

#5 Příspěvekod Arcas » 07 úno 2014, 10:55

Takže dokud nevrátíš patičku do toho seznamu, pomoci se nedočkáš.

Až to napravíš, ozvy se :-)
Čeština a jiné jazyky jsou Freeware, ale ne Opensource!!! To znamená, že s nimi můžete nakládat jak chcete, ale nesmíte je upravovat...

// no comment

Uranus-Portal.com
Obrázek

Uživatelský avatar
R4d0n
Příspěvky: 61
Registrován: 09 pro 2013, 18:29
Reputation: 0

Re: Banlist , Spawn

#6 Příspěvekod R4d0n » 07 úno 2014, 16:29

Opravené ;) Som vynadal kamošovi :mrgreen:
http://www.mine-pro.6f.sk/server/stastiky-hlasovania/
Teraz mi už pomôžete ?
Obrázek
93.91.250.140:27806

fantomas2
Příspěvky: 1800
Registrován: 19 zář 2012, 17:54
Reputation: 0
Bydliště: Kanál
Kontaktovat uživatele:

Re: Banlist , Spawn

#7 Příspěvekod fantomas2 » 08 úno 2014, 14:02

s tím spawnom, nastav na spawne /setspawn a /setspawn newbies
Tvorba web stránok zdarma pro velké herné portály, ozvi se SZ.

Uživatelský avatar
R4d0n
Příspěvky: 61
Registrován: 09 pro 2013, 18:29
Reputation: 0

Re: Banlist , Spawn

#8 Příspěvekod R4d0n » 08 úno 2014, 14:56

Spawn je vyriešený ja skôr potrebujem Banlist :cry:
Obrázek
93.91.250.140:27806

Uživatelský avatar
Arcas
Příspěvky: 1406
Věk: 27
Registrován: 13 bře 2012, 19:15
Reputation: 0

Re: Banlist , Spawn

#9 Příspěvekod Arcas » 08 úno 2014, 14:58

S tím banlistem ti pomůže Mysteria. A pokud tě mohu poprosit za mého kamaráda Expl0iteda - dej /unban Expl0ited a pak /ban Expl0ited Fake (grief drevarne) - pravý Expl0ited nemá čas na MC servery (http://youtube.com/CaukyMnaukyRecordSK)
Čeština a jiné jazyky jsou Freeware, ale ne Opensource!!! To znamená, že s nimi můžete nakládat jak chcete, ale nesmíte je upravovat...

// no comment

Uranus-Portal.com
Obrázek

Uživatelský avatar
R4d0n
Příspěvky: 61
Registrován: 09 pro 2013, 18:29
Reputation: 0

Re: Banlist , Spawn

#10 Příspěvekod R4d0n » 08 úno 2014, 17:32

Vykonám šéfe :mrgreen: :mrgreen: :mrgreen: :mrgreen:
Ja viem že to nebol pravý Expl0 keďže je na CraftCone ;)
Obrázek
93.91.250.140:27806


Zpět na „Minecraft, Tekkit“

Kdo je online

Uživatelé prohlížející si toto fórum: Žádní registrovaní uživatelé a 81 hostů