GameSpy server substitute for civ4bts and civ4 (which is based on https://github.com/novice-rb/PRMasterServer)
1. Give a man a lobby and he spams shit in it for life or what is done so far.
- Gamespy Presence and Search (port 29900 and 29901) - works 8.5/10 good, needs testing. Buddies functions: implemented only sending messages.
- Irc server(port 6667) - works 10/10 in miniircd implementation.
- 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.
- Serverbrowser (port 28910) - works 10/10. Didn't crash once for about a year somewhere between 2015 and 2016.
- Queryserver (port 27900) - works 10/10. Didn't crash once for about a year somewhere between 2015 and 2016.
- 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.
- 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#
- GPC4 - GP and GPS servers in python.
- SBQRC4 - ServerBrowser and Query&Reporting servers in one project. Has 2 more functions than PRMasterserver's version of these servers. Written in python.
- Miniircd - basic irc server with gs encription support (latest version https://github.com/Zulan/miniircd). Written in python.
- 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 bobodobo11@gmail.com. Quick.
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
-
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.
-
Open PRMasterServer.sln, and build. This should download via NuGet any extra packages required.
-
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.
-
Get python 2.7.8.
-
Run GPC4.py. That will get 29900(GS Presence) and 29901 (GP Search) servers running
-
Run SBQRC4.py. That will get 28910(ServerBrowser) and 27900 (Q&R) servers running
-
Run miniircd.py. That will get 6667(irc) server running.
-
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: https://github.com/polaris-/dwc_network_server_emulator
Luigi Auriemma for reverse engineering the GameSpy protocol and encryption.
[Zulan] , for running the testing lobby servers, help with testing and his works: https://github.com/Zulan
[Zulan], [Caledorn] - users on realmsbeyond.net, for running natneg servers
[gamespy] For GsOpenSDK. [Rest in peace]
[SexIsBad2TheBone], [DimosEngel], [galatt] civ4 players (testing)
[sid meier and firaxis] for great game