Plugins
The servers have different plugins. Each plugin is an independent entity. The plugin can track various server events, and also somehow respond to them using a list of commands defined by the server.
How to install plugin
First way. Edit
plugins_list
table in plugins_manager.luaThe same as the first one, but you can not specify the
data
field there, but onlyorder
, and throw the plugin itself with the .lua extension intoplugins
folderThe third way is the most convenient. Just drop plugin into
plugins
folder with the .lua extension, and it will automatically pick up. You no longer need to add them manually in a text editor, just move them to a folder. If you need to adjust the order of calling plugins (first one, then the other), then see the second method of application.
All use cases are in the plugin manager
API
call_function
- call some function. This can be either a server-side function or a function of another plugin registered in the shared space.register_function
- register a function, it can then be called usingcall_function
. Useful to enable other plugins to get some info. For example, the system plugin defines a kick function with an appropriate message. And this ready-made function can be used by any other pluginregister_command
- register a command. For example, we want the player to receive the message abrakadabra when they enter the command /testset_data
- set data (required for interaction between plugins)get_data
- get data (needed for interaction between plugins). For example, you need to find out the player's nicknameremove_data
- remove datasend_data
- send data. You can send data to the client. True, the client will only respond to the data whose list is defined on its side. For example, you can use this plugin to force the player to update map dataset_server_state
- set the state of the server (ready, off, starting)start
- start the server
What events does the plugin track?
init
- server startverify_registration
- player verification (the server checks whether to let the player into the game or not)on_player_registered
- player registration on the server (when a player connects, he is given a country, he is added to the list of players)on_player_joined
- moment when the player loaded the map (for example, sending him a request to display the rules before this moment does not make sense, because the player is in the menu)on_player_disconnected
- player is disconnectedon_data
- receive data from clientbefore_next
- event before next turngame_over
- game overattribute_message
- message formatting
Analyze standard afk plugin
Last updated