Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
frage zu ds lan v.21
#50
(10.05.2009, 19:44)Black Arrow Wrote:
(10.05.2009, 18:59)Black Arrow Wrote: dann hast du die dateien nicht richtig entpackt. erstell im ordner {dslan}/htdocs/admin/actions/ eine datei mit dem namen anti_cheat.php und füge folgendes ein:
PHP Code:
<?php /** * DSLan AntiCheat Script * * @author Alexander Thiemann <mail@agrafix.net> * @version 1.0 */ /** * The AntiCheat class * */ class dslan_anticheat { /** * Database class * * @var db */ var $db = null; /** * Template class * * @var Smarty */ var $tpl = null; /** * Saves actions * * @var array */ var $actions = array(); /** * Init anticheat class * * @param db $db * @param Smarty $tpl */ function init($db, &$tpl) { $this->db = $db; $this->tpl = &$tpl; } /** * Update ban state of user * * @param int $userid * @param enum $state (Y|N) */ function update_ban_state($userid, $state="N") { if(!is_numeric($userid)) { $this->display_error("security", "Param \$userid is not numeric!"); } $this->db->query("UPDATE `users` SET `banned` = '$state' WHERE `id` = '$userid'"); // Session kill $this->db->query("DELETE FROM `sessions` WHERE `userid` = '$userid'"); } /** * Removes random village * * @param int $userid * @return boolean */ function remove_village($userid) { if(!is_numeric($userid)) { $this->display_error("security", "Param \$userid is not numeric!"); } $result = $this->db->query("SELECT * FROM `villages` WHERE `userid` = '$userid'"); $vil = array(); if($this->db->numrows($result) == 0) { return false; } while($v = $this->db->fetch($result)) { $vil[] = $v; } $max = count($vil)-1; $rnd = rand(0, $max); $this->db->query("UPDATE `villages` SET `userid` = -1 AND `name` = '".urlencode("|AntiCheatDorf|")."' WHERE `id` = ".$vil[$rnd]["id"]); $this->db->query("UPDATE `users` SET `villages` = `villages`-1 WHERE `id` = '$userid'"); return true; } /** * Displays an action result to user * * @param string $content * @param enum $col (normal|error|ok) */ function display_action($content, $col="normal") { //$this->tpl->assign("action_show", "Y"); switch($col) { case "normal": $color = "#000000"; break; case "ok": $color = "#0A5F06"; break; case "error": $color = "#AF0A11"; break; } $this->actions[] = "<span style='color:$color;'>$content</span>"; } function finish() { $str = "<ul>"; foreach($this->actions AS $a) { $str .= "<li>".$a."</li>"; } $str .= "</ul>"; $this->tpl->assign("action_text", $str); } /** * Generate error and die script * * @param string $type * @param string $content */ function display_error($type, $content) { $msg = "DSLan AntiCheat "; switch(@$type) { case "security": $msg .= "Security Error: "; break; case "fatal": $msg .= "Fatal Error: "; break; case "general": $msg .= "General Error: "; break; default: $msg .= "Default Error: "; break; } $msg .= $content; die($msg); } } /** * Init Class */ $anti_cheat = new dslan_anticheat; $anti_cheat->init($db, &$tpl); /** * Handle Actions */ switch(@$_GET["do"]) { case "ban": if(count($_GET["user"]) < 1) { $anti_cheat->display_error("fatal", "No userids given!"); } foreach($_GET["user"] AS $uid) { $anti_cheat->update_ban_state($uid, "Y"); $anti_cheat->display_action("Speler #$uid gebanned!", "ok"); } break; case "remove_village": if(count($_GET["user"]) < 1) { $anti_cheat->display_error("fatal", "No userids given!"); } foreach($_GET["user"] AS $uid) { if($anti_cheat->remove_village($uid)) { $anti_cheat->display_action("Er werd een dorp van #$uid weggenomen!", "ok"); } else { $anti_cheat->display_action("#$uid heeft geen dorpen!", "error"); } } break; case "change_ban_state": if(!is_numeric($_GET["id"])) { $anti_cheat->display_error("fatal", "ID not numeric!"); } if($_POST["state"] != "N" AND $_POST["state"] != "Y") { $anti_cheat->display_error("fatal", "Wrong ENUM!"); } $anti_cheat->update_ban_state($_GET["id"], $_POST["state"]); $anti_cheat->display_action("Aktion erfolgreich!", "ok"); break; } /** * Find Multis */ $result = $db->query("SELECT * FROM `users`"); $v = array(); $multis_found = "N"; while($row = $db->fetch($result)) { $row["logins"] = array(); $row["ip"] = ""; $row["multi"]["enum"] = "N"; $row["multi"]["userid"] = 0; $row["multi"]["username"] = "-"; $yesterday = mktime(23, 59, 59, date("m"), date("d"), date("Y")) - 60 * 60 * 24; $uid_result = $db->query("SELECT * FROM `logins` WHERE `userid` = '".$row["id"]."' AND `time` > ".$yesterday); while($logins = $db->fetch($uid_result)) { $row["logins"][] = $logins; $row["ip"] = $logins["ip"]; $nomulti_result = $db->query("SELECT * FROM `logins` WHERE `ip` = '".$logins["ip"]."' AND `userid` != '".$row["id"]."' AND `time` > ".$yesterday." LIMIT 1"); if($db->numrows($nomulti_result) == 1) { $multi_user = $db->fetch($nomulti_result); $row["multi"]["enum"] = "Y"; $row["multi"]["userid"] = $multi_user["userid"]; $row["multi"]["username"] = $multi_user["username"]; $multis_found = "Y"; } } $v[] = $row; } $anti_cheat->finish(); $tpl->assign("users", $v); $tpl->assign("multis_found", $multis_found); ?>

erstell im ordner {dslan}/htdocs/admin/extern_moduls/ eine datei mit dem namen anti_cheat.php und füge folgendes ein:
PHP Code:
<?php /** * DSLan AntiCheat Script * * @author Alexander Thiemann <mail@agrafix.net> * @version 1.0 */ $toolname = "Bansysteem"; $screenname = "anti_cheat"; ?>
erstell im ordner {dslan}/htdocs/admin/templates/ eine datei mit dem namen index_anti_cheat.tpl und füge folgendes ein:
Code:
<!-- This ds-lan extension was written by Alexander Thiemann Visit me: www.agrafix.net Mail me: mail@agrafix.net --> <h2>AntiCheat Script</h2> {if !empty($action_text)} <h3>Aktion</h3> {$action_text} {/if} <h3>Multis</h3> {if $multis_found == "Y"} <table class="vis"> <tr> <th>Spieler</th> <th>IP</th> <th>Spieler mit gleicher IP</th> <th>Aktion</th> </tr> {foreach from=$users item=u} {if $u.multi.enum == "Y"} <tr> <td>{$u.username|urldecode|htmlentities} {if $u.banned == "Y"}(gesperrt){/if}</td> <td>Heute: {$u.ip}</td> <td>{$u.multi.username|urldecode|htmlentities}</td> <td> <a href="index.php?screen=anti_cheat&amp;do=ban&amp;user[0]={$u.id}&amp;user[1]={$u.multi.userid}">Beide Sperren</a> - <a href="index.php?screen=anti_cheat&amp;do=ban&amp;user[0]={$u.id}">{$u.username|urldecode|htmlentities} Sperren</a> - <a href="index.php?screen=anti_cheat&amp;do=ban&amp;user[0]={$u.multi.userid}">{$u.multi.username|urldecode|htmlentities} Sperren</a> <br /> <a href="index.php?screen=anti_cheat&amp;do=remove_village&amp;user[0]={$u.id}&amp;user[1]={$u.multi.userid}">Beiden ein Dorf wegnehmen</a> - <a href="index.php?screen=anti_cheat&amp;do=remove_village&amp;user[0]={$u.id}">{$u.username|urldecode|htmlentities} ein Dorf wegnehmen</a> - <a href="index.php?screen=anti_cheat&amp;do=remove_village&amp;user[0]={$u.multi.userid}">{$u.multi.username|urldecode|htmlentities} ein Dorf wegnehmen</a> </td> </tr> {/if} {/foreach} </table> {else} <i>Keine Multis gefunden.</i> {/if} <h3>Spieler sperren/entsperren</h3> <table class="vis"> <tr> <th>Spieler</th> <th>Sperrstatus</th> <th>Aktion</th> </tr> {foreach from=$users item=u} <tr> <td>{$u.username|urldecode|htmlentities}</td> <td> <form action="index.php?screen=anti_cheat&amp;do=change_ban_state&amp;id={$u.id}" method="post"> <select name="state"> <option value="Y" {if $u.banned == "Y"}selected="selected"{/if}>gesperrt</option> <option value="N" {if $u.banned == "N"}selected="selected"{/if}>entsperrt</option> </select> <input type="submit" value="&auml;ndern" /> </form> </td> <td> <a href="index.php?screen=anti_cheat&amp;do=remove_village&amp;user[0]={$u.id}">Dorf wegnehmen</a> </td> </tr> {/foreach} </table> {literal} <script type="text/javascript"> /** * DO NOT REMOVE THIS */ window.onload = _init_agrafix; function _init_agrafix() { var st = document.getElementById("serverTime"); var parentP = st.parentNode; parentP.innerHTML = "<a href='http://www.agrafix.net' target='_blank'>AntiCheat Erweiterung v1.1 von agrafix.net</a><br /> " + parentP.innerHTML; } </script> {/literal} <!-- End of Extension -->

mach mal das, dann müsste es gehen.

mach das doch mal und wenn es bei dir in {dslan}/htdocs/admin kein ordner extern_modules gibt, dann erstelltst du ihn halt, das ist doch nicht so schwer.



Messages In This Thread
frage zu ds lan v.21 - by ecol - 10.05.2009, 16:33
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 16:36
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 16:42
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 16:44
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 16:45
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 16:46
RE: frage zu ds lan v.21 - by Yannici - 10.05.2009, 17:29
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 17:36
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 17:38
RE: frage zu ds lan v.21 - by Yannici - 10.05.2009, 17:39
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 17:43
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 17:50
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 17:52
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 18:22
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 18:36
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 18:38
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 18:41
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 18:48
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 18:55
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 18:59
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 19:44
RE: frage zu ds lan v.21 - by Black Arrow - 11.05.2009, 17:42
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 19:04
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 19:08
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 19:17
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 19:18
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 19:20
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 19:25
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 19:37
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 19:38
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 19:39
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 19:41
RE: frage zu ds lan v.21 - by ecol - 10.05.2009, 19:43
RE: frage zu ds lan v.21 - by edi123 - 10.05.2009, 20:01
RE: frage zu ds lan v.21 - by Black Arrow - 10.05.2009, 20:03
RE: frage zu ds lan v.21 - by Black Arrow - 11.05.2009, 13:37
RE: frage zu ds lan v.21 - by ecol - 11.05.2009, 13:32
RE: frage zu ds lan v.21 - by Black Arrow - 11.05.2009, 13:33
RE: frage zu ds lan v.21 - by ecol - 11.05.2009, 13:36
RE: frage zu ds lan v.21 - by ecol - 11.05.2009, 13:43
RE: frage zu ds lan v.21 - by Black Arrow - 11.05.2009, 13:45
RE: frage zu ds lan v.21 - by ecol - 11.05.2009, 13:47
RE: frage zu ds lan v.21 - by Black Arrow - 11.05.2009, 13:50
RE: frage zu ds lan v.21 - by ecol - 11.05.2009, 13:51
RE: frage zu ds lan v.21 - by Black Arrow - 11.05.2009, 13:56
RE: frage zu ds lan v.21 - by ecol - 11.05.2009, 13:58
RE: frage zu ds lan v.21 - by Black Arrow - 11.05.2009, 14:00
RE: frage zu ds lan v.21 - by ecol - 11.05.2009, 14:40
RE: frage zu ds lan v.21 - by Yannici - 11.05.2009, 15:38
RE: frage zu ds lan v.21 - by ecol - 11.05.2009, 17:40
RE: frage zu ds lan v.21 - by SlimShady95 - 11.05.2009, 17:46
RE: frage zu ds lan v.21 - by ecol - 11.05.2009, 18:25
RE: frage zu ds lan v.21 - by Black Arrow - 11.05.2009, 18:30
RE: frage zu ds lan v.21 - by ecol - 11.05.2009, 18:43
RE: frage zu ds lan v.21 - by Black Arrow - 11.05.2009, 18:46
RE: frage zu ds lan v.21 - by Yannici - 11.05.2009, 19:07
RE: frage zu ds lan v.21 - by Black Arrow - 11.05.2009, 19:10
RE: frage zu ds lan v.21 - by ecol - 11.05.2009, 19:12
RE: frage zu ds lan v.21 - by Black Arrow - 11.05.2009, 19:15
RE: frage zu ds lan v.21 - by Yannici - 11.05.2009, 19:18
RE: frage zu ds lan v.21 - by ecol - 11.05.2009, 19:22
RE: frage zu ds lan v.21 - by Black Arrow - 11.05.2009, 19:23
RE: frage zu ds lan v.21 - by ecol - 12.05.2009, 12:27
RE: frage zu ds lan v.21 - by Black Arrow - 12.05.2009, 12:45
RE: frage zu ds lan v.21 - by agrafix - 13.05.2009, 20:33



Users browsing this thread: 1 Guest(s)