Skip to content

civ4-mp/save-over-http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

=== Target ===

This repository builds 'BTS_Wrapper.exe' and it's dll-files, which improving the Civ4 multiplayer capabilities. The main reason for using this tool is the speedup during entering a Civ4 Pitboss multiplayer game.

The tool was extended over the years and supports now multiple features.

=== Calling Arguments ===

BTS_Wrapper.exe [Civ4:BTS binary name] [-6|--ip6] [[-l|--log] {Logfile} ] [[-P|--share-saves] {Port}] {Normal Civ4 arguments} Logfile will be created in Civ4:BTS\Logs (if writeable) or %TMP%.

=== Features ===

  • Speed up loading of Saves from Civ4 Pitboss servern. Normally, the network code of Civ4:BTS limits the bandwidth to ancient 10kB/sec, but advanced saves consume a few MB. This leads to long timeouts during the login…

  • Fast loading of saves in normal Civ4 MP games. Simply forward an extra port, e.g. 2055, for sharing the save-game folder. All clients will load the save game over this port instead the normal slow ingame way.

  • IPv6 support. If Host or client own an IPv6 address the Wrapper using the 'socat' tool to tunnel the ingame traffic over IPv6. By avoiding the NAT64-gates from ISP's this should resolving the issues of DualStack light and IPv6-only connections. It should work for all IPv4/IPv6 combinations unless an IPv4-only and a IPv6-only client want join. (If one single player is IPv4 only, he could host the game. Here, the IPv6 clients using the ISP's NAT64 service to etablish a connection to the host and IPv6 for all clients.)

=== How to use it ===

It requires changes on both (client & host/pb server) sides.

  1. As Player (non hosting):
  1. As host of normal multiplayer game (Direct IP host)
  • Add '-P [port number, i.e. 2055]' argument to the start arguments of BTS_Wrapper.exe. This port will be used to transfer the save game.
  • Extend the port forwarding of Civ4 on the new port. This step depends on your network settings.
  1. As Civ4 Pitboss host (with Linux in mind): The tricky part is the encoding of the server ip into the data, provided to the clients, if they loading the save. Assuming that your current Altroot folder for the server is $HOME/PBs/PB1 and your server has the ip 1.2.3.4, then the following steps fitting paths/urls into matching pairs.

  2. Setup a webserver and prepare a folder for your PB saves and allow symlinks. Example path: /var/www/PBs

  3. Create a folder which encodes the IP/url of your server. The naming scheme is "http[s]{ip|url}". Move the Pitboss Altroot folder into this directory. Example path: $HOME/_http_1.2.3.4/PBs/PB1.

    => At runtime Civ4 will store the save games into Z:\home\$USERNAME\_http_1.2.3.4\PBs\PB1\Saves\pitboss\auto (Windows path syntax).

  4. Create the directory /var/www/PBs/PB1/Save/pitboss and place a symbolic link into the above 'auto' directory.

Now, the save games are public available. If a modified client connects, it converts
`_http_1.2.3.4/` into `http://1.2.3.4/` and downloading the file
`http://1.2.3.4/PBs/PB1/Saves/pitboss/auto/Recovery_{nickname}.CivBeyondSwordSave`.
If the download fails the save will transfered normally.

If it doesn't work re-check the setup of your paths.

=== Sources ===

The sources and project files for Visual Studio 2017 can be found in ./sources. Used following libraries:

Olaf Schulz, 2015-23