Raised This Month: $18 Target: $400
 4% 

Solved Max value of vault entry?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 07-27-2020 , 15:54   Max value of vault entry?
Reply With Quote #1

Hello,
I have doubts with nvault functions.
I am trying to store some big data into an nvault, but, for some reason, I can store only half of this data.
Does the value of an entry have limited size?
And, sure, I search for this in the module's source code: https://github.com/alliedmodders/amx...modules/nvault
__________________

Last edited by Shadows Adi; 07-28-2020 at 10:30.
Shadows Adi is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-27-2020 , 17:21   Re: Max value of vault entry?
Reply With Quote #2

These are your limiting factors:

PHP Code:
uint8_t keylen;   // key max is 255 chars
uint16_t vallen;  // val max is 32,767 chars 
__________________
Bugsy is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 07-27-2020 , 20:02   Re: Max value of vault entry?
Reply With Quote #3

After some debugging and testing, I realized that the Array is holding only 256 items, after that, it seems to start over, Example of what's goin' on:
I have 300 items in the dyn array, I select 274th item. The Array is thinking my selected item is 274-256 = 18th item is being selected, instead 274th.
__________________
Shadows Adi is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-27-2020 , 20:26   Re: Max value of vault entry?
Reply With Quote #4

You're probably going to have to show some code because arrays and nvault don't go together (not directly).
__________________
fysiks is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 07-28-2020 , 04:31   Re: Max value of vault entry?
Reply With Quote #5

After I come home, I will show se code.
EDIT: After looked into remote ftp to see error logs, it throws some stack errors =)). My var is holding 1326 cells. Solved by defining the var globaly, not localy.
EDIT2 : The problem seems to be not from what did I mention. Marked as solved.
__________________

Last edited by Shadows Adi; 07-28-2020 at 10:30. Reason: Edit
Shadows Adi is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 07-28-2020 , 18:35   Re: Max value of vault entry?
Reply With Quote #6

The bug were from menu_item_getinfo, I did not properly used it
__________________
Shadows Adi is offline
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 14:09.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode