You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To register a plugin, you need to create an instance of it and pass it to the FeatherPluginManager. The FeatherPluginManager will handle the lifecycle of the plugin and call the appropriate functions.
The FeatherPluginManager will handle the lifecycle of the plugin and call the appropriate functions. Here's a breakdown of the plugin lifecycle:
72
72
73
-
### Initialization
73
+
####Initialization
74
74
75
75
-`init(config)`: This function is called when the plugin is initialized.
76
76
-`getConfig()`: This function returns the configuration for the plugin when the Feather app is initialized. Sent to the client app.
77
77
78
-
### Request Handling
78
+
####Request Handling
79
79
80
80
-`handleRequest(request, feather)`: This function is called when a request is received. (GET)
81
81
-`handleActionRequest(request, feather)`: This function is called when an action request is received. (POST)
82
82
-`handleParamsUpdate(request, feather)`: This function is called when a params update request is received. (PUT)
83
83
84
-
### Update
84
+
####Update
85
85
86
86
-`update(dt, feather)`: This function is called every frame. (Called after the request handling)
87
87
88
-
### Error Handling
88
+
####Error Handling
89
89
90
90
-`onerror(msg, feather)`: This function is called when an error occurs. Errors in this function will close the game abruptly. No frame is rendered after this function is called.
91
91
92
-
### finish
92
+
####finish
93
93
94
94
-`finish(feather)`: This function is called when the server is closed.
95
95
96
+
## Registering a plugin
97
+
98
+
To register a plugin, you need to create an instance of it and pass it to the FeatherPluginManager. The FeatherPluginManager will handle the lifecycle of the plugin and call the appropriate functions.
0 commit comments