| .onedev-buildspec.yml | Loading last commit info... | |
| .gitignore | ||
| CMakeLists.txt | ||
| README.md | ||
| build.sh | ||
| main.cpp | ||
| mingw-w64-i686.cmake |
Need for Speed: ProStreet Server ASI Plugin Template (AsiPluginTemplate)
A starter template for developing custom .asi C++ plugins for the Need for Speed: ProStreet server (bombd.exe) using ProStreetServerASILoader.
Overview
.asi plugins are standard 32-bit Windows dynamic link libraries (DLLs) renamed to .asi. When loaded by ProStreetServerASILoader, the plugin's DllMain entry point is called during bombd.exe startup, allowing developers to execute custom code, hook internal server functions, log events, or extend server functionality.
Features
- Starter C++ Architecture: Boilerplate code handling Windows
DLL_PROCESS_ATTACH. - Cross-Platform Building: Built on Linux targeting 32-bit Windows (
i686-w64-mingw32) with CMake. - OneDev Integration: Includes
.onedev-buildspec.ymlfor automated versioning, tagging, and building.
Getting Started
1. Modifying the Plugin Code
Open main.cpp and insert your custom logic inside InitPlugin() or DllMain:
#include <windows.h>
#include <iostream>
const char* PLUGIN_NAME = "MyCustomPlugin";
const char* PLUGIN_VERSION = "1.0.0";
void InitPlugin() {
std::cout << "[" << PLUGIN_NAME << "] Plugin loaded successfully!" << std::endl;
// Add custom memory patches, hooks, or server extensions here
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
if (fdwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hinstDLL);
InitPlugin();
}
return TRUE;
}
Building the Plugin
Prerequisites
Install the 32-bit MinGW toolchain and CMake:
# Arch Linux
sudo pacman -S cmake make mingw-w64-gcc python
Compiling
Run the cross-compilation build script:
chmod +x build.sh
./build.sh
Output binary:
build/TestPlugin.asibuild/TestPlugin_v1.0.0.zip
Deployment
Copy your compiled .asi file (TestPlugin.asi) into the server's scripts/ directory:
cp build/TestPlugin.asi ~/.OpenProStreet/scripts/
When bombd.exe starts, ProStreetServerASILoader will discover and load TestPlugin.asi automatically.
Project Structure
AsiPluginTemplate/
├── CMakeLists.txt # CMake build script
├── build.sh # Cross-compilation script
├── main.cpp # C++ plugin source code
├── mingw-w64-i686.cmake # MinGW 32-bit toolchain file
├── README.md # Documentation
└── .onedev-buildspec.yml # OneDev CI/CD pipeline spec
License
Distributed under the MIT License.