12345678910111213141516171819202122232425262728293031323334 |
- --[[
- Descripttion:玩家事件
- version:
- Author: Neo,Huang
- Date: 2022-07-05 19:59:16
- LastEditors: Neo,Huang
- LastEditTime: 2022-07-05 20:08:31
- --]]
- local lib_game_redis = require("lib_game_redis")
- local MODULE_NAME = "global"
- local root = {}
- -- 创建玩家id
- function root:gen_user_id()
- local uid = lib_game_redis:hincrby(MODULE_NAME, "user:max:id", 1)
- if uid < 1000000 then
- uid = uid + 1000000
- lib_game_redis:set("user:max:id", uid)
- end
- return uid
- end
- -- 创建邮件id
- function root:gen_mail_id()
- local id = lib_game_redis:hincrby(MODULE_NAME, "mail:max:id", 1)
- return id
- end
- return root
|