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
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Dateien
  • Forum
  • Lexikon
  • Erweiterte Suche
  1. GSManager
  2. Mitglieder
  3. jchamb2010

Beiträge von jchamb2010

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!
  • Need help

    • jchamb2010
    • 8. Juli 2009 um 17:00

    I actually just noticed a problem that you might not notice for about 8 hours after starting the script, I forgot to put MySQL_close() functions in there... Without these the mysql server will drop the connection after 8 hours of no queries being sent.

    I've added them to the original script.

  • Need help

    • jchamb2010
    • 6. Juli 2009 um 22:31

    No one?

  • Need help

    • jchamb2010
    • 5. Juli 2009 um 01:55

    I found out I can make a script run everytime someone joins the server, so that's the way that I did it.

    The reason I do not use the built in reserved slots feature is that it actually "reserves" the slots, meaning that nobody but who has the password to join in those slots can fill them. This means that if I have a 16 slot server, and say 6 reserved slots, the maximum amount of public people that can join my server is 10, weather or not those other 6 slots have anybody in them. Also I really don't like that whole password thing, I'd rather have it be passive to the end user.

    Another reason I don't like the password is that I'm making a script where if you donate to help support my server, you automatically get put into the database of safe hashes (reserved slots) for one month, once that month is up you are automatically removed from the safe hashes table, and can be once again kicked for people that are on the list.

    The only problem with the way that I have this setup, is that you need to have an odd number of slots in your server, so that It can always keep one open.

    I'm going to share this plugin with you guys, but before anyone actually uses it (because I don't want any problems with people's servers), I need someone with more knowledge then me, to tell me if this plugin will actually work.

    Here it is:

    PHP
    <?
    
    
    
    
    /*
    Config:
    
    
    
    
    PUT THE FOLLOWING PARAGRAPH INTO YOUR CONFIG.CFG
    
    
    
    
    [reserved]
    enabled = 0
    admin = 0
    reason_serverfull = "Sorry this server is currently full."
    reason_reserved = "Sorry you have been kicked to make room for a reserved slot member."
    msg_reserved = "<KICKED_PLAYER> has been kicked to make room for reserved slot member <JOINED_PLAYER>."
    //Database Information
    mysql_user = "MySQL username"
    mysql_pass = "MySQL password"
    mysql_host = "MySQL hostname"
    mysql_name = "MySQL database name"
    
    
    
    
    */
    
    
    
    
    $mod->setDefaultCV("reserved", "enabled", 0);
    $mod->setDefaultCV("reserved", "admin", 0);
    $mod->setDefaultCV("reserved", "slots", 0);
    $mod->setDefaultCV("reserved", "reason_serverfull", "Sorry this server is currently full.");
    $mod->setDefaultCV("reserved", "reason_reserved", "Sorry you have been kicked to make room for a reserved slot member.");
    $mod->setDefaultCV("reserved", "msg_reserved", "<KICKED_PLAYER> has been kicked to make room for reserved slot member <JOINED_PLAYER>.");
    $mod->setDefaultCV("reserved", "mysql_user", "NULL");
    $mod->setDefaultCV("reserved", "mysql_pass", "NULL");
    $mod->setDefaultCV("reserved", "mysql_host", "localhost");
    $mod->setDefaultCV("reserved", "mysql_name", "manuadmin");
    
    
    
    
    $mod->registerEvent("playerJoined", "reservedslots_main");
    
    
    
    
    function reservedslots_main($guid){
        global $players;
        global $mod;
        if(!mysql_link()){return;}
        //Determine if server setting is an odd number, it has to be in order to work correctly.
        if($odd = $mod->getCV("reserved", "slots")%2){
            $logging->write(MOD_WARNING, "Reserved slots mod disabled, you musth have an odd number of slots in your server.");
            return;
        }
        //If server is not full, then don't to anything.
        if(count($players) < $mod->getCV("reserved", "slots")){
            return;
        }
        //If server is full -> gotta kick someone.
        if(count($players) >= $mod->getCV("reserved", "slots")){
            //Get Safe GUID's from database
            while($hashes = mysql_query("SELECT * FROM reserved WHERE expire > '".time()."' AND enabled = '1'")){
                $safe[$hashes['hash']] = 1;
            }
            //Determine if new user is a reserved slot member.
            if($safe[$guid] || $players[$guid]->isProtected()){
                openslot($safe,$guid);
                return
            }else{
                $players[$guid]->kick($mod->getCV("reserved", "reason_serverfull"));
            }
        }
        mysql_close();    
    }
    
    
    
    
    function mysql_link(){
        global $mod;
        $db = mysql_connect($mod->getCV("reserved", "mysql_host"),$mod->getCV("reserved", "mysql_user"),$mod->getCV("reserved", "mysql_pass")) or $logging->write(MOD_WARNING, "Could not connect to database, reserved slot mod failed.");
        $db1 = mysql_select_db($mod->getCV("reserved", "mysql_name")) or $logging->write(MOD_WARNING, "Could not select database, reserved slot mod failed.");
        if($db && $db1){
            return true;
        }else{
            return false;
        }
    }
    
    
    
    
    function open_slot($safe,$guid){
        global $players;
        global $mod;
        //Get the player info of the player that can be kicked.
        $kicker = find_slot($safe);
        if(!$kicker){
            //If no information is provided, kick the player who just joined, regardless of reserved slot status.
            $player = $players[$guid]->getName();
            $logging->write(MOD_NOTICE, "Player $player has been removed because the server is full of reserved slots.");
            $players[$guid]->kick($mod->getCV("reserved", "reason_serverfull"));
            return;
        }else{
            //If information is provided, kick the person who is given.
            $player = $players[$kicker["guid"]]->getName();
            $new = $player[$guid]->getName();
            $logging->write(MOD_NOTICE, "Player \"$player\" has been removed because a reserved slot member \"$new\" joined.");
            $player[$kicker["guid"]]->kick($mod->getCV("reserved", "reason_reserverd"));
            $search = array("<JOINED_PLAYER>","<KICKED_PLAYER>");
            $replace = array($player,$new);
            $mod->rconSay(str_replace($search,$replace,$mod->getCV("reserved", "msg_reserved")));
            return $player;
        }    
    }
    
    
    
    
    function find_slot($safe){
        global $mod;
        global $players;
        $playerlist = $mod->rconPlayerList();
    
        foreach($playerlist as $player){
            //If the user is not in the safe list, add them to the kickable list.
            if(!$safe[$player["guid"]]){
                $kickable[] = $player;
                $scores[] = $player["score"];
            }
        }
        //If nobody in the server is kickable it is now officially full, return false.
        if(!$kickable){
            return false;
        }
        foreach($kickable as $player){
            //If score is not below 0 or ping above 300 remove them from the list.
            if($player["score"] < 0 || $player["ping"] > 300){
                $kickers[] = $player;
                $score[] = $player["score"];
            }
        }
        //If nobody is left you have to go back to the other list
        if(!$kickers){
            asort($scores);
            foreach($scores as $playerid => $score){
                //Return the person with the lowest score out of the kickable people.
                return $kickers[$playerid];
            }    
        }else{
            asort($score);
            foreach($score as $playerid => $score){
                //Return the person with the lowest score out of the kickable people.
                return $kickable[$playerid];
            }
        }
    }
    ?>
    Alles anzeigen

    The MySQL table that it uses:

    SQL
    CREATE TABLE IF NOT EXISTS `reserved` (
      `hash` varchar(32) NOT NULL,
      `expires` int(10) NOT NULL,
      `created` int(10) NOT NULL,
      `donamount` varchar(5) NOT NULL,
      `enabled` tinyint(2) NOT NULL,
      KEY `hash` (`hash`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    Anybody that knows what they are doing better than I do (which is most of you), please tell me if this will work, and if it's safe to use on a server.

  • Need help

    • jchamb2010
    • 4. Juli 2009 um 17:42

    Is there a way to determine who the last person to join the server is? I'm asking because I'd like to make a reserved slot plugin, and It needs to know who the last player to join the server is.

    Thanks.

  • MAM installation requirements?

    • jchamb2010
    • 4. Juli 2009 um 17:39

    ahh ok, I just can't use SQLite, my server just doesn't like it, no matter what i do, or how i configure my server, it just doesn't let SQLite work... so mysql was the only option.

  • fun message when a headshot was made

    • jchamb2010
    • 4. Juli 2009 um 17:15

    Ok, i didn't know modifying core files would make u lose support. I've restored all of my files, do you have a tutorial on how to make plugins?

    Also can you upload that rar, as a zip, because I'm using a Linux server for this and I can't unzip rars ;( so I have to constantly download on my windows comp unzip the rar, and then put the files on a flash drive; which is extremely inconveinent.

  • fun message when a headshot was made

    • jchamb2010
    • 3. Juli 2009 um 22:13

    Yes I've actually done this with Nutshots, I don't see why you couldn't do it for Headshots, or Falling...

    However I do not mod mods very well, especially ones that are made sorta confusing (I've only been using this for like 3 days now, so it could just be me), but I'll attatch the file, and explain what to change if you want either of these, or both to happen, however I have yet to figure out how to be able to add things to the config, so your going to have to edit class files, If you are not comfortable doing this I suggest you stop reading :)

    FOR HEADSHOT MESSAGE

    Open adminmod/classes/mod.class.php
    FIND: Around Line 680

    PHP
    if ($killer_guid != "" && !array_key_exists($killer_guid, $this->players)) {
    			$this->logging->write(MOD_WARNING, "DEATH by player '$killer_name' who is actually not on the server: PID: $killer_pid, GUID: $killer_guid");
    			return;
    		}


    ADD BELOW

    PHP
    $killfind = array("<KILLER_NAME>",
    						  "<VICTIM_NAME>",);
    		$killreplace = array($killer_name,
    							 $victim_name,);
    	    if($image == "MOD_HEAD_SHOT"){
    			$message = "Change this to your will"; //You may use variables <KILLER_NAME> and <VICTIM_NAME>
    			$parsed = str_replace($killfind,$killreplace,$message);
    			$mod->rconSay($parsed);
    		}


    Save + Upload adminmod/classes/mod.class.php


    This will send a the message that is set by the variable $message (which should be in bold above) when a person gets a head shot, you may edit this however you want, but you can not use double quotes (") anywhere in the message, and you must surround the message with double quotes ("). You may use the variables <KILLER_NAME> to show the killers name, and <VICTIM_NAME> to show the victim's name.

    FOR FALLING MESSAGE

    Open adminmod/classes/mod.class.php
    FIND: Around Line 680

    PHP
    if ($killer_guid != "" && !array_key_exists($killer_guid, $this->players)) {
    			$this->logging->write(MOD_WARNING, "DEATH by player '$killer_name' who is actually not on the server: PID: $killer_pid, GUID: $killer_guid");
    			return;
    		}

    ADD BELOW

    PHP
    $killfind = array("<VICTIM_NAME>",);
    		$killreplace = array($victim_name,);
    	    if($image == "MOD_FALLING"){
    			$message = "Change this to your will"; //You may use variable <VICTIM_NAME>
    			$parsed = str_replace($killfind,$killreplace,$message);
    			$mod->rconSay($parsed);
    		}


    Save + Upload adminmod/classes/mod.class.php

    This will send a the message that is set by the variable $message (which should be in bold above) when a person gets a falls to their death, you may edit this however you want, but you can not use double quotes (") anywhere in the message, and you must surround the message with double quotes ("). You may use the variable <VICTIM_NAME> to show the victim's name, however because there is no killer, you may NOT use <KILLER_NAME>.

    Hope this helps,
    Jchamb2010

  • MAM installation requirements?

    • jchamb2010
    • 3. Juli 2009 um 21:13

    Actually I have modified the Statistics.php file to make it compatable with MySQL, so if anybody wants to use MySQL instead of SQLite (I was having issues with SQLite personally), I'd be more than happy to provide the modified file (if it's ok with Manu that is) :)

  • Interested? A game server provider that installs MAM

    • jchamb2010
    • 3. Juli 2009 um 21:03
    Zitat von GrossKopf

    MAM has to run on the game server. You need remote desktop access. Since most COD 4/5 admins rent their servers, they can't run MAM because they don't get remote access. This would allow bring more users to MAM.

    Actually Gross (btw this is shotgun202 from your site), you do not need to have Remote Desktop Access... you only need a computer (perhaps an old one that is hanging around your house), that you can run two programs on, one that is written in perl that is called FTPTAIL, and the other is PHP. Using both of these programs together on any computer will allow you to use this mod on any COD4 server, just so long as you have FTP access to the server.

    Here's why:

    What ftptail does it downloads only the last few lines of a file on an FTP server (which uses amazingly little bandwidth), allowing you to basically stream your rented game servers games_mp.log file to your desktop, once it is there, you can then tell manu-admin-mod to look for the file on your computer, rather than on the remote server.

    I also think that Manu-Admin-Mod has a built in FTP feature now, but I trust FTPtail better :).

    This setup has only been tested on a Linux based computer at my house, using a WolfServers game server (which I know is what you are talking about), The commands are almost instant (maybe a 1-2 second delay), and extremely reliable FTPtail only fails like once every 5 days and I'd be willing to create a daemon for it so that it just restarted if it crashed, if anybody else is intereste.

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