Browse Source

修改背包道具变化通知协议

huangyuhao 2 years ago
parent
commit
8323ea99e3
1 changed files with 20 additions and 5 deletions
  1. 20 5
      proto-lib/proto_bag.lua

+ 20 - 5
proto-lib/proto_bag.lua

@@ -1,6 +1,20 @@
1
-
2
-local proto_struct = [[
1
+--[[
2
+Descripttion:背包
3
+version:
4
+Author: Neo,Huang
5
+Date: 2023-11-15 22:34:08
6
+LastEditors: Neo,Huang
7
+LastEditTime: 2023-11-19 20:43:33
8
+--]]
9
+local proto_struct =
10
+    [[
11
+    # 资源更新信息
12
+    .DataItemUpdate {
13
+        id 0: integer                       # 物品id
14
+        count 1: integer                    # 物品当前数量
15
+        deltaCount 2: integer               # 物品变化量
16
+        bid 3: integer                      # 物品在背包的id
17
+    }
3
 ]]
18
 ]]
4
 
19
 
5
 local proto_c2s =
20
 local proto_c2s =
@@ -14,7 +28,7 @@ local proto_c2s =
14
             items 1: *DataItemBag       # 物品列表
28
             items 1: *DataItemBag       # 物品列表
15
         }
29
         }
16
     }
30
     }
17
-    
31
+
18
     # 分解
32
     # 分解
19
     bag_exchange 2101 {
33
     bag_exchange 2101 {
20
         request {
34
         request {
@@ -25,7 +39,7 @@ local proto_c2s =
25
             goldCount 1: integer        # 分解后获得金币数量
39
             goldCount 1: integer        # 分解后获得金币数量
26
         }
40
         }
27
     }
41
     }
28
-    
42
+
29
     # 提取
43
     # 提取
30
     bag_draw 2102 {
44
     bag_draw 2102 {
31
         request {
45
         request {
@@ -42,7 +56,7 @@ local proto_s2c =
42
     # 玩家当前物品
56
     # 玩家当前物品
43
     on_user_items 2100 {
57
     on_user_items 2100 {
44
         request {
58
         request {
45
-            items 0: *DataItemBag
59
+            items 0: *DataItemUpdate
46
         }
60
         }
47
     }
61
     }
48
 ]]
62
 ]]