コード例 #1
0
        public void Join(string name, string topic, RoomVersion roomVersion)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentException(Resources.Client_Join_Cannot_be_empty_or_null, "name");
            }

            if (string.IsNullOrEmpty(topic))
            {
                throw new ArgumentException(Resources.Client_Join_Cannot_be_empty_or_null, "topic");
            }

            if (this._lobby == null)
            {
                throw new ApplicationException("Lobby is null");
            }

            ObjectAdapter adapter = this.Communicator.createObjectAdapter(string.Empty);

            this._jobQueue = new JobQueue();
            Listener  listener    = new ListenerI(this._outputTxtBx, this._jobQueue);
            ObjectPrx listenerPrx = adapter.addWithUUID(listener);

            this._jobQueue.Start();
            adapter.activate();
            this._lobby.ice_getConnection().setAdapter(adapter);

            this._roomAccess = this._lobby.Join(name, topic, listenerPrx.ice_getIdentity());
            this._context    = new Dictionary <string, string> {
                { SESSIONCTXPROP.value, topic }, { AUTHORCTXPROP.value, name }
            };
        }
コード例 #2
0
ファイル: ChatClient.cs プロジェクト: spolnik/Chat_Ice_ZeroC
        public void Join(string name, string topic, RoomVersion roomVersion)
        {
            if (string.IsNullOrEmpty(name))
                throw new ArgumentException(Resources.Client_Join_Cannot_be_empty_or_null, "name");

            if (string.IsNullOrEmpty(topic))
                throw new ArgumentException(Resources.Client_Join_Cannot_be_empty_or_null, "topic");

            if (this._lobby == null)
                throw new ApplicationException("Lobby is null");

            ObjectAdapter adapter = this.Communicator.createObjectAdapter(string.Empty);
            this._jobQueue = new JobQueue();
            Listener listener = new ListenerI(this._outputTxtBx, this._jobQueue);
            ObjectPrx listenerPrx = adapter.addWithUUID(listener);
            this._jobQueue.Start();
            adapter.activate();
            this._lobby.ice_getConnection().setAdapter(adapter);

            this._roomAccess = this._lobby.Join(name, topic, listenerPrx.ice_getIdentity());
            this._context = new Dictionary<string, string> { { SESSIONCTXPROP.value, topic }, {AUTHORCTXPROP.value, name} };
        }