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

Visual Studio Code 의 원격 개발 기능을 사용해서 MS Windows와 macOS 상에서 linux 서버를 연결하여 C++ 혹은 C# (mono) 를 사용해서 개발할 수 있습니다. IDE는 Windows 혹은 macOS에서 구동하고, 개발 관련된 파일들은 linux 서버 위에 저장하게 됩니다.

이 챕터에서는 Visual Studio Code 대신 VS Code로 축약해서 부르겠습니다.

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

iFun Engine Experimental 4310 버전 부터 사용할 수 있습니다.

Important

현재 Mono 라이브러리의 버전 문제로 Ubuntu 에서 C# 프로젝트를 실행할 수 없는 문제가 있습니다. 아이펀엔진과 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/5.10.1 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/5.10.1 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.