summaryrefslogtreecommitdiff
path: root/doc/changelog/pendings/changes_1624436916395082900.md
blob: 5538879a04a86cc76f6405976e1672894173ea95 (plain)
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
### Changed
- New options for loading scripts `static dynamic minimal-static minimal-dynamic` [#5346](https://github.com/azerothcore/azerothcore-wotlk/pull/5346)
```
static - Build statically. Default option. for all scripts (As it was before)
dynamic - Build dynamically. After start support Dynamic Linking Library (DLL) can make separated library for each script. Now don't support
minimal-static - builds commands and spells statically
minimal-dynamic - builds commands and spells dynamically. Now don't support
```
- Also the default value which is provided by the `SCRIPTS` variable is overwriteable through the `SCRIPTS_COMMANDS, SCRIPTS_SPELLS...` variable.
- Each subdirectory contains it's own translation unit now which is responsible for loading it's directory
- If module using deprecated script loader api, you get error message.
```cmake
> Module (mod-ah-bot) using deprecated loader api
```

### How to upgrade
- For most modules, the `CMakeLists.txt' file is no longer needed
- Need change script loader file.
```
1. Rename extension in file to `.cpp`
2. Rename general loading function to `Add(module name with replace all whitespace to '_')Scripts()`.
3. Delete macros `AC_ADD_SCRIPT_LOADER` from `CMakeLists.txt`
```
- Example loader script for modules:
```cpp
/*
 * Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
 */

// From SC
void AddSC_ServerAutoShutdown();

// Add all scripts
void Addmod_server_auto_shutdownScripts()
{
    AddSC_ServerAutoShutdown();
}
```
- List modules support new script loader api:
https://github.com/azerothcore/mod-server-auto-shutdown