update readme and add gitignore
[client-tools.git] / tools / checkChunkLoading.pl
blobab6fac9a42d883f4edf97ce0d595f0fe61aa8c0f
1 #!/usr/bin/perl
3 # Given a planet name, searches a log file to check that every chunk on that planet was loaded
5 ($targetPlanet, $logfile)=@ARGV;
6 open(LOGFILE,$logfile);
7 while (<LOGFILE>)
9 if (/ChunkLocator:Chunk (\w+) ([-\d]+) ([-\d]+)/)
11 ($planet, $x, $z) = ($1, $2, $3);
12 if ($planet eq $targetPlanet)
14 $chunks{$x.":".$z}+=1;
19 for ($x=-8000; $x<=8000; $x+=100)
21 for ($z=-8000; $z<=8000; $z+=100)
23 if ($chunks{$x.":".$z}!=2)
25 print "Chunk error $targetPlanet $x,$z. Was in logs ".($chunks{$x.":".$z}+0)." times (should be 2 times)\n";