2 # ======================================================================
3 # ======================================================================
8 # ======================================================================
10 # ======================================================================
13 $scriptName =~ s/^(.*)[\\\/]//;
15 # ======================================================================
17 # ======================================================================
21 die "\nUsage:\n\t$scriptName current [ debug | release ] (default is debug)\n";
28 # find out where a perforce file resides on the local machine
31 open(P4
, "p4 where $_[0] |");
42 # ======================================================================
44 # ======================================================================
46 usage
() if(@ARGV == 0 || (@ARGV >= 2 && $ARGV[1] ne "debug" && $ARGV[1] ne "release"));
49 my $serverType = (@ARGV) ?
shift : "debug";
53 chdir(perforceWhere
("//depot/swg/$branch/src/game/server/database/build/linux")) or die "Cannot change directory to database directory\n";
55 my $update_complete = 1;
56 my $dbUser = $ENV{"USER"};
57 $dbUser .= "_$branch" if($branch ne "current");
59 system("perl database_update.pl --delta --username=$dbUser > startServer.log") == 0 or die "database_update failed\n";
60 open(DBLOG
, "startServer.log");
63 $update_complete = 0 if(/ERROR/);
67 die "Error while updating database - detailed info in startServer.log\n" if(!$update_complete);
68 unlink("startServer.log");
71 chdir(perforceWhere
("//depot/swg/$branch/bootleg/linux")) || die "Cannot chdir to ".perforceWhere
("//depot/swg/$branch/bootleg/linux")."\n";
73 # Extract new server exes if they exist
74 if(-e
"servers_${serverType}.tar.gz")
76 print STDERR
"Extracting new server exes...\n";
77 system("tar -xzf servers_${serverType}.tar.gz") == 0 || die "error extracting from $serverType server gzip\n";
78 system("rm -f servers_${serverType}.tar.gz") == 0 || die "error removing servers_${serverType}.gzip\n";
82 system("$serverType/LoginServer -- \@loginServer.cfg &") == 0 || die "error starting LoginServer\n";
83 system("$serverType/TaskManager -- \@taskmanager.cfg &") == 0 || die "error starting TaskManager\n";