Example #1
0
        public void Client_DisconnectFromServer()
        {
            GameNetworkClient client = GameNetworkClient.Instance;

            if (client != null)
            {
                //remove handlers for entity system service events
                client.EntitySystemService.WorldCreateBegin -= Client_EntitySystemService_WorldCreateBegin;
                client.EntitySystemService.WorldCreateEnd   -= Client_EntitySystemService_WorldCreateEnd;
                client.Dispose();

                SuspendWorkingWhenApplicationIsNotActive = true;
            }
        }
        public void Client_DisconnectFromServer()
        {
            GameNetworkClient client = GameNetworkClient.Instance;

            if (client != null)
            {
                client.ConnectionStatusChanged -= Client_ConnectionStatusChanged;
                client.ChatService.ReceiveText -= Client_ChatService_ReceiveText;
                client.CustomMessagesService.ReceiveMessage -= Client_CustomMessagesService_ReceiveMessage;

                //remove handlers for entity system service events
                client.EntitySystemService.WorldCreateBegin -= Client_EntitySystemService_WorldCreateBegin;
                client.EntitySystemService.WorldCreateEnd   -= Client_EntitySystemService_WorldCreateEnd;
                client.EntitySystemService.WorldDestroy     -= Client_EntitySystemService_WorldDestroy;

                client.Dispose();
            }
        }