Debugging Server Scripts

Summary

Debug running server scripts using Visual Studio.

Debugging Reactor in Visual Studio.

Server room/player/entity scripts are extacted from the project and built seperately in a KSServerRuntime solution. In order to step trough your server scripts with a debugger you must do the following:

  1. Remember the name of the project you want to test. When you see <PROJECT> in the following instructions, replace that with the project name.

  2. Remember the name of the scene your want to test. When you see <SCENE> in the following instructions, replace that with the name of your scene.

  3. Remember the name of the room object your want to test. When you see <ROOM> in the following instructions, replace that with the room name.

  4. Open ./YourProject/Assets/ReactorScripts/Editor/Server/KSServerRuntime.sln in Visual Studio. This is the project used to build the KSServerRuntime that includes your server scripts.

Only change the following settings. Changing other settings may result in a broken build. If this happens use CTR-F4 in Unity to rebuild your project.

  1. Set the configuration options to Debug / AnyCPU

  2. Open the KSServerRuntime project properties and select the Build Events tab. Add the following to the "Post-build event command line" options

copy $(TargetDir)KSServerRuntime.dll $(TargetDir)..\projects\<PROJECT>\KSServerRuntime.dll
copy $(TargetDir)KSServerRuntime.pdb $(TargetDir)..\projects\<PROJECT>\KSServerRuntime.pdb
  1. Build the project with the debug configuration.

  2. Open the KSServerRuntime project properties and select the Debug tab. Make the following changes

You will now be able to step through your server scripts by clicking debug or F5 in KSServerRuntime project.

**Note that logs will be written to console instead of a log file while debugging