View Single Post
  #10  
Old 12-26-2014, 07:29 PM
freewind1
Fire Beetle
 
Join Date: Dec 2009
Posts: 6
Default

i feel dumb but i cant seem to make this work, i copied and pasted
all 3 of the code snippets into their respective .pl and then placed all 3 in quest/global folder and also sourced the zonecontroller NPC & tables to the database, but for some reason this is not doing anything... (no editing has been done to the imported tables)

this is loadmysql.pl
Code:
sub LoadMysql_Old{	
	use DBI;
	use DBD::mysql;
	# CONFIG VARIABLES
	my $confile = "eqemu_config.xml"; #default
	open(F, "<$confile") or die "Unable to open config: $confile\n";
	my $indb = 0;

	while(<F>) {
		s/\r//g;
		if(/<database>/i) {
			$indb = 1;
		}
		next unless($indb == 1);
		if(/<\/database>/i) {
			$indb = 0;
			last;
		}
		if(/<host>(.*)<\/host>/i) {
			$host = $1;
		} elsif(/<username>(.*)<\/username>/i) {
			$user = $1;
		} elsif(/<password>(.*)<\/password>/i) {
			$pass = $1;
		} elsif(/<db>(.*)<\/db>/i) {
			$db = $1;
		}
	}
	# DATA SOURCE NAME
	$dsn = "dbi:mysql:$db:localhost:3306";
	# PERL DBI CONNECT
	$connect = DBI->connect($dsn, $user, $pass);
}

sub LoadMysql{	
	use DBI;
	use DBD::mysql;
	# CONFIG VARIABLES
	$host = 127.0.0.1;
	$user = "root";
	$pass = "Mypassword";
	$db = "peq";
	$dsn = "dbi:mysql:$db:localhost:3306";
	return DBI->connect($dsn, $user, $pass);
}
im using Akka's PEQ Server Repack


thanks for the help!
Reply With Quote