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_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_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
Crazy Tronners Wiki - Running a Server

Running a Server

From Tronwiki
Jump to: navigation, search
(All on one screen session)
 
Line 3: Line 3:
 
= Running the scripted server =
 
= Running the scripted server =
 
== All on one screen session ==
 
== All on one screen session ==
To start the server, which will read the all impotant file [[EdLog|edlog.txt]], feed that into the parser script, then write the output of that into arma server, which will use tee to display the console log, use something like this shell script:  
+
To start the server, which will read the all important file [[ladderlog|ladderlog.txt]], feed that into the parser script, then write the output of that into arma server, which will use tee to display the console log, use something like this shell script:  
  
 
  #!/bin/sh
 
  #!/bin/sh
Line 11: Line 11:
 
  userconfigdir="/path/to/config/"
 
  userconfigdir="/path/to/config/"
 
  parser="/path/to/parser.php"
 
  parser="/path/to/parser.php"
  edlog="${var}edlog.txt"
+
  ladderlog="${var}ladderlog.txt"
+
 
  tail -n0 -f -s 0.01 $edlog | $parser | $tron --userconfigdir $userconfigdir --vardir $var | tee -a $log
+
  tail -n0 -f -s 0.01 $ladderlog | $parser | $tron --userconfigdir $userconfigdir --vardir $var | tee -a $log
  
 
== On two screen sessions for more flexibility ==
 
== On two screen sessions for more flexibility ==
Alternativey, for debugging, you might want to write the cmds to a seperate text file for reading. This allows you to modify and restart the parser as the server is running it.
+
Alternatively, for debugging, you might want to write the cmds to a separate text file for reading. This allows you to modify and restart the parser as the server is running.
  
  tail -f -n0 -s 0.01 /path/to/edlog.txt | /path/to/parser.php | tee -a /path/to/cmds.txt
+
  tail -f -n0 -s 0.01 /path/to/ladderlog.txt | /path/to/parser.php | tee -a /path/to/cmds.txt
  
 
Then run the server on a separate screen session with:
 
Then run the server on a separate screen session with:
Line 28: Line 28:
 
  userconfigdir="/path/to/config/"
 
  userconfigdir="/path/to/config/"
 
  parser="/path/to/parser.php"
 
  parser="/path/to/parser.php"
  edlog="${var}edlog.txt"
+
  ladderlog="${var}ladderlog.txt"
 
  cmds="${var}cmds.txt"
 
  cmds="${var}cmds.txt"
 
+
 
  tail -n0 -f -s 0.01 $cmds | $tron --userconfigdir $userconfigdir --vardir $var | tee -a $log
 
  tail -n0 -f -s 0.01 $cmds | $tron --userconfigdir $userconfigdir --vardir $var | tee -a $log
  
Line 100: Line 100:
 
             }
 
             }
 
         }
 
         }
 +
    }
 +
}
 +
?>
 +
</nowiki>
 +
==Zombies Attack==
 +
Create a grid of Zombies following every player.
 +
<nowiki>#!/usr/bin/php
 +
<?php
 +
while (1)  {
 +
    $line = rtrim(fgets(STDIN, 1024));
 +
    // watch the game time to update settings based on time
 +
    if (preg_match("/^GAME_TIME/", $line)){
 +
      $keywords = preg_split("/ /", $line);
 +
      $game_time=floor($keywords[1]);
 +
      if ( $game_time == -1 ) {
 +
          if ($current_map=="loopy_passages") {
 +
      print($zombie_spawn);
 +
      }
 +
      $zombie_spawn=""; 
 +
      }
 +
  }
 +
 +
if (preg_match("/^ONLINE_PLAYER/", $line)){
 +
        $keywords = preg_split("/ /", $line);
 +
            //make sure the player is playing
 +
      if(sizeof($keywords)==7){
 +
          //SPAWN_ZONE zombie <player> <x> <y> <size> <growth> <xdir> <ydir> <interactive> <r> <g> <b> <target_size>
 +
        $zombie_spawn.="SPAWN_ZONE zombie ".$keywords[1]." 1<x> <y> <size> <growth> <xdir> <ydir> 1 15 00 00 <target_size>\n";
 +
      }
 
     }
 
     }
 
}
 
}
 
?>
 
?>
 
</nowiki>
 
</nowiki>

Latest revision as of 18:13, 15 April 2009

Personal tools