Abandoned Regarding the database not storing any items

Status
Not open for further replies.

liliwang

Member
Registered
Joined
Sep 11, 2024
Messages
37
Reaction score
3
Points
8
Adding the code in the picture, I am unable to save any item in my backpack.
Apart from the initial items
11111111.png

Tables and savings in CHARACTER-01-DBF and CHARACTER-STR have been added

This is something I modified. I don't know where the error occurred and I'm not saving any items
Where do I need to add the correct method

Hey There!
Please login and(or) register to see this awesome content today.
 
It's almost impossible to read/understand such huge queries...
Anyways...Are you sure the properties are of type "int" (especially "m_mitem", "m_Tmoki" and "m_ItemTitle") ?
Because you are formatting all those properties as if they were signed int ( %d ).
 
  • Like
Reactions: Kia
It's almost impossible to read/understand such huge queries...
Anyways...Are you sure the properties are of type "int" (especially "m_mitem", "m_Tmoki" and "m_ItemTitle") ?
Because you are formatting all those properties as if they were signed int ( %d ).
I have already added these. As long as the server is restarted, all items will disappear
 
I have already added these. As long as the server is restarted, all items will disappear

1. It's not about "adding" them in, it's about "verifying" the correct input for a "printf" call.

For instance, is m_ItemTitle declared as an int, or Cstring or char array?

2. And then, what about OnGetItem or OnGetOneItem or whatever it's called -- where it's parsing the inventory load.

3. Further-more, if it's a string, you'll have to make sure it's safe for database transmission and no one can sql-inject via string if it's controlled by the user's client and not properly validated on the server before sending to the database.
 
  • Like
Reactions: Fliperworld
1. It's not about "adding" them in, it's about "verifying" the correct input for a "printf" call.

For instance, is m_ItemTitle declared as an int, or Cstring or char array?

2. And then, what about OnGetItem or OnGetOneItem or whatever it's called -- where it's parsing the inventory load.

3. Further-more, if it's a string, you'll have to make sure it's safe for database transmission and no one can sql-inject via string if it's controlled by the user's client and not properly validated on the server before sending to the database.
Apart from the initial items, as long as something new is added to my backpack and I restart the server, everything that enters my backpack returns to its original state
Hey There!
Please login and(or) register to see this awesome content today.
 
As we mentioned before, the name of the attribute 'm_ItemTitle' seriously suggests that it should be some 'char array' (or something like that...CString) and not an integer/Int.

The error suggests CDbManager::SavePlayer , with failure to call the CHARACTER_STR stored procedure due to bad query formatting.
But the error might be happening in the SaveOneItem function or something like that, where each string representing an item is formatted.

I don't know what version/source you are using, what function you mentioned, but it appears to be SaveOneItem.

13.png

Please show us the declarations of these attributes/functions (which are theoretically in a *.h file)
Just highlight the attribute/function name and press F12 (or right Click, go to declaration...).
This should return something similar to:
Hey There!
Please login and(or) register to see this awesome content today.

To better help you, I need to have knowledge of ALL these types of attributes/functions in the image above.
Theoretically the problem would be in the type of the m_ItemTitle attribute, but it is better to check everything.
 
Last edited:
Status
Not open for further replies.