-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action, improve logging throughout system + exception reco…
…very
- Loading branch information
Showing
13 changed files
with
206 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: BitMod.Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
framework-version: [ 'net6.0' ] | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET Core SDK | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '7.0.x' | ||
dotnet-quality: 'ga' | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
- name: Build for ${{ matrix.framework-version }} | ||
run: dotnet build tests\BitMod.Tests --framework ${{ matrix.framework-version }} --configuration Release --no-restore | ||
- name: Test for ${{ matrix.framework-version }} | ||
run: dotnet test tests\BitMod.Tests --framework ${{ matrix.framework-version }} --configuration Release --no-build --no-restore --verbosity normal |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,60 @@ | ||
# BitMod | ||
|
||
An elegant BattleBit: Remastered modding framework designed to enable plugins of all kinds to operate | ||
simultaneously on the same API server. | ||
|
||
## Introduction | ||
|
||
BitMod features four kinds of "callback" objects: **Events**, **Hooks**, **Producers**, and **Mutators**. | ||
Each handles a different API call used by the BattleBit gameserver. BitMod chooses which event to use based | ||
on a callback's first argument. Callbacks are implemented as [lilikoi containers](https://github.com/Mooshua/Lilikoi/blob/dev/Docs/containers.md). | ||
|
||
**Events** are one-off alerts that do not require any form of response: | ||
```cs | ||
public class MyPlugin | ||
{ | ||
[BitEvent] | ||
public Task OnPlayerDied(PlayerDiedEvent ev) | ||
{ | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
``` | ||
|
||
**Hooks** expect a response of either *Allow*, *Disallow*, or *Neutral*. The first plugin to express | ||
an opinion will have it's opinion selected. Plugins are executed in ascending order of priority (0 = highest, 255 = lowest). | ||
The priority is specified by the plugin. | ||
|
||
**Events** are one-off alerts that do not require any form of response: | ||
```cs | ||
public class MyPlugin | ||
{ | ||
[BitHook(32)] | ||
public async Task<Directive> OnPlayerChatted(PlayerTypedMessageEventArgs ev) | ||
{ | ||
// No hate speech! | ||
if (ev.Message.Contains("i hate you")) | ||
return Directive.Disallow; | ||
|
||
return Directive.Neutral; | ||
} | ||
} | ||
``` | ||
|
||
**Producers** produce a value out of thin air. Similarly to hooks, they are executed in ascending order of priority. | ||
A producer can choose to either produce a value or do nothing. If a producer produces a value, then the chain ends. | ||
|
||
Producers are used for when data is expected to appear out of thin air--For example, when loading or saving | ||
player stats. | ||
|
||
**Mutators** mutate the object created by the producer. They can choose to modify whatever values they want, | ||
but are critically **not responsible for originally producing that data**. Mutators, similarly to events, will | ||
always run regardless of what a mutator before it does. | ||
|
||
## Contributors | ||
|
||
| Who | What | | ||
|-----------|---------------------| | ||
| @Mooshua | Core library design | | ||
| @moddedmcplayer | Event Arg Classes | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace BitMod; | ||
|
||
public static class Environment | ||
{ | ||
public static bool DoNotCatchEventExceptions = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.