I made this tutorial on clean machine just after installing Windows 10 Pro (64bit) on 2020-02-16. Installing everything took around 1 hour. In this tutorial we will use Visual Studio 2019, not 2017 recommended for TFS compilation. It will work!
What do you need before start?
Windows 10
Web Browser (tutorial created with Google Chrome)
What will you have after completing this tutorial?
GIT client integrated with Windows 10
‘linux console’ integrated with Windows 10
Visual Studio 2019 Community with C++ dev tools – IDE that let you compile TFS/OTClient easily (generate ‘.exe’ file)
vcpkg – C++ Library Manager for Windows, it will let you compile TFS/OTClient without searching for C++ libraries for hours
IDEA Community Edition with EmmyLUA plugin – free version of IDE that let you manage ‘data’ folder easily (XML and LUA files)
MariaDB database, PHP 7.4 and Apache2 server – website for your OTS
The Forgotten Server 1.2+ running on your PC
Gesior2012 for TFS 1.2+ running on your PC
1. Install GIT for Windows with environment integration
Download it from site (version 64-bit Setup): https://git-scm.com/download/win ‘Setup’ version will integrate Git with Windows explorer.
3. Install vcpkg – C++ library manager for Windows
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
Link: https://github.com/Microsoft/vcpkg Newest tagged version should be stable. I tried master branch and it did not work with all libraries. You can always use old version, not newest. I used for this tutorial: 2020.01
git checkout 2020.01
It will switch version of vcpkg to version from 2020.01
./bootstrap-vcpkg.bat
To build vcpkg. You must do it after downloading from GitHub and after every version change.
cd C:\vcpkg
.\vcpkg integrate install
This will integrate vcpkg C++ library manager with Visual Studio we installed before. After integrating with Visual Studio close PowerShell. We don’t need administrator rights anymore.
If you plan to do many changes in sources and compile in often, you may try to use Debug build type. It should link faster and reduce time of building solution.
If Apache fails to start, it’s probably because some other application is already using port 80. Common problem is Skype. Turn off Skype, start Apache, start again Skype – you got website and Skype working.
C:\ots\forgottenserver\schema.sql
and click Import. We got database for our OTS! Time to configure game server.
6. Install IntelliJ IDEA, configure game server and run it for first time!
What is IntelliJ IDEA? It’s IDE for Java and Android development. What is IDE? It’s ‘Integrated Development Environment’. Why do I need it? To develop code faster, automatically detect simple bugs and make cleaner code.
Yes. There is space and dot at end. We want to download Gesior2012 to current folder. Not to folder C:\xampp\htdocs\Gesior2012
git checkout TFS-1.2
Change Gesior2012 version to TFS-1.2 (exactly change gitbranch to TFS-1.2) Same as we did during vcpkg installation. Download from GitHub with git clone and then change version.
PHP files are not colored in IntelliJ IDEA Community edition 🙁 LUA plugin is free, but PHP is available only in IntelliJ IDEA Ultimate (paid / 30 days trial) or as separate application PHPStorm (it’s IntelliJ IDEA with PHP plugin).
PHP router file. Check if route is on list of available routes and include file by name of route. Some parts of route can be variables: ‘user/$name’. Variables can have default values: ‘users/$order=id’, default value can be empty string: ‘user/$name=’