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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-20-2018, 09:08 PM
superpally1
Sarnak
 
Join Date: Jul 2018
Location: Tennessee
Posts: 33
Default Data Buckets question

I have been using the data_buckets table alot lately.

Anyways, I have noticed that in the use of :
Code:
quest::get_data(std::string bucket_key)
quest::set_data(std::string bucket_key, std::string bucket_value, std::string expires_in)
quest::delete_data(std::string bucket_key)
delete_data does not seem to work using perl.

Perhaps there is a delay from the time you call to delete the bucket and the actual time it is deleted from the database table?

It isn't a big deal. I just use an sql query to remove the buckets when needed, I was just curious if I missed something in my application of the functions.

Here is a very simple script that will show what I am talking about.
Code:
sub EVENT_SAY {

	if($text=~/Hail/){ 
	    $client->Message(12,"" . quest::saylink("Make Bucket", 1) . "");
	    $client->Message(12,"" . quest::saylink("Get Bucket", 1) . "");
	    $client->Message(14,"" . quest::saylink("Delete Bucket", 1) . "");
	    $client->Message(14,"" . quest::saylink("Delete Bucket SQL", 1) . "");
        }
	if($text=~/Make Bucket/){          #Bucket set to 1 hour.
	    quest::set_data("testkey", "5", 3600); 
	    $client->Message(12,"Data Bucket set.");
        }
	if($text=~/Get Bucket/){           #Displays the value of "testkey" which is 5.
	     $client->Message(12,"Data Bucket value is : (" . quest::get_data(testkey) . ")");
        }
	if($text=~/Delete Bucket/){        #Should work but doesn't.
	    $client->Message(12,"Attempting to delete the data bucket...");
	    quest::delete_data("testkey");
	    $client->Message(12,"Data Bucket value is : (" . quest::get_data(testkey) . ")");
        }
	if($text=~/Delete Bucket SQL/){    #Works, just a little more code.
	    $client->Message(12,"Attempting to delete the data bucket using SQL query...");
	    $connect = plugin::LoadMysql();
	    $sql_query = ("DELETE FROM data_buckets WHERE data_buckets.key='testkey'");
	    $sql_handler = $connect->prepare($sql_query);
	    $sql_handler->execute();
	    $connect->disconnect;
	    $client->Message(12,"Data Bucket value is : (" . quest::get_data(testkey) . ")");
       }
}
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 09:32 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3