Environment setup: Difference between revisions

From OuroDev
No edit summary
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Setting up City of Heroes: Volume 2=
TODO: organize and clarify the information on this page.


==Compiling the source code==
TODO: upload picture galleries documenting each process listed within.


==Making data changes==
=Setting up City of Heroes: Volume 2=
Volume 2 has made great strides to simplify the setup process from traditional guides.


==Running a server==
The CoX/Source repo has a working default configuration that allows for localhost connections, and requires changing a single line to work over LAN/WAN.


==Connecting to your server==
note: AuthServer does not require a File DSN anymore and can connect to the cohauth table via a connection string. It is backwards compatible for older setups.


==Making Source Changes==
==Compiling the source code==
This section is only necessary if you plan on making changes to the server/client executables. [https://git.ourodev.com/CoX/Source/-/pipelines You can download prebuilt executables from Gitlab] (referred to as build artifacts). Extract them to C:\CoH\bin if you go that route.


===Prerequisite software===
===Prerequisite software===
*A git client of your choice, i.e. [https://git-scm.com/download/win regular ol' Git]


*[https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16 VS2019 Community]
*[https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16 VS2019 Community]


===Setting up Visual Studio 2019===
===Setting up Visual Studio 2019===
This section is only necessary if you plan on making changes to the server/client executables. [https://git.ourodev.com/CoX/Source/-/pipelines You can download prebuilt executables from Gitlab] (referred to as build artifacts). Extract them to C:\CoH\bin if you go that route.
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.


===Building from the Source repo===
===Building from the Source repo===
Download CoX/Source.git based on the instructions in "Running a server."
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. You may close VS after this if there were no errors.
Build the solution (F7) and wait. You may close VS after this if there were no errors.
==Running a Server==
==Making data changes==
i2401-bin-server is a complete binning setup that's ready to be used immediately after downloading. It is largely 1:1 compared i24 with some exceptions, like badge definitions being slightly off because they require a specific order to be used when updating bins.
 
[https://git.ourodev.com/CoX/i2401-bin-server/-/pipelines You can download prebuilt piggs from Gitlab] (referred to as build artifacts). Extract to C:\CoH\bin\piggs if you go that route.


===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]
<code>git clone https://git.ourodev.com/CoX/i2401-bin-server.git</code>
===Binning from the data repo===
Read the instructions in readme.txt on which scripts to run and in what order.
''TODO: This section should be expanded on.''
==Running a server==
===Prerequisite software===
*A git client of your choice, i.e. [https://git-scm.com/download/win regular ol' Git]
*[https://go.microsoft.com/fwlink/?linkid=866662 SQL Server 2019 Developer]
*[https://go.microsoft.com/fwlink/?linkid=866662 SQL Server 2019 Developer]
*[https://aka.ms/ssmsfullsetup SQL Server Management Studio]
*[https://aka.ms/ssmsfullsetup SQL Server Management Studio]
Line 42: Line 63:


===Setting up SQL Server 2019===
===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.
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.
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===
This section is only necessary if you plan on running the server software.
Open SSMS. Connect using the default settings.
Open SSMS. Connect using the default settings.


Line 64: Line 79:
#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.
===Installing the latest data changes===
Follow the instructions in "Making data changes." Place bins in their correct places inside the data folder, or place the generated piggs under the piggs folder.


===Starting the server===
===Starting the server===
Line 70: Line 88:
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.


===Connecting to the server===
==Connecting to your server==
Run <code>Ouroboros.exe -auth <IP></code>, e.g. 127.0.0.1. Your game will load and you can begin playing.
Run <code>Ouroboros.exe -auth <IP></code>, e.g. 127.0.0.1. Your game will load and you can begin playing.


If you are not using an AuthServer you should use <code>-db <IP></code> instead.
If you are not using an AuthServer you should use <code>-db <IP></code> instead.


==Making Data Changes==
=Recommended tips=
TODO.tl;dr download i2401-bin-server and read the instructions. copy bins to server.
Rapid testing environments used for local development should specify <code>UseFakeAuth 1</code> and <code>DefaultAccessLevel 255</code> inside of servers.cfg.


= Recommended tips =
Launch your client with -nopopups.

Latest revision as of 19:45, 3 June 2021

TODO: organize and clarify the information on this page.

TODO: upload picture galleries documenting each process listed within.

Setting up City of Heroes: Volume 2

Volume 2 has made great strides to simplify the setup process from traditional guides.

The CoX/Source repo has a working default configuration that allows for localhost connections, and requires changing a single line to work over LAN/WAN.

note: AuthServer does not require a File DSN anymore and can connect to the cohauth table via a connection string. It is backwards compatible for older setups.

Compiling the source code

This section is only necessary if you plan on making changes to the server/client executables. You can download prebuilt executables from Gitlab (referred to as build artifacts). Extract them to C:\CoH\bin if you go that route.

Prerequisite software

Setting up Visual Studio 2019

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

Building from the Source repo

Download CoX/Source.git based on the instructions in "Running a server."

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.

Making data changes

i2401-bin-server is a complete binning setup that's ready to be used immediately after downloading. It is largely 1:1 compared i24 with some exceptions, like badge definitions being slightly off because they require a specific order to be used when updating bins.

You can download prebuilt piggs from Gitlab (referred to as build artifacts). Extract to C:\CoH\bin\piggs if you go that route.

Prerequisite software

git clone https://git.ourodev.com/CoX/i2401-bin-server.git

Binning from the data repo

Read the instructions in readme.txt on which scripts to run and in what order.

TODO: This section should be expanded on.

Running a server

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 SQL Server 2019

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

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 do not plan on using an AuthServer (as it's not necessary and can be a hindrance in dev setups), set UseFakeAuth to 1 in C:\CoH\bin\data\server\db\servers.cfg

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.

Installing the latest data changes

Follow the instructions in "Making data changes." Place bins in their correct places inside the data folder, or place the generated piggs under the piggs folder.

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.

Connecting to your server

Run Ouroboros.exe -auth <IP>, e.g. 127.0.0.1. Your game will load and you can begin playing.

If you are not using an AuthServer you should use -db <IP> instead.

Recommended tips

Rapid testing environments used for local development should specify UseFakeAuth 1 and DefaultAccessLevel 255 inside of servers.cfg.

Launch your client with -nopopups.