示例#1
0
        public RoomPrx GetRoom(string nick, string topic, ListenerPrx listener)
        {
            if (!this._rooms.ContainsKey(topic))
            {
                return(this.CreateNewRoomProxies(nick, topic, listener));
            }

            var facets = this.Adapter.findAllFacets(this._rooms[topic].ice_getIdentity());

            foreach (Object room in facets.Values)
            {
                if (room is RoomAdmTie_)
                {
                    RoomAdmTie_ roomAdmTie = (RoomAdmTie_)room;
                    RoomI       roomAdm    = (RoomI)roomAdmTie.ice_delegate();
                    roomAdm.AddListener(nick, listener);
                }
                else if (room is RoomI)
                {
                    RoomI roomI = (RoomI)room;
                    roomI.AddListener(nick, listener);
                }
                else if (room is RoomV2)
                {
                    RoomV2I roomV2I = (RoomV2I)room;
                    roomV2I.AddListener(nick, listener);
                }
            }

            return(this._rooms[topic]);
        }
示例#2
0
        public void LeaveRoom(string author, string topic)
        {
            var facets = this.Adapter.findAllFacets(this._rooms[topic].ice_getIdentity());

            foreach (Object room in facets.Values)
            {
                if (room is RoomAdmTie_)
                {
                    RoomAdmTie_ roomAdmTie = (RoomAdmTie_)room;
                    RoomI       roomAdm    = (RoomI)roomAdmTie.ice_delegate();
                    roomAdm.RemoveListener(author);
                }
                else if (room is RoomI)
                {
                    RoomI roomI = (RoomI)room;
                    roomI.RemoveListener(author);
                }
                else if (room is RoomV2)
                {
                    RoomV2I roomV2I = (RoomV2I)room;
                    roomV2I.RemoveListener(author);
                }
            }
        }