zhaoyang 3 年之前
父節點
當前提交
fbbda8eee1

+ 9 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstStorageId.cs

@@ -0,0 +1,9 @@
+namespace GFGGame
+{
+    public class ConstStorageId
+    {
+        public const int STORAGE_GUIDE = 10000;//引导起始Id,引导存储id:10000+引导编号id
+
+
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstStorageId.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 441ac0fd2688c874db6ade3b87a6ba5c
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 30 - 0
GameClient/Assets/Game/HotUpdate/Data/StorageDataManager.cs

@@ -0,0 +1,30 @@
+using System.Collections.Generic;
+
+namespace GFGGame
+{
+    public class StorageDataManager : SingletonBase<StorageDataManager>
+    {
+        private Dictionary<int, int> _storangeInfoById = new Dictionary<int, int>();
+
+        public void Clear()
+        {
+            _storangeInfoById.Clear();
+        }
+
+
+        public void RspStorageInfo(int key, int value)
+        {
+            if (!_storangeInfoById.ContainsKey(key))
+            {
+                _storangeInfoById.Add(key, value);
+            }
+            _storangeInfoById[key] = value;
+        }
+        public int GetStorageValue(int key)
+        {
+            int value = 0;
+            _storangeInfoById.TryGetValue(key, out value);
+            return value;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Data/StorageDataManager.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a18354629872b2744a3753a198a72d82
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 40 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/StorageSProxy.cs

@@ -0,0 +1,40 @@
+using System.Collections.Generic;
+using ET;
+using GFGGame;
+
+
+namespace GFGGame
+{
+    public class StorageSProxy
+    {
+
+        //存储
+        public static async ETTask 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)
+                {
+
+
+                }
+            }
+        }
+
+        //获取
+        public static async ETTask ReqGetClientValues(int chapterId, int buyType, int buyCount)
+        {
+            M2C_GetClientValues response = null;
+            response = (M2C_GetClientValues)await MessageHelper.SendToServer(new C2M_GetClientValues() { });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+
+                }
+            }
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/StorageSProxy.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9fc70ffb4d9417b4fa7796a96cb55872
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: