Skip to content
A GameSpy replacement server for civ4
Branch: master
Clone or download
Pull request Compare This branch is 165 commits ahead of novice-rb:master.
Latest commit 501f577 Sep 29, 2016
Type Name Latest commit message Commit time
Failed to load latest commit information.
.nuget NatNeg with INIT and INIT_ACK messages Aug 2, 2014
.version Initial Commit Jun 14, 2014
GP deleting for clarity Sep 29, 2016
LALCIRCENCDEC Update dll.h Sep 25, 2014
SBQRC4 Update Jul 11, 2016
miniircd latest working one at the time, from zulan's Jul 11, 2016
.gitignore Initial Commit Jun 14, 2014
LICENSE Initial commit Jun 14, 2014
PRMasterServer.sln NatNeg with INIT and INIT_ACK messages Aug 2, 2014 Updated to fit the current vision Jul 11, 2016
hosts colonization support Jul 7, 2016

GameSpy server substitute for civ4bts and civ4 (which is based on

1. Give a man a lobby and he spams shit in it for life or what is done so far.

  1. Gamespy Presence and Search (port 29900 and 29901) - works 8.5/10 good, needs testing. Buddies functions: implemented only sending messages.
  2. Irc server(port 6667) - works 10/10 in miniircd implementation.
  3. Natneg server (port 27901) - works 8.5/10 (Sometimes people can't join supposedly because of bad works of this server, there is a branch of natnegging that was implemented in official gs, that isn't here). Not tested much with people who are inside inner networks that are inside other inner networks. Nested networks or some such clownery. Found no good testing material.
  4. Serverbrowser (port 28910) - works 10/10. Didn't crash once for about a year somewhere between 2015 and 2016.
  5. Queryserver (port 27900) - works 10/10. Didn't crash once for about a year somewhere between 2015 and 2016.
  6. Webservver (port 80) - use any, or use none, but make sure skype doesnt use your port 80 (or people will wait 2 minutes to enter lobby).

2. Subprojects that are included in this repository.

  1. PRMasterserver - 4 servers in one application. Has option to run only wanted separate servers, so you can use other applications for other servers. Written in c#
  2. GPC4 - GP and GPS servers in python.
  3. SBQRC4 - ServerBrowser and Query&Reporting servers in one project. Has 2 more functions than PRMasterserver's version of these servers. Written in python.
  4. Miniircd - basic irc server with gs encription support (latest version Written in python.
  5. GSAIRCDTMM - irc server with gs encoding, written on delphi. It works with some bugs, i used it in the beginning. Miniircd is a better irc server.

3. Wanted logs of gs<->civ4 traffic
Captures taken in wireshark or other programs. Send them to my mail Quick.

4. Current progress It is roughly 96% done now.(4% that arent done include: testing, buddy functions, which i dont want to implement because they add alot of traffic and take processing resources that goes to getting info from the database about users each time someone logs in)

6. Current problems and directions of investigation:
2. NatNeg is implemented only in basic form atm. It needs to be reasearched how exactly to improve it for civ4 though.

7. How gamespy server works for nabs with small brains
to be written later

8. Running the server

  1. Be sure to have Visual Studio 2013 installed. You might be able to compile it using previous versions of Visual Studio or using Mono, but this is untested and may not work.

  2. Open PRMasterServer.sln, and build. This should download via NuGet any extra packages required.

  3. Run PRMasterServer.exe +db logindb.db3 +game civ4bts +servers natneg (it will include civ4 vanilla and japan version too). That will get 27901(natneg) server running.

  4. Get python 2.7.8.

  5. Run That will get 29900(GS Presence) and 29901 (GP Search) servers running

  6. Run That will get 28910(ServerBrowser) and 27900 (Q&R) servers running

  7. Run That will get 6667(irc) server running.

  8. Check that skype is not listening on port 80.

That's all

9. To join the lobby from the game you need to redirect traffic that is going to official gs ip address to ur server. Best way known to me at this point is to configure windows/system32/drivers/etc/hosts file. Correctly configured hosts file for Zulan's server is included.

10. Credits

[novice-rb] for work on natneg
[AncientMan2002] for work on PRMasterServer
[polaris-] and others who created this:
Luigi Auriemma for reverse engineering the GameSpy protocol and encryption.
[Zulan] , for running the testing lobby servers, help with testing and his works:
[Zulan], [Caledorn] - users on, for running natneg servers
[gamespy] For GsOpenSDK. [Rest in peace]
[SexIsBad2TheBone], [DimosEngel], [galatt] civ4 players (testing)
[sid meier and firaxis] for great game

You can’t perform that action at this time.