Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-05-2008, 04:21 PM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default

ok i tried it a diff way and still getting same error.. basically i set it up like the quest_globals scripts. maybe this easier to figure out?
embparser.cpp
added
Code:
////////ADDED/////////////////////////////////////////////////
		if(!isPlayerQuest){
		if(npcmob && npcmob->GetQglobal()){

			map<string, string> globhash;

			// Load global variables
			database.RunQuery(query, MakeAnyLenString(&query,
			"SELECT name,value FROM server_globals"), errbuf, &result);
			if (result)
			{
				while ((row = mysql_fetch_row(result)))
				{
					globhash[row[0]] = row[1];

					// DEPRECATED: Export variables as $var in addition to hash
					ExportVar(packagename.c_str(), row[0], row[1]);
				}
				mysql_free_result(result);
			}
			safe_delete_array(query);

			// Put key-value pairs in perl hash
			ExportHash(packagename.c_str(), "sglobals", globhash);
		}
	}
	else{
		//only export globals if the npcmob has the qglobal flag
		if(mob){

			map<string, string> globhash;

			// Load global variables
			database.RunQuery(query, MakeAnyLenString(&query,
			"SELECT name,value FROM server_globals"), errbuf, &result);
			if (result)
			{
				while ((row = mysql_fetch_row(result)))
				{
					globhash[row[0]] = row[1];

					// DEPRECATED: Export variables as $var in addition to hash
					ExportVar(packagename.c_str(), row[0], row[1]);
				}
				mysql_free_result(result);
			}
			safe_delete_array(query);

			// Put key-value pairs in perl hash
			ExportHash(packagename.c_str(), "sglobals", globhash);
		}
	}

///////////END ADDED//////////////////////////////////////
before
Code:
		if(!isPlayerQuest){
		//only export globals if the npcmob has the qglobal flag
		if(npcmob && npcmob->GetQglobal()){
parser.cpp
added
Code:
///////ADDED//////////////////////
//spider661 - load server variables
	if (npcmob->GetQglobal())
	{
	char errbuf[MYSQL_ERRMSG_SIZE];
    char *query = 0;
    MYSQL_RES *result;
	MYSQL_ROW row;
	char tmpname[65];

		if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT name,value FROM server_globals"), errbuf, &result))
		{
		safe_delete_array(query);			
			while ((row = mysql_fetch_row(result)))
			{
				sprintf(tmpname,"%s.g",row[0]);
				AddVar(tmpname, row[1]);
			}
		mysql_free_result(result);
		}
		else{
			LogFile->write(EQEMuLog::Error, "Error in GetServerInt query", query, errbuf);
			}
		if (query)
		{
			safe_delete_array(query);
			query=0;
		}
	}
//////////////END ADDED////////////
before
Code:
	// SCORPIOUS2K - load global variables

	if (npcmob->GetQglobal())
	{
now if i understood that correctly thats all the code that makes it load the globals. and if so then it should be loading the server globals i added the same way?
Reply With Quote
 


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 08:46 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