public void TryJoin(Character joiner, string password) { if (MaxMembersCount <= Members.Count) { ChatMgr.SendEnterChatRoomResultResponse(joiner.Client, EnterChatRoomStatus.RoomisFull, null); return; } if (IsPrivate && password != Password) { ChatMgr.SendEnterChatRoomResultResponse(joiner.Client, EnterChatRoomStatus.WrongPassword, null); return; } lock (this) { Members.Add(joiner.AccId, joiner); } joiner.ChatRoom = this; ChatMgr.SendChatRoomEventResponse(this, ChatRoomEventType.Joined, joiner); ChatMgr.SendEnterChatRoomResultResponse(joiner.Client, EnterChatRoomStatus.Ok, this); }
public void TryJoin(Character joiner, string password) { if ((int)this.MaxMembersCount <= this.Members.Count) { ChatMgr.SendEnterChatRoomResultResponse(joiner.Client, EnterChatRoomStatus.RoomisFull, (Asda2Chatroom)null); } else if (this.IsPrivate && password != this.Password) { ChatMgr.SendEnterChatRoomResultResponse(joiner.Client, EnterChatRoomStatus.WrongPassword, (Asda2Chatroom)null); } else { lock (this) this.Members.Add(joiner.AccId, joiner); joiner.ChatRoom = this; ChatMgr.SendChatRoomEventResponse(this, ChatRoomEventType.Joined, joiner); ChatMgr.SendEnterChatRoomResultResponse(joiner.Client, EnterChatRoomStatus.Ok, this); } }