Example #1
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 클라이언트 : 정보 : 기본
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvClientInfoDefault( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            uint	client_id		= cNetwork.ReadClientId( bits );
            string	character_name	= cNetwork.ReadString( bits );
            byte	channel_id		= cNetwork.ReadChannelId( bits );
            uint	stage_id		= cNetwork.ReadStageId( bits );

            Print();
        }
Example #2
0
 protected override void RecvStageMonSkillPos( cNetwork.eResult result, cBitStream bits )
 {
     base.RecvStageMonSkillPos( result, bits );
     ++m_step;
 }
Example #3
0
 protected override void RecvStageUserSkillSelf( cNetwork.eResult result, cBitStream bits )
 {
     base.RecvStageUserSkillSelf( result, bits );
     ++m_step;
 }
Example #4
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// OR 연산
        /// </summary>
        /// <param name="bits">비트스트림</param>
        /// <returns>비트스트림</returns>
        //----------------------------------------------------------------------------------------------------
        public virtual cBitStream OR(cBitStream bits)
        {
            if(!m_open)		throw new Exception("open=false");
            if(bits==null)	throw new Exception("bits=null");
            if(bits.Length!=m_buffer_length)
                            throw new Exception("m_buffer_length!=param");

            // Create the new BitStream
            cBitStream bstrmNew = new cBitStream(m_buffer_length);

            uint whole_uint_length = m_buffer_length >> c_bit_buffer_unit_size_shift;
            uint bit_counter = 0;

            for(bit_counter = 0; bit_counter < whole_uint_length; bit_counter++)
                bstrmNew.m_buffer[bit_counter] = m_buffer[bit_counter] | bits.m_buffer[bit_counter];

            // Are there any further bits in the buffer?
            if((m_buffer_length & c_bit_buffer_unit_size_mod) > 0)
            {
                uint mask = uint.MaxValue << (int)(c_bit_buffer_unit_size - (m_buffer_length & c_bit_buffer_unit_size_mod));
                bstrmNew.m_buffer[bit_counter] = m_buffer[bit_counter] | bits.m_buffer[bit_counter] & mask;
            }

            return bstrmNew;
        }
Example #5
0
 protected override void RecvServerOut( cNetwork.eResult result, cBitStream bits )
 {
     base.RecvServerOut( result, bits );
     ++m_step;
 }
Example #6
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지 : 유저 : 퇴장
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageUserOut( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            uint	client_id	= cNetwork.ReadClientId( bits );
            uint	master_id	= cNetwork.ReadClientId( bits );
            Print( client_id, master_id );
        }
Example #7
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지 : 유저 : 스킬 사용 : 좌표
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageUserSkillPos( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            uint		client_id	= cNetwork.ReadClientId( bits );
            ushort		skill_id	= cNetwork.ReadSkillId( bits );
            cVector3	stage_pos	= cNetwork.ReadStagePos( bits );
            Print( client_id, skill_id, stage_pos );
        }
Example #8
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지 : 입장 : 승락
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageInAccept( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            Client.Stage = cNetwork.ReadStageId( bits );
            Print( Client.Stage );

            // 스테이지 입장
            // 장착아이템 입력(임시)
            uint[] equip_items = new uint[(int)cUserCharacter.eEquipSlot.MAX_EQUIPSLOT];
            for( int c=0; c<equip_items.Length; ++c )
            {
                equip_items[c] = 0;
            }
            Client.SendStageUserIn( equip_items, new cVector3(0,0,0) );
        }
Example #9
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지 : 입장 : 요청
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageInRequest( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            Client.Party = cNetwork.ReadPartyId( bits );

            Print( Client.Party );
        }
Example #10
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 서버 : 퇴장
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvServerOut( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            Client.Disconnect();
            Print();
        }
Example #11
0
 //----------------------------------------------------------------------------------------------------
 /// <summary>
 /// 수신 : 스테이지 : 커스텀 데이터
 /// </summary>
 /// <param name="result">수신 결과코드</param>
 /// <param name="bits">수신 데이터</param>
 //----------------------------------------------------------------------------------------------------
 protected virtual void RecvStageData( cNetwork.eResult result, cBitStream bits )
 {
     if( result != cNetwork.eResult.SUCCESS ) return;
     Print();
 }
