Skip to content

Commit

Permalink
Merge branch 'dev' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus-QC authored Jul 26, 2024
2 parents 42b541e + 1ddf14c commit cac54f2
Show file tree
Hide file tree
Showing 19 changed files with 669 additions and 46 deletions.
100 changes: 55 additions & 45 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,65 @@ on:
push:
branches:
- master
pull_request:
branches:
- master

defaults:
run:
working-directory: ./EXILED
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
actions: read
pages: write
id-token: write

env:
EXILED_REFERENCES_URL: https://misaka-zerotwo.github.io/SL-References/Master.zip
EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Dev.zip
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
# Important due to https://t.ly/5DZAy
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build_and_publish_docs:
runs-on: windows-latest

publish-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1.7.2

- name: Setup Nuget
uses: iRebbok/setup-nuget@master
- name: Get references
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ EXILED_REFERENCES_URL }} -OutFile ${{ github.workspace }}/EXILED/References.zip
Expand-Archive -Path References.zip -DestinationPath ${{ env.EXILED_REFERENCES_PATH }}
- name: Download DocFX
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install docfx --pre
- name: Run DocFX
env:
EXILED_REFERENCES: ${{ env.EXILED_REFERENCES_PATH }}
run: docfx docfx.json; docfx docfx.json

- name: Deploy to GitHub Pages
if: github.event_name == 'push' && success() #Only publishes on push to master to avoid docs mishaps
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: _site
keep_history: true
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3

- name: Dotnet Setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x

- run: dotnet tool update -g docfx

- name: Setup .NET Core SDK
uses: actions/[email protected]

- name: Setup Nuget
uses: iRebbok/setup-nuget@master

