Commit 147ef2ce0259b768d6b06c6da288e3b8290a618a

Authored by zhouhaihai
1 parent eb4b0152

邮件 Gm

Showing 2 changed files with 19 additions and 4 deletions   Show diff stats
src/actions/GmAction.lua
... ... @@ -284,6 +284,22 @@ function _M.tower(role, pms)
284 284 return "成功"
285 285 end
286 286  
  287 +table.insert(helpDes, {"发送邮件", "email", "id", "奖励"})
  288 +function _M.email(role, pms)
  289 + local id = tonum(pms.pm1, 0)
  290 + local reward = pms.pm2
  291 + redisproxy:insertEmail({
  292 + roleId = role:getProperty("id"),
  293 + emailId = id,
  294 + createtime = skynet.timex(),
  295 + title = id == 0 and "来自GM的邮件!" or nil,
  296 + stitle = id == 0 and "GM测试" or nil,
  297 + content = id == 0 and "测试内容测试内容!!!\n\t 巴拉巴拉!" or nil,
  298 + attachments = id == 0 and reward or nil,
  299 + rewardPms = id ~= 0 and reward or nil,
  300 + })
  301 + return "成功"
  302 +end
287 303  
288 304 function _M.helpRpc(agent, data)
289 305 SendPacket(actionCodes.Gm_helpRpc, MsgPack.pack({help = helpDes}))
... ... @@ -291,4 +307,6 @@ function _M.helpRpc(agent, data)
291 307 end
292 308  
293 309  
  310 +
  311 +
294 312 return _M
295 313 \ No newline at end of file
... ...
src/actions/RoleAction.lua
... ... @@ -245,8 +245,6 @@ function _M.loginRpc( agent, data )
245 245 -- 玩家登陆做的一些操作
246 246 role:saveHangTeam()
247 247 role:savePvpCTeam()
248   -
249   -
250 248 -- role:log("login", { ip = agent.ip, diamond = role:getProperty("diamond"), reDiamond = role:getProperty("reDiamond")})
251 249  
252 250 return true
... ... @@ -296,8 +294,7 @@ function _M.createRpc(agent, data)
296 294  
297 295 newRole:award(globalCsv.birthItem)
298 296 -- 欢迎邮件
299   - -- redisproxy:insertEmail({roleId = roleId, emailId = 1})
300   - -- redisproxy:insertEmail({roleId = roleId, emailId = 2})
  297 + redisproxy:insertEmail({roleId = roleId, emailId = 1})
301 298  
302 299 newRole:log("create", { ip = agent.ip})
303 300  
... ...