• 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!

Windows Login Error?

Programmer

Lua, Java, C
Joined
Jan 26, 2013
Messages
67
Reaction score
3
Location
United States
Hey guys, I had my server up and running really well, then I fixed an error in "Login.lua". No error was given in TFS on startup, so I decided to log in. But, when I do I get a green text message saying "You will be dissconected and required to put in your account/password again." and get this console error.

Code:
[31/08/2013 14:57:57] Account Manager has logged in.
[31/08/2013 14:57:57] mysql_real_query(): UPDATE `theforgottenserver`.`players` SET `name` = '[v] Account Manager' WHERE `players`.`account_id`= 1; - MYSQL ERROR: Table 'theforgottenserver.players' doesn't exist (1146)
[31/08/2013 14:58:00] Account Manager has logged out.

I'm using TFS 0.3.6 v8 for 8.6. Does anyone have any ideas?
 
Also, in Login.lua, there is an addition that contains this...

PHP:
    local id,nm,qry = getPlayerAccountId(cid),string.find (getCreatureName(cid), "(%[+)%v*(%]+)%s*"),""
    if isPremium(cid) and nm == nil then
        qry = "UPDATE `theforgottenserver`.`players` SET `name` = '[v] "..getCreatureName(cid).."' WHERE `players`.`account_id`= "..id..";"
    elseif (not isPremium(cid)) and nm ~= nil then
        local nnome = string.gsub(getCreatureName(cid), "(%[+)%v*(%]+)%s*", "")
        qry = "UPDATE `theforgottenserver`.`players` SET `name` = '"..nnome.."' WHERE `players`.`account_id`= "..id..";"
    end
    if qry ~= "" then
        db.executeQuery(qry)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You will be disconnected and will be required to put the login and password again.")
        addEvent(doRemoveThing,3000,cid)
    end
    return true
end

And I would change it to this...


PHP:
    local id,nm,qry = getPlayerAccountId(cid),string.find (getCreatureName(cid), "(%[+)%v*(%]+)%s*"),""
    if isPremium(cid) and nm == nil then
        qry = "UPDATE `MYDATABASE`.`players` SET `name` = '[v] "..getCreatureName(cid).."' WHERE `players`.`account_id`= "..id..";"
    elseif (not isPremium(cid)) and nm ~= nil then
        local nnome = string.gsub(getCreatureName(cid), "(%[+)%v*(%]+)%s*", "")
        qry = "UPDATE `MYDATABASE`.`players` SET `name` = '"..nnome.."' WHERE `players`.`account_id`= "..id..";"
    end
    if qry ~= "" then
        db.executeQuery(qry)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You will be disconnected and will be required to put the login and password again.")
        addEvent(doRemoveThing,3000,cid)
    end
    return true
end

And it would crash and send some message about a duplicate entry with "MYDATABASE.name"

--EDIT--
I deleted that entry and it worked fine, but i'd like to know why theres an error.
 
Back
Top