Ejemplo n.º 1
0
    void LoadInbox(DictionaryFile file)
    {
        bool resave = false;

        string messages = "";

        if (file.HasKey("inbox") == true)
        {
            messages = file.GetString("inbox", "");
        }
        else
        {
            string rootKey = "Player[" + m_PrimaryKey + "].CloudMailbox";
            messages = PlayerPrefs.GetString(rootKey + ".Inbox", "");

            PlayerPrefs.DeleteKey(rootKey + ".Inbox");

            resave = true;
        }

        m_LastMessageIndexFromProductInbox = file.GetInt("lastMessageIndexFromProductInbox", 0);

        //System.IO.File.WriteAllText("Inbox.json", messages);

        m_Inbox = ReconstructFromString(messages);
        m_Inbox = m_Inbox ?? new List <BaseMessage>();
        m_Inbox = CleanUpMailBox(m_Inbox);

        if (resave == true)
        {
            Save();
        }

        OnInboxChanged();
    }
Ejemplo n.º 2
0
 public int GetInt(string key, int defVal)
 {
     return(m_File != null?m_File.GetInt(key, defVal) : defVal);
 }