Commit 6f6be52837c17d519f03d8e167476dc367e9fa4a

Authored by zhouhaihai
2 parents 3e513948 af7863ef

Merge branch 'develop' into player

Showing 1 changed file with 4 additions and 4 deletions   Show diff stats
src/actions/RoleAction.lua
@@ -332,15 +332,15 @@ function _M.changeNameRpc(agent, data) @@ -332,15 +332,15 @@ function _M.changeNameRpc(agent, data)
332 SendPacket(actionCodes.Role_changeNameRpc, MsgPack.pack({result = 3})) 332 SendPacket(actionCodes.Role_changeNameRpc, MsgPack.pack({result = 3}))
333 return true 333 return true
334 end 334 end
335 -  
336 - local result = redisproxy:setnx(string_format("user:%s", newName), roleId) 335 + local dbName = string.upper(newName)
  336 + local result = redisproxy:setnx(string_format("user:%s", dbName), roleId)
337 if result == 0 then 337 if result == 0 then
338 SendPacket(actionCodes.Role_changeNameRpc, MsgPack.pack({result = 1})) 338 SendPacket(actionCodes.Role_changeNameRpc, MsgPack.pack({result = 1}))
339 return true 339 return true
340 end 340 end
341 redisproxy:pipelining(function (red) 341 redisproxy:pipelining(function (red)
342 - red:del(string_format("user:%s", oldName))  
343 - red:set(string_format("uid:%s", role:getProperty("uid")), newName) 342 + red:del(string_format("user:%s", string.upper(oldName)))
  343 + red:set(string_format("uid:%s", role:getProperty("uid")), dbName)
344 end) 344 end)
345 345
346 role:updateProperties({ 346 role:updateProperties({