An attempt to bring .NET scripting into classic "Ace of Spades" (0.x) servers ❤️
The goal is to be able to use C# (or any .NET language) for scripting server-side.
Because we can... (and because I'm noobmen at Python 😆)
But, mainly because I want to learn some Python. Oh, and by the way I also want to make hot-reloading possible.
I will try my best to support all (modern) server implementations, while keeping everything as smooth as possible, cross-platform and architecture independent.
- piqueserver (Python 3) on Windows/Linux/Mac/RaspberryPi | x86, x64, ARM, ARM64
NOTE: I am slowly dropping the support for Python 2 targets (PySpades and PySnip), very soon (in fact some of the code has already become red for Python 2 here), because they are really no longer maintained and also Python 2 gone End-of-Life.
Theoretically speaking, Spadecs should run fine on any Python 3-based server implementation, and also as long as you have .NET Runtime installed.
Hot-reloading means as you make changes to the server-code while it is up and running, you would see those changes applied immediately on the server (no more server restarting). Wouldn't that be cool? 😎
C# hot-reloading is work-in-progress, you can read the source code by going into CSharpScripten
folder.
However, we are not living in a perfect world, so everything comes with advantages and disadvantages.
The primary and biggest advantage of our code hot-reloading is: real-time interaction with server-code.
The downside to this is, you won't be able to debug the csx
code, because it is being recompiled on-the-fly (in memory).
In other words, if you want the ability to be able to fully debug your server-code while it is running, you must compile .NET code into a binary (library) DLL.
If you want to manually build Spadecs from source:
I can do it myself!
- Install .NET SDK (5.0 or higher), using latest available is highly recommended.
- Download or Clone the repository (using
git clone https://github.com/Conticop/Spadecs
, or use your favorite GUI).- If you choose to download via zip: After downloading, extract the zip archive to preferable location, and open a command prompt (Terminal) inside an extracted folder.
- If you choose to clone: After cloning, open the repo folder (
cd Spadecs
).
- Run
dotnet build Spadecs
.
Note: In order to build Spadecs successfully, you must have at least .NET 5.0 SDK.
If there are no errors, the output binaries shall be located in a new dotnet
folder under scripts.
If you have encountered a build error and can't figure it out, please don't hesitate to report an issue.
If you made it this far, you are ready to proceed to Running section.
If you want to get started as soon as possible:
- If you have build Spadecs from source, skip this step. Otherwise, download and install .NET Runtime.
- Copy all contents of the
scripts
folder (*.py
files +dotnet
folder) into your server scripts folder. - Modify your server configuration file to include and run
dotnet
script, it is recommended to place it first before any other scripts. - Launch your server.
- ???
- Profit.
-
You only need .NET Runtime unless you intent to build Spadecs from source.
-
Are you getting
%1 is not valid Win32 program
error upon server launch?
Spadecs is licensed under the terms of the MIT license.
See LICENSE file for more information.