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. Web-Interface
  7. Artikel
  8. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  • Deutsch
  • Anmelden
  • Registrieren
  • Suche
Forum
  1. GSManager
  2. Mitglieder
  3. DFC-NightMare[NL]

Beiträge von DFC-NightMare[NL]

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!
  • Bug found in SetNextMap

    • DFC-NightMare[NL]
    • 26. Juli 2009 um 12:05

    Hi Guys,

    Each time that we use "!setnextmap mapname" the current "map rotation" gets reset.

    After playing "mapname" the rotation starts at the beginning instead of continue where it was.
    One could argu if this is wanted or not, aka a bug or not.

    I Found a fix for resetting the map rotation, I hope you like it:

    - Open the file called:mod.class.php

    - find this code:

    //=============================================================


    public function rconSetNextMap($map, $gametype) {
    $nextmap = "gametype " . $gametype . " map " . $map;
    $this->rconSetDvar("sv_maprotationcurrent", $nextmap);
    return true;
    }
    //=============================================================


    - replace it with this code:

    //=============================================================

    // sv_mapRotation is the list of maps and gametypes to play in the rotation.
    // The game does not touch it in anyway accept to read it once during a rotation.
    // sv_mapRotationCurrent is created by the game. It uses it internally to keep track of the current rotation.
    // Each time a map_rotation is called for, it looks at that string.
    // It strips the first map and map name from the head of that string and that is the map that it starts.
    // Notice that the sv_mapRotationCurrent string has been modified by the game. The string is now shorter.
    // When that string is finally empty after running thru the whole rotation,
    // the game then copies the contents of sv_mapRotation to sv_mapRotationCurrent (including the gametype specifiers) and the process starts again.
    public function rconGetCurrentMapRotation() {
    $return = $this->rconDvarList("sv_maprotation*");
    $current = $return["sv_maprotationcurrent"];
    return $current;
    }

    // Insert the "nextmap" before the current rotation sequence.
    // The rotation will continue as where it was after playing the "special inserted map"
    public function rconSetNextMap($map, $gametype) {
    $nextmap = "gametype " . $gametype . " map " . $map . " " . $this->rconGetCurrentMapRotation();
    $this->rconSetDvar("sv_maprotationcurrent", $nextmap);
    return true;
    }

    //=============================================================


    Restart the adminmod and your fixed.

    Each time that you Use "setnextmap" the map is inserted before the rest of the rotation.

    Therefor the rotation does not get reset each time that you use this command.


    I hope you like this fix/addon.


    Kind regards,


    DFC-NightMare[NL]

    http://www.dutchfightclub.nl

  • Bug found in mod.class.php function FindMap

    • DFC-NightMare[NL]
    • 23. Juli 2009 um 18:02

    Hi Guys,


    I think I found a bug in the function FindMap.

    When we use "!setnextmap mapname" with a mapname that doesnt exist the server (cod5) crashes when rotating to that new map.

    After looking at the code i found an easy fix:


    old code:

    public function findMap($search) {
    $search = strtolower($search);
    if (array_key_exists($search, $this->maps)) {
    return $search;
    }
    foreach ($this->maps as $short => $long) {
    if (strtolower($long) == $search) {
    return $short;
    }
    }
    if (!preg_match('|^[a-z0-9._-]+$|i', $search)) return false;
    return $search;
    }


    New code:

    public function findMap($search) {
    $search = strtolower($search);
    if (array_key_exists($search, $this->maps)) {
    return $search;
    }
    foreach ($this->maps as $short => $long) {
    if (strtolower($long) == $search) {
    return $short;
    }
    }
    if (!preg_match('|^[a-z0-9._-]+$|i', $search)) return false;
    return false;
    }

    Changes: last line returns false instead of ($search), the mapname.

    This causes the admin mod to say "no such map" when typing a wrong mapname.

    And therefor the server no longer crashes.
    running standard cod5.


    Please update this in the next package.

    And keep up the good work!


    DFC-NightMare[NL]

    http://www.dutchfightclub.nl

  1. Mitarbeiter
  2. Datenschutzerklärung
  3. Nutzungsbedingungen
  4. Impressum
  5. Kontakt
Community-Software: WoltLab Suite™
  • Alles
  • Artikel
  • Seiten
  • Dateien
  • Forum
  • Lexikon
  • Erweiterte Suche
  • Deutsch
  • English