AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Max value of vault entry? (https://forums.alliedmods.net/showthread.php?t=326341)

Shadows Adi 07-27-2020 15:54

Max value of vault entry?
 
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

Bugsy 07-27-2020 17:21

Re: Max value of vault entry?
 
These are your limiting factors:

PHP Code:

uint8_t keylen;   // key max is 255 chars
uint16_t vallen;  // val max is 32,767 chars 


Shadows Adi 07-27-2020 20:02

Re: Max value of vault entry?
 
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.

fysiks 07-27-2020 20:26

Re: Max value of vault entry?
 
You're probably going to have to show some code because arrays and nvault don't go together (not directly).

Shadows Adi 07-28-2020 04:31

Re: Max value of vault entry?
 
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.

Shadows Adi 07-28-2020 18:35

Re: Max value of vault entry?
 
The bug were from menu_item_getinfo, I did not properly used it :P


All times are GMT -4. The time now is 06:27.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.