mirror of
				https://github.com/CommonLoon102/NBloodServerSupervisor.git
				synced 2025-11-04 07:47:28 +01:00 
			
		
		
		
	NBloodServerSupervisor
Web API and NBlood server launcher service in .NET Core
Debug with Visual Studio
- Publish 
WebInterfaceto a folder with Debug configuration - Create a new folder in the publish folder and name it
blood - Compile NBlood with 
make blood NORENDER=1or withmingw32-make blood NORENDER=1 - Copy 
nblood.exeinto the newbloodfolder and rename it tonblood_server.exe - Copy the following files of Blood 1.21 into the 
bloodfolder: 
- BLOOD.INI
 - BLOOD.RFF
 - GUI.RFF
 - SOUNDS.RFF
 - SURFACE.DAT
 - TILES000.ART-TILES017.ART
 - VOXEL.DAT
 
- Start 
WebInterface.exe - Attach the debugger to 
WebInterface.exeand/orSupervisor.exe - You can call the following URLs with your web browser or Postman:
 
- http://localhost:5000/nblood/api/listservers
 - http://localhost:5000/nblood/api/startserver?players=3&ApiKey=CHANGEME
 
Deploy the server onto GNU/Linux
- Install Docker and wget (if you don’t have already), for example
like this:
sudo snap install docker && sudo apt install wget -y - Download the Dockerfile:
wget https://raw.githubusercontent.com/CommonLoon102/NBloodServerSupervisor/master/Dockerfile --directory-prefix=supervisor - Build the Docker image:
sudo docker build -t nblood-supervisor:latest supervisor - Navigate to your Blood 1.21 directory where you have these files:
 
- BLOOD.INI
 - BLOOD.RFF
 - GUI.RFF
 - SOUNDS.RFF
 - SURFACE.DAT
 - TILES000.ART-TILES017.ART
 - VOXEL.DAT
 
- Run a Docker container from there:
sudo docker run --volume "$PWD":/supervisor/publish/blood --network=host --detach nblood-supervisor - Optional: You can see the ApiKey here:
 
sudo docker run -it nblood-supervisor /bin/bashcat /supervisor/publish/appsettings.json | grep 'ApiKey'exit
Usage
You can list the currently running public servers via this URL:
http://your.ip.goes.here:23580/nblood/api/listservers
You can start new private servers via this URL:
http://your.ip.goes.here:23580/nblood/api/startserver?players=3&ApiKey=the_actual_apikey_here
The number of players must be at least 3 and maximum 8. The servers
started with this URL won’t be visible publicly via the
listservers URL. You can see the port and the command line
command to join in the response.
					Languages
				
				
								
								
									C#
								
								80%
							
						
							
								
								
									HTML
								
								15%
							
						
							
								
								
									Dockerfile
								
								5%