Memories of Mars

Memories of Mars

Not enough ratings
Custom Server Set-up With Dynamic Server IP
By TechieZero
This helps to set up your custom MoM server --- for guys like me who have a server in their house with a dynamic IP address.

This augments the set-up PDF which is version 14 at this time. There is a thread on the discussions with the link.
   
Award
Favorite
Favorited
Unfavorite
Some Background
MoM is a good game and everyone should be able to use this addendum to the existing dedicated server PDF and get their server going. This is the a link from the Official Discord: https://1drv.ms/b/s!Ajp6FnJZTDgX4DN8ePSYz02Nx4Kn

I realize that the PDF describes setting custom ports for connection and a beacon. I never got those to work. This guide will show you how I got mine to work. If you are able to squeeze more flexibility out of this set-up, please let us know.

This guide is for someone who has a PC with decent RAM and CPU, and sets up various games on it.
  • That PC has an internal to your network static IP assigned to it (helpful to forward ports).
  • You have a decent internet connection.
  • That internet connection is not static so you use a dynamic DNS company to associate a domain name to your ever changing internet IP.
How I got It Running
OK what I did was use ping to output to a text file based on my domain name. Then I wrote a REXX script to parse out the resolved IP. Here it is step by step if you want to use my method.

Put in the Run Server bat...replacing the existing START command set-up.

***

ECHO Getting the Outside IP
ping ***YOUR URL - REPLACE WITH YOURS*** -a -n 1 > pingrpt.txt
FOR /F %%G IN ('"C:\Program Files\ooRexx\rexx.exe" D:\REXX\MACRO\getip.rex pingrpt.txt') DO (
Set Rexxip=%%G
)

ECHO Starting server for Memories of Mars
START /w Game\Binaries\Win64\MemoriesOfMarsServer.exe -PublicIp="%Rexxip%"

***

REXX is a script language like Java so I call an interpreter called REXX.EXE. It runs a script that I called getip.rex which has as it's input the ping report in text format.

Here is the REXX which is OOREXX. You can GIS to get the free install.

***

/* OO REXX */

Parse arg FileLeft

/*skip a line */
LineLeft = LINEIN(FileLeft)
CALL LINEOUT(FileNew),LineLeft

/* Grab the IP */
LineLeft = LINEIN(FileLeft)
Parse Var LineLeft crap '[' PublicIP ']' ROL

Say PublicIP


Exit

***

That's it...message me if you have questions...I might answer...good luck.