$NetBSD$

--- pts.pl.orig	Sat Jun 15 01:27:49 2002
+++ pts.pl	Sun Jan 26 13:39:03 2003
@@ -24,16 +24,16 @@
 use strict;
 
 # path
-use constant BANFILE => "./pts.ban"; # ban list file
-use constant BACKUPSUFFIX => ".old"; # winlist old data file suffix
-use constant CONFIGFILE => "./pts.ini"; # config file
-use constant DAILYFILE => "./dstats/%y%m.log"; # daily stats file (%y = year, %m = month, %d = month day)
-use constant LMSGFILE => "./pts.lmsg"; # left message file
-use constant LOGFILE => "./logs/%y%m.log"; # log file (%y = year, %m = month, %d = month day)
-use constant PIDFILE => "./pts.pid"; # pid file
-use constant PROFILEFILE => "./pts.profile"; # profile file
+use constant BANFILE => "/usr/pkg/share/pts/pts.ban"; # ban list file
+use constant BACKUPSUFFIX => "/usr/pkg/share/pts/winlist_old"; # winlist old data file suffix
+use constant CONFIGFILE => "/usr/pkg/share/pts/pts.ini"; # config file
+use constant DAILYFILE => "/usr/pkg/share/pts/dstats/%y%m.log"; # daily stats file (%y = year, %m = month, %d = month day)
+use constant LMSGFILE => "/usr/pkg/share/pts/pts.lmsg"; # left message file
+use constant LOGFILE => "/usr/pkg/share/pts/logs/%y%m.log"; # log file (%y = year, %m = month, %d = month day)
+use constant PIDFILE => "/var/run/pts.pid"; # pid file
+use constant PROFILEFILE => "/usr/pkg/share/pts/pts.profile"; # profile file
 use constant RELAUNCH => "perl $PROGRAM_NAME"; # shell command to re-launch the server
-use constant SECUREFILE => "./pts.secure"; # secure (password) file
+use constant SECUREFILE => "/usr/pkg/share/pts/pts.secure"; # secure (password) file
 
 # system
 use constant DAEMON => 0; # run as daemon (fork() should be available)
@@ -5214,7 +5214,7 @@
   $Misc{writable} = IO::Select->new();
   @COLOR_CODES = ("\x04","\x06","\x0F","\x11","\x05","\x03","\x17","\x0E","\x0C","\x10","\x14","\x08","\x13","\x19","\x18","\x02","\x16","\x1F","\x0B","\x15");
   @COLOR_NAMES = qw[black gray lgray dblue blue lblue dgreen lgreen teal rust red pink purple yellow white bold italic underline];
-  $PROGRAM_NAME = 'Perl TetriNET Server v' . VERSION;
+  $PROGRAM_NAME = 'pts ' . VERSION;
   ResetPTime();
 
   WriteLog("Starting $PROGRAM_NAME...");
@@ -5270,7 +5270,7 @@
 
   print "Completed!\n";
 
-  if (DAEMON) {
+  if ($Config->val('Main', 'Background')) {
     if ( my $result = Daemon() ) {
       Report('error', undef, undef, "ERROR: Cannot be daemon: $result");
       die "Cannot be daemon: $result\n";
@@ -5308,8 +5308,8 @@
 #  open(STDERR, "+>&STDIN");
   open(STDERR, "+>&STDIN") if not DEBUG; # DEBUGGING
 
-  open(STDOUT, ">> ./logs/debug.log") if DEBUG; # DEBUGGING
-  open(STDERR, ">> ./logs/debug.log") if DEBUG; # DEBUGGING
+  open(STDOUT, ">> /usr/pkg/share/pts/logs/debug.log") if DEBUG; # DEBUGGING
+  open(STDERR, ">> /usr/pkg/share/pts/logs/debug.log") if DEBUG; # DEBUGGING
 
   return undef;
 }
@@ -5347,9 +5347,9 @@
     '[Main] MessagePenalty' => 100,
     '[Main] PenaltyPerSecond' => 50,
     '[Locale] Default' => 'en',
-    '[Locale] en' => './locale/en.msg',
+    '[Locale] en' => '/usr/pkg/share/pts/locale/en.msg',
 #    '[Locale] ja' => './locale/ja.msg',
-    '[FilePath] motd' => './pts.motd',
+    '[FilePath] motd' => '/usr/pkg/share/pts/pts.motd',
 #    '[FilePath] news' => './pts.news',
     '[Authority] User' => 0,
     '[Authority] Moderator' => 1,
