I25 Server Setup: Difference between revisions

From OuroDev
Line 142: Line 142:
::: <syntaxhighlight lang="text"> DbServer 127.0.0.1 127.0.0.1 7000 Paragon 1 1</syntaxhighlight>  
::: <syntaxhighlight lang="text"> DbServer 127.0.0.1 127.0.0.1 7000 Paragon 1 1</syntaxhighlight>  
;: Example mission_server.cfg
;: Example mission_server.cfg
::: <syntaxhighlight lang="text"> Shard NAME WAN SHARDID</syntaxhighlight>  
::: <syntaxhighlight lang="text"> Shard NAME WAN REGION</syntaxhighlight>  
::: <syntaxhighlight lang="text"> Shard Paragon 127.0.0.1 1 </syntaxhighlight>  
::: <syntaxhighlight lang="text"> Shard Paragon 127.0.0.1 1 </syntaxhighlight>  
: Next copy the "piggs" folder from your client to the server directory(C:\CoH\piggs)
: Next copy the "piggs" folder from your client to the server directory(C:\CoH\piggs)

Revision as of 00:51, 5 May 2019

Server Setup From Scratch

i25 Configuration Files

Setup Local Server

1. Install SQL Server 2017 Express Edition
2. Choose Basic when installing and when given the option choose to install SSMS(SQL Server Manager Suite).
3. Move your i25 Binaries to C:\CoH
4. Navigate to C:\CoH\data\server\db
5. Open up auction_server.cfg(I25_auction_server.cfg), account_server.cfg(I25_account_server.cfg), chat_server.cfg(I25_chat_server.cfg), and servers.cfg(I25_Server.cfg).
You can change the password to whatever you would like. For this example I will be just using "YOURL33TPASS!".
You will see something like this.
 SqlLogin "DRIVER={SQL Server Native Client 11.0};Server=NS319069\SCORE;Uid=sa;Pwd=FinallyFree!;"
Change this to
 SqlLogin "DRIVER={SQL Server Native Client 11.0};Server=localhost\SQLEXPRESS;Uid=sa;Pwd=YOURL33TPASS!;"
