Skip to content

Commit d502d44

Browse files
committed
fix: add new guides
1 parent aa08144 commit d502d44

File tree

22 files changed

+7956
-7844
lines changed

22 files changed

+7956
-7844
lines changed

content/1.introduction/4.architecture.md

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,108 @@ icon: lucide:layers
66

77
# Version 2.#.#
88

9-
## TODO
9+
```mermaid
10+
sequenceDiagram
11+
Client->>Server: Send Request
12+
Server->>Database: Query Data
13+
Database-->>Server: Return Data
14+
Server-->>Client: Return Response
15+
```
16+
17+
::stack
18+
::div{class="p-4"}
19+
```mermaid
20+
flowchart TD
21+
A[Start: scan plugin & module folders] --> B{Found manifest?}
22+
B -- No --> Z[Finish: nothing to load]
23+
B -- Yes --> C[Parse manifest]
24+
C --> D{manifest valid?}
25+
D -- No --> E[Use filename as package name, log error]
26+
D -- Yes --> F[Register package metadata]
27+
F --> G[If language module => load language module]
28+
F --> H[If plugin => add to plugin graph]
29+
H --> I[All manifests processed]
30+
I --> J{Detect duplicate language modules?}
31+
J -- Yes --> K[Reject/choose single module & log conflict]
32+
J -- No --> L[Topologically sort plugin graph]
33+
L --> M{cycle detected?}
34+
M -- Yes --> N[Fail load, emit error with cycle trace]
35+
M -- No --> O[Load plugins in DFS order via their language modules]
36+
O --> P[Call plugin lifecycle: onStart -> onUpdate -> onEnd]
37+
P --> Q[Shutdown: unload ALL modules & plugins together]
38+
Q --> Z
39+
```
40+
::
41+
::
42+
43+
::stack
44+
::div{class="p-4"}
45+
```mermaid
46+
sequenceDiagram
47+
participant Context as Plugify Context
48+
participant PluginMgr as Plugin Manager
49+
participant PkgMgr as Package Manager
50+
participant LMLoader as LanguageModule Loader
51+
participant LMod as Language Module (C++)
52+
participant Plugin as Plugin (via LMod)
53+
participant Provider as Plugify Provider
54+
55+
Context->>PluginMgr: Init()
56+
PluginMgr->>PkgMgr: scanDirectoriesForManifests()
57+
PkgMgr-->>PluginMgr: list of manifests (.pmodule / .pplugin)
58+
PluginMgr->>LMLoader: load language modules (order doesn't matter)
59+
LMLoader->>LMod: open library / export ILanguageModule
60+
LMod-->>PluginMgr: register language module (language name)
61+
PluginMgr->>PkgMgr: enumerate plugin manifests
62+
PluginMgr->>PluginMgr: sort plugins by dependencies (SAT)
63+
PluginMgr->>LMod: request instantiate(pluginX)
64+
LMod->>Plugin: load & call onStart()
65+
Plugin->>LMod: calls language-API (calls routed)
66+
LMod->>Provider: request core services (logging, config, base dir)
67+
Provider->>Context: perform core operation / access resources
68+
Note over PluginMgr,LMod: Cyclic deps => detection during SAT;
69+
```
70+
::
71+
::
72+
73+
::stack
74+
::div{class="p-4"}
75+
```mermaid
76+
graph LR
77+
subgraph Core["Plugify Core"]
78+
PC[Plugify Context]
79+
PP[Plugify Provider]
80+
PM[Plugin Manager]
81+
PkgM[Package Manager]
82+
end
83+
84+
subgraph "Language Layer"
85+
LM[Language Module]
86+
end
87+
88+
subgraph "Plugin Layer"
89+
PluginA[Plugin A]
90+
PluginB[Plugin B]
91+
end
92+
93+
%% relationships
94+
PC -->|initializes / shutdown| PM
95+
PC -->|exposes logging/config| PP
96+
PM -->|uses provider API| PP
97+
PM -->|queries packages| PkgM
98+
PkgM -->|reads manifests| PM
99+
100+
%% language modules mediate all interactions
101+
LM -->|exports ILanguageModule interface| PM
102+
LM -->|loads / instantiates| PluginA
103+
LM -->|loads / instantiates| PluginB
104+
105+
%% no direct core-plugin link
106+
PluginA -.->|no direct link| PC
107+
PluginB -.->|no direct link| PC
108+
```
109+
::
110+
::
10111

11112
# Version 1.#.#
12113

