jefersonzc
New Member
- Joined
- Apr 13, 2011
- Messages
- 17
- Reaction score
- 4
Hello everyone. First of all, sorry for the english, I'm using ChatGPT ^^
I'm using TFS 1.4 (from the official forgottenserver repository) and Ubuntu 24.04. And I'm getting the following error:
But as we can see, my database seems to be getting updated regardless of the error.

Anyway, I'm trying to get rid of this error. So, I found the following line in the GAME.CPP file.
And if I remove it and recompile the code, everything seems to work well, but my database will no longer be updated at that line, and I don't know if that will be a problem at some point.
I also found something in the 11.lua file. I’m not sure if it’s related to the issue, but maybe it is. I suspect it could be line 4, which in my opinion should be receiving 0, not "empty".
Or, maybe, the problem is the lastMotd.txt file, which doesn’t exist. I already tried creating it (blank) in the root folder, but it didn’t work (maybe I did it wrong).
Any help? Thank you guys.
I'm using TFS 1.4 (from the official forgottenserver repository) and Ubuntu 24.04. And I'm getting the following error:
Code:
[Error - mysql_real_query] Query: UPDATE `server_config` SET `value` = '3' WHERE `config` = 'motd_num'
But as we can see, my database seems to be getting updated regardless of the error.

Anyway, I'm trying to get rid of this error. So, I found the following line in the GAME.CPP file.
Code:
db.executeQuery(fmt::format("UPDATE `server_config` SET `value` = '{:d}' WHERE `config` = 'motd_num'", motdNum));
And if I remove it and recompile the code, everything seems to work well, but my database will no longer be updated at that line, and I don't know if that will be a problem at some point.
I also found something in the 11.lua file. I’m not sure if it’s related to the issue, but maybe it is. I suspect it could be line 4, which in my opinion should be receiving 0, not "empty".
Or, maybe, the problem is the lastMotd.txt file, which doesn’t exist. I already tried creating it (blank) in the root folder, but it didn’t work (maybe I did it wrong).
LUA:
function onUpdateDatabase()
print("> Updating database to version 12 (storing players record and message of the day in database)")
local motdNum = ""
local motd = ""
local lastMotdFile = io.open("lastMotd.txt", "r")
if lastMotdFile then
motdNum = lastMotdFile:read()
motd = lastMotdFile:read()
lastMotdFile:close()
end
local record = 0
local playersRecordFile = io.open("playersRecord.txt", "r")
if playersRecordFile then
record = playersRecordFile:read("*n")
playersRecordFile:close()
end
db.query("INSERT INTO `server_config` (`config`, `value`) VALUES ('players_record', '" .. record .. "'), ('motd_hash', SHA1(" .. db.escapeString(motd) .. ")), ('motd_num', " .. db.escapeString(motdNum) .. ")")
return true
end
Any help? Thank you guys.
Last edited: