Skip to content

Commit 7434f5f

Browse files
committed
Clean: Plugins.md
1 parent 3de9880 commit 7434f5f

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

Plugins.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
1-
# Loading / Installing plugins
1+
# Plugins
2+
3+
## Loading / Installing
4+
25
- Run CoveServer once to generate the `/plugins` directory.
36
- Make sure you have plugins enabled in the `server.cfg` file!
47
- Place the plugin dll file in the `/plugins` directory.
58
- Restart CoveServer.
69
- The plugin should now be loaded!
710
- If the plugin is not loaded, check the CoveServer log for errors.
811

9-
# Creating Plugins
12+
## Creating Plugins
1013

1114
The repo for a template plugin can be found here: [CovePluginTemplate](https://github.com/DrMeepso/TemplateCovePlugin)
1215

13-
- Make sure you have dotnet 8.0 installed. (Cove uses .net 8!)
16+
- Make sure you have .Net 8.0 installed. (Cove uses .net 8!)
1417
- Create a new class library project in your IDE of choice.
1518
- Add a reference to the `Cove.dll` file, this can be found in the CoveServer directory.
16-
- If you didnt build Cove yourself, you can download this repo and reference it as a project in your solution.
19+
- If you didn't build Cove yourself, you can download this repo and reference it as a project in your solution.
1720
- Create a class that extends the `CovePlugin` class.
1821
- Implement the `onInit` method.
1922
- Add a `plugin.cfg` file to the project
2023
- Make sure the plugin.cfg file is set to bundle into the dll. (This makes plugins compact and work with just one file!)
21-
- You can do this by adding XML to the `.csproj` file.
22-
```xml
23-
<ItemGroup>
24-
<EmbeddedResource Include="plugin.cfg"></EmbeddedResource>
25-
</ItemGroup>
26-
```
24+
- You can do this by adding XML to the `.csproj` file.
25+
```xml
26+
<ItemGroup>
27+
<EmbeddedResource Include="plugin.cfg"></EmbeddedResource>
28+
</ItemGroup>
29+
```
2730
- Build the project!
2831

2932
## Example Plugin
33+
3034
This is a simple plugin that logs when it is loaded and when a chat message is received.
35+
3136
```csharp
3237
using Cove.Server;
3338
using Cove.Server.Actor;
@@ -36,7 +41,7 @@ using Steamworks;
3641

3742
public class ChatCommands : CovePlugin
3843
{
39-
CoveServer Server { get; set; } // lol
44+
CoveServer Server { get; set; }
4045
public ChatCommands(CoveServer server) : base(server)
4146
{
4247
Server = server;
@@ -57,7 +62,7 @@ public class ChatCommands : CovePlugin
5762
Log("Plugin unloaded!");
5863
}
5964

60-
public override void onChatMessage(WFPlayer sender, string message)
65+
public override void onChatMessage(WFPlayer sender, string message, bool local, Vector3 position, string zone)
6166
{
6267
base.onChatMessage(sender, message);
6368
Log($"{sender.Username}: {message}");
@@ -67,15 +72,17 @@ public class ChatCommands : CovePlugin
6772
```
6873

6974
Here is the `plugin.cfg` file for the plugin.
75+
7076
```cfg
7177
name=Plugin Name
7278
author=Your Name
7379
version=1.0
7480
description=Simple chat logging plugin
7581
```
7682

77-
# Plugin API
83+
## Plugin API
84+
7885
You can see all methods and properties available in the `CovePlugin` class here: [CovePlugin.cs](https://github.com/DrMeepso/WebFishingCove/blob/main/Cove/Server/Plugins/CovePlugin.cs)
7986
You can also use the `Server` property to access the CoveServer instance and all of its properties and methods!
8087
Most useful methods are in the [Server.Utils.cs](https://github.com/DrMeepso/WebFishingCove/blob/main/Cove/Server/Server.Utils.cs) file
81-
But anything in the server class is usable!
88+
But anything in the server class is usable!

0 commit comments

Comments
 (0)