While you have servers.cfg and auction_server.cfg open. Change all the ips to 127.0.0.1.
6. Extract the dbschema.rar found in C:\CoH\dbschema.rar.
7. Open up SQL Server Management Studio (SSMS which you installed in the first step). Hit Connect on the screen that pops up to and connect with windows authentication.
8. We need to enable the sa login so that server can login to the database.
If you look to the left panel you will see the object explorer and your connection. Right click it and select properties.
When this window comes up hit Security to the left and enable "sql server and windows authentication". Then click ok.
In the same panel you used before navigate to Security -> Logins then right click and enter properties the sa user.
In this window set the password to the same password you set back at step 4
Choose Status from the left panel in this same window and set login to enabled and hit ok.
Right click the connection in the object explorer again and click Restart.
9. Click File, Select Open, navigate back to C:\CoH, open the dbschema folder, and select cohauc.sql in SQL Server Management Studio.
You will see these 2 lines at the top of the file opened
  •  ( NAME = N'cohauc', FILENAME = N'C:\mssql\MSSQL11.SCORE\MSSQL\DATA\cohauc.mdf' , SIZE = 157440KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
    
  •  ( NAME = N'cohauc_log', FILENAME = N'C:\mssql\MSSQL11.SCORE\MSSQL\DATA\cohauc_log.ldf' , SIZE = 353216KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
    
10. What you want to do is set the first part of these directory listings to where your SQL Server is located for example, I set my to D:\Program Files\Microsoft SQL Server\MSSQL14.SQLEXPRESS\MSSQL because that is where my SQL Server is. So my would become:
Error creating thumbnail: File missing
  •  ( NAME = N'cohauc', FILENAME = N'D:\Program Files\Microsoft SQL Server\MSSQL14.SQLEXPRESS\MSSQL\DATA\cohauc.mdf' , SIZE = 157440KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
    
  •  ( NAME = N'cohauc_log', FILENAME = N'D:\Program Files\Microsoft SQL Server\MSSQL14.SQLEXPRESS\MSSQL\DATA\cohauc_log.ldf' , SIZE = 353216KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
    
11. Once done click the Execute button. And do this again for both the cohauth and cohchat.
12. Open up ODBC Data Sources (32-bit).
  • Type 'ODBC' in Windows search, or run directly from C:\Windows\SysWOW64\odbcad32.exe
  • Do NOT use 64-bit!
  • Click File DSN then click add to the right.
  • Choose ODBC Driver 17 for SQL Server. Click Next.
  • Enter AuthDB into the box and hit next then finish.
  • It will then say something like ‘Which SQL Server would you like to connect to?’
    • Type localhost\SQLEXPRESS and hit next.
  • Choose with SQL Auth enter sa into username and the password you use previously.
  • Tick choose change default database to and select cohauth and hit next.
  • After this hit finish then ‘Test Data source’ this will test the auth database connection to your main database if it successful congrats :D
13. Once you have done that you can now start up your server. Navigate back to C:\CoH and create a bat file to start your server.
 
@echo off
echo Starting Auth Server
START C:\coh\bin\authserver.exe
TIMEOUT 2
echo Starting DB Server
START C:\coh\bin\dbserver.exe -zonelaunchers 1
TIMEOUT 2
echo Starting Launcher Server
START C:\coh\bin\launcher64.exe -noversioncheck
TIMEOUT 2
echo Everything should be launched! Go enjoy COH.
TIMEOUT 10
14. Go to your City of Heroes folder and make a shortcut of score.exe.
  • Add the string below to the shortcut if playing locally on the hosting machine.
     score.exe -patchdir score -patchversion 2019.04.19 -auth 127.0.0.1 -noversioncheck -console
    
  • Add the string below to the shortcut if playing over the network. Note you'll need the hosting machines IP for this. (CMD -> IPConfig)
     score.exe -patchdir score -patchversion 2019.04.19 -auth <HOSTIPADDRESS> -noversioncheck -console
    
15. Login and Enjoy!

Port Forwards

TCP Ports
Port 11228
UDP Ports
Ports 18717 through 18917

Setup Internet Facing Server

Patching the DBServer allows it to return the correct IP address for MapServers to the client.
dbserver.exe needs to be patched to read its external IP from a config file, a patched version can be downloaded from here or from the following magnet link
dbserver nat fix.zip
dbserver.exe [MD5] c66842d15bc94f6b6b2a282331c01e3f   |   dbserver.exe [SHA1] 9ba7c9774de2f75cd72efb604c44c3a86cbd24eb
From SQL Sever Manager Studio(SSMS) run the query below.
 INSERT INTO cohauth.dbo.server (id, name, ip, inner_ip, ageLimit, pk_flag, server_group_id) VALUES (1, 'ShardName', 'Public IP', '127.0.0.1', 0, 0, 1);
Replace the existing dbserver.exe with the patched one and add the RouteIp line to servers.cfg with your server's public IP.
 RouteIp YOURPUBLICIPADDRESS

Patched AuthServer

Patched AuthServer
For use alongside the patched dbserver, reads first RouteIp in servers.cfg as externalIP and second RouteIp in servers.cfg as internal IP, rather than from cohauth
Patched authserver
 MD5: kuF0O1e/K3iT6tcXKA0xmQ== | SHA1: +7IdIglCD1EEM9xNcZUyYRuZ9Ec= | SHA256: 7A370DAB25CBEA30A0BCA3333F6BBD971315604E98218B71BEDCC2F415918285
Example configuration:
 
// First RouteIP is External (WAN) IP
RouteIp 123.123.123.123
// Second RouteIP is Internal (LAN) IP
RouteIp 192.168.0.0

// Uncomment the following line to use IPs from cohauth
//AuthDBIP 1

Setup TurnstileServer

Making the changes below will put your server into "production" mode. This will require things like mission_server.cfg to be created.
First make sure your turnstile_server.cfg is correct. Below you'll find an example.
Example turnstile_server.cfg
 DbServer LAN WAN 7000 ShardName ShardID ShardAuthID
 DbServer 127.0.0.1 127.0.0.1 7000 Paragon 1 1
Example mission_server.cfg
 Shard NAME WAN REGION
 Shard Paragon 127.0.0.1 1
Next copy the "piggs" folder from your client to the server directory(C:\CoH\piggs)
At this point you should be able to run turnstileserver.exe.
As I mentioned earlier in the guide you'll likely run into new issues with these changes. Like needing mission_server.cfg, -noreserved on chatserver, and a few other minor edits.
Putting the server into production mode will also change the version to 2400.201208211101.1. Your clients will need to update their connect parameter.
-patchdir score -patchversion 2400.201208211101.1 -auth VMIPGOESHERE -console