Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 12-26-2012, 02:13 AM
Hateborne
Hill Giant
 
Join Date: May 2010
Posts: 125
Default

If memory serves, you said it yourself that qglobals was a trash system. Trying to find a reliable way to keep instances going past ~30min when they are somehow lost. I am still able to fight and farm in the instance, but I can never re-enter it through the normal context menu.

Perl DBI is from the ladies/gents that produce Perl (if memory serves). I am actually LOOKING for way to use that.


:-P


-Hate
Reply With Quote
  #2  
Old 12-26-2012, 03:18 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Quote:
Originally Posted by Hateborne View Post
If memory serves, you said it yourself that qglobals was a trash system. Trying to find a reliable way to keep instances going past ~30min when they are somehow lost. I am still able to fight and farm in the instance, but I can never re-enter it through the normal context menu.

Perl DBI is from the ladies/gents that produce Perl (if memory serves). I am actually LOOKING for way to use that.


:-P


-Hate
I may have said it at one point in time but it is actually a pretty decent system there were just some things about it that I didn't like which were cleaned up recently.

qglobals is amazing for information that requires quick calls and it is stored in memory.

qglobals are refreshed in memory whenever a client writes a new one and can be deleted just as quickly.

As far as DBI, I've written some pretty hefty systems using it and if you need different information stored in the table I recommend using it.

I will post some stuff for you shortly, troubleshooting an issue with Secrets.
Reply With Quote
  #3  
Old 12-26-2012, 04:04 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

This is a perfect example of how to use Perl DBI:

http://www.cyberciti.biz/faq/how-to-...se-using-perl/

How I go about doing it is I load a plugin that parses the XML config of the server.

Put it in plugins folder:

Mysql.pl
Code:
sub LoadMysql{	
	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);
}
Example snippet:

Code:
### Read from DB
	if(!$connect){ $connect = plugin::LoadMysql(); }
	$query = "SELECT
		cust_npc_scaling.level,
		cust_npc_scaling.type,
		cust_npc_scaling.hp,
		cust_npc_scaling.mana,
		cust_npc_scaling.mindmg,
		cust_npc_scaling.maxdmg,
		cust_npc_scaling.attack_speed,
		cust_npc_scaling.AC,
		cust_npc_scaling.STR,
		cust_npc_scaling.STA,
		cust_npc_scaling.DEX,
		cust_npc_scaling.AGI,
		cust_npc_scaling._INT,
		cust_npc_scaling.WIS,
		cust_npc_scaling.CHA,
		cust_npc_scaling.MR,
		cust_npc_scaling.CR,
		cust_npc_scaling.DR,
		cust_npc_scaling.FR,
		cust_npc_scaling.PR,
		cust_npc_scaling.hp_regen,
		cust_npc_scaling.npcspecialattks,
		cust_npc_scaling.spellscale,
		cust_npc_scaling.healscale
		FROM
		cust_npc_scaling
		ORDER BY cust_npc_scaling.level, cust_npc_scaling.type";
		$query_handle = $connect->prepare($query);
		$query_handle->execute();
		$NTYPE = 0; my @SD;
		while (@row = $query_handle->fetchrow_array()){ $SD[$row[0]][$row[1]] = [@row]; }
That should help alot

Thanks,
~Akkadius
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:23 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3