Stránka 1 z 1
Banlist , Spawn
Napsal: 07 úno 2014, 00:35
od R4d0n
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

Re: Banlist , Spawn
Napsal: 07 úno 2014, 01:05
od Mysteria
V banlist/classes/Database.php budeš muset přidat ke všem větvím metody getAllPunishments podmínku
kde místo x,y,z dej čísla, který odpovídají těm typům, který chceš zobrazovat.
Re: Banlist , Spawn
Napsal: 07 úno 2014, 08:27
od R4d0n
Prosím nemohol by si mi to spraviť ?

Lebo ja som s toho vôl
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;
}
}
Re: Banlist , Spawn
Napsal: 07 úno 2014, 09:25
od zikl
Re: Banlist , Spawn
Napsal: 07 úno 2014, 10:55
od Arcas
Takže dokud nevrátíš patičku do toho seznamu, pomoci se nedočkáš.
Až to napravíš, ozvy se

Re: Banlist , Spawn
Napsal: 07 úno 2014, 16:29
od R4d0n
Re: Banlist , Spawn
Napsal: 08 úno 2014, 14:02
od fantomas2
s tím spawnom, nastav na spawne /setspawn a /setspawn newbies
Re: Banlist , Spawn
Napsal: 08 úno 2014, 14:56
od R4d0n
Spawn je vyriešený ja skôr potrebujem Banlist

Re: Banlist , Spawn
Napsal: 08 úno 2014, 14:58
od Arcas
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)
Re: Banlist , Spawn
Napsal: 08 úno 2014, 17:32
od R4d0n