This topic was marked solved by its starter, on June 15th, 2017, 03:14 AM
A small problem....

DarkRaZoR^

  • Full Member
  • VC:MP Battlefield Head Developer/KF Leader
  • Posts: 226
A small problem....
« on June 10th, 2017, 09:56 PM »
Dear fellows,
Quote from Kewun on January 20th, 2017, 12:26 PM
Nice bump but i will answer your question
"=" sign in ini parser ruins the file
When ever a player registers, creates a INI section, and the name of that section is the player's nick. However, if the player had brackets at the first character of the nickname, it will corrupt/ruin the data and stop the process. I wonder is there any way to prevent this from happening? I want you best answers as possible to solve this issue. If it's unsolving, then that's okay.

Stormeus

  • VC:MP Developer
  • oh god how did i get here im not good w computer
  • Posts: 1,128
Re: A small problem....
« Reply #1, on June 10th, 2017, 10:15 PM »
Yes, stop using INIs for data storage.

You could also try replacing the = symbol with a different character when saving and making sure to convert back when loading.

DarkRaZoR^

  • Full Member
  • VC:MP Battlefield Head Developer/KF Leader
  • Posts: 226
Re: A small problem....
« Reply #2, on June 10th, 2017, 10:17 PM »Last edited on June 10th, 2017, 10:31 PM
Quote from Stormeus on June 10th, 2017, 10:15 PM
Yes, stop using INIs for data storage.

You could also try replacing the = symbol with a different character when saving and making sure to convert back when loading.
Well then I have no choice but to use SQLite. Although, I'm receiving errors from the Fuzzie Account system. Is about the constructor. Would you help me on this?



P.S. Press CTRL & + to zoom in this images. Forgive me if their small.

Stormeus

  • VC:MP Developer
  • oh god how did i get here im not good w computer
  • Posts: 1,128

DarkRaZoR^

  • Full Member
  • VC:MP Battlefield Head Developer/KF Leader
  • Posts: 226

KAKAN

  • Wiki Contributor
  • Posts: 3,340
Re: A small problem....
« Reply #5, on June 11th, 2017, 08:13 AM »
show us onPlayerJoin maybe?
Also, using INI is no problem. Hash the name using SHA1 and match it against the player's hashed name when it joins.
oh no

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,760
Re: A small problem....
« Reply #6, on June 11th, 2017, 09:52 AM »
You're using SLC's SQLite plugin which causes a not an error error when an SQLite query fails. To figure out the actual error, you need to implement a workaround demonstrated here:
Code: [Select]
        try r = ::SQLite_Query(inst, q)
        catch (e) throw ::SQLite_ErrMsg(inst);

Wrap your query up in a try/catch block and add throw SQLite_ErrMsg(db); inside the catch part of that block and try again. You should get a more detailed error message this time.

Stormeus

  • VC:MP Developer
  • oh god how did i get here im not good w computer
  • Posts: 1,128

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,760
Re: A small problem....
« Reply #8, on June 11th, 2017, 10:33 AM »
Quote from Stormeus on June 11th, 2017, 09:58 AM
Quote from EK.IceFlake on June 11th, 2017, 09:52 AM
You're using SLC's SQLite plugin which causes a not an error error when an SQLite query fails.
... why does it say not an error?
Don't really feel like checking the source, but most probably because of someone forgetting to return the error code. An error code of 0 will usually cause either not an error or the operation completed successfully.

After checking the source, I'm guessing it's because of checking for an error on the query rather than the actual database unlike SQLite_ErrMsg.

DarkRaZoR^

  • Full Member
  • VC:MP Battlefield Head Developer/KF Leader
  • Posts: 226
Re: A small problem....
« Reply #9, on June 11th, 2017, 07:29 PM »
Quote from KAKAN on June 11th, 2017, 08:13 AM
show us onPlayerJoin maybe?
Also, using INI is no problem. Hash the name using SHA1 and match it against the player's hashed name when it joins.
This may actutally work, rather than restarting the whole account system. The error coming from the console is in this line from onPlayerJoin: pstats[ player.ID ] = PlayerClass( player.Name, db );
Quote from EK.IceFlake on June 11th, 2017, 09:52 AM
You're using SLC's SQLite plugin which causes a not an error error when an SQLite query fails. To figure out the actual error, you need to implement a workaround demonstrated here:
Code: [Select]
        try r = ::SQLite_Query(inst, q)
        catch (e) throw ::SQLite_ErrMsg(inst);

