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

TFS 1.X+ /reload command question + live map edits? TFS 1.3

FenX

Advanced OT User
Joined
Jul 8, 2019
Messages
360
Solutions
1
Reaction score
159
Hi,

Back on my project again. I run the project on a budget vps just for myself and a few irl friends to test things. Anyways back to the point...

Instead of restarting the server like I used to back in the day I've started to use the /reload command. There's a param "all" which I assume reloads everything...but it doesn't seem to work. As an example, changed a magic effect in an action script, used /reload all, nothing changed, used /reload actions and it works as intended.

Here's the script written as revscriptsys:
Lua:
local reloadTypes = {
    ["all"] = RELOAD_TYPE_ALL,

    ["action"] = RELOAD_TYPE_ACTIONS,
    ["actions"] = RELOAD_TYPE_ACTIONS,

    ["chat"] = RELOAD_TYPE_CHAT,
    ["channel"] = RELOAD_TYPE_CHAT,
    ["chatchannels"] = RELOAD_TYPE_CHAT,

    ["config"] = RELOAD_TYPE_CONFIG,
    ["configuration"] = RELOAD_TYPE_CONFIG,

    ["creaturescript"] = RELOAD_TYPE_CREATURESCRIPTS,
    ["creaturescripts"] = RELOAD_TYPE_CREATURESCRIPTS,

    ["events"] = RELOAD_TYPE_EVENTS,

    ["global"] = RELOAD_TYPE_GLOBAL,

    ["globalevent"] = RELOAD_TYPE_GLOBALEVENTS,
    ["globalevents"] = RELOAD_TYPE_GLOBALEVENTS,

    ["items"] = RELOAD_TYPE_ITEMS,

    ["module"] = RELOAD_TYPE_MODULES,
    ["modules"] = RELOAD_TYPE_MODULES,

    ["monster"] = RELOAD_TYPE_MONSTERS,
    ["monsters"] = RELOAD_TYPE_MONSTERS,

    ["mount"] = RELOAD_TYPE_MOUNTS,
    ["mounts"] = RELOAD_TYPE_MOUNTS,

    ["move"] = RELOAD_TYPE_MOVEMENTS,
    ["movement"] = RELOAD_TYPE_MOVEMENTS,
    ["movements"] = RELOAD_TYPE_MOVEMENTS,

    ["npc"] = RELOAD_TYPE_NPCS,
    ["npcs"] = RELOAD_TYPE_NPCS,

    ["raid"] = RELOAD_TYPE_RAIDS,
    ["raids"] = RELOAD_TYPE_RAIDS,

    ["spell"] = RELOAD_TYPE_SPELLS,
    ["spells"] =  RELOAD_TYPE_SPELLS,

    ["stages"] = RELOAD_TYPE_STAGES,
    ["stage"] = RELOAD_TYPE_STAGES,
    ["rate"] = RELOAD_TYPE_STAGES,
    ["rates"] = RELOAD_TYPE_STAGES,

    ["talk"] = RELOAD_TYPE_TALKACTIONS,
    ["talkaction"] = RELOAD_TYPE_TALKACTIONS,
    ["talkactions"] = RELOAD_TYPE_TALKACTIONS,

    ["weapon"] = RELOAD_TYPE_WEAPONS,
    ["weapons"] = RELOAD_TYPE_WEAPONS,

    ["scripts"] = RELOAD_TYPE_SCRIPTS,
    ["libs"] = RELOAD_TYPE_GLOBAL
}

local reload = TalkAction("/reload")

function reload.onSay(player, words, param)
    if not player:getGroup():getAccess() or player:getAccountType() < ACCOUNT_TYPE_GOD then
        return true
    end

    if param == "" then
        player:sendCancelMessage("Command param required.")
        return false
    end

    logCommand(player, words, param)

    local reloadType = reloadTypes[param:lower()]
    if reloadType then
        Game.reload(reloadType)
        player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("Reloaded %s.", param:lower()))
        print("Reloaded: " .. param:lower() .. ".")
        return true
    elseif not reloadType then
        player:sendCancelMessage("Reload type not found.")
        print("Reload type not found.")
        return false
    end
    return false
