[nexuiz-commits] r8579 - trunk/misc/tools
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Jan 27 06:49:19 EST 2010
Author: div0
Date: 2010-01-27 06:49:19 -0500 (Wed, 27 Jan 2010)
New Revision: 8579
Removed:
trunk/misc/tools/demosplit.pl
Log:
remove demosplit
Deleted: trunk/misc/tools/demosplit.pl
===================================================================
--- trunk/misc/tools/demosplit.pl 2010-01-27 11:46:06 UTC (rev 8578)
+++ trunk/misc/tools/demosplit.pl 2010-01-27 11:49:19 UTC (rev 8579)
@@ -1,74 +0,0 @@
-#!/usr/bin/perl
-
-# usage:
-# ./demosplit.pl demo.dem
-# splits the demo into separate demos for each map played and writes them
-# to demo-0000.dem, demo-0001.dem ...
-
-use strict;
-use warnings;
-
-# constants
-my $svc_signon = "\001";
-
-# opening the files
-
-die "Usage: $0 infile"
- if @ARGV != 1;
-my ($in) = @ARGV;
-
-my $demoname = [$in =~ /^(.*)\.dem$/]->[0];
-$demoname = "out"
- if not defined $demoname;
-
-open my $infh, "<", $in
- or die "open $in: $!";
-binmode $infh;
-
-# 1. CD track
-
-$/ = "\012";
-my $cdtrack = <$infh>;
-
-# 2. packets
-
-my $outfh;
-my $outnum = 0;
-
-for(;;)
-{
- last
- unless 4 == read $infh, my $length, 4;
- $length = unpack("V", $length);
- die "Invalid demo packet"
- unless 12 == read $infh, my $angles, 12;
- die "Invalid demo packet"
- unless $length == read $infh, my($data), $length;
-
- use Data::Dumper; $Data::Dumper::Useqq = 1; print Dumper $data;
-
- if($data =~ m{
- ^
- $svc_signon
- $
- }sx)
- {
- close $outfh
- if $outfh;
- my $outname = sprintf("%s-%04d.dem", $demoname, $outnum++);
- open $outfh, ">", $outname
- or die "open $outname: $!";
- binmode $outfh;
- print $outfh $cdtrack;
- print "Writing to $outname...\n";
- }
-
- #die "No signon received"
- # unless $outfh;
- #print $outfh pack("V", length $data);
- #print $outfh $angles;
- #print $outfh $data;
-}
-
-close $outfh;
-close $infh;
More information about the nexuiz-commits
mailing list