Example #12
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 서버 : 로그인
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvServerLogin( cNetwork.eResult result, cBitStream bits )
        {
            if( result == cNetwork.eResult.FAIL_SERVER_LOGIN_REFUSE )
            {
                // 기존 접속 과 연결 시도....
            }
            if( result != cNetwork.eResult.SUCCESS )
            {
                Print( "FAILED : " + result );
                return;
            }

            Client.AccountID = cNetwork.ReadAccountId( bits );
            Print( Client.ClientID, Client.AccountID );

            // 서버 입장
            Client.SendServerIn( s_version );
        }
Example #13
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 서버 : 입장
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvServerIn( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            Client.ClientID = cNetwork.ReadClientId( bits );

            Print( "ClientID:"+Client.ClientID );
        }
Example #14
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 파티 : 채팅.
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvPartyChat( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            uint	client_id	= cNetwork.ReadClientId( bits );
            string	message		= cNetwork.ReadString( bits );
            Print( client_id, message );
        }
Example #15
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지 : 유저 : 입장
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageUserIn( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            // 캐릭터 정보 받음
            bool	master				= cNetwork.ReadFlag(bits);
            uint	client_id			= cNetwork.ReadClientId( bits );
            string	char_name			= cNetwork.ReadString(bits);
            uint	char_item_info_id	= cNetwork.ReadItemInfoId(bits);
            uint[]	equip_items			= cNetwork.ReadItemInfoIds(bits,(int)cUserCharacter.eEquipSlot.MAX_EQUIPSLOT);
            cVector3 stage_pos			= cNetwork.ReadStagePos( bits );

            Print( client_id, master, char_name, stage_pos );
        }
Example #16
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지 : 리스트
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageList( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            RemoveAllStagePartyCount();
            ushort stage_count = cNetwork.ReadStageCount( bits );
            string print = "Stages[" + stage_count + "]{";
            for( int c=0; c<stage_count; ++c )
            {
                uint	stage_id	= cNetwork.ReadStageId( bits );
                ushort	party_count	= cNetwork.ReadPartyCount( bits );

                SetStagePartyCount( stage_id, party_count );

                print += stage_id + "=" + party_count + ",";
            }
            print += "}";
            Print( print );
        }
Example #17
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지 : 유저 : 아이템 사용 : 자신
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageUserItemUseSelf( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            uint	client_id	= cNetwork.ReadClientId( bits );
            ulong	item_id		= cNetwork.ReadItemId( bits );
            Print( client_id, item_id );
        }
Example #18
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지 : 몬스터 : 데미지 : (파티장 권한 필요)
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageMonDemage( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            ushort		monster_id	= cNetwork.ReadMonsterId( bits );
            uint		damage		= cNetwork.ReadDamage( bits );
            bool		death		= cNetwork.ReadFlag( bits );
            Print( monster_id, damage, death );
        }
Example #19
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지 : 유저 : 스킬 사용 : 몬스터
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageUserSkillMonster( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            uint	client_id		= cNetwork.ReadClientId( bits );
            ushort	skill_id		= cNetwork.ReadSkillId( bits );
            byte	target_count	= cNetwork.ReadSkillTargetCount( bits );
            ushort[]	monster_ids	= new ushort[target_count];
            string print = "";
            print += "client_id="+client_id;
            print += ",skill_id="+skill_id;
            print += ",monster_ids{";
            for( byte c=0; c<target_count; ++c )
            {
                monster_ids[c]	= cNetwork.ReadMonsterId( bits );
                print += monster_ids[c]+",";
            }
            print += "}";
            Print( print );
        }
Example #20
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지  : 몬스터 : 이동 : (파티장 권한 필요)
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageMonMove( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            ushort		monster_id	= cNetwork.ReadMonsterId( bits );
            cVector3	stage_pos	= cNetwork.ReadStagePos( bits );
            Print( monster_id, stage_pos );
        }
