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 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
  #2  
Old 10-20-2018, 09:31 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

There should be zero delay in the deletion of a data bucket flag, all of the operations are atomic and happen immediately

I double checked the source on this and it looks like there was a copy pasta issue on the delete function that I'm not sure how that occurred because all of the tests were ran several times at one point

Either way I've pushed the fix and if you update your binaries you should be good to go natively

https://github.com/EQEmu/Server/comm...2c2487505f313e

Let me know if you have further questions
Reply With Quote
  #3  
Old 10-21-2018, 07:06 PM
superpally1
Sarnak
 
Join Date: Jul 2018
Location: Tennessee
Posts: 33
Default

Awesome. It isnt a big deal to just do it with the sql query but it is nice to have it working as intended. Thankyou sir!
Reply With Quote
  #4  
Old 10-21-2018, 07:07 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by superpally1 View Post
Awesome. It isnt a big deal to just do it with the sql query but it is nice to have it working as intended. Thankyou sir!
Thank you for bringing this up so we could get it addressed!
Reply With Quote
Reply


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 06:45 PM.


 

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