huangyuhao 1 anno fa
parent
commit
8226c1d1f4

+ 2 - 2
common/utils/nodeUtil.lua

@@ -77,7 +77,7 @@ end
77 77
 -- 分配游戏服节点/agent
78 78
 function root:user_dispatch_game_node_and_agent(uid)
79 79
 	local nodeInfo = self:call_to_node("master", ".srvNodeMgr", "user_dispatch_cluster_node", uid, "game")
80
-	if is_empty(nodeInfo) or is_empty(nodeInfo.nodeName) then
80
+	if nodeInfo == nil or is_empty(nodeInfo.nodeName) then
81 81
 		return
82 82
 	end
83 83
 	local gameNode = nodeInfo.nodeName
@@ -95,7 +95,7 @@ end
95 95
 -- 分配网关节点/agent
96 96
 function root:user_dispatch_gate_node_and_agent(uid)
97 97
 	local nodeInfo = self:call_to_node("master", ".srvNodeMgr", "user_dispatch_cluster_node", uid, "gate")
98
-	if is_empty(nodeInfo) or is_empty(nodeInfo.nodeName) then
98
+	if nodeInfo == nil or is_empty(nodeInfo.nodeName) then
99 99
 		return
100 100
 	end
101 101
 	local gameNode = nodeInfo.nodeName

+ 2 - 1
nodes/game/interface/box.lua

@@ -12,6 +12,7 @@ local gameConst = require("const.gameConst")
12 12
 local itemUtil = require("utils.itemUtil")
13 13
 
14 14
 local boxAdapt = require("adapt.boxAdapt")
15
+local resAdapt = require("adapt.resAdapt")
15 16
 
16 17
 local bagData = require("data.bag")
17 18
 
@@ -95,7 +96,7 @@ function root:box_dream_open(role, msg)
95 96
     bagData:consume_items(uid, _costItems, keyEvent)
96 97
     -- 随机道具
97 98
     local awardList = {
98
-        {id = itemId, count = 1, weight = adds},
99
+        {id = itemId, count = 1, weight = odds},
99 100
         {id = gameConst.ITEM_ID.N1, count = 1, weight = 100 - odds}
100 101
     }
101 102
     local index = random_list_by_weight(awardList)

+ 2 - 1
nodes/game/interface/room.lua

@@ -10,6 +10,7 @@ local code = require("code")
10 10
 local util_match = require("utils.util_match")
11 11
 local gameConst = require("const.gameConst")
12 12
 local nodeMgr = require("nodeMgr")
13
+local nodeUtil = require("utils.nodeUtil")
13 14
 
14 15
 local boxAdapt = require("adapt.boxAdapt")
15 16
 local bagData = require("data.bag")
@@ -28,7 +29,7 @@ end
28 29
 
29 30
 -- 创建房间
30 31
 function root:room_create_room(role, msg)
31
-    local msg = msg.playCount
32
+    local playCount = msg.playCount
32 33
     local battleBoxList = msg.battleBoxList
33 34
     local uid = role.uid
34 35
 

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

@@ -49,7 +49,7 @@ function root.on_pay(role, msg)
49 49
         util_user:log_event(uid, "OrderError", extraParams)
50 50
     end
51 51
     local gid = msg.goodsId
52
-    local conf = goodsId and shopAdapt:goods_get_info(gid)
52
+    local conf = gid and shopAdapt:goods_get_info(gid)
53 53
     if is_empty(conf) then
54 54
         log.error("商城充值回调 gid =%s", gid)
55 55
         logEvent(1)

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

@@ -1,12 +1,6 @@
1 1
 -- 测试工具
2 2
 local code = require "code"
3
-local gameConst = require("const.gameConst")
4 3
 local timeUtil = require "utils.timeUtil"
5
-local honorAdapt = require("adapt.honorAdapt")
6
-local redisUtil = require "utils.redisUtil"
7
-local whiteAdapt = require "adapt.whiteAdapt"
8
-local nodeMgr = require "nodeMgr"
9
-local util_user = require("utils.util_user")
10 4
 local util_order = require("utils.util_order")
11 5
 
12 6
 local moduleData = require("data.module")

+ 4 - 1
nodes/gate/service/srvSprotoAgent.lua

@@ -202,7 +202,7 @@ function CMD.recycle()
202 202
 end
203 203
 
204 204
 function CMD.update_proto()
205
-    protoUtil.update()
205
+    protoUtil:update()
206 206
 end
207 207
 
208 208
 skynet.start(
@@ -211,6 +211,9 @@ skynet.start(
211 211
             "lua",
212 212
             function(session, address, command, ...)
213 213
                 local f = CMD[command]
214
+                if f == nil then
215
+                    log.error("agent command[%s] not found", tostring(command))
216
+                end
214 217
                 if session > 0 then
215 218
                     skynet.ret(skynet.pack(f(...)))
216 219
                 else

+ 1 - 4
nodes/master/service/srvNodeMgr.lua

@@ -69,10 +69,7 @@ function root.user_dispatch_cluster_node(uid, clusterName)
69 69
 	if is_empty(clusterName) then
70 70
 		return
71 71
 	end
72
-	if root.mapCluster == nil then
73
-		return
74
-	end
75
-	if root.mapCluster[clusterName] == nil then
72
+	if root.mapCluster == nil or root.mapCluster[clusterName] == nil then
76 73
 		return
77 74
 	end
78 75
 	-- 已分配