end

reload:separator(" ")
reload:register()

Onto the second question of this thread :D

I'm not familiar with most tips/tricks of hosting/running a server correctly but the one thing I've always wondered was how are map edits implemented on a live server? Surely there's a way right? Seems a bit dumb having to restart the entire server each time you want to update the map lol.

Thanks in advance guys :)
 
Last edited:
Solution
E
whenever I reported map bugs the owner would instantly fix and update without restart?
small bugs can easily be "fixed" by creating/removing items with ingame GM commands, but proper/lasting fixes only with map edit and server restart

I'm using otservbr, where would I even check if they've removed it so I could readd it if so.
okay seems like they didn't remove it, but since their source code is awful as hell (no offense guys, don't need to get b*thurt) I don't know what should be, if you think it is a bug, just use their issue tracker and report this
Seems a bit dumb having to restart the entire server each time you want to update the map lol.

that is the only way AFAIK, because the server loads the map on the startup 😁 its not dumb, but how it was implemented... maybe in the future we can change this!

and about the first question, are you using tfs 1.3 master or OTserverbr global? maybe they removed this reload type
 
that is the only way AFAIK, because the server loads the map on the startup 😁 its not dumb, but how it was implemented... maybe in the future we can change this!

and about the first question, are you using tfs 1.3 master or OTserverbr global? maybe they removed this reload type
I see, yeah I mean it's a little inconvenient however though, I remember playing on some small 10.98 project and whenever I reported map bugs the owner would instantly fix and update without restart?

I'm using otservbr, where would I even check if they've removed it so I could readd it if so.
 
whenever I reported map bugs the owner would instantly fix and update without restart?
small bugs can easily be "fixed" by creating/removing items with ingame GM commands, but proper/lasting fixes only with map edit and server restart

I'm using otservbr, where would I even check if they've removed it so I could readd it if so.
okay seems like they didn't remove it, but since their source code is awful as hell (no offense guys, don't need to get b*thurt) I don't know what should be, if you think it is a bug, just use their issue tracker and report this
 
Solution
You cannot reload map on live server. There is no command for that nor the support. Cips got this, because their map is sectored (shitton of smaller map pieces put together and reloded only if there is no player around) and otbm isn't.
 
small bugs can easily be "fixed" by creating/removing items with ingame GM commands, but proper/lasting fixes only with map edit and server restart


okay seems like they didn't remove it, but since their source code is awful as hell (no offense guys, don't need to get b*thurt) I don't know what should be, if you think it is a bug, just use their issue tracker and report this
Everyone seems to reference otservbr as a "terribly coded build", I even remember Nekiro telling me that :D and I don't doubt it, it has got issues.

But when it comes to content, is their build the most upto date that is available right now publicly?

Would it be a better option to just use TFS 1.3 and drag over the content side of the otservbr datapack like monsters/weapons/spells etc. into TFS 1.3? Will this require source editing?

In terms of testing a map and basic scripts the datapack is fine but when it comes to public release of a custom server it's not reliable, many custom features don't work on their build and plenty of other issues.
 
The open source code is made up of collaborations. Unfortunately, open tibia is at a very critical level of collaborators, where most of them only know how to update XML and create basic scripts in Lua. What is more complicated is that the collaboration is done by a maximum of ten regular members. The rest (of more than 100) only know how to complain and suck. Nobody gets paid to do anything, whoever doesn't want to, look for a "better" one to use, that doesn't have "bugs" but that has also been stuck in time for more than three years. kkkk

Keep in mind that a global project involves great INSANE work. We have more than 10 repositories to take care of and we don't have to worry about leechers who never do to complain ou to demand stuff. And we already have almost a year and a half of repository, in that short term things were done that NO other repository was able to do.
 
Last edited:
I wonder why is this XML developer always complaining about others code, without being able to any better nor close to what otbr has being done. Poor boy.

