public void SetHistoryData( body2_SC_SOCIAL_HISTORY Data, bool isClone) { m_data = Data; IsClone = isClone; SetButtonVisible(); SetButtonState(); if( Data.nSubTitleIdx == 0) // Friand Add Message { m_GameHistory.Text = string.Format( AsTableManager.Instance.GetTbl_String( 153), Data.szUserId); m_Time.Text = GetTime( Data.nTime); } else //Title Add Message { DesignationData designationData = AsDesignationManager.Instance.GetDesignation( Data.nSubTitleIdx); if( null == designationData) { Debug.LogWarning( "SetHistoryData nSubTitleIdx Err!!! : "); return; } m_GameHistory.Text = string.Format( AsTableManager.Instance.GetTbl_String( 275),Data.szUserId, AsTableManager.Instance.GetTbl_String( designationData.name)); m_Time.Text = GetTime( Data.nTime); m_strArticle = string.Format( AsTableManager.Instance.GetTbl_String( 415),Data.szUserId, AsTableManager.Instance.GetTbl_String( designationData.name)); } }
public void PacketBytesToClass( byte[] data, int index) { Type infotype = this.GetType(); FieldInfo headerinfo; byte[] idx = new byte[ sizeof( UInt32)]; Buffer.BlockCopy( data, index, idx, 0, sizeof( UInt32)); headerinfo = infotype.GetField( "nUserUniqKey", BINDING_FLAGS_PIG); headerinfo.SetValue( this, BitConverter.ToUInt32( idx, 0)); index += sizeof( UInt32); // headerinfo = infotype.GetField ( "nMaxPage", BINDING_FLAGS_PIG); // headerinfo.SetValue( this, data[ index++]); byte[] maxPage = new byte[ sizeof( Int32)]; Buffer.BlockCopy( data, index, maxPage, 0, sizeof( Int32)); headerinfo = infotype.GetField( "nMaxPage", BINDING_FLAGS_PIG); headerinfo.SetValue( this, BitConverter.ToInt32( maxPage, 0)); index += sizeof( Int32); headerinfo = infotype.GetField ( "nCnt", BINDING_FLAGS_PIG); headerinfo.SetValue( this, data[ index++]); if( 0 < nCnt) { body = new body2_SC_SOCIAL_HISTORY[nCnt]; for ( int i = 0; i < nCnt; i++) { body[i] = new body2_SC_SOCIAL_HISTORY(); index = body[i].PacketBytesToClass( data, index); } } }