• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Error saving character

failkin

Member
Joined
May 10, 2021
Messages
25
Solutions
1
Reaction score
9
[Error - mysql_real_query] Query: UPDATE players SET level = 8,group_id = 1,vocation = 1,health = 185,healthmax = 185,experience = 4200,lookbody = 63,lookfeet = 100,lookhead = 52,looklegs = 99,looktype = 129,lookaddons = 0,maglevel = 0,mana = 90,manamax = 90
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ',lastlogin = 1622648207,lastip = 2429951815,conditions = '',`skulltime...' at line 1
Error while saving player: Failkin

whenever a character logs out I get this error every time they completely reset back to the temple. skull time is in my player database so i'm a little confused where else the error would be? tfs 1.2.
 
Check this to fix the issue ayusutina mentioned above.
and if it didn't solve your character's saving maybe check this
I also think that you shouldn't compile TFS 1.2 using Visual Studio 2019/vcpkg if you're doing so then you should use Toolsetv141
 
in IOLoginData::savePlayer(), change:
from: query << "sex = " << player->sex << ',';
to: query << "sex = " << (int)(player->sex) << ',';

if you're referring to this I've tried and it didn't work
Post automatically merged:

Check this to fix the issue ayusutina mentioned above.
and if it didn't solve your character's saving maybe check this
I also think that you shouldn't compile TFS 1.2 using Visual Studio 2019/vcpkg if you're doing so then you should use Toolsetv141
Its a Linux VPS ubuntu i didnt use windows for it, the skull time line is in the players table so where would I look to actually quote the 0?
 
in IOLoginData::savePlayer(), change:
from: query << "sex = " << player->sex << ',';
to: query << "sex = " << (int)(player->sex) << ',';

if you're referring to this I've tried and it didn't work
Post automatically merged:


Its a Linux VPS ubuntu i didnt use windows for it, the skull time line is in the players table so where would I look to actually quote the 0?

query << "`sex` = " << static_cast<uint16_t>(player->sex) << ',';
 
Nostalrius bug with sex on iologindata.cpp
This was the callout that solved it for me.

iologindata.cpp
bool IOLoginData::savePlayer(Player* player)
C++:
query << "`sex` = " << player->sex << ',';
to
C++:
query << "`sex` = " << static_cast<uint16_t>(player->sex) << ',';
If you're getting the error:
[Error - mysql_real_query] Query: UPDATE players SET level = 8,group_id = 1,vocation = 1,health = 185,healthmax = 185,experience = 4200,lookbody = 63,lookfeet = 100,lookhead = 52,looklegs = 99,looktype = 129,lookaddons = 0,maglevel = 0,mana = 90,manamax = 90
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ',lastlogin = 1622648207,lastip = 2429951815,conditions = '',`skulltime...' at line 1
Error while saving player: Playername

You need to modify iologindata.cpp and recompile.
Change line 688 from
query << "sex = " << player->sex << ',';
to
query << "sex = " << (int)(player->sex) << ',';
or if that doesn't work, try:
query << "sex = " << static_cast<uint16_t>(player->sex) << ',';

But thank you very much, @emil92b, for your response from three years ago, and thank you @ayusutina for the reference!
 
Back
Top