1. GSManager
    1. Funktionen
    2. Unterstützte Spiele
    3. Neuigkeiten
    4. Statistiken
    5. Serverliste
  2. Lexikon
  3. Filebase
  4. Entwicklung
  5. Forum
    1. Dashboard
    2. Unerledigte Themen
  6. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Dateien
  • Forum
  • Lexikon
  • Erweiterte Suche
  1. GSManager
  2. Mitglieder
  3. kishen kamal

Beiträge von kishen kamal

Das Projekt GSManager (vormals ManuAdminMod) wurde am 01.01.2020 eingestellt - diese Internetpräsenz bleibt verfügbar, die Software wird aber nicht länger gepflegt. Vielen Dank für eure Unterstützung in den mehr als zehn vergangenen Jahren!
  • Ban IP Range Plugin

    • kishen kamal
    • 28. April 2013 um 14:10
    Zitat von Yenz

    Ban IP Range Plugin (Version: 1.2)
    This plugin kicks all players with ips within the banned ranges.
    [tabmenu]
    [tab='Requirements']
    ManuAdminMod Version 0.11.3 or newer

    [tab='Description']
    This plugin kicks all players with ips within the banned ranges.
    The ranges are defined in config/plugins/banned_ip_ranges.txt.
    After editing this file just execute !readconfig to apply changes or wait at least three minutes.

    [tab='Installation Manual']
    (copy&paste:wink:)

    [tab='Configuration Manual']
    The ranges are defined in config/plugins/banned_ip_ranges.txt.
    All lines beginning with ";" are treated as comments (will be ignored).
    An ip range is defined as following: a.b.c.d - e.f.g.h
    example: 15.13.0.0 - 15.13.255.255

    [tab='Changelog']
    version 1.2
    - fixed crash after kicking player
    - added automatic check for all players every 3 minutes

    version 1.1
    - fixed mispelled config file in zip archive
    - fixed missing readconfig event
    - added continuos readconfig (every 3 minutes)

    released 1.0
    [/tabmenu]

    Alles anzeigen
    Zitat von Yenz

    Ban IP Range Plugin (Version: 1.2)
    This plugin kicks all players with ips within the banned ranges.
    [tabmenu]
    [tab='Requirements']
    ManuAdminMod Version 0.11.3 or newer

    [tab='Description']
    This plugin kicks all players with ips within the banned ranges.
    The ranges are defined in config/plugins/banned_ip_ranges.txt.
    After editing this file just execute !readconfig to apply changes or wait at least three minutes.

    [tab='Installation Manual']
    (copy&paste:wink:)

    [tab='Configuration Manual']
    The ranges are defined in config/plugins/banned_ip_ranges.txt.
    All lines beginning with ";" are treated as comments (will be ignored).
    An ip range is defined as following: a.b.c.d - e.f.g.h
    example: 15.13.0.0 - 15.13.255.255

    [tab='Changelog']
    version 1.2
    - fixed crash after kicking player
    - added automatic check for all players every 3 minutes

    version 1.1
    - fixed mispelled config file in zip archive
    - fixed missing readconfig event
    - added continuos readconfig (every 3 minutes)

    released 1.0
    [/tabmenu]

    Alles anzeigen
  • GeoIp

    • kishen kamal
    • 28. April 2013 um 14:03

    how to make geoip


    <?php
    $geoip = new Geoip_class();

    class Geoip_class {
    private $mod;
    private $logging;
    private $geoip_database;
    private $database = false;
    private $dir;

    function __construct() {
    $this->mod = $GLOBALS['mod'];
    $this->logging = $GLOBALS['logging'];

    $this->dir = $this->mod->getConfigDir() . "/plugins/geoip/";
    $this->prepare();
    }

    private function prepare() {
    $check = false;
    if(file_exists($this->dir . "GeoIP.dat")) {
    $this->mod->Rconrcon("Country");
    include_once($this->dir . "geoip.inc");
    $this->geoip_database = geoip_open($this->dir . "GeoIP.dat", GEOIP_STANDARD);
    $this->database = "Country";
    $this->logging->write(MOD_NOTICE, "GEOIP: GEOIPCountry Database succesfully reloaded");
    }
    if(file_exists($this->dir . "GeoLiteCity.dat")) {
    $this->mod->Rconrcon("City");
    require_once($this->dir . "geoipcity.inc");
    $this->geoip_database = geoip_open($this->dir ."GeoLiteCity.dat", GEOIP_STANDARD);
    $this->database = "City";
    $this->logging->write(MOD_NOTICE, "GEOIP: GEOIPCity Database succesfully reloaded");
    }

    if($this->database == false) {
    $this->logging->write(MOD_WARNING, "GEOIP: Can't find Database Please Download it!");
    return false;
    }
    }


    public function getCountryCode($ip) {
    if($this->database == "Country") {
    return geoip_country_code_by_addr($this->geoip_database, $ip);
    }

    if($this->database == "City") {
    $array = geoip_record_by_addr($this->geoip_database, $ip);
    return $array->country_code;
    }
    }

    public function getCountryName($ip) {
    if($this->database == "Country") {
    return geoip_country_name_by_addr($this->geoip_database , $ip);
    }

    if($this->database == "City") {
    $array = geoip_record_by_addr($this->geoip_database, $ip);
    return $array->country_name;
    }
    }
    public function getCity($ip) {
    if($this->database != "City") return;
    $array = geoip_record_by_addr($this->geoip_database, $ip);
    return $array->city;
    }

    public function getRegionName($ip) {
    global $GEOIP_REGION_NAME;
    if($this->database != "City") return;
    $array = geoip_record_by_addr($this->geoip_database, $ip);
    return $GEOIP_REGION_NAME[$array->country_code][$array->region];
    }

    public function getContinent($ip) {
    if($this->database != "City") return;
    $array = geoip_record_by_addr($this->geoip_database, $ip);
    return $array->continent_code;
    }
    }

    $mod->setDefaultCV("geoip", "enabled", 1);
    $mod->setDefaultCV("geoip", "message", "^1My Name is: ^2<PLAYERNAME>^1.And I am from ^2<CONTINENT> ^1-> ^2<COUNTRY>");
    $mod->setDefaultCV("geoip", "adminmessage", "Name <PLAYERNAME> - From ||<CONTINENT> ||<COUNTRY> ||<REGION> ||<CITY>");
    $mod->setDefaultCV("geoip_welcomemessages", "enabled", 0);
    $mod->setDefaultCV("geoip_welcomemessages", "whisper", 0);

    $mod->registerCommand("geo", false , "command_geo" );
    $mod->registerCommand("geoip", '~^geoip \S.*$~i' , "command_geoip" );
    $mod->registerEvent("playerJoined", "geoip_welcomemessage");


    function command_geo($guid) {
    global $mod;
    global $players;
    global $geoip;

    if ($mod->getCV("geoip", "enabled") == 0) return false;

    $status = $mod->rconPlayerList();
    foreach ($status as $line) {
    if ($line["pid"] == $players[$guid]->getPid() || $line["guid"] == $players[$guid]) {
    $ip = $line["ip"];
    break;
    }
    }

    $search = array(
    "<PLAYERNAME>",
    "<COUNTRY>",
    "<COUNTRY_CODE>",
    "<CITY>",
    "<CONTINENT>",
    "<REGION>",
    );

    $replace = array(
    $players[$guid]->getName(),
    $geoip->getCountryName($ip),
    $geoip->getCountryCode($ip),
    $geoip->getCity($ip),
    $geoip->getContinent($ip),
    $geoip->getRegionName($ip),
    );

    str_replace($search , $replace , $mod->GetCV("geoip", "message"));

    $mod->RconSay(str_replace($search , $replace , $mod->GetCV("geoip", "message")));
    }

    function command_geoip($guid, $parameter) {
    global $mod;
    global $players;
    global $geoip;

    if (!$mod->getCV("geoip", "enabled")) return false;

    $parameter = implode(" ", $parameter);

    $player_guid = $mod->findPlayerGuid($parameter);
    if (!$player_guid) {
    $players[$guid]->say($mod->getLngString("playerNotFound", array("<SEARCH>"), array($parameter)));
    return false;
    }

    $status = $mod->rconPlayerList();
    foreach ($status as $line) {
    if ($line["pid"] == $players[$player_guid]->getPid() || $line["guid"] == $players[$player_guid]->getGuid()) {
    $ip = $line["ip"];
    break;
    }
    }

    $search = array(
    "<PLAYERNAME>",
    "<COUNTRY>",
    "<COUNTRY_CODE>",
    "<CITY>",
    "<CONTINENT>",
    "<REGION>",
    );

    $replace = array(
    $players[$player_guid]->getName(),
    $geoip->getCountryName($ip),
    $geoip->getCountryCode($ip),
    $geoip->getCity($ip),
    $geoip->getContinent($ip),
    $geoip->getRegionName($ip),
    );

    $players[$guid]->say(str_replace($search , $replace , $mod->GetCV("geoip", "adminmessage")));
    }

    //Hauptfunktion die aufgerufen wird, wenn ein Spieler joint; Argument: GUID des neuen Spielers
    function geoip_welcomemessage($guid) {
    global $players;
    global $mod;
    global $geoip;

    //Ist [welcomemessages]enabled = 1
    if (!$mod->getCV("welcomemessages", "enabled")) return false;


    $status = $mod->rconPlayerList();
    foreach ($status as $line) {
    if ($line["pid"] == $players[$guid]->getPid() || $line["guid"] == $players[$guid]) {
    $ip = $line["ip"];
    break;
    }
    }

    //Gruppe des neuen Spielers abrufen
    $group = $players[$guid]->getGroup();

    //Existiert eine Welcomemessage für diese Gruppe?
    if ($mod->existsCV("welcomemessages", $group)) {

    //Führe die replaces in der Message durch
    $search = array(
    "<PLAYER_NAME>",
    "<GROUP_NAME>",
    "<COUNTRY>",
    "<COUNTRY_CODE>",
    "<CITY>",
    "<CONTINENT>",
    "<REGION>",
    );

    $replace = array(
    $players[$guid]->getName(),
    $mod->getLongGroupName($group),
    $geoip->getCountryName($ip),
    $geoip->getCountryCode($ip),
    $geoip->getCity($ip),
    $geoip->getContinent($ip),
    $geoip->getRegionName($ip),
    );

    //Sende die Message
    if ($mod->getCV("welcomemessages", "whisper")) {
    $players[$guid]->say(str_replace($search, $replace, $mod->getCV("welcomemessages", $group)));
    }
    else {
    $mod->rconSay(str_replace($search, $replace, $mod->getCV("welcomemessages", $group)));
    }
    }
    }
    ?>

  1. Mitarbeiter
  2. Datenschutzerklärung
  3. Nutzungsbedingungen
  4. Impressum
  5. Kontakt
Community-Software: WoltLab Suite™