예제 #1
0
    public void UpdateField(int Id, int Index, byte[] buff, int start, int len)
    {
        SyncIdE SyncId = (SyncIdE)Id;

        byte[] updateBuffer = new byte[len];
        Array.Copy(buff, start, updateBuffer, 0, len);
        int  iValue = 0;
        long lValue = 0;

        switch (SyncId)
        {
        case SyncIdE.ACHIDATA:
            if (Index < 0)
            {
                m_Instance.ClearAchiData(); break;
            }
            if (Index >= m_Instance.SizeAchiData())
            {
                int Count = Index - m_Instance.SizeAchiData() + 1;
                for (int i = 0; i < Count; i++)
                {
                    m_Instance.AddAchiData(new AchievementAchiObjWraperV1());
                }
            }
            m_Instance.GetAchiData(Index).FromMemoryStream(new MemoryStream(updateBuffer));
            break;

        default:
            break;
        }

        try
        {
            if (NotifySyncValueChanged != null)
            {
                NotifySyncValueChanged(Id, Index);
            }
        }
        catch
        {
            Ex.Logger.Log("AchievementData.NotifySyncValueChanged catch exception");
        }
        updateBuffer.GetType();
        iValue++;
        lValue++;
    }