gitxsm 1 vuosi sitten
vanhempi
sitoutus
b5022d5779
1 muutettua tiedostoa jossa 19 lisäystä ja 1 poistoa
  1. 19 1
      script/module/role/RoleDBLogic.lua

+ 19 - 1
script/module/role/RoleDBLogic.lua

@@ -629,7 +629,6 @@ function roleDBInit()
 
 				if now_svrIndex ~= old_svrIndex then
 
-					local old_uTag = data.newUniqueTag
 					--重新生成正确UTag
 					data.newUniqueTag = Generateuuid(MUZI_CHANNEL_ID, data.account, old_svrIndex)
 
@@ -650,6 +649,25 @@ function roleDBInit()
 					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