|
|
@@ -30,6 +30,16 @@ local FieldName = {name = 1}
|
|
|
local FieldAccount = {account = 1}
|
|
|
|
|
|
local tempData = {}
|
|
|
+
|
|
|
+local function generateuuid(account, serverTag)
|
|
|
+ if not account or not serverTag then
|
|
|
+ assert(false, string.format("data Error! account:%s,svrIndex:%s", account, serverTag))
|
|
|
+ end
|
|
|
+ return string.format("%s|%s", serverTag, account)
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
function isNameExistInDB(name)
|
|
|
QueryByName.name = name
|
|
|
tempData.name = nil
|
|
|
@@ -180,9 +190,10 @@ function saveRoleSset(db, sunset)
|
|
|
end
|
|
|
|
|
|
-------------------- humandb 初始化 start ----------------------
|
|
|
-function createDefaultRole(account)
|
|
|
+function createDefaultRole(account, serverTag)
|
|
|
local db = {
|
|
|
svrIndex = Config.SVR_INDEX,
|
|
|
+ newUniqueTag = generateuuid(account, serverTag),
|
|
|
identity = nil, -- 11位全局不重复的数字id
|
|
|
account = account, -- 帐号名
|
|
|
name = nil, -- 角色名
|
|
|
@@ -542,6 +553,13 @@ function roleDBInit()
|
|
|
all = all + 1
|
|
|
roleDBchanged = nil
|
|
|
handleNew(data, newAddDBData)
|
|
|
+
|
|
|
+ --暂时特殊处理下
|
|
|
+ if not data.newUniqueTag then
|
|
|
+ data.newUniqueTag = generateuuid(data.account, Config.NEW_SVR_INDEX)
|
|
|
+ LuaMongo.update(DB.db_char, {_id = data._id}, data)
|
|
|
+ end
|
|
|
+
|
|
|
if roleDBchanged then
|
|
|
list[#list + 1] = data._id
|
|
|
end
|