Date: 2016/02/11 02:14:56 UTC-08:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
########################
# File for Engine-Core #
########################
##################################################################################
# World script that manages the loading and initialising of the entire framework #
##################################################################################
Engine_Manager:
type: world
events:
on server start:
- if <server.has_file[../dFramework/config.yml]> {
- yaml load:../dFramework/config.yml id:config
- ^run Engine_Load_Modules
}
else {
- yaml create id:config
- ^run Engine_Initialise_Core
- ^run Engine_Initialise_Modules
}
#########################################################################
# Task script for loading the core of the engine # CURRENTLY NOT IS USE #
#########################################################################
Engine_Load_Core:
type: task
script:
- yaml load:../dFramework/config.yml id:config
#####################################################
# Task script for loading the modules of the engine #
#####################################################
Engine_Load_Modules:
type: task
script:
- if <yaml[config].read[engine.options.enable-framework].not> {
- queue clear
}
- foreach <yaml[config].list_keys[engine.modules]> {
- if <yaml[config].read[engine.modules.<def[value]>.enable]> && <server.list_scripts.contains[s@Load_Module_<def[value]>]> {
- run Load_Module_<def[value]>
- debug debug "Module: <def[value]> detected and enabled. Loading module."
}
}
##############################################################
# Task script for initialising the core config of the engine #
##############################################################
Engine_Initialise_Core:
type: task
script:
- yaml id:config set engine.options.enable-framework:'true'
- yaml savefile:../dFramework/config.yml id:config
#################################################################
# Task script for initialising the modules config of the engine #
#################################################################
Engine_Initialise_Modules:
type: task
script:
- yaml id:config set engine.modules.dtitles.description:'This module is the dTitles plugin, used in the BuyCraft shop.'
- yaml id:config set engine.modules.dtitles.enable:'true'
- ^run Initialise_Module_dTitles
- yaml id:config set engine.modules.esteem.description:'This module is what determines how the npcs respond to you.'
- yaml id:config set engine.modules.esteem.enable:'true'
- ^run Initialise_Module_Esteem
- yaml id:config set engine.modules.debug.description:'This module contains all the debugging and security related tools.'
- yaml id:config set engine.modules.debug.enable:'true'
- ^run Initialise_Module_Debug
- yaml savefile:../dFramework/config.yml id:config