Ramkhamhaeng
Warlord
- Joined
- Feb 24, 2014
- Messages
- 209
Well, I keep trying because I would like to make this thing work for Direct IP too; but before doing that I'm trying to understand the full procedure you've set up, and there's something I probably don't understand.
Here's the procedure as described on github:
[...]
I'm using Win7. You say "Public http folder with Webdav support: http://{server}/{prefix}": what exactly is {prefix}? Let's say I'm saving my files on a OneDrive webspace: is that enough to use this folder https://d.docs.live.net/[USERID] if I want to save my files there? Right now I've added that location as a network drive and used mklink to link the save folder under My Games\Beyond the Sword\Saves to that location on OneDrive. My idea was to make everyone download the save from there instead of transferring from the host to the client. Could it work?
The prefix is free selectable and should reflect your environment. In your example case I would suggest
Code:
{server}=d.docs.live.net
{prefix}=[USERID]/Test
Now, I want to point out that Civ4 tries to load the save at the same path as the server stores it! Thus, if you start the game normally, it will use
Code:
C:\Users\[USERNAME]\My Games\Beyond the Sword\Saves\multi (DirectIP game, assumed variant in the following text)
or
C:\Users\[USERNAME]\My Games\Beyond the Sword\Saves\pitboss\auto (Pitboss game)
Moreover, we need the path to encode the server url. The trick is the usage of the ALTROOT-Argument!
Let's say the drive letter Z: is free and [PATH] is an arbitrary folder on your system…
Create the subfolder [PATH]\_http_d.docs.live.net\[USERID]\Test
and map [PATH] to Z: with
Code:
[i]subst Z: PATH[/i]
Spoiler :
Keep in mind that the ALTROOT-Argument forces Civ4 to move files from your "My Games\Beyond the Sword"-folder to the new root folder. (Don't ask my why ) Thus, it would be a good idea to backup the Beyond the Sword folder....
Then start the game with the following arguments (Altroot had to be first argument and space after mod= required):
Code:
/ALTROOT="Z:\_http_d.docs.live.net\[USERID]\Test" mod= "[Your mod name]"
If it works, Civ4 copies its files into the new folder...
Close the game and continue with the red marked step of your description. We had to reflect the path structure of the game becaus we would only share the subfolder with the saves:
Create "Test/Saves/multi" on your OneDrive location and use mklink
to combine it with [PATH]\...\Test\Saves\multi
Now, if an player left the game the VOTE_...-Saves should automatically be uploaded to your web space.
Check, if you can download it with your browser. (For testing please follow my test path and use DirectIP>Load game to re-load that VOTE-Save)
Let's assume the player tries to reconnect...
He joins and the server asks him to load
Code:
Z:\_http_d.docs.live\[USERID]\Test\Saves\multi\VOTE_...
The BTS_Wrapper.exe detects the _http_ keyword and tries to download http://d.docs.live\[USERID]\...
Mmm, I think both modifying the sending side and eliminating the timeout in the net code is beyond my ability although I mod BTS dll since 4 years now. I don't even know where to look for the net code of civ4. If you have any hint or sooner or later you can do it yourself, I will be more than happy
The net code is hidden in the executable and there are no public sources available. I've used disassemble/monitoring tools like Ida, Api Monitor or Wireshark for my analysis.
Currently, I'm study the Windows API and under the assumption IPv4-Address + Good configured firewall at host side I probably could provide a much simpler solution for Non-Pitboss DirectIP games.