nakama icon indicating copy to clipboard operation
nakama copied to clipboard

[Lua][Improvement] Consider processing all init.lua before other scripts

Open deflinhec opened this issue 1 year ago • 2 comments

Shouldn't init.lua been processed before all other scripts?

Asscending depth order of folder structure and priority to init.lua before other script.

deflinhec avatar Mar 15 '23 09:03 deflinhec

I'm running a project which contain an api folder, all dependecy have been handled and server starts without complains. After I deleted the api folder, some of the global variable and global functions are now missing, which affect to other modules.

Current the compling order will look like this.

  1. class.agent
  2. class.init
  3. class.table
  4. game.agent
  5. game.init
  6. game.table
  7. init

It should be like this, in case of breaking the dependency between.

  1. init
  2. class.init
  3. game.init
  4. class.agent
  5. class.table
  6. game.agent
  7. game.table

deflinhec avatar Mar 15 '23 10:03 deflinhec

I could provide a PR if needed.

deflinhec avatar Mar 15 '23 10:03 deflinhec