Wrap your query up in a try/catch block and add throw SQLite_ErrMsg(db); inside the catch part of that block and try again. You should get a more detailed error message this time.
Where do I try/catch block it at? The QuerySQL or.....?

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,760
Re: A small problem....
« Reply #10, on June 11th, 2017, 07:39 PM »
Quote from DarkRaZoR^ on June 11th, 2017, 07:29 PM
Quote from KAKAN on June 11th, 2017, 08:13 AM
show us onPlayerJoin maybe?
Also, using INI is no problem. Hash the name using SHA1 and match it against the player's hashed name when it joins.
This may actutally work, rather than restarting the whole account system. The error coming from the console is in this line from onPlayerJoin: pstats[ player.ID ] = PlayerClass( player.Name, db );
Quote from EK.IceFlake on June 11th, 2017, 09:52 AM
You're using SLC's SQLite plugin which causes a not an error error when an SQLite query fails. To figure out the actual error, you need to implement a workaround demonstrated here:
Code: [Select]
        try r = ::SQLite_Query(inst, q)
        catch (e) throw ::SQLite_ErrMsg(inst);

Wrap your query up in a try/catch block and add throw SQLite_ErrMsg(db); inside the catch part of that block and try again. You should get a more detailed error message this time.
Where do I try/catch block it at? The QuerySQL or.....?
Yes.

DarkRaZoR^

  • Full Member
  • VC:MP Battlefield Head Developer/KF Leader
  • Posts: 226
Re: A small problem....
« Reply #11, on June 11th, 2017, 10:18 PM »
Quote from EK.IceFlake on June 11th, 2017, 07:39 PM
Quote from DarkRaZoR^ on June 11th, 2017, 07:29 PM
Quote from KAKAN on June 11th, 2017, 08:13 AM
show us onPlayerJoin maybe?
Also, using INI is no problem. Hash the name using SHA1 and match it against the player's hashed name when it joins.
This may actutally work, rather than restarting the whole account system. The error coming from the console is in this line from onPlayerJoin: pstats[ player.ID ] = PlayerClass( player.Name, db );
Quote from EK.IceFlake on June 11th, 2017, 09:52 AM
You're using SLC's SQLite plugin which causes a not an error error when an SQLite query fails. To figure out the actual error, you need to implement a workaround demonstrated here:
Code: [Select]
        try r = ::SQLite_Query(inst, q)
        catch (e) throw ::SQLite_ErrMsg(inst);

Wrap your query up in a try/catch block and add throw SQLite_ErrMsg(db); inside the catch part of that block and try again. You should get a more detailed error message this time.
Where do I try/catch block it at? The QuerySQL or.....?
Yes.
Code: [Select]
try
{
  QuerySQL( db, "CREATE TABLE IF NOT EXISTS Accounts ( Name VARCHAR(32), Password VARCHAR(25), Cash INT, Bank INT, Kills INT, Deaths INT, Level INT, LastUsedIP VARCHAR(32) ");
}
catch (e) throw ::SQlite_ErrMsg( inst );
Is this correct?

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,760
Re: A small problem....
« Reply #12, on June 12th, 2017, 07:11 AM »
Quote from DarkRaZoR^ on June 11th, 2017, 10:18 PM
Quote from EK.IceFlake on June 11th, 2017, 07:39 PM
Quote from DarkRaZoR^ on June 11th, 2017, 07:29 PM
Quote from KAKAN on June 11th, 2017, 08:13 AM
show us onPlayerJoin maybe?
Also, using INI is no problem. Hash the name using SHA1 and match it against the player's hashed name when it joins.
This may actutally work, rather than restarting the whole account system. The error coming from the console is in this line from onPlayerJoin: pstats[ player.ID ] = PlayerClass( player.Name, db );
Quote from EK.IceFlake on June 11th, 2017, 09:52 AM
You're using SLC's SQLite plugin which causes a not an error error when an SQLite query fails. To figure out the actual error, you need to implement a workaround demonstrated here:
Code: [Select]
        try r = ::SQLite_Query(inst, q)
        catch (e) throw ::SQLite_ErrMsg(inst);

Wrap your query up in a try/catch block and add throw SQLite_ErrMsg(db); inside the catch part of that block and try again. You should get a more detailed error message this time.
Where do I try/catch block it at? The QuerySQL or.....?
Yes.
Code: [Select]
try
{
  QuerySQL( db, "CREATE TABLE IF NOT EXISTS Accounts ( Name VARCHAR(32), Password VARCHAR(25), Cash INT, Bank INT, Kills INT, Deaths INT, Level INT, LastUsedIP VARCHAR(32) ");
}
catch (e) throw ::SQlite_ErrMsg( inst );
Is this correct?
Why don't you try it?

Milko

  • Newbie
  • Bre
  • Posts: 41

DarkRaZoR^

  • Full Member
  • VC:MP Battlefield Head Developer/KF Leader
  • Posts: 226
Re: A small problem....
« Reply #14, on June 12th, 2017, 03:36 PM »Last edited on June 15th, 2017, 03:14 AM
Quote from Milko on June 12th, 2017, 01:32 PM
You need jebed on head.
Administradors, mind kindly preventing this topic from spam.

Edit: Solved & Locked.