Commit af7863ef137f193af1c6e3329a1fb633773cb770
1 parent
cdbe8a36
x小写名字异常
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 | 332 | SendPacket(actionCodes.Role_changeNameRpc, MsgPack.pack({result = 3})) |
| 333 | 333 | return true |
| 334 | 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 | 337 | if result == 0 then |
| 338 | 338 | SendPacket(actionCodes.Role_changeNameRpc, MsgPack.pack({result = 1})) |
| 339 | 339 | return true |
| 340 | 340 | end |
| 341 | 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 | 344 | end) |
| 345 | 345 | |
| 346 | 346 | role:updateProperties({ | ... | ... |