示例#1
0
 /// <summary>
 /// Get account data fot the account id.<para />
 /// If not exited, create it new.
 /// </summary>
 /// <param name="id">account id</param>
 /// <returns>account data</returns>
 public static AccountData GetAccountData(long id)
 {
     AccountData data;
     lock (storeLocker)
     {
         if (store.TryGetValue(id, out data))
             return data;
         data = new AccountData(id);
         store.Add(id, data);
         return data;
     }
 }
示例#2
0
 /// <summary>
 /// Store data for an account.
 /// </summary>
 /// <param name="data">storing data</param>
 public static void SetAccountData(AccountData data)
 {
     lock (storeLocker)
     {
         store[data.AccountId] = data;
     }
 }
示例#3
0
 private void GetAccountData()
 {
     _adata = AccountDataStore.GetAccountData(_userId);
 }