content/1.introduction/5.faq.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Plugify requires a specific folder structure for plugins and language modules. B
169169
---
170170
tree:
171171
- res:
172-
- ^plugins^:
172+
- ^extensions^:
173173
- plugin_name1:
174174
- bin:
175175
- plugin_name1.dll
@@ -178,7 +178,6 @@ Plugify requires a specific folder structure for plugins and language modules. B
178178
- plugin_name2:
179179
- plugin_name2.py
180180
- plugin_name2.pplugin
181-
- ^modules^:
182181
- cpp_language_module:
183182
- bin:
184183
- cpp_module.dll

content/1.introduction/6.requirements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Plugify has the following dependencies:
5858
## Hardware Requirements
5959

6060
### Minimum
61-
- **Processor**: 64-bit x86 or Arm processor
61+
- **Processor**: 32-bit x86 or Arm processor
6262
- **RAM**: 2 GB
6363
- **Storage**: 100 MB of free space
6464

content/2.essentials/3.building.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -262,24 +262,23 @@ cmake -DCMAKE_BUILD_TYPE=MinSizeRel -G Ninja ..
262262
263263
Plugify provides several CMake options for customization:
264264
265-
| Option | Description |
266-
|---------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
267-
| `-DPLUGIFY_BUILD_TESTS=ON` | Enable building tests |
268-
| `-DPLUGIFY_BUILD_DOCS=OFF` | Enable building with documentation |
269-
| `-DPLUGIFY_BUILD_OBJECT_LIB=OFF` | Build Plugify as an object library |
270-
| `-DPLUGIFY_BUILD_SHARED_LIB=ON` | Build Plugify as a shared library |
271-
| `-DPLUGIFY_BUILD_SHARED_ASMJIT=OFF` | Build AsmJit as a shared library |
272-
| `-DPLUGIFY_USE_EXTERNAL_ASMJIT=OFF` | Use an external AsmJit library |
273-
| `-DPLUGIFY_USE_EXTERNAL_GLAZE=OFF` | Use an external Glaze library |
274-
| `-PLUGIFY_USE_EXTERNAL_LIBSOLV=ON` | Use an external LibSolv library |
275-
| `-DPLUGIFY_USE_EXTERNAL_FMT=OFF` | Use an external fmt library |
276-
| `-DPLUGIFY_USE_LIBCPP=OFF` | Use libc++ by adding `-stdlib=libc++` flag if available |
277-
| `-DPLUGIFY_USE_STATIC_STDLIB=OFF` | Enable static standard library linkage to avoid ABI issues by adding `-static-*` flags if available |
278-
| `-DPLUGIFY_USE_SANITIZER=OFF` | Enable sanitizers by adding `-fsanitize=*` flags if available |
279-
| `-PLUGIFY_SANITIZER_PATH=""` | Path to sanitizes libraries. |
280-
| `-PLUGIFY_ENABLED_SANITIZERS=address` | Semicolon separated list of sanitizer names. E.g 'address;leak'. Supported sanitizers are address, leak, undefined and thread. |
281-
| `-DPLUGIFY_USE_CLANG_TIDY=OFF` | Enable static analysis with clang-tidy |
282-
| `-DPLUGIFY_USE_ABI0=ON` | Enable use of the older C++ ABI, which was the default in GCC versions before GCC 5 |
265+
| Option | Description |
266+
|-------------------------------------|-----------------------------------------------------------------------------------------------------|
267+
| `-DPLUGIFY_BUILD_TESTS=ON` | Enable building tests |
268+
| `-DPLUGIFY_BUILD_DOCS=OFF` | Enable building with documentation |
269+
| `-DPLUGIFY_BUILD_OBJECT_LIB=OFF` | Build Plugify as an object library |
270+
| `-DPLUGIFY_BUILD_SHARED_LIB=ON` | Build Plugify as a shared library |
271+
| `-DPLUGIFY_BUILD_SHARED_ASMJIT=OFF` | Build AsmJit as a shared library |
272+
| `-DPLUGIFY_USE_EXTERNAL_ASMJIT=OFF` | Use an external AsmJit library |
273+
| `-DPLUGIFY_USE_EXTERNAL_GLAZE=OFF` | Use an external Glaze library |
274+
| `-PLUGIFY_USE_EXTERNAL_LIBSOLV=ON` | Use an external LibSolv library |
275+
| `-DPLUGIFY_USE_EXTERNAL_FMT=OFF` | Use an external fmt library |
276+
| `-DPLUGIFY_USE_LIBCPP=OFF` | Use libc++ by adding `-stdlib=libc++` flag if available |
277+
| `-DPLUGIFY_USE_STATIC_STDLIB=OFF` | Enable static standard library linkage to avoid ABI issues by adding `-static-*` flags if available |
278+
| `-DPLUGIFY_USE_SANITIZER=OFF` | Enable sanitizers by adding `-fsanitize=address` flags if available |
279+
| `-DPLUGIFY_USE_ANALYZER=OFF` | Enable compiler static analyzers. CPU intensive |
280+
| `-DPLUGIFY_USE_CLANG_TIDY=OFF` | Enable static analysis with clang-tidy |
281+
| `-DPLUGIFY_USE_ABI0=ON` | Enable use of the older C++ ABI, which was the default in GCC versions before GCC 5 |
283282
284283
## Testing the Build
285284

