Environment setup: Difference between revisions

From OuroDev
No edit summary
Line 1: Line 1:
=== Prerequisite software ===
===Prerequisite software===


*A git client of your choice, i.e. [https://git-scm.com/download/win regular ol' Git]
*A git client of your choice, i.e. [https://git-scm.com/download/win regular ol' Git]
Line 7: Line 7:
*[https://aka.ms/ssmsfullsetup SQL Server Management Studio]
*[https://aka.ms/ssmsfullsetup SQL Server Management Studio]


=== Downloading the Source repo ===
===Downloading the Source repo===
I'm going to be using git from the command-line. You just need to clone the repo and submodules, the client does not matter. There is a built-in Git extension in VS2019 to handle commits, or if you use VS Code there is a built-in Git interface to manage commits/diffs there.
I'm going to be using git from the command-line. You just need to clone the repo and submodules, the client does not matter. There is a built-in Git extension in VS2019 to handle commits, or if you use VS Code there is a built-in Git interface to manage commits/diffs there.


Line 16: Line 16:
Once this command completes you can continue.
Once this command completes you can continue.


=== Setting up Visual Studio 2019 ===
===Setting up Visual Studio 2019===
This section is only necessary if you plan on building the server/client executables.
This section is only necessary if you plan on building the server/client executables.


Download Visual Studio Installer. Select "Desktop development with C++" and "Game development with C++" during the install process. Restart your computer after.
Download Visual Studio Installer. Select "Desktop development with C++" and "Game development with C++" during the install process. Restart your computer after.


=== Setting up SQL Server 2019 ===
===Setting up SQL Server 2019===
This section is only necessary if you plan on running the server software.
This section is only necessary if you plan on running the server software.


Download SQL Server 2019's Installer. Select "Basic" installation and leave all settings default. There is no need to restart after this step.
Download SQL Server 2019's Installer. Select "Basic" installation and leave all settings default. There is no need to restart after this step.


=== Setting up SQL Server Management Studio ===
===Setting up SQL Server Management Studio===
This section is only necessary if you plan on running the server software.
This section is only necessary if you plan on running the server software.


Download SSMS' Installer. Simply click Install and wait for the process to finish. Restart your computer after.
Download SSMS' Installer. Simply click Install and wait for the process to finish. Restart your computer after.


=== Importing database schemas ===
===Importing database schemas===
Open SSMS. Connect using the default settings.
Open SSMS. Connect using the default settings.


Line 38: Line 38:
If you plan on using an AuthServer you will need to add a server entry and register an account:
If you plan on using an AuthServer you will need to add a server entry and register an account:


# Edit the table "cohauth.dbo.server" -- set '''id''' 1, '''name''' anything you want, '''ip''' external or LAN IP (this is what clients connect to), '''internal_ip''' 127.0.0.1 or LAN IP (this is how auth server determines what server has connected internally), '''ageLimit''' 0, '''pk_flag''' 1, '''server_group_id''' 1, '''client_port''' 7000.
#Edit the table "cohauth.dbo.server" -- set '''id''' 1, '''name''' anything you want, '''ip''' external or LAN IP (this is what clients connect to), '''internal_ip''' 127.0.0.1 or LAN IP (this is how auth server determines what server has connected internally), '''ageLimit''' 0, '''pk_flag''' 1, '''server_group_id''' 1, '''client_port''' 7000.
# To create an account use the query generator here https://cohstuff.dreamhosters.com/makeaccount.php. Execute the output in SSMS.
#To create an account use the query generator here https://cohstuff.dreamhosters.com/makeaccount.php. Execute the output in SSMS.


=== Building from the Source repo ===
===Building from the Source repo===
Open C:\CoH\build\vs2019\master.sln. Switch the target configuration and platform to Release x86.
Open C:\CoH\build\vs2019\master.sln. Switch the target configuration and platform to Release x86.


Build the solution (F7) and wait.
Build the solution (F7) and wait. You may close VS after this if there were no errors.


=== Starting the server ===
===Starting the server===
Create a shortcut to <code>C:\CoH\bin\ServerMonitor.exe -connect</code>. Launch that shortcut. DBServer will create cohdb and all the necessary processes will finish starting up after a few minutes.
Create a shortcut to <code>C:\CoH\bin\ServerMonitor.exe -connect</code>. Launch that shortcut. DBServer will create cohdb and all the necessary processes will finish starting up after a few minutes.


If you don't want to pre-start all maps on startup (useful to avoid mission door bugs, not useful for testing sourcce code changes fast), switch to the Processes tab in ServerMonitor and remove -startall from DBServer's entry. Close everything and open ServerMonitor again to apply.
If you don't want to pre-start all maps on startup (useful to avoid mission door bugs, not useful for testing sourcce code changes fast), switch to the Processes tab in ServerMonitor and remove -startall from DBServer's entry. Close everything and open ServerMonitor again to apply.

Revision as of 13:06, 3 June 2021

Prerequisite software

Downloading the Source repo

I'm going to be using git from the command-line. You just need to clone the repo and submodules, the client does not matter. There is a built-in Git extension in VS2019 to handle commits, or if you use VS Code there is a built-in Git interface to manage commits/diffs there.

Open a command prompt in the root of your C: drive.

git clone --recurse-submodules https://git.ourodev.com/CoX/Source.git CoH

Once this command completes you can continue.

Setting up Visual Studio 2019

This section is only necessary if you plan on building the server/client executables.

Download Visual Studio Installer. Select "Desktop development with C++" and "Game development with C++" during the install process. Restart your computer after.

Setting up SQL Server 2019

This section is only necessary if you plan on running the server software.

Download SQL Server 2019's Installer. Select "Basic" installation and leave all settings default. There is no need to restart after this step.

Setting up SQL Server Management Studio

This section is only necessary if you plan on running the server software.

Download SSMS' Installer. Simply click Install and wait for the process to finish. Restart your computer after.

Importing database schemas

Open SSMS. Connect using the default settings.

Run each SQL file located in C:\CoH\Assets\DBSchemas. You can select all the files in Windows Explorer and drag them into SSMS to open them. Click on each tab and press "Run Query" for each tab.

If you plan on using an AuthServer you will need to add a server entry and register an account:

  1. Edit the table "cohauth.dbo.server" -- set id 1, name anything you want, ip external or LAN IP (this is what clients connect to), internal_ip 127.0.0.1 or LAN IP (this is how auth server determines what server has connected internally), ageLimit 0, pk_flag 1, server_group_id 1, client_port 7000.
  2. To create an account use the query generator here https://cohstuff.dreamhosters.com/makeaccount.php. Execute the output in SSMS.

Building from the Source repo

Open C:\CoH\build\vs2019\master.sln. Switch the target configuration and platform to Release x86.

Build the solution (F7) and wait. You may close VS after this if there were no errors.

Starting the server

Create a shortcut to C:\CoH\bin\ServerMonitor.exe -connect. Launch that shortcut. DBServer will create cohdb and all the necessary processes will finish starting up after a few minutes.

If you don't want to pre-start all maps on startup (useful to avoid mission door bugs, not useful for testing sourcce code changes fast), switch to the Processes tab in ServerMonitor and remove -startall from DBServer's entry. Close everything and open ServerMonitor again to apply.