Skip to content

Commit

Permalink
Update setup instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Crypto137 committed Mar 10, 2024
1 parent 18a01d8 commit 0477aa8
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 46 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# MHServerEmu

MHServerEmu is an experimental server emulator for Marvel Heroes.
MHServerEmu is a server emulator for Marvel Heroes.

The only currently supported version of the game client is **1.52.0.1700** (also known as **2.16a**).

The latest nightly build is available [here](https://nightly.link/Crypto137/MHServerEmu/workflows/nightly-release-windows-x64/master?preview).
The latest builds are available here: [Stable](https://github.com/Crypto137/MHServerEmu/releases/latest) / [Nightly](https://nightly.link/Crypto137/MHServerEmu/workflows/nightly-release-windows-x64/master?preview). If you are setting the server up for the first time, we recommend you to start with a stable build.

We post development progress reports on our [blog](https://crypto137.github.io/MHServerEmu/). You can find additional information on various topics in the [documentation](./docs/Index.md). If you would like to discuss this project and/or help with its development, feel free to join our [Discord](https://discord.gg/hjR8Bj52t3).

Expand All @@ -30,4 +30,4 @@ MHServerEmu is in early stages of development. Currently it features:

## Setup

See [Initial Setup](./docs/Setup/InitialSetup.md) for information on how to set the server up. Please note that since MHServerEmu is still in early stages in development, the process is currently not particularly user friendly.
See [Initial Setup](./docs/Setup/InitialSetup.md) for information on how to set the server up.
4 changes: 3 additions & 1 deletion docs/Index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ If you would like to ask questions or get up to date information, please feel fr

If this is your first time using MHServerEmu, you may be interested in this.

- [Initial Setup](./Setup/InitialSetup.md) - step by step instructions for setting up the server emulator for the first time.
- [Initial Setup](./Setup/InitialSetup.md) - stable build setup instructions.

- [Manual Setup](./Setup/ManualSetup.md) - manual setup instructions for advanced users.

- [Advanced Setup](./Setup/AdvancedSetup.md) - advanced setup instructions (enabling accounts, remote connections, etc.).

Expand Down
8 changes: 3 additions & 5 deletions docs/Setup/AdvancedSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

Below are some of the more advanced setup topics you might be interested in. For first-time setup instructions please see [Initial Setup](./InitialSetup.md).

## Enabling Accounts

By default the `BypassAuth` option in `Config.ini` is enabled. This makes the server accept any login information and always use a stub account, which is not ideal for anything beyond basic single player testing. To be able to save data and have multiple clients able to connect you need to disable `BypassAuth` and set up accounts.
## Managing Accounts

You can create and manage accounts by using ! commands in the server console or the in-game chat window. Here are some commands to get you started:

Expand Down Expand Up @@ -36,11 +34,11 @@ Please keep in mind that MHServerEmu is experimental software still heavily in d

The client uses an embedded web browser for some of its UI panels. MHServerEmu provides some options that allow you to make use of this feature.

1. Copy the [mhgame_store_home](./../../assets/store/mhgame_store_home/) folder provided in this repository to `Apache24\htdocs`.
1. Copy the [store](https://github.com/Crypto137/MHServerEmuWebAssets/tree/master/store) folder provided in the [MHServerEmuWebAssets](https://github.com/Crypto137/MHServerEmuWebAssets) repository to `Apache24\htdocs`.

2. Set `OverrideStoreUrls` in `Config.ini` to `true`.

3. Set `StoreHomePageUrl` in `Config.ini` to `http://localhost/mhgame_store_home`.
3. Set `StoreHomePageUrl` in `Config.ini` to `http://localhost/store`.

Restart the server, and you should be able to see an example store home page when you open the in-game store. You can set other pages by editing various URL options in `Config.ini` (e.g. `NewsUrl` to change the content of the news window). For more information on the embedded browser see [Embedded Browser](./../Web/EmbeddedBrowser.md).

Expand Down
49 changes: 12 additions & 37 deletions docs/Setup/InitialSetup.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,31 @@
# Initial Setup

First, you need to get the 1.52.0.1700 client. This is the final released version of Marvel Heroes, so if you still have the game in your Steam library, you can download it from there. If you do not have the game in your Steam library, you may be able to find an archived copy of it on websites like Archive.org.
First, you need to get the `1.52.0.1700` game client. This is the final released version of Marvel Heroes, so if you still have the game in your Steam library, you can download it from there. If you do not have the game in your Steam library, you may be able to find an archived copy of it on websites like Archive.org.

## Setting Up Apache and MHServerEmu
After you acquire the client, make sure to install .NET Desktop Runtime 6 if you do not have it installed already. You can download it [here](https://dotnet.microsoft.com/en-us/download/dotnet/6.0). Download [this version](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-6.0.27-windows-x64-installer) if you are not sure which one to get.

After getting the client, you need to set up a web server to serve SiteConfig.xml and redirect login requests. For this guide we are going to use Apache.
The following instructions are intended for stable builds of the server. If you feel confident in doing everything yourself, please see [Manual Setup](./ManualSetup.md).

1. Download Apache 2.4.58 Win64 [here](https://www.apachelounge.com/download/). You can use any other version of Apache you prefer, as long as it has OpenSSL support enabled.
## Setting Up

2. Extract the ```Apache24``` folder in the archive to the root directory on any drive (e.g. ```C:\Apache24```).
1. Download the latest [MHServerEmu stable build](https://github.com/Crypto137/MHServerEmu/releases/latest) and extract it.

3. Open `Apache24\conf\httpd.conf` with any text editor and uncomment (by removing the # symbol) the following six lines: `LoadModule rewrite_module modules/mod_rewrite.so`, `LoadModule proxy_module modules/mod_proxy.so`, `LoadModule proxy_http_module modules/mod_proxy_http.so`, `Include conf/extra/httpd-ssl.conf` `LoadModule ssl_module modules/mod_ssl.so`, and `LoadModule socache_shmcb_module modules/mod_socache_shmcb.so`. Make sure you remove only the # symbol and not the entire line!

4. Open ```Apache24\conf\extra\httpd-ssl.conf``` with any text editor, find the `<VirtualHost _default_:443>` section, and add the following two lines to it:
`RewriteEngine on` and `RewriteRule ^/AuthServer(.*) http://%{HTTP_HOST}:8080$1 [P]`.

5. Put [server.crt](./../../assets/ssl/server.crt) and [server.key](./../../assets/ssl/server.key) provided in this repository in `Apache24\conf`. Alternatively, you can generate your own SSL certificate.

6. Put [SiteConfig.xml](./../../assets/SiteConfig.xml) provided in this repository in ```Apache24\htdocs```.

7. Open ```ClientConfig.xml``` located in ```Marvel Heroes\Data\Configs``` with any text editor and replace the ```SiteConfigLocation``` value with ```localhost/SiteConfig.xml```. The line should look like this: `<str name="SiteConfigLocation" value="localhost/SiteConfig.xml" />`.

8. Download and install .NET 6 Runtime if you do not have it already. You can get it [here](https://dotnet.microsoft.com/en-us/download/dotnet/6.0).

9. Download the latest MHServerEmu nightly build [here](https://nightly.link/Crypto137/MHServerEmu/workflows/nightly-release-windows-x64/master?preview) and extract it wherever you like. Alternatively, you can build the source code yourself with Visual Studio or any other tool you prefer.

10. Copy `Calligraphy.sip` and `mu_cdata.sip` located in `Marvel Heroes\Data\Game` to `MHServerEmu\Data\Game`.
2. Run the included `SetupSorcererSupreme` tool and point it to your Marvel Heroes game files. You find them by right clicking on the game in your Steam library and choosing `Manage` -> `Browse local files`.

## Running the Server

Now you can actually start everything and get in-game.

1. Start Apache by running ```Apache24\bin\httpd.exe```.

2. Start MHServerEmu and wait for it to load.

3. Open the following link in your web browser and create your account: [http://localhost:8080/AccountManagement/Create](http://localhost:8080/AccountManagement/Create). This link is going to work only when MHServerEmu is fully up and running.

4. Launch the game.

5. Log in with the email / password combination you used for account creation.
1. Run the included `StartServers.bat` file and wait for MHServerEmu to initialize.

If everything works correctly, the server should display client connection information.
2. (Optional) Open http://localhost:8080/AccountManagement/Create and create an account. Note: this link is going to work only when the servers are running.

*Note: you can launch the game without Steam by running MarvelHeroesOmega.exe with the following arguments: -robocopy -nosteam.*
3. Run `StartClient.bat` and log in with your created account OR run `StartClientAutoLogin.bat` to play with a default account.

You can customize how the emulator functions by editing the `Config.ini` file. See [Advanced Setup](./AdvancedSetup.md) for more advanced setup topics.
4. When you are done, run the `StopServers.bat` file to stop the servers.

## Updating MHServerEmu

In most cases you can update MHServerEmu simply by downloading the latest nightly build and extracting it into the same directory, overwriting all files. You do not have to redo the Apache setup when you update.
In most cases you can update MHServerEmu simply by downloading the [latest nightly build](https://nightly.link/Crypto137/MHServerEmu/workflows/nightly-release-windows-x64/master?preview) and extracting it into the `MHServerEmu` directory, overwriting all files.

Overwriting all files is going to wipe your account data: if you would like to keep it, make sure to back up and restore the `MHServerEmu\Data\Account.db` file.
Overwriting all files is going to wipe your account data: if you would like to keep it, make sure to back up and restore the `MHServerEmu\Data\Account.db` file. Please keep in mind that the server is still early in development, and major changes are going to require account wipes.

In some cases migrating to a new version may require additional steps. These are going to be posted on our [Discord server](https://discord.gg/hjR8Bj52t3) in the #news channel.
46 changes: 46 additions & 0 deletions docs/Setup/ManualSetup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Manual Setup

This page contains instructions for the manual setup of the server. This is intended for more advanced users. If you are trying to set the server up for the first time, please see [Initial Setup](./InitialSetup.md).

## Setting Up the Server

You need to set up a web server to serve SiteConfig.xml and redirect login requests. For this guide we are going to use Apache.

1. Download Apache 2.4.58 Win64 [here](https://www.apachelounge.com/download/). You can use any other version of Apache you prefer, as long as it has OpenSSL support enabled.

2. Extract the ```Apache24``` folder in the archive to ```C:\Apache24```. If you would like to run it from another directory, make sure to edit the `SRVROOT` variable value in `Apache24\conf\httpd.conf`.

3. Open `Apache24\conf\httpd.conf` with any text editor and uncomment (by removing the # symbol) the following six lines: `LoadModule rewrite_module modules/mod_rewrite.so`, `LoadModule proxy_module modules/mod_proxy.so`, `LoadModule proxy_http_module modules/mod_proxy_http.so`, `LoadModule ssl_module modules/mod_ssl.so`, `LoadModule socache_shmcb_module modules/mod_socache_shmcb.so`. and `Include conf/extra/httpd-ssl.conf`. Make sure you remove only the # symbol and not the entire line!

4. Open ```Apache24\conf\extra\httpd-ssl.conf``` with any text editor, find the `<VirtualHost _default_:443>` section, and add the following two lines to it:
`RewriteEngine on` and `RewriteRule ^/AuthServer(.*) http://%{HTTP_HOST}:8080$1 [P]`.

5. Put [server.crt](./../../assets/ssl/server.crt) and [server.key](./../../assets/ssl/server.key) provided in this repository in `Apache24\conf`. Alternatively, you can generate your own SSL certificate.

6. Put [SiteConfig.xml](./../../assets/SiteConfig.xml) provided in this repository in ```Apache24\htdocs```.

7. Open ```ClientConfig.xml``` located in ```Marvel Heroes\Data\Configs``` with any text editor and replace the ```SiteConfigLocation``` value with ```localhost/SiteConfig.xml```. The line should look like this: `<str name="SiteConfigLocation" value="localhost/SiteConfig.xml" />`.

8. Download the latest MHServerEmu nightly build [here](https://nightly.link/Crypto137/MHServerEmu/workflows/nightly-release-windows-x64/master?preview) and extract it wherever you like. Alternatively, you can build the source code yourself with Visual Studio or any other tool you prefer.

9. Copy `Calligraphy.sip` and `mu_cdata.sip` located in `Marvel Heroes\Data\Game` to `MHServerEmu\Data\Game`.

## Running the Server

Now you can actually start everything and get in-game.

1. Start Apache by running ```Apache24\bin\httpd.exe```.

2. Start MHServerEmu and wait for it to load.

3. Open the following link in your web browser and create your account: [http://localhost:8080/AccountManagement/Create](http://localhost:8080/AccountManagement/Create). This link is going to work only when MHServerEmu is fully up and running.

4. Launch the game.

5. Log in with the email / password combination you used for account creation.

If everything works correctly, the server should display client connection information.

*Note: you can launch the game without Steam by running MarvelHeroesOmega.exe with the following arguments: -robocopy -nosteam.*

You can customize how the emulator functions by editing the `Config.ini` file. See [Advanced Setup](./AdvancedSetup.md) for more advanced setup topics.

0 comments on commit 0477aa8

Please sign in to comment.