Commit 66e696ae41ac42509080616cb8baff51f72f4219

Authored by zhouhaihai
1 parent 56c83e97

Revert "修改 robot"

This reverts commit 56c83e9775161bc9392098baf99ab20e16258efe.
Showing 3 changed files with 4 additions and 6 deletions   Show diff stats
@@ -6,7 +6,7 @@ local socketdriver = require "skynet.socketdriver" @@ -6,7 +6,7 @@ local socketdriver = require "skynet.socketdriver"
6 local netpack = require "skynet.netpack" 6 local netpack = require "skynet.netpack"
7 local xxtea = require "xxtea" 7 local xxtea = require "xxtea"
8 local httpc = require("http.httpc") 8 local httpc = require("http.httpc")
9 -local config 9 +local config = require "robot_config"
10 10
11 local XXTEA_KEY = "699D448D6D24f7F941E9F6E99F823E18" 11 local XXTEA_KEY = "699D448D6D24f7F941E9F6E99F823E18"
12 12
@@ -138,8 +138,6 @@ end @@ -138,8 +138,6 @@ end
138 138
139 -- 开始登录 139 -- 开始登录
140 function CMD.start(fd, id) 140 function CMD.start(fd, id)
141 - config = require "robot_config"  
142 -  
143 client.fd = fd 141 client.fd = fd
144 client.clientId = id 142 client.clientId = id
145 143
robot/robot_main.lua
1 local skynet = require "skynet" 1 local skynet = require "skynet"
  2 +local config = require "robot_config"
2 3
3 local preOnlineCount = 10 4 local preOnlineCount = 10
4 5
5 6
6 skynet.start(function() 7 skynet.start(function()
7 - local config = require "robot_config"  
8 local need = math.ceil(config.online / preOnlineCount) 8 local need = math.ceil(config.online / preOnlineCount)
9 local inpre = math.ceil(config.inpre / need) 9 local inpre = math.ceil(config.inpre / need)
10 local idRange = math.ceil(config.max / need) 10 local idRange = math.ceil(config.max / need)
1 require("utils.StringUtil") 1 require("utils.StringUtil")
2 require("utils.TableUtil") 2 require("utils.TableUtil")
3 require "utils.MathUtil" 3 require "utils.MathUtil"
4 -local config 4 +local config = require "robot_config"
5 local skynet = require "skynet" 5 local skynet = require "skynet"
6 local netpack = require "skynet.netpack" 6 local netpack = require "skynet.netpack"
7 local socketdriver = require "skynet.socketdriver" 7 local socketdriver = require "skynet.socketdriver"
@@ -123,7 +123,7 @@ end @@ -123,7 +123,7 @@ end
123 123
124 local function start(pooldp, pooldObj, onlineCountp, startIdp, endIdp, inprep) 124 local function start(pooldp, pooldObj, onlineCountp, startIdp, endIdp, inprep)
125 log("start testing ...") 125 log("start testing ...")
126 - config = require "robot_config" 126 +
127 factory = deque.clone(pooldObj) 127 factory = deque.clone(pooldObj)
128 poold, onlineCount, startId, endId, inpre = pooldp, onlineCountp, startIdp, endIdp, inprep 128 poold, onlineCount, startId, endId, inpre = pooldp, onlineCountp, startIdp, endIdp, inprep
129 id_max = startId - 1 129 id_max = startId - 1