Skip to content

Commit

Permalink
chore: update readme and code style settings
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkAtra committed May 18, 2024
1 parent 3467d4d commit 3e09e69
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 110 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ csharp_new_line_before_catch = false
csharp_new_line_before_finally = false
csharp_space_around_declaration_statements = ignore
csharp_space_after_cast = true
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required
resharper_csharp_place_attribute_on_same_line = never
resharper_place_field_attribute_on_same_line = never
resharper_place_method_attribute_on_same_line = never
Expand Down
108 changes: 1 addition & 107 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,114 +4,8 @@ This BepInEx plugin for V Rising Servers adds additional http endpoints to the s
allows you to expose additional information about players, such as the current gear level. Intended to be used
with [v-rising-discord-bot](https://github.com/DarkAtra/v-rising-discord-bot#v-rising-discord-bot-companion-integration).

It is recommended to **not** expose the server's api port to the internet.

> [!NOTE]
> This server side mod will likely break with the upcoming content update on may 8th. Progress is tracked in https://github.com/DarkAtra/v-rising-discord-bot-companion/issues/16.
[Refer to the documentation for details on how to use this mod.](https://vrising.darkatra.dev/bot-companion.html)

## Support

If you have questions or need support, feel free to join [this discord server](https://discord.gg/KcMcYKa6Nt).

## Endpoints

### `/v-rising-discord-bot/characters`

Returns information about all characters that exist on the server. Intended to be used in conjunction with
the [v-rising-discord-bot](https://github.com/DarkAtra/v-rising-discord-bot) to display the gear level for all characters.

#### Example Response

```http
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: application/json
[
{
"name": "Atra",
"gearLevel": 83,
"clan": "Test",
"killedVBloods": [
"FOREST_WOLF",
"BANDIT_STONEBREAKER"
]
},
{
"name": "Socium",
"gearLevel": 84,
"killedVBloods": []
}
]
```

### `/v-rising-discord-bot/player-activities`

Returns a list of connect and disconnect events for the last 10 minutes. Intended to be used in conjunction with
the [v-rising-discord-bot](https://github.com/DarkAtra/v-rising-discord-bot) to log connect and disconnect messages on discord.

Note that this is not persistent across server restarts.

#### Example Response

```http
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: application/json
[
{
"type": "CONNECTED",
"playerName": "Atra",
"occurred": "2023-01-01T00:00:00Z"
},
{
"type": "DISCONNECTED",
"playerName": "Atra",
"occurred": "2023-01-01T01:00:00Z"
}
]
```

### `/v-rising-discord-bot/pvp-kills`

Returns the most recent pvp kills. Intended to be used in conjunction with the [v-rising-discord-bot](https://github.com/DarkAtra/v-rising-discord-bot) to
display a kill feed on discord.

Note that this is not persistent across server restarts.

#### Example Response

```http
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: application/json
[
{
"killer": {
"name": "Atra",
"gearLevel": 71
},
"victim": {
"name": "Testi",
"gearLevel": 11
},
"occurred": "2023-01-01T00:00:00Z"
}
]
```

## Installing this BepInEx plugin on your V Rising Server

Please note that modding support for V Rising Gloomrot is still experimental. Proceed at your own risk.

1. Validate that the server has it's api enabled and a port configured. **It is not recommended to expose the api port to the internet.**
2. [Install the latest version of BepInEx](https://github.com/Odjit/BepInEx/releases/tag/vrising-release) on your Gloomrot V Rising server.
3. Download the [v-rising-discord-bot-companion.dll](https://github.com/DarkAtra/v-rising-discord-bot-companion/releases) or build it yourself by
cloning this repository and running `dotnet build`.
4. Download the [Bloodstone.dll](https://github.com/decaprime/Bloodstone/releases/tag/v0.2.1).
5. Move all dlls into your server's BepInEx `plugins` folder.
6. Start the server and test if the new endpoint is functional by executing the following command in the
terminal: `curl http://<your-server-hostname-here>:<your-api-port-here>/v-rising-discord-bot/characters`. Validate that the returned status code is 200 as
soon as the server has fully started.
2 changes: 1 addition & 1 deletion activity/ServerBootstrapSystemPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace v_rising_discord_bot_companion.activity;
[HarmonyPatch(typeof(ServerBootstrapSystem))]
public class ServerBootstrapSystemPatches {

private readonly static List<PlayerActivity> _playerActivities = new();
private static readonly List<PlayerActivity> _playerActivities = new();

public static List<PlayerActivity> getPlayerActivities() {
removeExpiredPlayerActivities();
Expand Down
2 changes: 1 addition & 1 deletion command/ServerWebAPISystemPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace v_rising_discord_bot_companion.command;
[HarmonyPatch(typeof(ServerWebAPISystem))]
public class ServerWebAPISystemPatches {

private readonly static JsonSerializerOptions _serializeOptions = new() {
private static readonly JsonSerializerOptions _serializeOptions = new() {
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase
};
Expand Down
2 changes: 1 addition & 1 deletion killfeed/VampireDownedServerEventSystemPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace v_rising_discord_bot_companion.killfeed;
[HarmonyPatch(typeof(VampireDownedServerEventSystem))]
public class VampireDownedServerEventSystemPatches {

private readonly static List<PvpKill> _pvpKills = new();
private static readonly List<PvpKill> _pvpKills = new();

public static List<PvpKill> getPvpKills() {
removeExpiredPvpKills();
Expand Down

0 comments on commit 3e09e69

Please sign in to comment.