otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.56k stars 1.04k forks source link

Move static LuaScriptInterface methods to namespace #4675

Closed ranisalt closed 1 month ago

ranisalt commented 2 months ago

Pull Request Prelude

Changes Proposed

Part 1 of a major rewrite to our dearest file that hangs low-powered computers and triggers out-of-memory situations all the time.

At first, move static functions (except functions that will be bound to Lua methods) out of the LuaScriptInterface class into the tfs::lua namespace. This should help reducing the load to compile this file and enables cleaning up the header in the future.

A few unused functions were removed, and some that weren't used outside luascript.cpp were moved into it as static, within an anonymous namespace.