From ec0df561677c5190ff49a9426613482aa42fad4f Mon Sep 17 00:00:00 2001 From: liuzujun <307836273@qq.com> Date: Fri, 26 Mar 2021 16:31:00 +0800 Subject: [PATCH] 创建及时保存一次 --- src/actions/RoleAction.lua | 2 ++ src/services/dbseed.lua | 36 ++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index bd66d6e..95c16da 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -377,6 +377,8 @@ function _M.createRpc(agent, data) if msg.newdevice then newRole:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]}) end + -- 整体保存一次 + newRole:update() SendPacket(actionCodes.Role_createRpc, MsgPack.pack(response)) diff --git a/src/services/dbseed.lua b/src/services/dbseed.lua index 46c8024..3712ff4 100644 --- a/src/services/dbseed.lua +++ b/src/services/dbseed.lua @@ -122,21 +122,21 @@ local function initSeaportTable() end local function initAdvSeasonTable() - mysqlproxy:query [[ - CREATE TABLE IF NOT EXISTS `adv_season` ( - `key` varchar(45) NOT NULL, - `value` int(11) DEFAULT NULL, - PRIMARY KEY (`key`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - ]] - local servId = tonumber(skynet.getenv("servId")) - if servId then - local tpl = "INSERT INTO `adv_season`(`key`, `value`) values('%s', %d)" + --mysqlproxy:query [[ + -- CREATE TABLE IF NOT EXISTS `adv_season` ( + -- `key` varchar(45) NOT NULL, + -- `value` int(11) DEFAULT NULL, + -- PRIMARY KEY (`key`) + -- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + --]] + --local servId = tonumber(skynet.getenv("servId")) + --if servId then + -- local tpl = "INSERT INTO `adv_season`(`key`, `value`) values('%s', %d)" - mysqlproxy:query(string.format(tpl, "idx", 0)) - mysqlproxy:query(string.format(tpl, "chapter", globalCsv.adv_endless_default_chapter)) - mysqlproxy:query(string.format(tpl, "overTime", 0)) - end + -- mysqlproxy:query(string.format(tpl, "idx", 0)) + -- mysqlproxy:query(string.format(tpl, "chapter", globalCsv.adv_endless_default_chapter)) + -- mysqlproxy:query(string.format(tpl, "overTime", 0)) + --end end local function checkRoleTables() @@ -201,10 +201,10 @@ local steps = { handler = initAutoIncreUidTable, desc = "initialize auto_increment_uid table " }, - --[3] = { - -- handler = initAdvSeasonTable, - -- desc = "initialize adv_season table " - --}, + [3] = { + handler = initAdvSeasonTable, + desc = "initialize adv_season table " + }, [4] = { handler = checkRoleTables, desc = "check role tables " -- libgit2 0.21.2