master_server.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. """DWC Network Server Emulator
  2. Copyright (C) 2014 polaris-
  3. Copyright (C) 2014 ToadKing
  4. Copyright (C) 2014 AdmiralCurtiss
  5. Copyright (C) 2014 msoucy
  6. Copyright (C) 2015 Sepalani
  7. This program is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU Affero General Public License as
  9. published by the Free Software Foundation, either version 3 of the
  10. License, or (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU Affero General Public License for more details.
  15. You should have received a copy of the GNU Affero General Public License
  16. along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. """
  18. from gamespy_player_search_server import GameSpyPlayerSearchServer
  19. from gamespy_profile_server import GameSpyProfileServer
  20. from gamespy_backend_server import GameSpyBackendServer
  21. from gamespy_natneg_server import GameSpyNatNegServer
  22. from gamespy_qr_server import GameSpyQRServer
  23. from gamespy_server_browser_server import GameSpyServerBrowserServer
  24. from gamespy_gamestats_server import GameSpyGamestatsServer
  25. from nas_server import NasServer
  26. from dls1_server import Dls1Server
  27. from internal_stats_server import InternalStatsServer
  28. from admin_page_server import AdminPageServer
  29. from storage_server import StorageServer
  30. from gamestats_server_http import GameStatsServer
  31. from register_page import RegPageServer
  32. import gamespy.gs_database as gs_database
  33. import threading
  34. if __name__ == "__main__":
  35. """Let database initialize before starting any servers.
  36. This fixes any conflicts where two servers find an uninitialized database
  37. at the same time and both try to initialize it.
  38. """
  39. db = gs_database.GamespyDatabase()
  40. db.initialize_database()
  41. db.close()
  42. servers = [
  43. GameSpyBackendServer,
  44. #GameSpyQRServer,
  45. GameSpyProfileServer,
  46. GameSpyPlayerSearchServer,
  47. GameSpyGamestatsServer,
  48. # GameSpyServerBrowserServer,
  49. GameSpyNatNegServer,
  50. NasServer,
  51. Dls1Server,
  52. InternalStatsServer,
  53. AdminPageServer,
  54. RegPageServer,
  55. StorageServer,
  56. GameStatsServer,
  57. ]
  58. for server in servers:
  59. threading.Thread(target=server().start).start()