Browse Source

修改服务管理池

neo 1 year ago
parent
commit
9a9b30869b

+ 4 - 4
nodes/battle/service/srvBattleMgr.lua

@@ -16,22 +16,22 @@ local pool
16 16
 local CMD = {}
17 17
 
18 18
 function CMD.getBattleAgent()
19
-    return pool:allocation()
19
+    return pool:alloc_agent_srv()
20 20
 end
21 21
 
22 22
 -- from agent
23 23
 function CMD.battleEnter(id, battleAgent)
24
-    pool:bindAgent(id, battleAgent)
24
+    pool:bind_agent(id, battleAgent)
25 25
 end
26 26
 
27 27
 -- from agent
28 28
 function CMD.battleLeave(id, battleAgent)
29
-    pool:unbindAgent(id, battleAgent)
29
+    pool:unbind_agent(id, battleAgent)
30 30
 end
31 31
 
32 32
 -- 玩家是否在战斗中
33 33
 function CMD.is_user_in_battle(uid, battleId, battleAgent)
34
-    if battleAgent == nil or not pool:getObj(battleAgent) then
34
+    if battleAgent == nil or not pool:get_agent_info_by_addr(battleAgent) then
35 35
         return false
36 36
     end
37 37
     local ok = skynet.call(battleAgent, "lua", "is_user_in_battle", uid, battleId)

+ 4 - 4
nodes/game/service/srvAgentMgr.lua

@@ -23,12 +23,12 @@ function root.user_get_game_agent(uid)
23 23
 	if mapUid2Agent[uid] then
24 24
 		log.error("uid:%s上一次的agent地址没有释放", uid)
25 25
 	end
26
-	return pool:allocation(uid)
26
+	return pool:alloc_agent_srv(uid)
27 27
 end
28 28
 
29 29
 -- 玩家登陆游戏服
30 30
 function root.login(uid, session)
31
-	pool:bindAgent(uid, session.gameAgent)
31
+	pool:bind_agent(uid, session.gameAgent)
32 32
 
33 33
 	mapUid2Agent[uid] = session.gameAgent
34 34
 	-- log.error("uid:%s登陆成功绑定agent地址:%s", uid, gSession.gameAgent)
@@ -36,7 +36,7 @@ end
36 36
 
37 37
 -- 玩家退出游戏服
38 38
 function root.logout(uid, session)
39
-	pool:unbindAgent(uid, session.gameAgent)
39
+	pool:unbind_agent(uid, session.gameAgent)
40 40
 	mapUid2Agent[uid] = nil
41 41
 	-- log.error("uid:%s下线成功, 解绑agent地址:%s", uid, gSession.gameAgent)
42 42
 end
@@ -58,7 +58,7 @@ function root.onStop()
58 58
 end
59 59
 
60 60
 function root.exit(agent)
61
-	pool:remove(agent)
61
+	pool:remove_agent_service(agent)
62 62
 	-- agent全部退出 唤醒退出协程
63 63
 	local addrList = pool:get_agent_srv_addr_list()
64 64
 	if #addrList <= 0 then

+ 3 - 3
nodes/gate/service/wsProtobufWatchdog.lua

@@ -40,7 +40,7 @@ local function l_close_connect(fd)
40 40
 		local gateAgent = session.gateAgent
41 41
 		skynet.call(gateAgent, "lua", "logout", uid, fd)
42 42
 
43
-		pool:unbindAgent(uid, gateAgent)
43
+		pool:unbind_agent(uid, gateAgent)
44 44
 	end
45 45
 end
46 46
 
@@ -106,7 +106,7 @@ local function l_build_connection(uid, fd, msgSession)
106 106
 	mapUid2Session[uid] = session
107 107
 
108 108
 	-- 分配agent
109
-	local gateAgent = pool:allocation(uid)
109
+	local gateAgent = pool:alloc_agent_srv(uid)
110 110
 	if gateAgent == nil then
111 111
 		session.status = LOGIN_DONE
112 112
 		l_response_auth(fd, code.UNKNOWN, msgSession)
@@ -127,7 +127,7 @@ local function l_build_connection(uid, fd, msgSession)
127 127
 	end
128 128
 
129 129
 	-- 绑定agent
130
-	pool:bindAgent(uid, gateAgent)
130
+	pool:bind_agent(uid, gateAgent)
131 131
 	return l_response_auth(fd, code.OK, msgSession)
132 132
 end
133 133
 

+ 3 - 3
nodes/gate/service/wsSprotoWatchdog.lua

@@ -40,7 +40,7 @@ local function l_close_connect(fd)
40 40
 		local gateAgent = session.gateAgent
41 41
 		skynet.call(gateAgent, "lua", "logout", uid, fd)
42 42
 
43
-		pool:unbindAgent(uid, gateAgent)
43
+		pool:unbind_agent(uid, gateAgent)
44 44
 	end
45 45
 end
46 46
 
@@ -106,7 +106,7 @@ local function l_build_connection(uid, fd, response)
106 106
 	mapUid2Session[uid] = session
107 107
 
108 108
 	-- 分配agent
109
-	local gateAgent = pool:allocation(uid)
109
+	local gateAgent = pool:alloc_agent_srv(uid)
110 110
 	if gateAgent == nil then
111 111
 		session.status = LOGIN_DONE
112 112
 		l_response_auth(fd, response, code.UNKNOWN)
@@ -127,7 +127,7 @@ local function l_build_connection(uid, fd, response)
127 127
 	end
128 128
 
129 129
 	-- 绑定agent
130
-	pool:bindAgent(uid, gateAgent)
130
+	pool:bind_agent(uid, gateAgent)
131 131
 	return l_response_auth(fd, response, code.OK)
132 132
 end
133 133