r5827 - in trunk: data/qcsrc/server misc/tools
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Tue Feb 10 15:37:08 EST 2009
Author: div0
Date: 2009-02-10 15:37:08 -0500 (Tue, 10 Feb 2009)
New Revision: 5827
Modified:
trunk/data/qcsrc/server/race.qc
trunk/misc/tools/demotc-race-record-extractor.sh
trunk/misc/tools/shader-checksums.pl
Log:
new race record marker (for extracting the records from demos)
Modified: trunk/data/qcsrc/server/race.qc
===================================================================
--- trunk/data/qcsrc/server/race.qc 2009-02-10 12:24:56 UTC (rev 5826)
+++ trunk/data/qcsrc/server/race.qc 2009-02-10 20:37:08 UTC (rev 5827)
@@ -153,6 +153,7 @@
db_put(ServerProgsDB, strcat(GetMapname(), "/racerecord/time"), ftos(t));
db_put(ServerProgsDB, strcat(GetMapname(), "/racerecord/netname"), e.netname);
GameLogEcho(strcat(":recordset:", ftos(e.playerid), ":", ftos(t / 10)));
+ stuffcmd(e, strcat("//RACE RECORD SET ", mmsss(t), "\n"));
}
else if(t < grecordtime)
{
@@ -163,6 +164,7 @@
db_put(ServerProgsDB, strcat(GetMapname(), "/racerecord/time"), ftos(t));
db_put(ServerProgsDB, strcat(GetMapname(), "/racerecord/netname"), e.netname);
GameLogEcho(strcat(":recordset:", ftos(e.playerid), ":", ftos(t / 10)));
+ stuffcmd(e, strcat("//RACE RECORD SET ", mmsss(t), "\n"));
}
else
{
Modified: trunk/misc/tools/demotc-race-record-extractor.sh
===================================================================
--- trunk/misc/tools/demotc-race-record-extractor.sh 2009-02-10 12:24:56 UTC (rev 5826)
+++ trunk/misc/tools/demotc-race-record-extractor.sh 2009-02-10 20:37:08 UTC (rev 5827)
@@ -2,7 +2,7 @@
d=$1
i=0
-perl demotc.pl grep "$d" 'all-time fastest lap record with (.*)\n' | while IFS=" " read -r timecode result; do
+perl demotc.pl grep "$d" '//RACE RECORD SET (.*)\n' | while IFS=" " read -r timecode result; do
timecode=${timecode%:}
result=${result#\"}
result=${result%\"}
Modified: trunk/misc/tools/shader-checksums.pl
===================================================================
--- trunk/misc/tools/shader-checksums.pl 2009-02-10 12:24:56 UTC (rev 5826)
+++ trunk/misc/tools/shader-checksums.pl 2009-02-10 20:37:08 UTC (rev 5827)
@@ -13,8 +13,9 @@
return $p;
}
-my $find_texture_names;
-$find_texture_names = grep { /^-t$/ } @ARGV;
+my $find_texture_names = grep { /^-t$/ } @ARGV;
+my $dump_shaders = grep { /^-d$/ } @ARGV;
+my @match = grep { !/^-/ } @ARGV;
my $shadertext = "";
my $level = 0;
@@ -55,33 +56,42 @@
if($level <= 0)
{
$level = 0;
- printf "%s %s\n", Digest::MD5::md5_hex($shadertext), $curshader;
- if($find_texture_names)
+ if(!@match || grep { $_ eq $curshader } @match)
{
- # find out possibly loaded textures
- my @maps = ($shadertext =~ /^map ([^\$].*)$/gim);
- for($shadertext =~ /^animmap \S+ (.*)$/gim)
+ printf "%s %s\n", Digest::MD5::md5_hex($shadertext), $curshader;
+
+ if($find_texture_names)
{
- push @maps, split / /, $_;
- }
- for($shadertext =~ /^skyparms (.*)$/gim)
- {
- for(split / /, $_)
+ # find out possibly loaded textures
+ my @maps = ($shadertext =~ /^(?:clampmap|map|q3r_lightimage|q3r_editorimage) ([^\$].*)$/gim);
+ for($shadertext =~ /^animmap \S+ (.*)$/gim)
{
- next if $_ eq "-";
- push @maps, "$_"."_lf";
- push @maps, "$_"."_ft";
- push @maps, "$_"."_rt";
- push @maps, "$_"."_bk";
- push @maps, "$_"."_up";
- push @maps, "$_"."_dn";
+ push @maps, split / /, $_;
}
+ for($shadertext =~ /^skyparms (.*)$/gim)
+ {
+ for(split / /, $_)
+ {
+ next if $_ eq "-";
+ push @maps, "$_"."_lf";
+ push @maps, "$_"."_ft";
+ push @maps, "$_"."_rt";
+ push @maps, "$_"."_bk";
+ push @maps, "$_"."_up";
+ push @maps, "$_"."_dn";
+ }
+ }
+ @maps = ($curshader)
+ if @maps == 0;
+ printf "* %s %s\n", $_, $curshader
+ for map { normalize_path $_ } @maps;
}
- @maps = ($curshader)
- if @maps == 0;
- printf "* %s %s\n", $_, $curshader
- for map { normalize_path $_ } @maps;
+
+ if($dump_shaders)
+ {
+ print "| $_\n" for split /\n/, $shadertext;
+ }
}
$curshader = undef;
More information about the nexuiz-commits
mailing list