Commit ec0df561677c5190ff49a9426613482aa42fad4f

Authored by liuzujun
1 parent 3d8050ef

创建及时保存一次

Showing 2 changed files with 20 additions and 18 deletions   Show diff stats
src/actions/RoleAction.lua
... ... @@ -377,6 +377,8 @@ function _M.createRpc(agent, data)
377 377 if msg.newdevice then
378 378 newRole:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]})
379 379 end
  380 + -- 整体保存一次
  381 + newRole:update()
380 382  
381 383 SendPacket(actionCodes.Role_createRpc, MsgPack.pack(response))
382 384  
... ...
src/services/dbseed.lua
... ... @@ -122,21 +122,21 @@ local function initSeaportTable()
122 122 end
123 123  
124 124 local function initAdvSeasonTable()
125   - mysqlproxy:query [[
126   - CREATE TABLE IF NOT EXISTS `adv_season` (
127   - `key` varchar(45) NOT NULL,
128   - `value` int(11) DEFAULT NULL,
129   - PRIMARY KEY (`key`)
130   - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
131   - ]]
132   - local servId = tonumber(skynet.getenv("servId"))
133   - if servId then
134   - local tpl = "INSERT INTO `adv_season`(`key`, `value`) values('%s', %d)"
  125 + --mysqlproxy:query [[
  126 + -- CREATE TABLE IF NOT EXISTS `adv_season` (
  127 + -- `key` varchar(45) NOT NULL,
  128 + -- `value` int(11) DEFAULT NULL,
  129 + -- PRIMARY KEY (`key`)
  130 + -- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  131 + --]]
  132 + --local servId = tonumber(skynet.getenv("servId"))
  133 + --if servId then
  134 + -- local tpl = "INSERT INTO `adv_season`(`key`, `value`) values('%s', %d)"
135 135  
136   - mysqlproxy:query(string.format(tpl, "idx", 0))
137   - mysqlproxy:query(string.format(tpl, "chapter", globalCsv.adv_endless_default_chapter))
138   - mysqlproxy:query(string.format(tpl, "overTime", 0))
139   - end
  136 + -- mysqlproxy:query(string.format(tpl, "idx", 0))
  137 + -- mysqlproxy:query(string.format(tpl, "chapter", globalCsv.adv_endless_default_chapter))
  138 + -- mysqlproxy:query(string.format(tpl, "overTime", 0))
  139 + --end
140 140 end
141 141  
142 142 local function checkRoleTables()
... ... @@ -201,10 +201,10 @@ local steps = {
201 201 handler = initAutoIncreUidTable,
202 202 desc = "initialize auto_increment_uid table "
203 203 },
204   - --[3] = {
205   - -- handler = initAdvSeasonTable,
206   - -- desc = "initialize adv_season table "
207   - --},
  204 + [3] = {
  205 + handler = initAdvSeasonTable,
  206 + desc = "initialize adv_season table "
  207 + },
208 208 [4] = {
209 209 handler = checkRoleTables,
210 210 desc = "check role tables "
... ...