Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739
Crazy Tronners Wiki - Running a Server

Running a Server

From Tronwiki
Jump to: navigation, search
(Random Flying Deathzones)
(Random Flying Deathzones)
Line 42: Line 42:
 
     $line = rtrim(fgets(STDIN, 1024));
 
     $line = rtrim(fgets(STDIN, 1024));
 
     // watch the game time to update settings based on time
 
     // watch the game time to update settings based on time
     if (preg_match("/^GAME_TIME/", $line)){
+
     if ( preg_match( "/^GAME_TIME/", $line ) ){
$keywords = preg_split("/ /", $line);
+
        $keywords = preg_split("/ /", $line);
$game_time=$keywords[1];
+
$game_time=$keywords[1];
if ( $game_time % 10 == 0 ){
+
if ( $game_time % 10 == 0 ){
    $mincoord=225;
+
            $mincoord=225;
    $maxcoord=275;
+
            $maxcoord=275;
    $minsize=2;
+
            $minsize=2;
    $maxsize=8;
+
            $maxsize=8;
    $minspeed=1;
+
            $minspeed=1;
    $maxspeed=30;
+
            $maxspeed=30;
    $xcoord=rand($mincoord, $maxcoord);
+
            $xcoord=rand($mincoord, $maxcoord);
    $ycoord=rand($mincoord, $maxcoord);
+
            $ycoord=rand($mincoord, $maxcoord);
    $size=rand($minsize, $maxsize);
+
            $size=rand($minsize, $maxsize);
    $xspeed=rand($minspeed, $maxspeed);
+
            $xspeed=rand($minspeed, $maxspeed);
    $yspeed=rand($minspeed, $maxspeed);
+
            $yspeed=rand($minspeed, $maxspeed);
    $ycoord2=($ycoord>250)?(250-($ycoord-250)):(250+(250-$ycoord));
+
            $ycoord2=($ycoord>250)?(250-($ycoord-250)):(250+(250-$ycoord));
    $xcoord2=($xcoord>250)?(250-($xcoord-250)):(250+(250-$xcoord));
+
            $xcoord2=($xcoord>250)?(250-($xcoord-250)):(250+(250-$xcoord));
    if ( $game_time%20==0 ) {
+
            if ( $game_time%20==0 ) {
        print("spawn_zone death $xcoord $ycoord $size 0 $xspeed $yspeed true\n");
+
                print("spawn_zone death $xcoord $ycoord $size 0 $xspeed $yspeed true\n");
print("spawn_zone death $xcoord2 $ycoord2 $size 0 -$xspeed -$yspeed true\n");
+
        print("spawn_zone death $xcoord2 $ycoord2 $size 0 -$xspeed -$yspeed true\n");
    } else {
+
            } else {
        print("spawn_zone death $xcoord $ycoord $size 0 -$xspeed $yspeed true\n");
+
                print("spawn_zone death $xcoord $ycoord $size 0 -$xspeed $yspeed true\n");
        print("spawn_zone death $xcoord2 $ycoord2 $size 0 $xspeed -$yspeed true\n");
+
                print("spawn_zone death $xcoord2 $ycoord2 $size 0 $xspeed -$yspeed true\n");
    }
+
            }
}
+
}
 
     }
 
     }
 
}
 
}
 
?></nowiki>
 
?></nowiki>

Revision as of 12:08, 3 October 2007

Personal tools