Example #1
0
 public void Leave(Character leaver)
 {
     lock (this)
     {
         Members.Remove(leaver.AccId);
     }
     leaver.ChatRoom = null;
     ChatMgr.SendChatRoomEventResponse(this, ChatRoomEventType.Left, leaver);
     if (Owner == leaver && Members.Count > 0)
     {
         Owner = Members.Values.First();
         ChatMgr.SendChatRoomEventResponse(this, ChatRoomEventType.LeaderChanged, Owner);
         ChatMgr.SendChatRoomVisibleResponse(Owner, ChatRoomVisibilityStatus.Visible, this);
     }
     ChatMgr.SendChatRoomVisibleResponse(leaver, ChatRoomVisibilityStatus.Closed, null);
 }
Example #2
0
        public void Leave(Character leaver)
        {
            lock (this)
                this.Members.Remove(leaver.AccId);
            leaver.ChatRoom = (Asda2Chatroom)null;
            ChatMgr.SendChatRoomEventResponse(this, ChatRoomEventType.Left, leaver);
            if (this.Owner == leaver && this.Members.Count > 0)
            {
                this.Owner = this.Members.Values.First <Character>();
                ChatMgr.SendChatRoomEventResponse(this, ChatRoomEventType.LeaderChanged, this.Owner);
                ChatMgr.SendChatRoomVisibleResponse(this.Owner, ChatRoomVisibilityStatus.Visible, this,
                                                    (Character)null);
            }

            ChatMgr.SendChatRoomVisibleResponse(leaver, ChatRoomVisibilityStatus.Closed, (Asda2Chatroom)null,
                                                (Character)null);
        }