content/2.essentials/6.commands.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ plg help
6868
Display the current version of Plugify.
6969

7070
```bash
71-
plg version
71+
plg --version
7272
```
7373

74-
# **Package Manager Commands (mamba)**
74+
# **Package Manager Commands**
7575

76-
Mamba is a fast, drop-in replacement for conda and uses the same CLI patterns and configuration. This guide replaces the old Plugify (`plg`) commands with **mamba** equivalents and gives a few practical notes for migrating your workflows. :contentReference[oaicite:0]{index=0}
76+
[Mamba](https://mamba.readthedocs.io/en/latest/) is a fast, drop-in replacement for conda and uses the same CLI patterns and configuration. This guide replaces the old Plugify (`plg`) commands with **mamba** equivalents and gives a few practical notes for migrating your workflows.
7777

7878
---
7979

@@ -205,7 +205,7 @@ Add a remote repository (channel) to your configuration permanently:
205205
mamba config --add channels https://website.com/conda_channel/
206206
```
207207

208-
**Note**: Only add channels from trusted sources. Channel order and priority matter — prefer a pinned channel list (e.g., `conda-forge` then `defaults`) to avoid unexpected package mixes. :contentReference[oaicite:5]{index=5}
208+
**Note**: Only add channels from trusted sources. Channel order and priority matter — prefer a pinned channel list (e.g., `conda-forge` then `defaults`) to avoid unexpected package mixes.
209209

210210
---
211211

content/3.use-cases/1.metamod-plugin/2.installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Listing 1 plugin:
7575
You can also verify the installation by using the version command in the server console:
7676

7777
```bash
78-
plg version
78+
plg --version
7979
```
8080

8181
This will display the current version of Plugify installed on your server.

content/3.use-cases/2.standalone-launcher/2.installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Instead of running the game’s main executable (`cs2.exe` or `cs2`), use the **
6262
To ensure that Plugify has been installed correctly, open the in-game console and type the following command:
6363

6464
```bash
65-
plg version
65+
plg --version
6666
```
6767

6868
This will display the current version of Plugify running in your game.

content/3.use-cases/2.standalone-launcher/4.updating.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Since **S2-Plugify** is a standalone launcher, it must be updated manually. Foll
2828
Run the updated `s2-plugify.exe` (Windows) or `./s2-plugify` (Linux) to start the game. Verify the update by running the following command in the in-game console:
2929

3030
```bash
31-
plg version
31+
plg --version
3232
```
3333

3434
The output should display the updated version of Plugify.

content/6.plugins/5.s2sdk/4.guides/1.console-commands.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The callback function is what's invoked every time the command is used. Click he
1010
```csharp
1111
public void OnPluginStart()
1212
{
13-
var flags = ConVarFlag.LinkedConcommand | ConVarFlag.ServerCanExecute | ConVarFlag.ClientCanExecute;
13+
var flags = ConVarFlag.LinkedConcommand | ConVarFlag.Release | ConVarFlag.ClientCanExecute;
1414
AddConsoleCommand("sm_myslap", "slap me baby!", flags, Command_MySlap);
1515
}
1616

@@ -50,7 +50,7 @@ You can bind commands in the `OnPluginStart` (or anywhere you like).
5050
{
5151
public void OnPluginStart()
5252
{
53-
var flags = ConVarFlag.LinkedConcommand | ConVarFlag.ServerCanExecute | ConVarFlag.ClientCanExecute;
53+
var flags = ConVarFlag.LinkedConcommand | ConVarFlag.Release | ConVarFlag.ClientCanExecute;
5454
AddConsoleCommand("custom_command", "A command is registered during OnPluginStart", flags,
5555
(caller, context, arguments) =>
5656
{
@@ -71,7 +71,7 @@ You can bind commands in the `OnPluginStart` (or anywhere you like).
7171
class Sample : public plg::IPluginEntry {
7272
public:
7373
void OnPluginStart() override {
74-
ConVarFlag flags = ConVarFlag::LinkedConcommand | ConVarFlag::ServerCanExecute | ConVarFlag::ClientCanExecute;
74+
ConVarFlag flags = ConVarFlag::LinkedConcommand | ConVarFlag::Release | ConVarFlag::ClientCanExecute;
7575
AddConsoleCommand("custom_command", "A command is registered during OnPluginStart", flags,
7676
[](int caller, int context, const plg::vector<plg::string>& arguments) -> void {
7777
if (caller == -1) return;
@@ -88,7 +88,7 @@ You can bind commands in the `OnPluginStart` (or anywhere you like).
8888
8989
class Sample(Plugin):
9090
def plugin_start(self):
91-
flags = s2.ConVarFlag.LinkedConcommand | s2.ConVarFlag.ServerCanExecute | s2.ConVarFlag.ClientCanExecute
91+
flags = s2.ConVarFlag.LinkedConcommand | s2.ConVarFlag.Release | s2.ConVarFlag.ClientCanExecute
9292
s2.AddConsoleCommand("custom_command", "A command is registered during OnPluginStart", flags,
9393
lambda caller, context, arguments: (
9494
None if caller == -1 else s2.PrintToServer("Custom command called.\n")
@@ -107,7 +107,7 @@ You can bind commands in the `OnPluginStart` (or anywhere you like).
107107

108108
func init() {
109109
plugify.OnPluginStart(func() {
110-
flags := s2sdk.ConVarFlag.LinkedConcommand | s2sdk.ConVarFlag.ServerCanExecute | s2sdk.ConVarFlag.ClientCanExecute
110+
flags := s2sdk.ConVarFlag.LinkedConcommand | s2sdk.ConVarFlag.Release | s2sdk.ConVarFlag.ClientCanExecute
111111
s2sdk.AddConsoleCommand("custom_command", "A command is registered during OnPluginStart", flags,
112112
func(caller int, context int, arguments []string) {
113113
if caller == -1 {
@@ -126,7 +126,7 @@ You can bind commands in the `OnPluginStart` (or anywhere you like).
126126
127127
export class Sample extends Plugin {
128128
pluginStart() {
129-
const flags = s2.ConVarFlag.LinkedConcommand | s2.ConVarFlag.ServerCanExecute | s2.ConVarFlag.ClientCanExecute;
129+
const flags = s2.ConVarFlag.LinkedConcommand | s2.ConVarFlag.Release | s2.ConVarFlag.ClientCanExecute;
130130
s2.AddConsoleCommand("custom_command", "A command is registered during OnPluginStart", flags,
131131
(caller, context, arguments) => {
132132
if (caller === -1) return;
@@ -146,7 +146,7 @@ You can bind commands in the `OnPluginStart` (or anywhere you like).
146146
setmetatable(Sample, { __index = Plugin })
147147

148148
function Sample:plugin_start()
149-
local flags = bit.bor(s2:ConVarFlag.LinkedConcommand, s2:ConVarFlag.ServerCanExecute, s2:ConVarFlag.ClientCanExecute)
149+
local flags = bit.bor(s2:ConVarFlag.LinkedConcommand, s2:ConVarFlag.Release, s2:ConVarFlag.ClientCanExecute)
150150
s2:AddConsoleCommand("custom_command", "A command is registered during OnPluginStart", flags,
151151
function(caller, context, arguments)
152152
if caller == -1 then return end

content/6.plugins/5.s2sdk/4.guides/5.entity-schemas.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public unsafe class Sample : Plugin
6161
public void OnPluginStart()
6262
{
6363
AddConsoleCommand("set_health", "Sets player health to 200",
64-
ConVarFlag.LinkedConcommand | ConVarFlag.ServerCanExecute,
64+
ConVarFlag.LinkedConcommand | ConVarFlag.Release,
6565
(caller, context, arguments) =>
6666
{
6767
if (caller == -1) return ResultType.Handled;
@@ -92,7 +92,7 @@ using namespace s2sdk;
9292
class Sample : public plg::IPluginEntry {
9393
public:
9494
void OnPluginStart() override {
95-
ConVarFlag flags = ConVarFlag::LinkedConcommand | ConVarFlag::ServerCanExecute;
95+
ConVarFlag flags = ConVarFlag::LinkedConcommand | ConVarFlag::Release;
9696
AddConsoleCommand("set_health", "Sets player health to 200", flags,
9797
[](int caller, int context, const plg::vector<plg::string>& arguments) -> ResultType {
9898
if (caller == -1) return ResultType::Handled;
@@ -120,7 +120,7 @@ from plugify.pps import s2sdk as s2
120120
121121
class Sample(Plugin):
122122
def plugin_start(self):
123-
flags = s2.ConVarFlag.LinkedConcommand | s2.ConVarFlag.ServerCanExecute
123+
flags = s2.ConVarFlag.LinkedConcommand | s2.ConVarFlag.Release
124124
125125
def set_health_cmd(caller, context, arguments):
126126
if caller == -1:
@@ -154,7 +154,7 @@ import (
154154

155155
func init() {
156156
plugify.OnPluginStart(func() {
157-
flags := s2sdk.ConVarFlag.LinkedConcommand | s2sdk.ConVarFlag.ServerCanExecute
157+
flags := s2sdk.ConVarFlag.LinkedConcommand | s2sdk.ConVarFlag.Release
158158
s2sdk.AddConsoleCommand("set_health", "Sets player health to 200", flags,
159159
func(caller int, context int, arguments []string) s2sdk.ResultType {
160160
if caller == -1 {
@@ -184,7 +184,7 @@ import { s2 } from ':s2sdk';
184184

185185
export class Sample extends Plugin {
186186
pluginStart() {
187-
const flags = s2.ConVarFlag.LinkedConcommand | s2.ConVarFlag.ServerCanExecute;
187+
const flags = s2.ConVarFlag.LinkedConcommand | s2.ConVarFlag.Release;
188188
s2.AddConsoleCommand("set_health", "Sets player health to 200", flags,
189189
(caller, context, arguments) => {
190190
if (caller === -1) return s2.ResultType.Handled;
@@ -215,7 +215,7 @@ local Sample = {}
215215
setmetatable(Sample, { __index = Plugin })
216216

217217
function Sample:plugin_start()
218-
local flags = bit.bor(s2.ConVarFlag.LinkedConcommand, s2.ConVarFlag.ServerCanExecute)
218+
local flags = bit.bor(s2.ConVarFlag.LinkedConcommand, s2.ConVarFlag.Release)
219219
s2:AddConsoleCommand("set_health", "Sets player health to 200", flags,
220220
function(caller, context, arguments)
221221
if caller == -1 then return s2.ResultType.Handled end
@@ -330,7 +330,7 @@ public unsafe class GodMode : Plugin
330330
public void OnPluginStart()
331331
{
332332
AddConsoleCommand("god", "Toggle god mode",
333-
ConVarFlag.LinkedConcommand | ConVarFlag.ServerCanExecute,
333+
ConVarFlag.LinkedConcommand | ConVarFlag.Release,
334334
Command_God, HookMode.Post);
335335
}
336336

@@ -376,7 +376,7 @@ public unsafe class Teleport : Plugin
376376
public void OnPluginStart()
377377
{
378378
AddConsoleCommand("teleport", "Teleport to coordinates",
379-
ConVarFlag.LinkedConcommand | ConVarFlag.ServerCanExecute,
379+
ConVarFlag.LinkedConcommand | ConVarFlag.Release,
380380
Command_Teleport, HookMode.Post);
381381
}
382382

@@ -424,7 +424,7 @@ public unsafe class ModelChanger : Plugin
424424
public void OnPluginStart()
425425
{
426426
AddConsoleCommand("setmodel", "Change player model",
427-
ConVarFlag.LinkedConcommand | ConVarFlag.ServerCanExecute,
427+
ConVarFlag.LinkedConcommand | ConVarFlag.Release,
428428
Command_SetModel, HookMode.Post);
429429
}
430430

@@ -464,7 +464,7 @@ public unsafe class SpeedMod : Plugin
464464
public void OnPluginStart()
465465
{
466466
AddConsoleCommand("speed", "Change player speed",
467-
ConVarFlag.LinkedConcommand | ConVarFlag.ServerCanExecute,
467+
ConVarFlag.LinkedConcommand | ConVarFlag.Release,
468468
Command_Speed, HookMode.Post);
469469
}
470470

0 commit comments

Comments
 (0)