versuchst du andere Admins zu bannen?
Beiträge von Mirko911
-
-
try to replace the randommapcycle.php file with this one:
PHP: plugins/randommapcycle/randommapcycle.php
Alles anzeigen<?php /** * GSManager * * This is a mighty and platform independent software for administrating game servers of various kinds. * If you need help with installing or using this software, please visit our website at: www.gsmanager.de * If you have licensing enquiries e.g. related to commercial use, please contact us at: sales@gsmanager.de * * @copyright Greenfield Concept UG (haftungsbeschränkt) * @license GSManager EULA <https://www.gsmanager.de/eula.php> * @version 1.2.2 **/ namespace GSM\Plugins\Randommapcycle; use GSM\Daemon\Core\Utils; /** * randommapcycle Class * * The randommapcycle plugin * */ class RandomMapCycle extends Utils { /** * Maps * * @var array $maps Maps */ private $maps = array(); /** * lastmaps * * @var array $lastmaps the last maps */ private $lastmaps = array(); /** * Chosen * * @var array $chosen */ private $chosen = array(); /** * Start * * @var int $start */ private $start = 0; /** * last announce * * @var int $lastannounce */ private $lastAnnounce = 0; /** * vote in progress * * @var boolean $voteinprogress */ private $voteinprogress = false; /** * Skips * * @var array $skips */ private $skips = array(); /** * Gametypes * * @var array $gametypes */ private $gametypes = array(); /** * Voters * * @var array $voters */ private $voters = array(); /** * Votes * * @var array $votes */ private $votes = array(); private $job_id; /** * Inits the plugin * * This function initiates the plugin. This means that it register commands * default values, and events. It's important that every plugin has this function * Otherwise the plugin exists but can't be used */ public function initPlugin() { parent::initPlugin(); $this->config->setDefault('randommapcycle', 'enabled', true); $this->config->setDefault('randommapcycle', 'type', 2); $this->config->setDefault('randommapcycle', 'mapcount', 3); $this->config->setDefault('randommapcycle', 'duration', 300); $this->config->setDefault('randommapcycle', 'interval', 90); $this->config->setDefault('randommapcycle', 'maps', array('*')); $this->config->setDefault('randommapcycle', 'gametypes', array('*')); $this->config->setDefault('randommapcycle', 'ignorepriorgametype', true); $this->config->setDefault('randommapcycle', 'ignorepriormaps', 3); $this->config->setDefault('randommapcycle', 'skipquorum', '50%'); $this->config->setDefault('randommapcycle', 'skipvoting', false); } /** * Function to enable this plugin */ public function enable() { parent::enable(); $this->events->register('nextMap', [$this, 'eventNextMap']); /* Fix if the vote command isn't enabled */ if ($this->commands->getCommand('vote') === false) { $this->commands->register('vote', false, [$this]); } $this->commands->registerSubCommand('vote', 'choice', '~choice \d+~i', [$this, 'commandVmap']); $this->commands->registerSubCommand('vote', 'skip', false, [$this, 'commandSkip']); $this->readConfig(); list($this->lastmaps[]) = $this->mod->getLastMaps(1); $this->eventNextMap(); } /** * Function to disable this plugin */ public function disable() { parent::disable(); $this->events->unregister('nextMap', [$this, 'eventNextMap']); $this->commands->unregisterSubCommand('vote', 'choice'); $this->commands->unregisterSubCommand('vote', 'skip'); } /** * executes the readConfig event. */ private function readConfig() { $this->maps = array(); $allowed_maps = $this->config->get('randommapcycle', 'maps'); if (is_array($allowed_maps) && isset($allowed_maps[0]) && $allowed_maps[0] == '*') { $this->maps = $this->mod->getMaps(); } elseif (is_array($allowed_maps)) { $this->maps = $allowed_maps; } $allowed_gametypes = $this->config->get('randommapcycle', 'gametypes'); if (is_array($allowed_gametypes) && isset($allowed_gametypes[0]) && $allowed_gametypes[0] == '*') { $this->gametypes = $this->mod->getGametypes(); } elseif (is_array($allowed_gametypes)) { $this->gametypes = $allowed_gametypes; } } /** * executes the nextMap event. */ public function eventNextMap() { $this->readConfig(); $lastmaps = $this->mod->getLastMaps(2); if ($lastmaps[1] == $lastmaps[0]) { return; } $this->lastmaps[] = $lastmaps[0]; $this->voteinprogress = false; $last_map_count = count($this->lastmaps); /** Shift to old entrys */ while ($last_map_count > $this->config->get('randommapcycle', 'ignorepriormaps')) { array_shift($this->lastmaps); } $this->lastmaps = array_merge($this->lastmaps); if ($this->config->get('randommapcycle', 'type') == 2) { $this->logging->debug("[Random MapCycle] Random map set."); $this->jobs->addSingleJob(20, array($this, "setRandomMap")); } if ($this->config->get('randommapcycle', 'type') == 1) { $this->jobs->addSingleJob(20, array($this, "startVote")); } } /** * announce if the vote is possible to skip. */ public function setRandomMap() { $this->readConfig(); $this->chooseMap(1); if (empty($this->chosen)) { return false; } $this->rcon->rconSetNextMap($this->chosen[0]['map'], $this->chosen[0]['gametype'], false); $this->skips = array(); if ($this->config->get('randommapcycle', 'skipvoting')) { $this->announceSkipMessage(); } } /** * the message on the server for the skip vote. */ public function announceSkipMessage() { $this->rcon->rconSay($this->language->get('randommapcycle.voteforskip', array('<MAP>', '<GAMETYPE>'), array($this->mod->getLongMapName($this->chosen[0]['map']), $this->mod->getLongGametype($this->chosen[0]['gametype'])))); $this->job_id = $this->jobs->addSingleJob($this->config->get('randommapcycle', 'interval'), array($this, 'announceSkipMessage')); } /** * execztes the command skip. * * @param string $guid Guid of executing player * @param string[] $parameters The chatline splitted by " " without !command */ public function commandSkip($guid, $parameters) { if ($this->config->get('randommapcycle', 'type') != 2 || !$this->config->get('randommapcycle', 'skipvoting')) { return; } if (in_array($guid, $this->skips)) { $this->players[$guid]->say($this->language->get('randommapcycle.alreadyvoted')); } else { $this->skips[] = $guid; if (substr(trim($this->config->get('randommapcycle', 'skipquorum')), -1) == '%') { $needed = round(((int) $this->config->get('randommapcycle', 'skipquorum')) / 100 * count($this->players)); } else { $needed = (int) $this->config->get('randommapcycle', 'skipquorum'); } $skippers = count($this->skips); $search = array('<SKIPPERS>', '<NEEDED>', '<MAP>', '<GAMETYPE>'); $replace = array($skippers, $needed, $this->mod->getLongMapName($this->chosen[0]['map']), $this->mod->getLongGametype($this->chosen[0]['gametype'])); $say = $this->language->get('randommapcycle.votedskip', $search, $replace); $this->rcon->rconSay($say); if ($skippers >= $needed) { $this->jobs->deleteJob($this->job_id); $this->setRandomMap(); } } } /** * choose a map * * @param int $count */ private function chooseMap($count) { $maps = $this->maps; $gametypes = $this->gametypes; foreach ($maps as $key => $value) { if (in_array($value, $this->lastmaps)) { unset($maps[$key]); } } if ($this->config->get('randommapcycle', 'ignorepriorgametype')) { $current = $this->mod->getCurrentGametype(); foreach ($gametypes as $key => $value) { if ($value == $current) { unset($gametypes[$key]); } } } $gametypes = array_merge($gametypes); if (count($gametypes) == 0) { $gametypes[0] = $this->mod->getCurrentGametype(); } if (count($maps) < $count) { /* @todo logmarker */ $this->logging->warning("[Random MapCycle] Couldn't choose a random map because count(maps) < $count"); return false; } $this->chosen = array(); for ($i = 1; $i <= $count; $i++) { $maps = array_merge($maps); $rand = rand(0, count($maps) - 1); if ($this->mod->getEngine() == 'frostbite3') { // $this->rcon->getMaps()->clear(); $map_gametypes = $this->rcon->getMaps()->getAllowedGametypesOnMap($maps[$rand]); foreach ($gametypes as $key => $value) { if (!in_array($value, $map_gametypes)) { unset($gametypes[$key]); } } $gametypes = array_merge($gametypes); } $rand2 = rand(0, count($gametypes) - 1); $this->chosen[] = array('map' => $maps[$rand], 'gametype' => $gametypes[$rand2]); unset($maps[$rand]); } return true; } /** * Ends a Vote */ public function endVote() { $this->voteinprogress = false; arsort($this->votes); reset($this->votes); $won = key($this->votes); $this->rcon->rconSay($this->language->get('randommapcycle.wonvote', array('<MAP>', '<GAMETYPE>'), array($this->mod->getLongMapName($this->chosen[$won]['map']), $this->mod->getLongGametype($this->chosen[$won]['gametype'])))); $this->rcon->rconSetNextMap($this->chosen[$won]['map'], $this->chosen[$won]['gametype'], false); $this->jobs->deleteJob($this->job_id); } /** * Starts a Vote */ public function startVote() { $this->chooseMap($this->config->get('randommapcycle', 'mapcount')); $this->start = time(); $this->voteinprogress = true; $this->votes = array_fill(0, $this->config->get('randommapcycle', 'mapcount'), 0); $this->voters = array(); $this->announceVote(); $this->jobs->addSingleJob($this->config->get('randommapcycle', 'duration'), array($this, "endVote")); } /** * Announces a Vote */ public function announceVote() { $mapstr = array(); foreach ($this->chosen as $id => $map) { $mapstr[] = $this->language->get('randommapcycle.list', array('<ID>', '<MAP>', '<GAMETYPE>'), array($id + 1, $this->mod->getLongMapName($map['map']), $this->mod->getLongGametype($map['gametype']))); } $mapstr = implode("\n", $mapstr); $this->rcon->rconSay($this->language->get('randommapcycle.voteformap') . "\n" . $mapstr); $this->job_id = $this->jobs->addSingleJob($this->config->get('randommapcycle', 'interval'), array($this, "announceVote")); } /** * executes the command vmap * * Example: !vmap 1-3 * * @param string $guid Guid of executing player * @param string[] $parameters The chatline splitted by " " without !command */ public function commandVmap($guid, $parameters) { if ($this->config->get('randommapcycle', 'type') != 1) { return; } if (!$this->voteinprogress) { return; } //-1 because we start with 1 but count array with 0 $map = $parameters[0] - 1; if (!array_key_exists($map, $this->chosen)) { return; } if (in_array($guid, $this->voters)) { return; } $this->voters[] = $guid; $this->votes[$map] ++; $str = $this->language->get('randommapcycle.voted', array('<MAP>', '<GAMETYPE>'), array($this->mod->getLongMapName($this->chosen[$map]['map']), $this->mod->getLongGametype($this->chosen[$map]['gametype']))); $this->players[$guid]->say($str); } }
-
I'll check this when I'm at home
-
Irgendwelche Mods installiert?
er meint CoD4 Mods wie Deathrun, Promod, Codjumper, etc.
Durch Mods ändert sich der Pfad zur Logdatei, aber wenn der GSM erst nach ein paar Maps diesen Fehler bringt ist es komisch.
Kannst du den Fehler evtl noch etwas näher eingrenzen? Kommt er erst nach x Minuten oder hängt das an der Anzahl der Mapchanges?
[17.06.18 20:35:07] Info: Automatic Message was sent:
[17.06.18 20:37:07] Info: Automatic Message was sent:
[17.06.18 20:39:07] Info: Automatic Message was sent:
[17.06.18 20:41:07] Info: Automatic Message was sent: )
der Part wundert mich etwas. Habt ihr dort die Nachrichten geändert?
-
you could use my chatlog plugin and modify the php file
https://gitlab.mirko-rosenthal.info/gsm-plugins/chatlog
just add
<PLAYER_PBGUID>
and
$this->players[$guid]->getPBGuid()
-
change this line
%PHP% -f gsm.php -- -game %GAME% -cfgdir %CFGDIR% -logdir %LOGDIR%
to this
%PHP% -f gsm.php -- -game %GAME% -cfgdir %CFGDIR% -logdir %LOGDIR% -debug 127
in the gsm.bat
-
can you post the full gsm log?
-
The only thing we "spam" is the "New Version available" Notification each 15 Minutes.
And you can disable the rconSay Message for it via config in the daemon section (updatecheck = false)
-
also mir fällt momentan dazu keine Lösung ein. Hab momentan leider kein CoD4 installiert um es selber zu testen und es lohnt sich auch leider bis Anfang nächster Woche nicht, da ich mir einen neuen Rechner gegönnt habe und über Ostern das OS neu aufsetzen wollte
-
"fastrcon": false,
steht bei dir immer noch auf false, oder?
-
kannst du mal im CoD4 Server shortversion eingeben und mir den Output senden?
-
Ist das eigentlich gewollt, dass bei scream jetzt nur einer kommt?
Du solltest eigentlich 9 Nachrichten sehen
PHP
Alles anzeigen/** * Screams a message 9 times on the server * * @param String $guid Guid of executing player * @param String $params Additional parameters */ public function scream($guid, $params) { $msg = implode(" ", $params); $this->mod->findReason($msg); $msg = (strlen($msg) > 100) ? substr($msg, 0, 100) : $msg; for ($i = 0; $i <= 9; $i ++) { $this->rcon->rconSay("^$i$msg"); } }
-
Das ich 1.2.2 nicht nutzen kann, stört mich nicht sonderlich. Ich hab jetzt einfach in der daemon.php die Versionsnummer geändert, damit ich nicht immer die update-Nachricht bekomme^^
Das sollte eigentlich nicht die Lösung sein ;-). Am Code für das finden der Game Server logs ("auto") haben wir auch sehr lange nichts mehr geändert. Wenn es mit 1.2.1 funktioniert, dann sollte das auch mit 1.2.2 gehen.
Das "auto" Feature funktioniert in Windows oft nicht, da die fs_homepath und fs_basepath dvars oft nicht gesetzt sind. Ansonsten würde mir aber kein Grund einfallen, warum es mit einem richtigen Pfad in der 1.2.1 geht und in der 1.2.2 nicht.
Kannst du mir deine gsm.cfg, die Logfile vom GSM und den Quake Part aus der basics.json schicken?
-
can you check if the mysql connection works over the console? Maybe it's a permission problem in the database?
-
Wie hast du es geschafft das DevKit Plugin zu bekommen? Das sollte seit gefühlt 3 Versionen nicht mehr dabei sein.
Viele commands werden nicht richtig verarbeiten und er stürzt bei bestimmten Szenarien einfach ab;
ich würde mich freuen, wenn du mir mehr dazu schreiben könntest. Der GSManager läuft auf meinen Servern teils mehrere Monate ohne Crash
-
"databasetype": "mysqli",
replace the mysqli with mysql
-
also ich könnte mal per Teamviewer drüber schauen, wenn das für dich ok wäre
-
[10.02.18 14:28:22] Debug: Rcon Input: say Welcome Player Nizar from Palestine. (1 Visits)
mit dem Server scheint es ja nun zu funktionieren
-
Hi,
habe eben mal einen Query auf deinen Server gemacht
Zitat\_Location\Germany\_Website\http://www.shooter-szene.de\g_compassShowEnemies\0\g_gametype\war\gamename\Call of Duty 4\mapname\mp_farm\protocol\6\shortversion\1.7\sv_allowAnonymous\0\sv_disableClientConsole\0\sv_floodprotect\1\sv_hostname\Testserver\sv_maxclients\20\sv_maxPing\350\sv_maxRate\20000\sv_minPing\0\sv_privateClients\0\sv_punkbuster\0\sv_pure\1\sv_voice\0\ui_maxclients\32\pswrd\0\mod\0
selbst der Server Query gibt an, dass auf dem Server kein PB läuft.
Wenn Commands und Events am Server nicht ausgeführt werden kann das 2 Gründe haben:
1) Server und Port sind vertauscht. So kann es bei mehreren Servern vorkommen, dass du z.B per Rcon auf dem richtigen Server bist, aber die falsche games_mp.log ausliest.
2) Es wird nicht richtig in die Games_mp.log geschrieben. Die games_mp.log, die du ein paar Posts vorher angehangen hast enthält keine Join, Quit, Say oder Kill Logs. Dafür hat dieser aber Punkbuster aktiviert. Der Server auf dem du dich mit Rcon Verbindest hat kein PB aktiviert. Laufen evtl 2 Test Server?
-
sagt GSM das ich enabled setzten soll!
Punkbuster ist nicht verpflichtend für den GSM. Das PB Plugin liefert nur einige zusätzliche Commands sowie die möglichkeit über Punkbuster zu kicken.
+set net_ip 213.202.228.167 +set net_port 28990 +set loc_language 2 +exec last.cfg +map_rotate +set sv_punkbuster 1 +pb_sv_enabled
setz dein sv_punkbuster mal vor das +exec last.cfg +map_rotate