Vanilla Netrek Server Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[VANILLA-L:598] pwstats.pl fixes




Hi,

There was a typo in the pwstats.pl script which reseted the stats
if a player rejoined.

Fixed it and also added the player number to the stats file.

Here the patch:

*** /home/netrek/Server/pwstats.pl	Sun Apr 13 21:54:34 1997
--- ./pwstats.pl	Sun Apr 27 21:24:00 1997
***************
*** 67,72 ****
--- 67,73 ----
  $accIdx =10;          # Actual Carriers Created
  $pckIdx =11;          # Actual Carriers Created
  $whoIdx =12;          # Adress of the player
+ $raceIdx=13;          # Last Race and number of Player
  
  $homeName = "Home Team";
  $homeRace = IND;
***************
*** 137,143 ****
      for (keys(%PlayerStats)) 
      {
  	$who = $PlayerStats{$_}[$whoIdx];
! 	$PlayerStats{$_} = [0,0,0,0,0,0,0,0,0,0,0,0,$who];
      }
  }
  
--- 138,145 ----
      for (keys(%PlayerStats)) 
      {
  	$who = $PlayerStats{$_}[$whoIdx];
!         $race = $PlayerStats{$_}[$raceIdx];
! 	$PlayerStats{$_} = [0,0,0,0,0,0,0,0,0,0,0,0,$who,$race];
      }
  }
  
***************
*** 234,246 ****
  	    }
  	    $name =~ s/^\s*//;
  	    $Players{$fromPlayer} = [$name," ",0,0];
! 	    if ($PlayersStats{$name})
  	    {                               # player just rejoined
! 		;
  	    }
  	    else
  	    {
! 		$PlayerStats{$name} = [0,0,0,0,0,0,0,0,0,0,0,0,$mail];
  	    }
  
  	    # print "Joined: P: $name N: $fromPlayer R: $Race{$fromRace}\n";
--- 236,248 ----
  	    }
  	    $name =~ s/^\s*//;
  	    $Players{$fromPlayer} = [$name," ",0,0];
! 	    if ($PlayerStats{$name})
  	    {                               # player just rejoined
! 		$PlayerStats{$name}[$raceIdx]=$from;
  	    }
  	    else
  	    {
! 		$PlayerStats{$name} = [0,0,0,0,0,0,0,0,0,0,0,0,$mail,$from];
  	    }
  
  	    # print "Joined: P: $name N: $fromPlayer R: $Race{$fromRace}\n";
***************
*** 375,387 ****
  Away: @||  @>  @<<<<<<<<<<<<<<<<<<<<<<<
        $awayRace, $awayPlanets, $awayName
  
! Player       tek def tpd tpt tpb tab tac cak eao eck pck acc      Login
  ------------------------------------------------------------------------------
  .
  
  format STDOUT =
! @<<<<<<<<<<<@>>>@>>>@>>>@>>>@>>>@>>>@>>>@>>>@>>>@>>>@>>>@>>> @<<<<<<<<<<<<<<<<
! $name,  $tek,$def,$tpd,$tpt,$tpb,$tab,$tac,$cak,$eao,$eck,$pck,$acc,$who
  .
  
  for (sort(keys(%PlayerStats))) 
--- 377,389 ----
  Away: @||  @>  @<<<<<<<<<<<<<<<<<<<<<<<
        $awayRace, $awayPlanets, $awayName
  
!    Player       tek def tpd tpt tpb tab tac cak eao eck pck acc    Login
  ------------------------------------------------------------------------------
  .
  
  format STDOUT =
! @<<@<<<<<<<<<<<@>>>@>>>@>>>@>>>@>>>@>>>@>>>@>>>@>>>@>>>@>>>@>>> @<<<<<<<<<<<<<<<
! $race,$name, $tek,$def,$tpd,$tpt,$tpb,$tab,$tac,$cak,$eao,$eck,$pck,$acc,$who
  .
  
  for (sort(keys(%PlayerStats))) 
***************
*** 400,405 ****
--- 402,408 ----
      $acc  = $PlayerStats{$_}[$accIdx];
      $pck  = $PlayerStats{$_}[$pckIdx];
      $who  = $PlayerStats{$_}[$whoIdx];
+     $race = $PlayerStats{$_}[$raceIdx];
  
      write;