Example #21
0
 //----------------------------------------------------------------------------------------------------
 /// <summary>
 /// 복제
 /// </summary>
 /// <returns>비트스트림</returns>
 //----------------------------------------------------------------------------------------------------
 public virtual cBitStream Copy()
 {
     cBitStream bstrmCopy = new cBitStream(this.Length);
     Buffer.BlockCopy(m_buffer, 0, bstrmCopy.m_buffer, 0, bstrmCopy.m_buffer.Length << 2);
     bstrmCopy.m_buffer_length = this.m_buffer_length;
     return bstrmCopy;
 }
Example #22
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지 : 몬스터 : 스킬 사용 : 자신 : (파티장 권한 필요)
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageMonSkillSelf( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            ushort monster_id = cNetwork.ReadMonsterId( bits );
            ushort skill_id = cNetwork.ReadSkillId( bits );
            Print( monster_id, skill_id );
        }
Example #23
0
 protected override void RecvPartyChat( cNetwork.eResult result, cBitStream bits )
 {
     base.RecvChannelChat( result, bits );
     ++m_step;
 }
Example #24
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지 : 몬스터 : 스킬 사용 : 유저 : (파티장 권한 필요)
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageMonSkillUser( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            ushort	monster_id		= cNetwork.ReadMonsterId( bits );
            ushort	skill_id		= cNetwork.ReadSkillId( bits );
            byte	target_count	= cNetwork.ReadSkillTargetCount( bits );
            uint[]	client_ids		= new uint[target_count];
            string print = "";
            print += "client_id="+monster_id;
            print += ",skill_id="+skill_id;
            print += ",client_ids{";
            for( byte c=0; c<target_count; ++c )
            {
                client_ids[c]		= cNetwork.ReadClientId( bits );
            }
            Print( monster_id, skill_id );
        }
Example #25
0
 //----------------------------------------------------------------------------------------------------
 /// <summary>
 /// 수신 : 스테이지 : 커스텀 데이터
 /// </summary>
 /// <param name="result">수신 결과코드</param>
 /// <param name="bits">수신 데이터</param>
 //----------------------------------------------------------------------------------------------------
 protected override void RecvStageData( cNetwork.eResult result, cBitStream in_bits )
 {
     if( result != cNetwork.eResult.SUCCESS ) return;
 }
Example #26
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지 : 유저 : 공격 : 몬스터
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageUserAttackMonster( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            uint	client_id	= cNetwork.ReadClientId( bits );
            ushort	monster_id	= cNetwork.ReadMonsterId( bits );
            Print( client_id, monster_id );
        }
Example #27
0
 protected override void RecvStageUserAttackMonster( cNetwork.eResult result, cBitStream bits )
 {
     base.RecvStageUserAttackMonster( result, bits );
     ++m_step;
 }
Example #28
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 스테이지 : 유저 : 데미지
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvStageUserDemage( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            uint		client_id	= cNetwork.ReadClientId( bits );
            uint		damage		= cNetwork.ReadDamage( bits );
            bool		death		= cNetwork.ReadFlag( bits );
            Print( client_id, damage, death );
        }
Example #29
0
 protected override void RecvStageUserTriggerOn( cNetwork.eResult result, cBitStream bits )
 {
     base.RecvStageUserTriggerOn( result, bits );
     ++m_step;
 }
Example #30
0
        //----------------------------------------------------------------------------------------------------
        /// <summary>
        /// 수신 : 채널 : 퇴장
        /// </summary>
        /// <param name="result">수신 결과코드</param>
        /// <param name="bits">수신 데이터</param>
        //----------------------------------------------------------------------------------------------------
        protected virtual void RecvChannelOut( cNetwork.eResult result, cBitStream bits )
        {
            if( result != cNetwork.eResult.SUCCESS ) return;

            uint client_id = cNetwork.ReadClientId(	bits );
            Print( client_id );
        }