- name: Get references
shell: pwsh
run: |
Invoke-WebRequest -Uri $env:EXILED_REFERENCES_URL -OutFile $env:GITHUB_WORKSPACE/EXILED/References.zip
Expand-Archive -Path $env:GITHUB_WORKSPACE/EXILED/References.zip -DestinationPath $env:EXILED_REFERENCES_PATH
- run: docfx EXILED/docs/docfx.json
env:
EXILED_REFERENCES: ${{ env.EXILED_REFERENCES_PATH }}

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'EXILED/docs/_site'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public override ItemType Type
get => base.Type;
set
{
if (!value.IsArmor() && (value != ItemType.None))
if (value != ItemType.None && !value.IsArmor())
throw new ArgumentOutOfRangeException("Type", value, "Invalid armor type.");

base.Type = value;
Expand Down
6 changes: 6 additions & 0 deletions EXILED/Exiled.Loader/LoaderPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public class LoaderPlugin
[PluginPriority(byte.MinValue)]
public void Enable()
{
if (Config == null)
{
Log.Error("Detected null config, EXILED will not be loaded.");
return;
}

if (!Config.IsEnabled)
{
Log.Info("EXILED is disabled on this server via config.");
Expand Down
38 changes: 38 additions & 0 deletions EXILED/docs/articles/contributing/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Contributing to EXILED
---
# Contributing to EXILED

This is a simple tutorial guiding you to contribute to our framework.

### Forking EXILED
First, create a fork of our [GitHub repository](https://github.com/Exiled-Official/EXILED).

Then, clone it to your computer like so: `git clone https://github.com/your-username/EXILED.git`

Open a terminal in your forked EXILED folder and run ```git checkout dev```. This will switch you to the dev branch, which all pull requests should be submitted to.

### Setting `EXILED_REFERENCES`

If you haven't already, install the `SCP: Secret Laboratory Dedicated Server` through Steam or extract [this zip file](https://Exiled-Official.github.io/SL-References/Dev.zip) to an easily accessible folder.

#### Windows users
Open the Environment Variables menu by searching for `Environment Variables` in the Start Menu.

Create a new environment variable titled `EXILED_REFERENCES`.

The value should point to `your_steamapps_directory/common/SCP Secret Laboratory Dedicated Server/SCPSL_Data/Managed`, or to the folder where you extracted the zip file mentioned earlier.

#### Linux users
Add `export EXILED_REFERENCES="PATH"` to your `~/.bashrc` or similar file.

PATH should point to `your_steamapps_directory/common/SCP Secret Laboratory Dedicated Server/SCPSL_Data/Managed`, or to the folder where you extracted the zip file mentioned earlier.

---

You should now be able to open the EXILED directory in your favorite IDE.


Once you are done, test your changes thoroughly, and then submit a pull request to the main EXILED repository. Make sure you are targeting the `dev` branch, not `master`!

Happy coding!
49 changes: 49 additions & 0 deletions EXILED/docs/articles/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Introduction
---

# Exiled Introduction

## About EXILED

**EXILED** is a low level plugin framework for SCP: Secret Laboratory.

It offers an event system for developers to hook in order to manipulate or change game code, or implement their own functions.

All **EXILED** events are coded with [Harmony](https://harmony.pardeike.net/) using IL transpilers, meaning they require no direct editing of server Assemblies to function, which allows for two unique benefits.

- The entirety of the frameworks code can be freely published and shared. Allowing developers to better understand how it works, as well as contributing to the framework itself.
- Since all of the code related to the framework is done outside of the server assembly, things like small game updates will have little, if any, effect on the framework.

---

# Frequently Asked Questions

## What is EXILED?
EXILED - short for "EXtended In-runtime Library for External Development" is a plugin framework for SCP: Secret Laboratory compatible with MP2. It is not a direct replacement for SMOD, but it's purpose is to implement an event-based framework using Harmony patches, that plugin developers can utilize to develop plugins for SCP:SL servers.

## How do I install EXILED?
See the [Installation](https://jesus-qc.github.io/EXILED/articles/installation/index.html) page for installation information.

## How do I install plugins?
All plugins contain a DLL file (found in its latest release) that is used to load the plugin. Place the plugin in the appropriate plugin folder.
- Windows: `%AppData%\EXILED\Configs(ServerPortHere)-configs.yml`
- Linux: `~/.config/EXILED/Configs(ServerPortHere)-configs.yml`

## Where is plugin configuration stored?
Plugin configuration is stored in a separate folder than the base-game config files.
- Windows: `%AppData%\EXILED\Plugins`
- Linux: `~/.config/EXILED/Plugins`

## Is there a plugin for upgrading items in hand, inside SCP-914?
No, this is unnecessary because this is a base-game feature! Simply set the `914_mode` config_gameplay config to `DroppedAndHeld`.

## What is Harmony?
Harmony is a library that examines the code of a program as it is being run, allowing developers to tap into those functions, and run their own code, either adding onto, or completely replacing, the code the program would normally run.


The reason EXILED uses harmony is to allow easier updating of the framework in conjunction with game updates. Under ideal circumstances, a new game update will not break EXILED itself, and the only thing needed to make EXILED work again, is a very simple copy/paste of a few lines of code into the new Assembly-CSharp file.


By keeping all of our code outside of the Assembly, other developers can have full, unhindered access to the entirety of EXILED's source code, making collaboration easier. <br />
Additionally, it means that our code will be mostly unaffected by game updates. Unless the game drastically changes code in a very specific function EXILED uses for an event patch, a game update may not even require EXILED itself to also be updated.
43 changes: 43 additions & 0 deletions EXILED/docs/articles/installation/automatic/linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Automatic Linux Installation
---

# Automatic Linux Installation

Download `Exiled.Installer-Linux` from [here](https://github.com/Exiled-Official/EXILED/releases).

Move it into your **server directory** and run it using `./Exiled.Installer-Linux`
- Make sure the server directory is the one where LocalAdmin executable is found.

#### Usage
```
Usage:
Exiled.Installer [options] [[--] <additional arguments>...]]
Options:
-p, --path <path> (REQUIRED) Path to the folder with the SL server [default: YourWorkingFolder]
--appdata <appdata> (REQUIRED) Forces the folder to be the AppData folder (useful for containers when pterodactyl runs as root) [default: YourAppDataPath]
--pre-releases Includes pre-releases [default: False]
--target-version <target-version> Target version for installation
--github--token <github--token> Uses a token for auth in case the rate limit is exceeded (no permissions required)
--exit Automatically exits the application anyway
--get-versions Gets all possible versions for installation
--version Show version information
-?, -h, --help Show help and usage information
Additional Arguments:
Arguments passed to the application that is being run.
```

-----

#### Examples

- ##### Installation in a specific folder, specific version and specific appdata folder
```powershell title="Basic installation in the folder you are in"
.\Exiled.Installer-Linux --pre-releases
```

```powershell title="Installation in a specific folder, specific version and specific appdata folder"
.\Exiled.Installer-Linux -p /home/user/scpsl/server --appdata /home/user/scpsl --target-version 2.0.8
```
43 changes: 43 additions & 0 deletions EXILED/docs/articles/installation/automatic/windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Automatic Windows Installation
---

# Automatic Windows Installation

Download `Exiled.Installer-Win.exe` from [here](https://github.com/Exiled-Official/EXILED/releases).

Move it into your **server directory** and double click the .exe.
- Make sure the server directory is the one where LocalAdmin.exe is found.

#### Usage
```
Usage:
Exiled.Installer [options] [[--] <additional arguments>...]]
Options:
-p, --path <path> (REQUIRED) Path to the folder with the SL server [default: YourWorkingFolder]
--appdata <appdata> (REQUIRED) Forces the folder to be the AppData folder (useful for containers when pterodactyl runs as root) [default: YourAppDataPath]
--pre-releases Includes pre-releases [default: False]
--target-version <target-version> Target version for installation
--github--token <github--token> Uses a token for auth in case the rate limit is exceeded (no permissions required)
--exit Automatically exits the application anyway
--get-versions Gets all possible versions for installation
--version Show version information
-?, -h, --help Show help and usage information
Additional Arguments:
Arguments passed to the application that is being run.
```

-----

#### Examples
Using powershell.

```powershell title="Basic installation in the folder you are in"
.\Exiled.Installer-Win --pre-releases
```

```powershell title="Installation in a specific folder, specific version and specific appdata folder"
.\Exiled.Installer-Win -p D:\Games\SCPSL\Server --appdata C --target-version 2.0.8
```
15 changes: 15 additions & 0 deletions EXILED/docs/articles/installation/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Installing EXILED
---

# Installing EXILED

## Automatic Installation

Exiled has a tool that allows you to install **automatically** the framework for you.

## Guides

- [Window Automatic Installation](/EXILED/articles/installation/automatic/windows.html).
- [Linux Automatic Installation](/EXILED/articles/installation/automatic/linux.html).
- [Manual Installation](EXILED/articles/installation/manual.html).
24 changes: 24 additions & 0 deletions EXILED/docs/articles/installation/manual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Manual Installation
---

# Manual Installation

You can download exiled manually following this steps:

### Pick a release

You can select a release inside [our official GitHub repo](https://github.com/Exiled-Official/EXILED/releases/).

### Download the release

Download the `Exiled.tar.gz` file and extract it with your favourite tool, we recommend [7Zip](https://www.7-zip.org/) or [WinRar](https://www.win-rar.com/download.html?&L=6).

### Installation

1. Move the file **``Assembly-CSharp.dll``** to: **`(Your Server Folder)/SCPSL_Data/Managed`** and replace the file.
2. Move the **``EXILED``** folder to **`%appdata%`**

#### Note:
- Windows: This **`%appdata%`** folder is the one located inside **`AppData/Roaming`**, not just `AppData`.
- Linux: This **`%appdata%`** folder is the one called **`~/.config`**.
Loading

0 comments on commit cac54f2

Please sign in to comment.