• 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 Memory Leaks and some OnLogin function problems

  • Thread starter Thread starter LordVissie
  • Start date Start date
L

LordVissie

Guest
Hello, I'm having some problems. I'm using TFS 0.3.6

When I start my server I recieve this error

Code:
[20/09/2015 10:42:10] [Error - GlobalEvent Interface]
[20/09/2015 10:42:10] data/globalevents/scripts/start.lua:onStartup
[20/09/2015 10:42:10] Description:
[20/09/2015 10:42:10] data/globalevents/scripts/start.lua:2: attempt to concatenate a nil value
[20/09/2015 10:42:10] stack traceback:
[20/09/2015 10:42:10]     data/globalevents/scripts/start.lua:2: in function <data/globalevents/scripts/start.lua:1>

my start.lua
Code:
function onStartup()
    db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
    return true
end

I recieve a another error when i try to login and i can't login it's just saying "Connecting to the game world server"
Code:
[20/09/2015 10:46:28] [Error - GlobalEvent Interface]
[20/09/2015 10:46:28] data/globalevents/scripts/record.lua:onRecord
[20/09/2015 10:46:28] Description:
[20/09/2015 10:46:28] data/globalevents/scripts/record.lua:2: attempt to concatenate a nil value
[20/09/2015 10:46:28] stack traceback:
Code:
[20/09/2015 10:46:28]     data/globalevents/scripts/record.lua:2: in function <data/globalevents/scripts/record.lua:1>
[20/09/2015 10:46:28] GOD Viso has logged in.
[20/09/2015 10:46:28] mysql_real_query(): SELECT `vipdays` FROM `accounts` WHERE `id` = 3 LIMIT 1 - MYSQL ERROR: Unknown column 'vipdays' in 'field list' (1054)

Another errors
Code:
[20/09/2015 10:46:28] [Error - CreatureScript Interface]
[20/09/2015 10:46:28] data/creaturescripts/scripts/templeteleport.lua:onLogin
[20/09/2015 10:46:28] Description:
[20/09/2015 10:46:28] data/lib/004-database.lua:60: [Result:getDataInt] Result not set!
[20/09/2015 10:46:28] stack traceback:
[20/09/2015 10:46:28]     [C]: in function 'error'
[20/09/2015 10:46:28]     data/lib/004-database.lua:60: in function 'getDataInt'
[20/09/2015 10:46:28]     data/lib/050-function.lua:5: in function 'getPlayerVipDays'
[20/09/2015 10:46:28]     data/creaturescripts/scripts/templeteleport.lua:2: in function <data/creaturescripts/scripts/templeteleport.lua:1>
[20/09/2015 10:46:28] mysql_real_query(): SELECT `vipdays` FROM `accounts` WHERE `id` = 3 LIMIT 1 - MYSQL ERROR: Unknown column 'vipdays' in 'field list' (1054)

my templeteleport.lua
Code:
function onLogin(cid)
if getPlayerVipDays(cid) > 0 then
setPlayerStorageValue(cid, 20500, 1)
elseif getPlayerVipDays(cid) == 0 and getPlayerStorageValue(cid, 20500) == 1 then
doTeleportThing(cid, getPlayerMasterPos(cid))
setPlayerStorageValue(cid, 20500, -1)
end
return true
end

My lib/004-database.lua
http://pastebin.com/ufTnGreS

my lib/050-function.lua
http://pastebin.com/TmzHvBnR

and my vipcheck.lua
Code:
--- Script by Kekox
function onLogin(cid)
if getPlayerVipDays(cid) >= 1 then
doPlayerSendTextMessage(cid, 19, "You have ".. getPlayerVipDays(cid) .." vip days left.")
end
return true
end

And to the end i recieve this error.
Code:
[Error  Npc interface]
data/npc/lib/npc.lua
Description: Not enough memory
my lib npc.lua file
http://pastebin.com/YNZZ0nvi

Who knows a solution?

Thanks. :)
 
Last edited by a moderator:
Lol, I just threw the vipsystem out of my server xD

I'm going to test it out thanks for the help! :)

Oh, Thanks for the help! I only got 1 error when I logged in:

Code:
[20/09/2015 17:29:28] [Error - GlobalEvent Interface]
[20/09/2015 17:29:28] data/globalevents/scripts/record.lua:onRecord
[20/09/2015 17:29:28] Description:
[20/09/2015 17:29:28] data/globalevents/scripts/record.lua:2: attempt to concatenate a nil value
[20/09/2015 17:29:28] stack traceback:
[20/09/2015 17:29:28]     data/globalevents/scripts/record.lua:2: in function <data/globalevents/scripts/record.lua:1>

And this is the script:
Code:
function onRecord(current, old, cid)
    db.executeQuery("INSERT INTO `server_record` (`record`, `world_id`, `timestamp`) VALUES (" .. current .. ", " .. getConfigValue('worldId') .. ", " .. os.time() .. ");")
    addEvent(doBroadcastMessage, 150, "New record: " .. current .. " players are logged in.", MESSAGE_STATUS_DEFAULT)
