Example #1
0
        public void UpdateGameSettings(Game.Settings.GameSettings gameSettings)
        {
            lock (Lock) {
                CurrentUpdatePacket.DataPacketIds.Add(ClientPacketId.GameSettingsUpdated);

                CurrentUpdatePacket.GameSettingsUpdate.GameSettings = gameSettings;
            }
        }
Example #2
0
        public GameManager(ModSettings modSettings)
        {
            ThreadUtil.Instantiate();

            FontManager.LoadFonts();
            TextureManager.LoadTextures();

            var packetManager        = new PacketManager();
            var serverKnightsManager = new ServerKnightsManager();

            var networkManager = new NetworkManager(packetManager, serverKnightsManager);

            serverKnightsManager._networkManager = networkManager;

            var clientGameSettings = new Settings.GameSettings();
            var serverGameSettings = modSettings.GameSettings ?? new Settings.GameSettings();

            var playerManager = new PlayerManager(networkManager, clientGameSettings, modSettings, serverKnightsManager);

            var animationManager =
                new AnimationManager(networkManager, playerManager, packetManager, clientGameSettings, serverKnightsManager);

            var mapManager = new MapManager(networkManager, clientGameSettings);

            var clientManager = new ClientManager(
                networkManager,
                playerManager,
                animationManager,
                mapManager,
                clientGameSettings,
                packetManager,
                serverKnightsManager
                );


            var serverManager = new ServerManager(networkManager, serverGameSettings, packetManager, serverKnightsManager);

            new UI.UIManager(
                serverManager,
                clientManager,
                clientGameSettings,
                serverGameSettings,
                modSettings
                );
        }