View unanswered posts | View active topics
Author |
Message |
wurst
|
Posted: 09.30.12 |
|
|
Godlike |
|
Joined: 07.15.08 Posts: 4648 Location: Behind U
-----tdm:
nick: [dswp]GewitterOma
skill: 1122.83
kills: 25960
deaths: 19847
ratio: 1.30
-----bomb:
nick: [dswp]GewitterOma
skill: 812.172
kills: 3885
deaths: 3541
ratio: 1.09
|
@mapcycle(s) one thing cant never be beaten easily: q3 dont accept multiple occourrences of the same map within 1 file. this means running a *non-weighted playlist* the first map in the 2 lists will be played unbelievable often, some days i go and re-sort maps manually. the lines in the mapcycle files are php-shuffeled... thats the way it runs: Code: <?php// (c) 2012 Blinkymysql_connect("333.444.555.666", "user", "***") or die("sql verbindung gescheitert"); mysql_select_db("dbname"); $votesettings = mysql_query("SELECT nextvote,intervall,reg,cus FROM map_vote_admin LIMIT 0, 1"); $settings = mysql_fetch_row($votesettings); $nextcycdate = $settings[0]; $cycleinterval = $settings[1]; $numberreg = $settings[2]; $numbercus = $settings[3]; $totalvotes = "0"; $todaysdate = date("Y-m-d"); // Datum ueberpfuefen ...if ($nextcycdate == $todaysdate) {// infos zum neuen cycle$nextregmaps = mysql_query("SELECT name,votes FROM map_vote_maps WHERE reg='1' && votes!='0' && size<'3' ORDER BY votes DESC LIMIT 0, $numberreg"); $nextregnumber = mysql_num_rows($nextregmaps); $nextcusmaps = mysql_query("SELECT name,votes FROM map_vote_maps WHERE reg='0' && votes!='0' && size<'3' ORDER BY votes DESC LIMIT 0, $numbercus"); $nextcusnumber = mysql_num_rows($nextcusmaps); $usersvoted = mysql_query("SELECT voted_for_maps FROM phpbb_users WHERE voted_for_maps='1'"); $usersvotednumber = mysql_num_rows($usersvoted); $totalmapvotes = mysql_query("SELECT votes FROM map_vote_maps WHERE votes!='0' && size<'3'"); if (mysql_num_rows($totalmapvotes) != "0") { while ($mapvotes = mysql_fetch_row($totalmapvotes)) { $totalvotes = $totalvotes + $mapvotes[0]; }}if ($nextregnumber == "0" && $nextcusnumber == "0") die("keine votes in der datenbank"); ////////////$nextregmaps2 = mysql_query("SELECT name,votes FROM map_vote_maps WHERE reg='1' && votes!='0' && size>'1' ORDER BY votes DESC LIMIT 0, $numberreg"); $nextregnumber2 = mysql_num_rows($nextregmaps2); $nextcusmaps2 = mysql_query("SELECT name,votes FROM map_vote_maps WHERE reg='0' && votes!='0' && size>'1' ORDER BY votes DESC LIMIT 0, $numbercus"); $nextcusnumber2 = mysql_num_rows($nextcusmaps2); $usersvoted2 = mysql_query("SELECT voted_for_maps FROM phpbb_users WHERE voted_for_maps='1'"); $usersvotednumber2 = mysql_num_rows($usersvoted2); $totalmapvotes2 = mysql_query("SELECT votes FROM map_vote_maps WHERE votes!='0' && size>'1'"); if (mysql_num_rows($totalmapvotes2) != "0") { while ($mapvotes2 = mysql_fetch_row($totalmapvotes2)) { $totalvotes2 = $totalvotes2 + $mapvotes2[0]; }}if ($nextregnumber2 == "0" && $nextcusnumber2 == "0") die("keine votes in der datenbank"); // mapcycle_arrays erstellen$mapcycle_array = array(); $votes_array = array(); if ($nextregnumber != "0") { while ($nextregs = mysql_fetch_row($nextregmaps)) { $mapcycle_array[] = $nextregs[0]; $votes_array[] = $nextregs[1]; }}if ($nextcusnumber != "0") { while ($nextcuss = mysql_fetch_row($nextcusmaps)) { $mapcycle_array[] = $nextcuss[0]; $votes_array[] = $nextcuss[1]; }}////////////$mapcycle_array2 = array(); $votes_array2 = array(); if ($nextregnumber2 != "0") { while ($nextregs2 = mysql_fetch_row($nextregmaps2)) { $mapcycle_array2[] = $nextregs2[0]; $votes_array2[] = $nextregs2[1]; }}if ($nextcusnumber2 != "0") { while ($nextcuss2 = mysql_fetch_row($nextcusmaps2)) { $mapcycle_array2[] = $nextcuss2[0]; $votes_array2[] = $nextcuss2[1]; }}// mapcycle_array shuffelnshuffle($mapcycle_array); ////////////shuffle($mapcycle_array2); // neue mapcycle.temp.txt anlegenif (file_exists("mapcycle.temp.txt")) unlink("mapcycle.temp.txt"); $file = fopen("mapcycle.temp.txt", "a"); for ($i = 0; $i<count ($mapcycle_array); $i++ ) { fputs($file, $mapcycle_array[$i]); if ($i < (count($mapcycle_array) - 1)) fputs($file, "\n"); }fclose($file); ////////////if (file_exists("mapcycle2.temp.txt")) unlink("mapcycle2.temp.txt"); $file2 = fopen("mapcycle2.temp.txt", "a"); for ($i = 0; $i<count ($mapcycle_array2); $i++ ) { fputs($file2, $mapcycle_array2[$i]); if ($i < (count($mapcycle_array2) - 1)) fputs($file2, "\n"); }fclose($file2); // file uppen$conn_id = ftp_connect("666.555.444.333"); $login_result = ftp_login($conn_id, "user", "***"); if ((! $conn_id) || (! $login_result)) die("ftp verbindung gescheitert"); ftp_delete($conn_id, "mapcycle.old.txt"); ftp_rename($conn_id, "mapcycle.txt", "mapcycle.old.txt"); ////////////ftp_delete($conn_id, "mapcycle2.old.txt"); ftp_rename($conn_id, "mapcycle2.txt", "mapcycle2.old.txt"); $upload = ftp_put($conn_id, "mapcycle.txt", "mapcycle.temp.txt", FTP_ASCII ); if (! $upload) { ftp_close($conn_id); die("upload gescheitert"); }////////////$upload = ftp_put($conn_id, "mapcycle2.txt", "mapcycle2.temp.txt", FTP_ASCII ); if (! $upload) { ftp_close($conn_id); die("upload gescheitert"); }ftp_close($conn_id); ////////////// db stuff// cycle in db eintragenmysql_query("INSERT INTO map_vote_cycles (allvotes,electors) VALUES ('$totalvotes','$usersvotednumber')"); // map_voted for users auf 0mysql_query("UPDATE phpbb_users SET voted_for_maps='0'"); // map_vote_maps votes auf 0mysql_query("UPDATE map_vote_maps SET votes='0'"); // neuen termin festlegen$nextcycdatearray = explode("-", $nextcycdate); $nextcycdateime = mktime(0, 0, 0, $nextcycdatearray[1], $nextcycdatearray[2], $nextcycdatearray[0]); $newnextcycdatetime = $nextcycdateime + ($cycleinterval* 7* 24* 60* 60); $newnextcycdate = date("Y-m-d", $newnextcycdatetime); mysql_query("UPDATE map_vote_admin SET nextvote='$newnextcycdate'"); // server restart//$fp = fsockopen('udp://192.168.9.1', 22222, $errno, $error, 1); //fwrite($fp, "\xFF\xFF\xFF\xFFrcon *** exec server.cfg\x00");// post a new topic, post, edit forums$small_cycle = file_get_contents('mapcycle.temp.txt'); $big_cycle = file_get_contents('mapcycle2.temp.txt'); $new_cyc_time = time(); // new postmysql_query("INSERT INTO phpbb_posts (forum_id,poster_id,post_time,post_subject,post_text,bbcode_bitfield,bbcode_uid) VALUES ('29','857','$new_cyc_time','MapCycle from $todaysdate','small cycle:\[code:ua744a8e\]$small_cycle\[/code:ua744a8e\]big cycle:\[code:ua744a8e\]$big_cycle\[/code:ua744a8e\]', 'AIA=','ua744a8e')"); $cyc_postid = mysql_insert_id(); // new topicmysql_query("INSERT INTO phpbb_topics (forum_id,topic_title,topic_poster,topic_time,topic_first_post_id, topic_first_poster_name,topic_first_poster_colour,topic_last_post_id,topic_last_poster_id,topic_last_poster_name, topic_last_poster_colour,topic_last_post_subject,topic_last_post_time) VALUES ('29','MapCycle from $todaysdate','857','$new_cyc_time','$cyc_postid','MapCycle [Cron]','9E8DA7', '$cyc_postid','857','MapCycle [Cron]','9E8DA7','MapCycle from $todaysdate','$new_cyc_time')"); $cyc_topicid = mysql_insert_id(); // topic_id into postmysql_query("UPDATE phpbb_posts SET topic_id=$cyc_topicid WHERE post_id=$cyc_postid"); // edit forummysql_query("UPDATE phpbb_forums SET forum_posts=forum_posts+1,forum_topics=forum_topics+1, forum_topics_real=forum_topics_real+1,forum_last_post_id='$cyc_postid',forum_last_poster_id='867', forum_last_post_subject='MapCycle from $todaysdate',forum_last_post_time='$new_cyc_time', forum_last_poster_name='MapCycle [Cron]',forum_last_poster_colour='9E8DA7' WHERE forum_id='29'"); // +1 post for botmysql_query("UPDATE phpbb_users SET user_posts=user_posts+1 WHERE user_id=857"); }?>
_________________
|
|
Top |
|
|
natirips
|
Posted: 10.01.12 |
|
|
[dswp]R.Stallman |
|
Joined: 04.13.09 Posts: 2946 Location: Solar System/≈Zagreb
-----tdm:
nick: [ntr]Shortly
skill: 497.05
kills: 3446
deaths: 4411
ratio: 0.78
-----bomb:
nick: [ntr]Shortly
skill: 707.602
kills: 526
deaths: 863
ratio: 0.60
|
Since you're shuffling it anyway, how about shuffling the mapcycle every time it changes from big to small or vice versa? Could you instruct b3 to run something like this every time it switched to small cycle? Code: shuf /path/to/bigmapcycle.txt -o /path/to/bigmapcycle.txt (this is gnu/linux code; I hope Python has something like C's "system()" call so it can run an external system command) Also, you would have to run the opposite when it switches to the big cycle. Edit: the serwer is running GNU/Linux nowdays right?
_________________ ssh natirips@*.255.255.255 sudo chown -R natirips / \; echo Also, »QUESTION EVERYTHING«
|
|
Top |
|
|
Cookie
|
Posted: 10.01.12 |
|
|
Godlike |
|
Joined: 08.27.09 Posts: 746 Location: Zagreb, Croatia
-----tdm:
nick: Zombie
skill: 1153.35
kills: 2521
deaths: 1384
ratio: 1.82
-----bomb:
nick: Zombie
skill: 799.915
kills: 649
deaths: 361
ratio: 1.79
|
actually, there was talk about this already, and we were talking about moving up the mapcycle so each map in the mapcycle will be at one point 1st map in the cycle. this can be done with just sticking the maplist from the txt file into an array and just pushing the 1st element in hte array to be the last. this way all the maps are 1st sequentally so you dont cycle 2-3 maps all the time.
_________________ <- got this from JRandomNoob
|
|
Top |
|
|
SvaRoX
|
Posted: 10.01.12 |
|
|
Leader |
|
Joined: 11.29.08 Posts: 1972
|
The B3 plugin I talked about is said to remember the nextmap in the mapcycle, and as soon at the next map starts, forces g_nextmap with the stored map name. It should solve the custom map bug. To solve the small/big mapcycle switching bug, we could shuffle it before sending it to the server like you said -> the adjustrotation() function of poweradminurt.py needs to be modified in that case. Unless we try something more custom...
_________________ ut4_he_tennis_v0.1------------------------- "We are talking about computers here, compared to those I can read women like a book ;P" Unclefragger
|
|
Top |
|
|
Who is online |
Users browsing this forum: No registered users and 36 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|
voice server |
|
|
|
top 20 players
name | skill | kills |
---|
-Dws.BLINGBLING*-* | 1730.63 | 418631 | NormaSnockers | 1865.75 | 400492 | Zottel | 1760.8 | 276378 | make.them.suffer | 1846.17 | 269872 | >8v= | 1825.35 | 230156 | moon | 1777.56 | 195615 | sjas | 1692.49 | 192315 | peace | 1878.86 | 190660 | Wagner_Moura | 1562.9 | 188001 | Goomba | 1859.75 | 182677 | z0rn | 1608.41 | 181016 | Mad | 1803.76 | 179124 | [dswp]PLZ | 1847.85 | 178516 | Graf_ZahlIII | 1835.73 | 167407 | Zohan | 1611.07 | 159737 | ubercunt | 1634.93 | 159240 | Yarrr! | 1917.33 | 156233 | I_am_nOOb | 1909.64 | 151268 | Pandageddon | 1891.75 | 148319 | Pirat | 1664.08 | 145798 |
|
|
|