About the questions, though:
@FenX it shouldnt be hard to make something that reloads your map, unfortunately it would require dropping all connections in order to have the map properly sync (as ppl already answered its a full map block, so reloading it implies reloading everything). Be aware that, with this model, you can create unexpected behaviours if reloading with players online and you must verify that you properly free the memory allocated with the old map components: tiles, creatures, etc. Also, it could take a while if your map is big.

As Nekiro well said, the best approach would be a sectored map, as Tibia does, so that you can easily manipulate.. also it would require better isolation between stuffs that belongs to the map and instances, so that you can do something granular like a reload without messing up with your players, items dropped on the floor, summoned creatures, etc.

One of otbr initiatives is the Canary project that is focused in better architectural design, applying modern ideas and technologies on top of otserver engines. We are actually using tfs (saiyans version), due to datapack small sjze and sayians optimizations. Unfortunately, even with a HUGE effort from our side and saiyans side, there are still a lot of bugs and terrible design decisions, that makes it really hard to develop on top of it.

Im almost giving up on Canary to start a full engine/client from scratch based on existing 2D frameworks such as love2d and godot (unity doesnt fit well this purpose Im afraid). It will save me a lot of time as far as I noticed.

Last but not least, tfs is the base of 99.9% of the existing code bases, including otx versions used by otbr in the beggining. You shouldn't point fingers when you are actually the root of the chaotic architecture, really.

Kiss in the a** with love,
Lucas
 
Last edited:
The open source code is made up of collaborations. Unfortunately, open tibia is at a very critical level of collaborators, where most of them only know how to update XML and create basic scripts in Lua. What is more complicated is that the collaboration is done by a maximum of ten regular members. The rest (of more than 100) only know how to complain and suck. Nobody gets paid to do anything, whoever doesn't want to, look for a "better" one to use, that doesn't have "bugs" but that has also been stuck in time for more than three years. kkkk

Keep in mind that a global project involves great INSANE work. We have more than 10 repositories to take care of and we don't have to worry about leechers who never do to complain ou to demand stuff. And we already have almost a year and a half of repository, in that short term things were done that NO other repository was able to do.
I wonder why is this XML developer always complaining about others code, without being able to any better nor close to what otbr has being done. Poor boy.

About the questions, though:
@FenX it shouldnt be hard to make something that reloads your map, unfortunately it would require dropping all connections in order to have the map properly sync (as ppl already answered its a full map block, so reloading it implies reloading everything). Be aware that, with this model, you can create unexpected behaviours if reloading with players online and you must verify that you properly free the memory allocated with the old map components: tiles, creatures, etc. Also, it could take a while if your map is big.

As Nekiro well said, the best approach would be a sectored map, as Tibia does, so that you can easily manipulate.. also it would require better isolation between stuffs that belongs to the map and instances, so that you can do something granular like a reload without messing up with your players, items dropped on the floor, summoned creatures, etc.

One of otbr initiatives is the Canary project that is focused in better architectural design, applying modern ideas and technologies on top of otserver engines. We are actually using tfs (saiyans version), due to datapack small sjze and sayians optimizations. Unfortunately, even with a HUGE effort from our side and saiyans side, there are still a lot of bugs and terrible design decisions, that makes it really hard to develop on top of it.

Im almost giving up on Canary to start a full engine/client from scratch based on existing 2D frameworks such as love2d and godot (unity doesnt fit well this purpose Im afraid). It will save me a lot of time as far as I noticed.

Last but not least, tfs is the base of 99.9% of the existing code bases, including otx versions used by otbr in the beggining. You shouldn't point fingers when you are actually the root of the chaotic architecture, really.

Kiss in the a** with love,
Lucas
Appreciate your comments and insight.

Anyways,

Wanted to report the /reload all issue but I've lost my authenticator codes for github and locked myself out lol. Will have to contact support to try and recover my account. In that time, anyone care to report it? :D
 
Back
Top