1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System.Collections.Generic;
- using ET;
- using GFGGame;
- namespace GFGGame
- {
- public class StorageSProxy
- {
- //存储
- public static async ETTask<bool> ReqSetClientValue(int key, int value)
- {
- M2C_SetClientValue response = null;
- response = (M2C_SetClientValue)await MessageHelper.SendToServer(new C2M_SetClientValue() { Key = key, Value = value });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- StorageDataManager.Instance.InitStorageInfo(response.Key, response.Value);
- return true;
- }
- }
- return false;
- }
- //获取
- public static async ETTask ReqGetClientValues()
- {
- M2C_GetClientValues response = null;
- response = (M2C_GetClientValues)await MessageHelper.SendToServer(new C2M_GetClientValues() { });
- if (response != null)
- {
- if (response.Error == ErrorCode.ERR_Success)
- {
- for (int i = 0; i < response.Ks.Count; i++)
- {
- StorageDataManager.Instance.InitStorageInfo(response.Ks[i], response.Vs[i]);
- }
- }
- }
- }
- }
- }
|