///////////////////////////////////////////

        public GameNetworkClient(bool entitySystemServiceEnabled)
        {
            if (instance != null)
                Log.Fatal("GameNetworkClient.GameNetworkClient: instance != null.");
            instance = this;

            //register network services

            //register user management service
            userManagementService = new UserManagementClientNetworkService();
            RegisterService(userManagementService);

            //register custom messages service
            customMessagesService = new CustomMessagesClientNetworkService();
            RegisterService(customMessagesService);

            //register chat service
            chatService = new ChatClientNetworkService(userManagementService);
            RegisterService(chatService);

            //register entity system service
            if (entitySystemServiceEnabled)
            {
                entitySystemService = new EntitySystemClientNetworkService(userManagementService);
                RegisterService(entitySystemService);
            }
        }
        ///////////////////////////////////////////

        public GameNetworkClient(bool entitySystemServiceEnabled)
        {
            if (instance != null)
            {
                Log.Fatal("GameNetworkClient.GameNetworkClient: instance != null.");
            }
            instance = this;

            //register network services

            //register user management service
            userManagementService = new UserManagementClientNetworkService();
            RegisterService(userManagementService);

            //register custom messages service
            customMessagesService = new CustomMessagesClientNetworkService();
            RegisterService(customMessagesService);

            //register chat service
            chatService = new ChatClientNetworkService(userManagementService);
            RegisterService(chatService);

            //register entity system service
            if (entitySystemServiceEnabled)
            {
                entitySystemService = new EntitySystemClientNetworkService(userManagementService);
                RegisterService(entitySystemService);
            }
        }
Ejemplo n.º 3
0
        void Client_EntitySystemService_WorldDestroy( EntitySystemClientNetworkService sender,
			bool newMapWillBeLoaded )
        {
            WPFAppWorld.WorldDestroy();
        }
Ejemplo n.º 4
0
 void Client_EntitySystemService_WorldCreateEnd( EntitySystemClientNetworkService sender )
 {
 }
Ejemplo n.º 5
0
        void Client_EntitySystemService_WorldCreateBegin( EntitySystemClientNetworkService sender,
			WorldType worldType, string mapVirtualFileName )
        {
            MapSystemWorld.MapDestroy();

            if( !EntitySystemWorld.Instance.WorldCreate( WorldSimulationTypes.ClientOnly,
                worldType, sender.NetworkingInterface ) )
            {
                Log.Fatal( "GameEngineApp: Client_EntitySystemService_WorldCreateBegin: " +
                    "EntitySystemWorld.WorldCreate failed." );
            }
        }
            //

            public ClientEntitySystemNetworkingInterface(EntitySystemClientNetworkService service)
            {
                this.service = service;
            }
Ejemplo n.º 7
0
        private void Client_EntitySystemService_WorldDestroy(EntitySystemClientNetworkService sender,
            bool newMapWillBeLoaded)
        {
            MapSystemWorld.MapDestroy();
            if (EntitySystemWorld.Instance != null)
                EntitySystemWorld.Instance.WorldDestroy();

            //close all windows
            foreach (Control control in GameEngineApp.Instance.ControlManager.Controls)
                control.SetShouldDetach();

            if (!newMapWillBeLoaded)
            {
                //create lobby window
                //MultiplayerLobbyWindow lobbyWindow = new MultiplayerLobbyWindow();
                GameEngineApp.Instance.ControlManager.Controls.Add(new MultiplayerLobbyWindow());
            }
        }
Ejemplo n.º 8
0
        private void Client_EntitySystemService_WorldCreateEnd(EntitySystemClientNetworkService sender)
        {
            //dynamic created map example
            if (string.IsNullOrEmpty(Map.Instance.VirtualFileName))
                ExampleOfProceduralMapCreation.Client_CreateEntities();

            //play music
            if (GameMap.Instance != null)
                GameMusic.MusicPlay(GameMap.Instance.GameMusic, true);

            if (GameMap.Instance.GameType == GameMap.GameTypes.AssaultKnights)
                controlManager.Controls.Add(new PlayerSpawnWindow());
            else
                CreateGameWindowForMap();
        }
Ejemplo n.º 9
0
        private void Client_EntitySystemService_WorldCreateBegin(EntitySystemClientNetworkService sender,
            WorldType worldType, string mapVirtualFileName)
        {
            //close all windows
            foreach (Control control in controlManager.Controls)
                control.SetShouldDetach();

            //show map loading window
            if (!string.IsNullOrEmpty(mapVirtualFileName))
            {
                string mapDirectory = Path.GetDirectoryName(mapVirtualFileName);
                string guiPath = Path.Combine(mapDirectory, "Description\\MapLoadingWindow.gui");
                if (!VirtualFile.Exists(guiPath))
                    guiPath = "Gui\\MapLoadingWindow.gui";
                Control mapLoadingWindow = ControlDeclarationManager.Instance.CreateControl(guiPath);
                if (mapLoadingWindow != null)
                {
                    mapLoadingWindow.Text = mapVirtualFileName;
                    controlManager.Controls.Add(mapLoadingWindow);
                }

                client_mapLoadingWindow = mapLoadingWindow;
            }

            RenderScene();

            DeleteAllGameWindows();

            MapSystemWorld.MapDestroy();

            //unload all reloadable textures
            TextureManager.Instance.UnloadAll(true, false);

            if (!EntitySystemWorld.Instance.WorldCreate(WorldSimulationTypes.ClientOnly,
                worldType, sender.NetworkingInterface))
            {
                Log.Fatal("GameEngineApp: Client_EntitySystemService_WorldCreateBegin: " +
                    "EntitySystemWorld.WorldCreate failed.");
            }
        }
Ejemplo n.º 10
0
		void Client_EntitySystemService_WorldCreateEnd( EntitySystemClientNetworkService sender )
		{
			//dynamic created map example
			if( string.IsNullOrEmpty( Map.Instance.VirtualFileName ) )
				ExampleOfProceduralMapCreation.Client_CreateEntities();

			//play music
			if( GameMap.Instance != null )
				GameMusic.MusicPlay( GameMap.Instance.GameMusic, true );

			CreateGameWindowForMap();
		}
            //

            public ClientEntitySystemNetworkingInterface(EntitySystemClientNetworkService service)
            {
                this.service = service;
            }