|
|
@@ -607,10 +607,6 @@ end
|
|
|
function roleDBInit()
|
|
|
_G.collectgarbage("step", 1000000)
|
|
|
|
|
|
-
|
|
|
- -- local repeatTb = {}
|
|
|
-
|
|
|
-
|
|
|
LuaMongo.find(DB.db_char)
|
|
|
local list = {}
|
|
|
local all = 0
|
|
|
@@ -623,78 +619,6 @@ function roleDBInit()
|
|
|
roleDBchanged = nil
|
|
|
handleNew(data, newAddDBData)
|
|
|
|
|
|
-
|
|
|
- --老账号暂时特殊处理下
|
|
|
- -- if not data.newUniqueTag then
|
|
|
- -- data.newUniqueTag = Generateuuid(MUZI_CHANNEL_ID, data.account, Config.NEW_SVR_INDEX)
|
|
|
- -- LuaMongo.update(DB.db_char, {_id = data._id}, data)
|
|
|
- -- end
|
|
|
-
|
|
|
- -- --老账号暂时特殊处理下
|
|
|
- -- if data.newUniqueTag then
|
|
|
- -- local t = Util.split(data.newUniqueTag, "|")
|
|
|
- -- if #t < 3 then
|
|
|
- -- data.newUniqueTag = Generateuuid(MUZI_CHANNEL_ID, data.account, Config.NEW_SVR_INDEX)
|
|
|
- -- LuaMongo.update(DB.db_char, {_id = data._id}, data)
|
|
|
- -- end
|
|
|
-
|
|
|
-
|
|
|
- -- --异常数据处理
|
|
|
-
|
|
|
- -- --只处理当前合服过的区服
|
|
|
- -- -- if Config.SVR_INDEX < NO_MERGE_SERVER_IDX then
|
|
|
- -- -- --角色原本所在服的标识
|
|
|
- -- -- local svrIndex = data.svrIndex
|
|
|
-
|
|
|
- -- -- local old_svrIndex = svrIndex - SERVER_START_IDX
|
|
|
- -- -- local now_svrIndex = tonumber(t[2])
|
|
|
-
|
|
|
- -- -- if now_svrIndex ~= old_svrIndex then
|
|
|
-
|
|
|
- -- -- --重新生成正确UTag
|
|
|
- -- -- data.newUniqueTag = Generateuuid(MUZI_CHANNEL_ID, data.account, old_svrIndex)
|
|
|
-
|
|
|
- -- -- if repeatTb[data.newUniqueTag] then
|
|
|
- -- -- if Util.isSameDay(data.createTime) then
|
|
|
- -- -- local ok, err = pcall(LuaMongo.remove, DB.db_char, {_id = data._id})
|
|
|
- -- -- if ok then
|
|
|
- -- -- print("删除成功")
|
|
|
- -- -- end
|
|
|
- -- -- end
|
|
|
- -- -- else
|
|
|
- -- -- repeatTb[data.newUniqueTag] = 1
|
|
|
-
|
|
|
- -- -- local res, err = pcall(LuaMongo.update, DB.db_char, {_id = data._id}, data)
|
|
|
- -- -- if not res then
|
|
|
- -- -- print("更新失败", err)
|
|
|
- -- -- end
|
|
|
- -- -- end
|
|
|
-
|
|
|
- -- -- end
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- -- -- if repeatTb[data.newUniqueTag] then
|
|
|
- -- -- if Util.isSameDay(data.createTime) then
|
|
|
- -- -- local ok, err = pcall(LuaMongo.remove, DB.db_char, {_id = data._id})
|
|
|
- -- -- if ok then
|
|
|
- -- -- print("删除成功")
|
|
|
- -- -- end
|
|
|
- -- -- end
|
|
|
- -- -- else
|
|
|
- -- -- repeatTb[data.newUniqueTag] = 1
|
|
|
-
|
|
|
- -- -- -- local res, err = pcall(LuaMongo.update, DB.db_char, {_id = data._id}, data)
|
|
|
- -- -- -- if not res then
|
|
|
- -- -- -- print("更新失败", err)
|
|
|
- -- -- -- end
|
|
|
- -- -- end
|
|
|
-
|
|
|
- -- -- end
|
|
|
-
|
|
|
-
|
|
|
- -- end
|
|
|
-
|
|
|
if roleDBchanged then
|
|
|
list[#list + 1] = data._id
|
|
|
end
|