Beispiel #1
0
        private void ReceiveExit(string[] split_str)                            // (廣播) 4 接收到離開訊息
        {
            ulong ID = ulong.Parse(split_str[0]);           // index 0 為 ID

            neighbor.Remove(ID, listenserverlist);  // 刪除該節點, 連同監聽的一併刪除
            neighborList = neighbor.GetList();  // 取得鄰居列表
            if (voicerecorder != null)
                voicerecorder.Update_Info(neighborList);  // 重新設定
            relation.Set_NeighborList(neighborList);  // 重新設定
            relationList = relation.Get_RelationList();  // 重新取得關係列表
            if (Listener != relation.Get_Listener())  // 若為傾聽者離開
            {
                Listener = relation.Get_Listener();  // 重新取得傾聽者
                string str = SelfID.ToString() + " " +
                             TYPE_ADDLISTENER + " " +
                             Listener.ToString();
                Vast.VASTPublish(str, (uint)str.Length, AOI_RADIUS);
            }

            // 顯示在視窗上
            show.SelfInnformation_Print(aoi_center, Speaker_Capacity, Max_Speaker_Capacity, Overhearer_Capacity, Max_Overhearer_capacity, socketip, Listener, voicerecorder);
            myPanel.Refresh();  // 更新畫面
        }