Myth of Empires

Myth of Empires

Otillräckligt med betyg
Rough Cluster Standup Guide for Windows Servers
Av IceWarden och 1 medverkande
Rough-Draft guide on getting your MoE Cluster running on Windows Servers
   
Utmärkelse
Favorit
Favoritmarkerad
Avfavoritmarkerad
About
Everything in this guide is meant to assist the average user in standing up a Myth of Empires cluster. All information gathered in this document has been discovered by either yours truly or the great community over at the Admins United discord. I will do my best to keep everything here up to date, but for the latest updates and discussions, please feel free to drop by!

Admins United Discord: https://discord.gg/7vrFzfAMvG

If you are looking for a standalone server guide and not ready for a cluster, check out our new stand alone guide here.
Server Prep
- Powershell Core (https://github.com/PowerShell/PowerShell)
- SteamCMD (https://developer.valvesoftware.com/wiki/SteamCMD)
- Windows Subsystem for Linux
- Ubuntu 20.04 (for the purpose of this tutorial)
- AnotherRedisDesktopManager (https://github.com/qishibo/AnotherRedisDesktopManager)
Install WSL + Ubuntu ( Server 2022 Only )
THIS IS NOW OPTIONAL. IF YOU DON'T CARE ABOUT USING THE LATEST VERSION OF REDIS THEN SKIP THIS SECTION AND GO TO THE INSTALL REDIS SECTION. BE WARNED: USING OUTDATED AND DEPRECATED SOFTWARE IS NEVER RECOMMENDED BUT ITS EASIER.

We need a REDIS Instance but these can't be natively hosted on windows, so we need to install WSL.
There is a few stand-alone 3rd party projects that allow you to run REDIS on windows, but these are untested. WSL/Ubuntu is a tried and true way of running REDIS properly. I will test these stand-alone redis installs later. Stay tuned for updates.

- Make sure your system is up to date
- open powershell core (Start->Run->pwsh)
- type
Install-WindowsFeature -Name Microsoft-Windows-Subsystem-Linux -Restart
and hit enter (This will reboot your server)
- open powershell core again and type
wsl --update
- type
wsl --install -d Ubuntu-20.04
- Reboot server again
- Now if you open start menu and type "Ubuntu" you should have an App show up. Launch it. This will finish the install of Ubuntu. Please follow the prompts, your ubuntu install on WSL is now completed.
Install WSL + Ubuntu (All Other Versions of Windows)
THIS IS NOW OPTIONAL. IF YOU DON'T CARE ABOUT USING THE LATEST VERSION OF REDIS THEN SKIP THIS SECTION AND GO TO THE INSTALL REDIS SECTION. BE WARNED: USING OUTDATED AND DEPRECATED SOFTWARE IS NEVER RECOMMENDED BUT ITS EASIER.

Official Microsoft Page: https://learn.microsoft.com/en-us/windows/wsl/install-on-server#install-wsl-on-previous-versions-of-windows-server


- Run Powershell (pwsh) as Administrator and type:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Download the Ubuntu 20.04 Windows Appx from the below link
https://aka.ms/wslubuntu2004
- Rename the Ubuntu Appx from .AppxBundle to .zip and then open it
You may need to disable "hide file extensions" in Windows Folder Options
- Copy the "Ubuntu_2204.1.7.0_x64.appx" to a destination of your choice
- Using powershell, change to the directory where you put the Ubuntu AppX file and run the following command
Add-AppxPackage .\Ubuntu_2204.1.7.0_x64.appx

Installation failed with error 0x8007007e: If you receive this error, then your system doesn't support WSL. Ensure that you're running Windows build 16215 or later. Check your build. Also check to confirm that WSL is enabled and your computer was restarted after the feature was enabled.

- Add the Distro to your Windows Environment Path:
$userenv = [System.Environment]::GetEnvironmentVariable("Path", "User") [System.Environment]::SetEnvironmentVariable("PATH", $userenv + ";C:\Users\Administrator\Ubuntu", "User")
Install Redis
IF YOU SKIPPED THE WSL AND UBUNTU INSTALL (NOT RECOMMENDED)
https://github.com/IceWarden/AdminsUnitedPub/releases/tag/RedisDatabase
- Download the zip and extract it to a location of your choice
- Edit the redis.cnf file and edit the following:
- #bind 127.0.0.1 (Uncomment this and change if you need a specific Bind Address)
- #requirepass foobared (Uncomment this and change it if you open redis to the interwebs)
- Launch the redis-server_start.bat and call it a day!

IF YOU WERE A GOOD BOY/GIRL/THING/IT/PERSON AND INSTALLED WSL AND UBUNTU FOLLOW BELOW

*https://redis.io/docs/install/install-redis/install-redis-on-windows/*
- Launch Ubuntu App
- Follow the instructions on the provided link.
I'll paste it here but please reference the url provided as this could change overtime
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list sudo apt-get update sudo apt-get install redis sudo service redis-server start
Installing Database Server
BIG THANKS TO DEVILIATH FOR FIGURING THIS OUT!!

Even though the Matrix Tool states that it uses MySQL, its actually using MariaDB which is an offshoot of MySQL. I've tested this thoroughly and it works without issues.

  • - Download MariaDB (latest version works fine)
  • * https://mariadb.org/download/?t=mariadb&p=mariadb&r=11.3.2&os=windows&cpu=x86_64&pkg=msi&m=acorn *
  • - Install MariaDB, make sure all options are selected
  • - next through the setup, make sure to set your root password as you will need that in the next section
  • - Once install is finished, open HeidiSQL on your server which should of been installed with MariaDB installer
  • - Click "new" to add a new connection and fill in the details as such:


  • - Connect to your database by hitting open
  • - Copy and paste the following query into your "Query" tab at the top

-- Don't touch this CREATE DATABASE moe_pub; CREATE DATABASE moe_role; CREATE DATABASE moe_opt; CREATE DATABASE moe_banlist; -- CHANGE THE PASSWORD CREATE USER 'moeadmin'@'%' IDENTIFIED BY 'CHANGE_ME'; GRANT ALL PRIVILEGES ON moe_opt.* TO 'moeadmin'@'%'; GRANT ALL PRIVILEGES ON moe_role.* TO 'moeadmin'@'%'; GRANT ALL PRIVILEGES ON moe_pub.* TO 'moeadmin'@'%'; GRANT ALL PRIVILEGES ON moe_banlist.* TO 'moeadmin'@'%';
  • - hit F9 to run the command. This sets up the databases and the user account we are going to use
  • - Done!
Installing and Configuring Myth of Empires
- Using Powershell and SteamCMD
& "C:\PATH\TO\STEAMCMD.exe" +force_install_dir "C:\PATH\TO\FOLDER" +login anonymous +app_update 1794810 validate +quit


Now On your client machine, browse to your MoE Client folder and run the Matrix Server tool and fill out all the fun information

**Scene Server**
  • - Server Map: East Mainland is the new map Dongzhou
  • - City ID: This the Prefecture
  • - XianchengID: This tells you where on the map the node is placed
  • - PVP/PVE: Straight forward
  • - SceneServerID: Unique ID for this server (default is 50000) (This has to change with each server)
  • - SceneServer Inner Addr: This is your "Private IP" (Use IPCONFIG to get it)
  • - SceneServer Outer Addr: This is your "Public IP" (Use IPCHICKEN.COM to get)
  • - SceneServer Ports: These ports need to be opened through your router/firewalls. Defaults are 5010, 5020, 5030
  • - SceneServer RemoteAddr: This is how to connect to RCON. Highly recommended to leave at 127.0.0.1 (so no one can connect from outside the server)
  • - SceneServer RemotePassword: RCON Password
  • - SceneServer MaxPlayers: Straight forward.
  • - Hit Save Scene Server.
  • - Change the ID +1 and hit ADD to create a second node in the cluster. Proceed to fill out the information. Make sure to not use the same ports

**Battle Server**
  • - This is the battle server. I never played officials so I dont know exactly how it works
  • - BattleServer Map: Review the documentation by MoE on this section
  • - BattleServer ID: Unique ID for the Server
  • - BattleServer Inner Addr: Your Private IP
  • - BattleServer Outer Addr: Your Public IP
  • - BattleServer Ports: These ports need to be opened through your router/firewall. Defaults are 6010, 6020, 6030.
  • - BattleServer RemoteAddr: This is how to connect to RCON. Recommended to leave at 127.0.0.1
  • - BattleServer RemotePassword: RCON Password
  • - BattleServer MaxPlayers: Self Explainatory

**Lobby Server**
  • - This is where everyone connects to your grid.
  • - Lobby ServerID: Unique ID
  • - Lobby Port: Unique Port, default is 7000
  • - Lobby Password: Essentially a server password
  • - LobbyServer InnerAddr: Your Private IP
  • - LobbyServer OuterAddr: Your Public IP
  • - LobbyServer Ports: These ports need to be opened through your router/firewalls. Defaults are 700, 7020, 7030, 7040
  • - LobbyServer RemoteAddr: This is how to connect to RCON. Recommended to leave at 127.0.0.1
  • - LobbyServer RemotePassword: RCON pass
  • - LobbyServer MaxPlayers: Get it?

**PubData Server**
  • - No idea what this is but it seems to connect everything together
  • - PubData ServerID: Unique Server ID
  • - PubData Addr: Your Public IP
  • - PubData Ports: These ports need to be opened through your router/firewalls. Defaults are 9000, 9010, 9020, 9030
  • - PubDataServer RemoteAddr: This is how to connect to RCON. Recommended to leave at 127.0.0.1
  • - PubDataServer RemotePassword: RCON pass

**Peripheral Server**
  • - This is all your connections
  • - Redis
  • - Redis Addr: 127.0.0.1
  • - Redis Prt: Port to redis (Default 6379)
  • - Redis Password: Default is blank
  • - Chat
  • - ChatServer Addr: Your Private IP
  • - ChatServer Port: Default is 8010
  • - ChatClient Addr: Your Public IP
  • - ChatClient port: Default is 8020
  • - DB Store Config
  • - DB Store Addr: Your Private IP (or 127.0.0.1)
  • - DB Store Port: Default 8030
  • - Battle Manager
  • - BattleManager Addr: Your Private IP (or 127.0.0.1)
  • - BattleManager Port: Default 8040
  • - OPT Tool
  • - Opt Addr: PRIVATE IP
  • - Ports: Defaults 8050, 8060, 8070, 8080

** Database Config **
IF YOU SETUP THE MARIADB SERVER ONLY
  • - Role Database Addr: IP of the server where MariaDB is installed
  • - Role Database Port: 3306
  • - Role Database Username: moeadmin
  • - Role Database Password: Your Password
  • - Role Database catalog: moe_role
  • - Public Database Addr: IP of the server where MariaDB is installed
  • - Public Database Port: 3306
  • - Public Database UserName: moeadmin
  • - Public Database Password: Your Password
  • - Public Database Catalog: moe_pub
  • - Opt Database Addr: IP of the server where MariaDB is installed
  • - Opt Database Port: 3306
  • - Opt Database UserName: moeadmin
  • - Opt Database Password: Your Password
  • - Opt Database Catalog: moe_opt

  • - Now go to Start Console -> Save Config
  • - Now we need to copy over the MatrixServerTool folder from your Client install. We don't need the whole folder, we only need the game-chat-service.exe and the game-opt-sys.exe, however without knowing what DLLs they require, its easier to just copy the entire thing over. You can put it wherever you want but its easiest to just drop it in the root of your server install folder.
  • - If you are using my powershell script, copy the "ServerParamConfig_All.ini" to <YOUR_SERVER_INSTALL>\configs
  • - If you are not using my script, the tool would have generated a series of BAT files. You just need to copy these over to your server, update the path in them to your MOEServer.exe and then run each of them.

-Update 2-23-2024: Opt Addr Needs to be your PRIVATE IP, not public.
IceWarden's Powershell Script
Icewarden's MOE Cluster Script: https://github.com/IceWarden/AdminsUnitedPub/blob/main/ServerScripts/MythOfEmpires/Moe_v1.ps1

Pre-Setup

I'm proud to announce the first release of my Myth of Empires Cluster Management script. This script is built to allow admins to easily manage their clusters without the aid of management systems (WGSM etc..). This script will read all the parameters from the ServerParamConfig_All.ini and stand up your cluster for you. This is a powershell script, to execute it you will need to use powershell!

What it does
  • Stands up Lobby, Opt, Pub, Chat, and Scene servers based on the configuration in the ServerParamConfig_All.ini file
  • Has options for Restarting, Stopping, or Updating your MoE Cluster
  • Since it is a powershell script, you have the ability to create Scheduled Tasks in Windows to have things like automated reboots and constant update checking

What it does not do
  • Does not start your REDIS Server for you
  • Does not start Battlefield Servers (this is current WIP but I wanted to get you this script sooner)
  • Does not buy you ice cream or cookies

How it works
  • Load the MatrixServerTool on your client computer, fill out all your settings and save it. This will create the "ServerParamConfig_All.ini" config file.
  • on your server create a folder called "configs" in the root directory of where you installed the MoE Dedicated Server. Copy the ServerParamConfig_All.ini config file to that folder.
  • Copy the MatrixServerTool folder from your client computer to your server into the root directory of where you installed the MoE Dedicated Server.
  • Edit the powershell script (Moe_v1.ps1) and change the parameter variables at the top of the script
  • Execute the script for the first time using the "UpdateCluster" option.
  • This will add the necessary files to help auto-update in the future.
  • The Script by default will auto-restart the cluster every 8 hours and Auto check for updates every 30 minutes. To Disable this set autoprocess = "false" in the parameters.

Options
-option StartCluster -> This function will start the cluster -option ShutdownCluster -> This function will save and shutdown the cluster -option RestartCluster -> Use this to restart cluster/recover from crashes -option UpdateCluster -> Use this to check and update the cluster if needed -option AddBan -> Use this to Add a steamID to the database and ban them across the entire cluster for a set amount of time.
FAQ
"My server won't start!"
ASGGameMode : : RegisterServerInfo GameServer to ServerList Failed! Server Outer Address Error
  • - Make sure to follow the instructions as per the videos linked in this channel. You need to make sure you edit the BAT file or your startup script!
-Multihome=<YOUR_PRIVATE_IP> -OutAddress=<YOUR_PUBLIC_IP>
  • - You can use http://ipchicken.com to get <YOUR_PUBLIC_IP>
  • - Make sure your ports are **4 Digit Ports** and not **5 Digit Ports**. *Ex. 11888 -> 1188*
  • - Make sure -ForceSteamNet is not in your startup script
  • - Make sure -disable_qim is not in your script

My Server Name Doesn't Display Correctly!
- Make sure you follow the instructions as per the videos linked in this channel. You need to edit your BAT file or Startup script and add quotation marks around your server name. For example:
-SessionName=I Like Spaces
Needs to be
-SessionName="I Like Spaces"

How do I add Multiple Admins?
  • - Admins are a semi-colon seperated list. You need to Edit your BAT or Startup Script as follows:
-ServerAdminAccounts=<STEAMID1>;<STEAMID2>

All my horses are dead!
  • -You need to edit this setting from 0 to 0.8 minimum
-HorseMaxQualityCorrection=

XYZ Setting Doesn't Exist on Nitrado/GPORTAL/GTX
  • - You need to reach out to your provider to give you that option. There's nothing anyone here can do as to configure these you need to set the startup script.

Can you remove Blue text from side of screen without removing Admin?
  • - No.

Server Region setting (thanks @deviliath )
  • - Set your DistrictID to the following:
  • - 1= Asia
  • - 2= Asia
  • - 3= Europe
  • - 4= North America
  • - 5= North America

My Chat stopped working!
  • - The Chat Service is very...fragile. Sometimes restarting the chat service can correct the issue, sometimes it may require a server wipe. Make sure REDIS is setup and check the chat server logs for more details.
  • - Make sure you have the chatClientAddr=<PUBLIC IP> otherwise no one outside your network can use it

Error: OptSDKClient, connect to server failed at x.x.x.x:8050
  • - This is the scene servers failing to connect to the OPT service. This is caused most likely because the OPT server is failing to connect to the database. Check your OPT logs and confirm all of your database settings. Refer to this guide on setup.
Admins United
All Information gathered in this guide came from either myself or the Admins United community. You can join us at: https://discord.gg/7vrFzfAMvG
Updates
*Update 2-26-2024*
- Added FAQ and About section
- Added guide for setting up Automatic Updates & Reboots

*Update 2-24-2024*
- Tested a new stand-alone Redis Install that works. Uploaded it to the Admins United Public GitHub for easy access for the community. Updated the guide to reflect that
- MoE_v1.ps1 Cluster Management Script released.

*Update 2-23-2024*
  • - WSL+Ubuntu section is now optional. However it is highly recommended to do it that way (or have a LINUX server on hand to use REDIS). There is a GITHUB repo that has been archived and is no longer maintained that runs a very very old version of redis that can easily be installed on Windows. I've tested it and it works, however once again I highly highly recommend going the WSL+Ubuntu route to use the latest version of REDIS.
  • - Added Instructions for Installing WSL and Ubuntu for non Server 2022 Servers
5 kommentarer
IceWarden  [skapare] 19 mar, 2024 @ 13:20 
@Razernok - Please read the instructions carefully. There is a section that boldly states to copy the Matrix Server Tool from your Client files to your server.

@KidneyCarver - Each Scene Server uses about 12-15GB of memory, so if you have enough RAM yes you are good, I recommend 64GB for 2 Scene servers + the rest of the backbone
Razernok 12 mar, 2024 @ 17:10 
so the windows version and matrix tool are missing from steamcmd
KidneyCarver 6 mar, 2024 @ 11:52 
Damn nice. Can all of these different servers run on 1 pc without overloading it or should I use multiple pcs?
TehG00SE  [skapare] 23 feb, 2024 @ 9:25 
If you run into any issues please hop on the AU Discord! Tons of people there willing to help!
SMooreAce 22 feb, 2024 @ 13:38 
Seems to be very well broken down. Ill have to give it a run sometime