Browse Source

修改接口引用

huangyuhao 1 year ago
parent
commit
252144755d
3 changed files with 11 additions and 14 deletions
  1. 5 5
      nodes/game/interface/mail.lua
  2. 3 3
      nodes/game/interface/shop.lua
  3. 3 6
      nodes/game/interface/test.lua

+ 5 - 5
nodes/game/interface/mail.lua

@@ -14,27 +14,27 @@ local userData = require("data.user")
14
 local root = {}
14
 local root = {}
15
 
15
 
16
 -- 获取邮件信息列表
16
 -- 获取邮件信息列表
17
-function root.mail_get_info(role, msg)
17
+function root:mail_get_info(role, msg)
18
     return role.pmail:itf_get_info(msg)
18
     return role.pmail:itf_get_info(msg)
19
 end
19
 end
20
 
20
 
21
 -- 读取邮件
21
 -- 读取邮件
22
-function root.mail_read(role, msg)
22
+function root:mail_read(role, msg)
23
     return role.pmail:itf_read(msg)
23
     return role.pmail:itf_read(msg)
24
 end
24
 end
25
 
25
 
26
 -- 删除邮件
26
 -- 删除邮件
27
-function root.mail_del(role, msg)
27
+function root:mail_del(role, msg)
28
     return role.pmail:itf_del(msg)
28
     return role.pmail:itf_del(msg)
29
 end
29
 end
30
 
30
 
31
 -- 获取邮件奖励
31
 -- 获取邮件奖励
32
-function root.mail_get_award(role, msg)
32
+function root:mail_get_award(role, msg)
33
     return role.pmail:itf_get_award(msg)
33
     return role.pmail:itf_get_award(msg)
34
 end
34
 end
35
 
35
 
36
 -- 新邮件通知
36
 -- 新邮件通知
37
-function root.add_new_mail(role, msg)
37
+function root:add_new_mail(role, msg)
38
     local uid = role.uid
38
     local uid = role.uid
39
     local id = msg.id
39
     local id = msg.id
40
     local channel = msg.channel
40
     local channel = msg.channel

+ 3 - 3
nodes/game/interface/shop.lua

@@ -11,7 +11,7 @@ local dataBag = require("data.bag")
11
 local root = {}
11
 local root = {}
12
 
12
 
13
 -- 购买商品
13
 -- 购买商品
14
-function root.shop_buy_goods(role, msg)
14
+function root:shop_buy_goods(role, msg)
15
     local gid = msg.goodsId
15
     local gid = msg.goodsId
16
     local conf = shopAdapt:goods_get_info(gid)
16
     local conf = shopAdapt:goods_get_info(gid)
17
     if conf == nil or conf.price == nil then
17
     if conf == nil or conf.price == nil then
@@ -29,7 +29,7 @@ function root.shop_buy_goods(role, msg)
29
 end
29
 end
30
 
30
 
31
 -- 充值成功回调
31
 -- 充值成功回调
32
-function root.on_pay(role, msg)
32
+function root:on_pay(role, msg)
33
     local uid = role.uid
33
     local uid = role.uid
34
     log.print("充值成功回调 %s, %s", uid, tostring(msg))
34
     log.print("充值成功回调 %s, %s", uid, tostring(msg))
35
     local order = msg.orderAction
35
     local order = msg.orderAction
@@ -88,7 +88,7 @@ local function is_order(str)
88
     return true
88
     return true
89
 end
89
 end
90
 -- 查询订单结果
90
 -- 查询订单结果
91
-function root.shop_get_order(role, msg)
91
+function root:shop_get_order(role, msg)
92
     if msg == nil or msg.orderId == nil then
92
     if msg == nil or msg.orderId == nil then
93
         return code.PARAMTER_ERROR
93
         return code.PARAMTER_ERROR
94
     end
94
     end

+ 3 - 6
nodes/game/interface/test.lua

@@ -10,7 +10,7 @@ local root = {}
10
 -- if not IS_TEST then return end
10
 -- if not IS_TEST then return end
11
 
11
 
12
 -- 调试系统时间
12
 -- 调试系统时间
13
-function root.test_debug_system_time(role, msg)
13
+function root:test_debug_system_time(role, msg)
14
     if not IS_TEST then
14
     if not IS_TEST then
15
         return code.UNKNOWN
15
         return code.UNKNOWN
16
     end
16
     end
@@ -40,20 +40,17 @@ function root.test_debug_system_time(role, msg)
40
     return code.OK, ret
40
     return code.OK, ret
41
 end
41
 end
42
 
42
 
43
-function root.test_add_items(role, msg)
43
+function root:test_add_items(role, msg)
44
     local uid = role.uid
44
     local uid = role.uid
45
     local items = msg.items
45
     local items = msg.items
46
     if not items then
46
     if not items then
47
         return code.PARAMTER_ERROR
47
         return code.PARAMTER_ERROR
48
     end
48
     end
49
-    for k, v in ipairs(items) do
50
-        v.force = true
51
-    end
52
     bagData:add_items(uid, items, "gmset")
49
     bagData:add_items(uid, items, "gmset")
53
     return code.OK, {}
50
     return code.OK, {}
54
 end
51
 end
55
 
52
 
56
-function root.test_pay_goods(role, msg)
53
+function root:test_pay_goods(role, msg)
57
     local orderId = msg.orderId
54
     local orderId = msg.orderId
58
     local payName = msg.payName
55
     local payName = msg.payName
59
     local status = msg.status
56
     local status = msg.status