void SocialHistory( byte[] _packet) { body1_SC_SOCIAL_HISTORY socialHistory = new body1_SC_SOCIAL_HISTORY(); socialHistory.PacketBytesToClass( _packet); #if _SOCIAL_LOG_ Debug.Log( "SocialHistory Count : " + socialHistory.nCnt + "nUserUniqKey: " + socialHistory.nUserUniqKey); #endif if( socialHistory.nUserUniqKey == AsUserInfo.Instance.LoginUserUniqueKey) { if( null == AsSocialManager.Instance.SocialUI.m_SocialDlg) { Debug.Log( "SocialDlg Friendlist is not exist"); return; } AsSocialManager.Instance.SocialUI.SetHistoryList( socialHistory); } else {//Clone if( null == AsSocialManager.Instance.SocialUI.m_ObjectSocialCloneDlg) { Debug.Log( "SocialDlg Friendlist is not exist"); return; } AsSocialManager.Instance.SocialUI.SetSocialCloneHistoryList( socialHistory); } }
public new void PacketBytesToClass( byte[] data) { FieldInfo headerinfo = null; Type infotype = this.GetType(); int index = ParsePacketHeader( data); // eType byte[] type = new byte[ sizeof( Int32)]; Buffer.BlockCopy( data, index, type, 0, sizeof( Int32)); headerinfo = infotype.GetField( "eType", BINDING_FLAGS_PIG); headerinfo.SetValue( this, BitConverter.ToInt32( type, 0)); index += sizeof( Int32); switch( ( eSOCIAL_UI_TYPE)eType) { case eSOCIAL_UI_TYPE.eSOCIAL_UI_HISTORY: { socialHistory = new body1_SC_SOCIAL_HISTORY(); socialHistory.PacketBytesToClass( data, index); } break; case eSOCIAL_UI_TYPE.eSOCIAL_UI_FRIEND: { friendList = new body1_SC_FRIEND_LIST(); friendList.PacketBytesToClass( data, index); } break; case eSOCIAL_UI_TYPE.eSOCIAL_UI_FRIEND_RANDOM: { randomList = new body1_SC_FRIEND_RANDOM(); randomList.PacketBytesToClass( data, index); } break; case eSOCIAL_UI_TYPE.eSOCIAL_UI_BLOCK: { blockOutList = new body1_SC_BLOCKOUT_LIST(); blockOutList.PacketBytesToClass( data, index); } break; case eSOCIAL_UI_TYPE.eSOCIAL_UI_FRIEND_APPLY: { friendApplyList = new body1_SC_FRIEND_LIST(); friendApplyList.PacketBytesToClass( data, index); } break; case eSOCIAL_UI_TYPE.eSOCIAL_UI_RECOMMEND: { recommendList = new body_SC_SOCIAL_RECOMMEND(); recommendList.PacketBytesToClass( data, index); } break; } }