Example #1
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        ///	스테이지 퇴장.
        /// </summary>
        /// <param name="stage_id">스테이지 아이디.</param>
        /// <param name="client">클라이언트 객체.</param>
        //----------------------------------------------------------------------------------------------------
        public void OutStage( uint stage_id, cClient client )
        {
            lock(m_stages)
            {
                // 스테이지 퇴장
                cStage stage=null;
                if( m_stages.TryGetValue( stage_id, out stage ) )
                {
                    client.Stage = cStage.NULL_ID;
                }

                // 파티 퇴장
                uint party_id = client.Party;
                if( party_id != cParty.NULL_ID )
                {
                    lock(m_parties)
                    {
                        // 파티 퇴장
                        OutParty( party_id, client );

                        // 등록된 파티 제거
                        if( IsParty( party_id )==false )
                        {
                            if( stage != null )
                            {
                                stage.RemoveChild( party_id );
                            }
                        }

                        //-----------------------------------------------
                        // Response
                        cBitStream bits = new cBitStream();
                        WriteOrder(	bits, cNetwork.eOrder.STAGE_USER_OUT );
                        WriteResult( bits, eResult.SUCCESS );
                        WriteClientId( bits, client.ClientID );
                        WriteClientId( bits, GetPartyMaster( party_id ) );
                        client.Send( bits );
                        SendParty( party_id, bits );
                    }
                }
            }
        }
Example #2
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        ///	채널 퇴장.
        /// </summary>
        /// <param name="channel_id">채널 아이디.</param>
        /// <param name="client">클라이언트 객체.</param>
        //----------------------------------------------------------------------------------------------------
        public void OutChannel( byte channel_id, cClient client )
        {
            // 스테이지 퇴장
            OutStage( client.Stage, client );

            // 채널 퇴장
            lock(m_channels)
            {
                cChannel channel;
                if( m_channels.TryGetValue( channel_id, out channel ) )
                {
                    channel.RemoveClient( client );

                    //-----------------------------------------------
                    // Response
                    cBitStream		bits = new cBitStream();
                    WriteOrder(		bits, cNetwork.eOrder.CHANNEL_OUT );
                    WriteResult(	bits, eResult.SUCCESS );
                    WriteClientId(	bits, client.ClientID );
                    client.Send( bits );
                    SendChannel( channel_id, bits );
                }
            }
        }