collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Load order of modules  (Read 3730 times)

0 Members and 1 Guest are viewing this topic.

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Load order of modules
« on: January 17, 2007, 03:11:44 pm »
Today was the first time I had a problem with the order in which modules are loaded in my 2.10 bot. There was a short discussion in this thread. Anyways, this was all completely off topic in the Online.php thread, but my own solution and Xenixa's got me thinking. The following concept may be complete bogus, or totally unnecessary. I have no idea what the new version brings, and how load order of modules is handled there.
  • Put all modules except for main.php into one directory, even Bot.php, AOChat and such.
  • Let main.php load (require_once) the modules in this directory in any order, no need to sort, no need to load Bot.php and such modules first. Remove the code from main.php that outputs which module just got loaded.
  • Add as many require_once into each module's header as necessary. All "normal" modules would need Bot.php at least, plus all additional modules they rely upon. Bot.php would require AOChat.php and MySQL.php.
  • Put the $bot -> log(...) output that tells us which module got loaded into each module's constructor.
Uhm... that's about it. I think this way modules should automatically get loaded in one of the many correct orders. AOChat.php and MySQL.php would still be loaded first, Bot.php thereafter, modules that rely upon other modules last. All modules that got loaded after Bot.php would output that they have been loaded themselves. Would that work? Would anyone need or want this?

Would be cool if someone tells me this is a stupid idea before I go and break my bot just for the fun of it.  ;D
« Last Edit: January 17, 2007, 05:10:46 pm by pusikas »
Luuv  Bot-Keeper of Vengeance ^^*

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Load order of modules
« Reply #1 on: January 22, 2007, 06:42:49 pm »
Im not sure which way is the best to go about this.

However we do recognize the need to have a method of either tracking dependencies and module loading order.

Ideally it would likely be part of the hooking revamp planned for 0.5 where we will be using wrapper functions to register modules and possibly dependencies etc.
Ï would love to see some more discussion around this.
BeBot Founder and Fixer Kingpin

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 301
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal