///////////////////////////////////////////
        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.º 2
0
        ///////////////////////////////////////////

        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_CustomMessagesService_ReceiveMessage( CustomMessagesClientNetworkService sender,
            string message, string data)
        {
            //process custom messages from server

            //if( message == "Lobby_MapName" )
            //{
            //}
        }
        void Client_CustomMessagesService_ReceiveMessage( CustomMessagesClientNetworkService sender,
            string message, string data)
        {
            if( message == "Lobby_MapName" )
            {
                //update map name on client
                comboBoxMaps.Items.Clear();
                comboBoxMaps.Items.Add( new MapItem( data, false ) );
                comboBoxMaps.SelectedIndex = 0;
            }

            if( message == "Lobby_AllowToConnectDuringGame" )
            {
                //update AllowToConnectDuringGame check box on client
                checkBoxAllowToConnectDuringGame.Checked = bool.Parse( data );
            }
        }