Jump to content

HeartbeatSaver: Difference between revisions

From fCraft Wiki
No edit summary
mNo edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[HeartbeatSaver]] is a utility, bundled with fCraft 0.633+, that serves as a standalone heartbeat server. It runs separately from fCraft process and reads information from a file (HeartbeatData.txt). This allows your server to keep its uptime on Minecraft.net even when your fCraft server process needs to be restarted/shutdown.
[[HeartbeatSaver]] is a utility, bundled with fCraft {{Changelog|0.633}}+, that serves as a standalone heartbeat server. It runs separately from fCraft process and reads information from a file (<code>heartbeatdata.txt</code>). This allows your server to keep its uptime on Minecraft.net even when your fCraft server process needs to be restarted/shutdown.


When you disable fCraft's built-in heartbeat (from the Advanced tab of ConfigGUI, or by setting [[List of config keys#Advanced|HeartbeatEnabled config key]] to "false"), fCraft will start writing <code>heartbeatdata.txt</code> to disk, in fCraft's working directory.
When you disable fCraft's built-in heartbeat (from the Advanced tab of ConfigGUI, or by setting [[List of config keys#Advanced|HeartbeatEnabled config key]] to "false"), fCraft will start writing <code>heartbeatdata.txt</code> to disk, in fCraft's working directory.


'''HeartbeatSaver only works as long as its external IP address is exactly same as your server's.''' That means it'll always work when ran from the same machine that fCraft is on, and it will ''usually'' work from another machine on the same LAN. Heartbeat saver does not depend on any other fCraft files/libraries, and does not need to be in the same directory as the rest of your fCraft installation.
'''HeartbeatSaver only works as long as its external IP address is exactly same as your server's.''' That means it'll always work when ran from the same machine that fCraft is on, and it will ''usually'' work from another machine on the same LAN. Heartbeat saver does not depend on any other fCraft files/libraries, and does not need to be in the same directory as the rest of your fCraft installation.
fCraft's automatic updater (UpdateInstaller) does not include HeartbeatSaver. If an update to HeartbeatSaver is ever released, it will need to be installed manually.


==Usage==
==Usage==
:'''<code>HeartbeatSaver</code>'''
::Assumes that <code>heartbeatdata.txt</code> is in the working directory
:'''<code>HeartbeatSaver "Path/To/heartbeatdata.txt"</code>'''
:'''<code>HeartbeatSaver "Path/To/heartbeatdata.txt"</code>'''
::Specifies path to the text file with heartbeat data (including the filename) explicitly.


==heartbeatdata.txt format==
==heartbeatdata.txt format==
Usually you don't need to mess with heartbeatdata.txt yourself. fCraft server will generate this for you every minute or so.
Usually you don't need to mess with <code>heartbeatdata.txt</code> yourself. fCraft server will generate this for you every minute or so.
  Line 01: Salt
  Line 01: Salt
  Line 02: InternalIP
  Line 02: InternalIP
Line 17: Line 23:
  Line 06: Server name
  Line 06: Server name
  Line 07: IsPublic flag ("true" or "false")
  Line 07: IsPublic flag ("true" or "false")
  Line 08: WoMDirectDescription
  Line 08: HeartbeatUrl
Line 09: WoMDirectFlags
 
Line 10: HeartbeatToWoMDirect
For example:
For example:
  MuXCwxhDCNz9BIz6aBDlNYXWWhypWwvA
  MuXCwxhDCNz9BIz6aBDlNYXWWhypWwvA
Line 28: Line 33:
  Custom Minecraft Server (fCraft)
  Custom Minecraft Server (fCraft)
  False
  False
 
  https://minecraft.net/heartbeat.jsp
  [fCraft]
True


==HeartbeatSaver.exe exit codes==
==HeartbeatSaver.exe exit codes==
:0 - Success (HeartbeatSaver never exits, so you should never normally encounter this code).
{|class="wikitable"
:1 - Usage error. Make sure that a valid file is given.
!Code
:2 - Could not read heartbeat data at startup. Make sure that a valid path is given, and that the file is in correct format.
!Meaning
!Notes
|-
|0
|Success
|HeartbeatSaver never exits, so you should never normally encounter this code
|-
|1
|UsageError
|Required command-line arguments were missing, or an error occurred while trying to parse options.
|-
|2
|HeartbeatDataReadingError
|Could not read heartbeat data at startup. Make sure that a valid path is given, and that the file is in correct format. If reading fails at any point AFTER the initial data is loaded, an error is printed in stderr, but HeartbeatSaver keeps running and trying.
|}


[[Category:Tools]]
[[Category:Tools]]

Latest revision as of 21:39, 15 October 2013

HeartbeatSaver is a utility, bundled with fCraft 0.633+, that serves as a standalone heartbeat server. It runs separately from fCraft process and reads information from a file (heartbeatdata.txt). This allows your server to keep its uptime on Minecraft.net even when your fCraft server process needs to be restarted/shutdown.

When you disable fCraft's built-in heartbeat (from the Advanced tab of ConfigGUI, or by setting HeartbeatEnabled config key to "false"), fCraft will start writing heartbeatdata.txt to disk, in fCraft's working directory.

HeartbeatSaver only works as long as its external IP address is exactly same as your server's. That means it'll always work when ran from the same machine that fCraft is on, and it will usually work from another machine on the same LAN. Heartbeat saver does not depend on any other fCraft files/libraries, and does not need to be in the same directory as the rest of your fCraft installation.

fCraft's automatic updater (UpdateInstaller) does not include HeartbeatSaver. If an update to HeartbeatSaver is ever released, it will need to be installed manually.

Usage

HeartbeatSaver
Assumes that heartbeatdata.txt is in the working directory
HeartbeatSaver "Path/To/heartbeatdata.txt"
Specifies path to the text file with heartbeat data (including the filename) explicitly.

heartbeatdata.txt format

Usually you don't need to mess with heartbeatdata.txt yourself. fCraft server will generate this for you every minute or so.

Line 01: Salt
Line 02: InternalIP
Line 03: Port
Line 04: Player count
Line 05: Max players
Line 06: Server name
Line 07: IsPublic flag ("true" or "false")
Line 08: HeartbeatUrl

For example:

MuXCwxhDCNz9BIz6aBDlNYXWWhypWwvA
0.0.0.0
25565
0
20
Custom Minecraft Server (fCraft)
False
https://minecraft.net/heartbeat.jsp

HeartbeatSaver.exe exit codes

Code Meaning Notes
0 Success HeartbeatSaver never exits, so you should never normally encounter this code
1 UsageError Required command-line arguments were missing, or an error occurred while trying to parse options.
2 HeartbeatDataReadingError Could not read heartbeat data at startup. Make sure that a valid path is given, and that the file is in correct format. If reading fails at any point AFTER the initial data is loaded, an error is printed in stderr, but HeartbeatSaver keeps running and trying.