예제 #1
0
        public void Execute(ISiqiServer server)
        {
            MessageToken token = null;

            lock (this)
            {
                if (mQueue.Count > 0)
                {
                    token = mQueue.Dequeue();
                }
            }
            if (mUpDesks.Count > 0)
            {
                lock (mUpDesks)
                {
                    Protocol.RoomInfoDetail detail = new RoomInfoDetail();
                    detail.Desks    = new List <Protocol.DeskInfo>();
                    detail.RoomID   = ID;
                    detail.RoomName = Name;
                    detail.Success  = true;

                    foreach (IDesk item in mUpDesks)
                    {
                        detail.Desks.Add(item.GetInfo());
                    }
                    mUpDesks.Clear();
                    server.Send(detail, GetAgents());
                }
            }
            if (token != null)
            {
                OnExecute(token, server);
            }
        }
예제 #2
0
        public RoomInfoDetail GetInfoDetail()
        {
            RoomInfoDetail result = new RoomInfoDetail();

            result.RoomID   = ID;
            result.RoomName = Name;
            result.Desks    = new List <Protocol.DeskInfo>();
            for (int i = 0; i < Desks.Count; i++)
            {
                result.Desks.Add(Desks[i].GetInfo());
            }
            return(result);
        }