end

I don't understand what is wrong with it.

I got another error but I always had this one but also don't know what is wrong with it.
When the server starts I get this:

Code:
[20/09/2015 17:31:13] [Error - GlobalEvent Interface]
[20/09/2015 17:31:13] data/globalevents/scripts/start.lua:onStartup
[20/09/2015 17:31:13] Description:
[20/09/2015 17:31:13] data/globalevents/scripts/start.lua:2: attempt to concatenate a nil value
[20/09/2015 17:31:13] stack traceback:
[20/09/2015 17:31:13]     data/globalevents/scripts/start.lua:2: in function <data/globalevents/scripts/start.lua:1>

Start.lua:
Code:
function onStartup()
    db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
    return true
end

But I'm able to login again thanks for the help. :D
 
Last edited by a moderator:
1. Are you sure, you have function getConfigValue?
2. If yes, then check if getConfigValue('worldId') return non-nil value
" .. getConfigValue('worldId') .. ",

This stands in both of the scripts but what is wrong with it? do I need to set " return non-nil value " behind it?

Or do I need to set a worldid like this: " .. getConfigValue('worldId = 1 ') .. " or something?

I think I'm not an experienced scripter lol :p
 
Put this, and restart serwer. After that show console.
Code:
function onStartup()
    print(type( getConfigValue ))
    print(type( getConfigValue('worldId') ))
     db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
return true
end
 
Put this, and restart serwer. After that show console.
Code:
function onStartup()
    print(type( getConfigValue ))
    print(type( getConfigValue('worldId') ))
     db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
return true
end

I get this but I can just login and all so what does it do actually ;)

Code:
[20/09/2015 19:50:43] >> Initializing game state modules and registering services...
[20/09/2015 19:50:43] function
[20/09/2015 19:50:43] nil

[20/09/2015 19:50:43] [Error - GlobalEvent Interface]
[20/09/2015 19:50:43] data/globalevents/scripts/start.lua:onStartup
[20/09/2015 19:50:43] Description:
[20/09/2015 19:50:43] data/globalevents/scripts/start.lua:4: attempt to concatenate a nil value
[20/09/2015 19:50:43] stack traceback:
[20/09/2015 19:50:43]     data/globalevents/scripts/start.lua:4: in function <data/globalevents/scripts/start.lua:1>

Thx for the help ;)
 
I get this but I can just login and all so what does it do actually ;)

Code:
[20/09/2015 19:50:43] >> Initializing game state modules and registering services...
[20/09/2015 19:50:43] function
[20/09/2015 19:50:43] nil

[20/09/2015 19:50:43] [Error - GlobalEvent Interface]
[20/09/2015 19:50:43] data/globalevents/scripts/start.lua:onStartup
[20/09/2015 19:50:43] Description:
[20/09/2015 19:50:43] data/globalevents/scripts/start.lua:4: attempt to concatenate a nil value
[20/09/2015 19:50:43] stack traceback:
[20/09/2015 19:50:43]     data/globalevents/scripts/start.lua:4: in function <data/globalevents/scripts/start.lua:1>

Thx for the help ;)

in u config worldid=0? and make it
db.executeQuery("UPDATE `players` SET `online` = 1
lol!

give me u server ip i will help u to fix your server and i tooo use tfs 0.3.6 if i helped u i can takke form u your tfs.exe and dlls and config beacuse in my server only this bug when i do /mc all players in same my global address :D
 
Ok, this script to work should have value "worldId" in config.lua, But don't know what value (I'm only sure it should be uint).

c243f4d947c03e4fc460019c3605a2fd.png


This?
 
Aahh. I get it. Didn't tought the error was about my config. but I get a random

Code:
[20/09/2015 20:30:38] function
[20/09/2015 20:30:38] number

When I start up my server lol. :p

Not that it's a big problem.
 
test it man
LUA:
local worldi = getConfigValue('worldId')
function onStartup()
if worldi == 0 then
db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = 0;")
elseif worldi == 1 then
db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = 1;")
end
return true
end

or
LUA:
function onStartup()
db.Query("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
return true
end

or Just try this to your lib/100-compact.lua
LUA:
db.executeQuery = db.query

or

LUA:
getConfigInfo = getConfigValue

i think it will work >>>

function onRecord(current, old, cid)
db.executeQuery("INSERT INTO `server_record` (`record`, `world_id`, `timestamp`) VALUES (" .. current .. ", " .. getConfigValue('worldId') .. ", " .. os.time() .. ");")
addEvent(doBroadcastMessage, 150, "New record: " .. current .. " players are logged in.", MESSAGE_STATUS_DEFAULT)
end
 
Last edited by a moderator:
It was:

Code:
function onStartup()
db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
return true
end

Thanks for the help :)

Works without problems, Thanks for the help :)
 
Last edited by a moderator:
Back
Top