예제 #1
0
        public void Dissmiss(Character dissmiser, uint targetAccId)
        {
            lock (this)
            {
                if (dissmiser != this.Owner || (int)dissmiser.EntityId.Low == (int)targetAccId)
                {
                    dissmiser.SendInfoMsg("You are not chat room owner.");
                    ChatMgr.SendDissmisedFromCharRoomResultResponse(dissmiser.Client,
                                                                    DissmissCharacterFromChatRoomResult.Fail);
                }

                if (!this.Members.ContainsKey(targetAccId))
                {
                    dissmiser.SendInfoMsg("Target not founded.");
                    ChatMgr.SendDissmisedFromCharRoomResultResponse(dissmiser.Client,
                                                                    DissmissCharacterFromChatRoomResult.Fail);
                }

                Character member = this.Members[targetAccId];
                ChatMgr.SendChatRoomEventResponse(this, ChatRoomEventType.Banned, member);
                member.ChatRoom = (Asda2Chatroom)null;
                this.Members.Remove(targetAccId);
                ChatMgr.SendChatRoomClosedResponse(member.Client, ChatRoomClosedStatus.Banned);
                ChatMgr.SendDissmisedFromCharRoomResultResponse(dissmiser.Client,
                                                                DissmissCharacterFromChatRoomResult.Ok);
            }
        }
예제 #2
0
 public void Dissmiss(Character dissmiser, uint targetAccId)
 {
     lock (this)
     {
         if (dissmiser != Owner || dissmiser.EntityId.Low == targetAccId)
         {
             dissmiser.SendInfoMsg("You are not chat room owner.");
             ChatMgr.SendDissmisedFromCharRoomResultResponse(dissmiser.Client, DissmissCharacterFromChatRoomResult.Fail);
         }
         if (!Members.ContainsKey(targetAccId))
         {
             dissmiser.SendInfoMsg("Target not founded.");
             ChatMgr.SendDissmisedFromCharRoomResultResponse(dissmiser.Client, DissmissCharacterFromChatRoomResult.Fail);
         }
         var target = Members[targetAccId];
         ChatMgr.SendChatRoomEventResponse(this, ChatRoomEventType.Banned, target);
         target.ChatRoom = null;
         Members.Remove(targetAccId);
         ChatMgr.SendChatRoomClosedResponse(target.Client, ChatRoomClosedStatus.Banned);
         ChatMgr.SendDissmisedFromCharRoomResultResponse(dissmiser.Client, DissmissCharacterFromChatRoomResult.Ok);
     }
 }