6. Development environment (C++/C#): Linux + Vislau Studio Code (remote)

Visual Studio Code(이하 VS Code) 의 원격 개발 기능을 사용하면 MS Windows 또는 macOS 같은 리눅스가 아닌 호스트에서 리눅스 호소트에 연결해서 개발을 할 수 있습니다. C++ 혹은 C# (mono) 를 사용해서 개발할 수 있습니다. VS CodeWindows 혹은 macOS 에서 구동하고, 개발 관련된 파일들은 리눅스 서버에 저장하게 됩니다.

You can develop game server on linux server remotely using Visual Studio Code and its remote development extension from your Windows environment or from your macOS environment.

I’ll call Visual Studio Code as VS Code, for brevity.

Important

현재 Ubuntu 기본 저장소의 Mono 라이브러리 버전 문제로 C# 프로젝트를 실행할 수 없는 경우가 있습니다.

특히, 6.x 미만의 Mono 라이브러리 버전을 사용하면 VS Code 확장 프로그램 중 C# (Microsoft) 확장 프로그램이 정상적으로 동작하지 않습니다.

아이펀엔진과 Monodevelop 개발도구를 설치하기 전 반드시 아래 절차를 따라 Mono 라이브러리 저장소를 설정 해 주시기 바랍니다.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

// Ubuntu 16.04 일 경우
echo "deb http://download.mono-project.com/repo/ubuntu stable-xenial/snapshots/6.8 main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

// Ubuntu 18.04 일 경우
echo "deb http://download.mono-project.com/repo/ubuntu stable-bionic/snapshots/6.8 main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

sudo apt-get update
sudo apt-get install mono-devel

6.1. Starting a new project

If you have an existing project, please go to the next step.

Enter the following command in a command shell to begin a new project called my_project.

$ funapi_initiator my_project

Your new project is in a directory with ‘-source’ as a suffix. For example, the project above will be named my_project-source . The game development team can put this directory in an SVN or GIT repository to share it.

6.2. Create a VS Code environment

Run as follows:

$ my_project-source/setup_build_environment --type=vscode

Launch VS Code from Windows or macOS, and then connect to the linux server. You may refer to the official document for further details.

6.3. Build the project

After connecting the linux server, you can access the previously created my_project-source directory from VS Code.

_images/vscode-cpp-build.png

From Terminal menu, run “Run Build Task” to build the project. The build configuration is located in the Build task in the .vscode/task.json file. You may change the build configuration in the tasks.json between debug/release.

Similarly, run “Packaging” task to create a package.

6.4. Debugging the project

6.4.1. C++ Project

_images/vscode-cpp-debug.png

After selecting the server type from the debug tab, you can start to debug your game server.

6.4.2. C# Project

_images/vscode-mono-debug.png

After selecting the server type from the debug tab, you can start to debug your game server. Because it uses “Mono Soft Debugger”, it may take several seconds to deubg the game server.

6.4.3. Adding a new flavor

If you use the server flavors, you need to run following command after adding a new flavor. The command will add a debugging target for the newly added flavor.

$ my_project-source/setup_build_environment --type=vscode

Note

If you modify the files in the .vscode directory, you can find the backup copies in the same directory.