Below are some of the more advanced setup topics you might be interested in. For first-time setup instructions please see Initial Setup.
There are additional steps you need to do to allow LAN connections to your server.
Before you do this, you need to know your local IP address:
-
Open the Windows Command Prompt.
-
Enter the
ipconfigcommand. -
Your local IP address should be displayed as
IPv4 Address.
Now you need to add your local IP address to server configuration files. In the examples below we are going to use 192.168.1.2 as the local IP address.
-
Find the
ConfigOverride.inifile in theMHServerEmudirectory and open it with a text editor. If this file does not exist, create a new text file with this name. It should be located next toConfig.ini. -
Set the value of the
PublicAddresssetting under theFrontendsection to your local IP address. Add these lines if they do no exist. It should look like this:
[Frontend]
PublicAddress=192.168.1.2-
Find the
SiteConfig.xmlfile in theApache24\htdocsdirectory and open it with a text editor. -
Set the value of the AuthServerAddress setting to your local IP address. It should look like this:
<str name="AuthServerAddress" value="192.168.1.2" />When you connect to the server from another machine, use the IP address you entered in the configuration files instead of localhost. Using the 192.168.1.2 address as an example, your client launch argument should be -siteconfigurl=192.168.1.2/SiteConfig.xml.
Setting the server up for connections outside of your local network requires the same steps as above, but instead of a local IP address you need to use a publicly accessible address or a domain name pointing to that address. You may also need to expose ports 443 for the auth server and 4306 for the frontend server. The latter port is configurable in Config.ini.
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:
-
!account create [email] [playerName] [password]- creates a new account with the specified email, player name, and password. Email and player name must be unique for each account. -
!account userlevel [email] [0|1|2]- sets user level for the specified account to user (0), moderator (1), or admin (2). Higher user levels enable additional in-game command privileges, up to being able to manage other accounts and shut down the server. -
!account password [email] [newPassword]- changes password for the specified account.
For a more in-depth list of commands see Server Commands or type !commands.
When hosting a server for larger player counts (50+), it is recommended to enable .NET's server garbage collection mode.
The easiest way to enable it for MHServerEmu is to modify the MHServerEmu.runtimeconfig.json file located next to MHServerEmu.exe:
-
Open
MHServerEmu.runtimeconfig.jsonwith a text editor. -
Add the following line to the
configPropertiessection:"System.GC.Server": true.
Please keep in mind that the server garbage collection mode tends to follow the "any RAM not used is RAM wasted" approach, which can result in very heavy RAM usage, especially when the server stays up for longer periods of time. You may want to limit memory usage by adding the following line to the same configProperties section of MHServerEmu.runtimeconfig.json: "System.GC.HeapHardLimitPercent": 80 (this will limit usage to 80% of available RAM).
You can find out more about the differences between the workstation (default) and the server modes in the .NET documentation.
The client can download additional loading screen tips from the server.
-
Copy the LiveLoadingTips.xml file provided in this repository to
Apache24\htdocs. -
Set
EnableLiveTipsandEnableLiveTipsDownloaderinSiteConfig.xmltotrue. -
Set
LoadScreenTipsURLinSiteConfig.xmltohttp://localhost/LiveLoadingTips.xml. -
(Optional) Adjust
LiveTipsQueryIntervalinSiteConfig.xmlto your preferred query interval (by default the client queries new tips every 15 minutes). -
Edit
LiveLoadingTips.xmlto add your own tips.
For tips to actually show up they need to have text matching the client's locale. For a list of supported locale website codes see here. The client updates tips only when the Date attribute of the root node of LiveLoadingTips.xml is different from the previous update.