BugReport.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. local Config = require("Config")
  2. local Json = require("common.Json")
  3. local Lang = require("common.Lang")
  4. local Msg = require("core.Msg")
  5. local Timer = require("core.Timer")
  6. local Broadcast = require("broadcast.Broadcast")
  7. REPORT_BUG_PHP = "/qqapi/report_bug.php?a="
  8. function bugReport(human, type, title, content)
  9. print("bugReport, type", type,title, content)
  10. if human.bugReportTime and human.bugReportTime + 60000 > Timer.now then
  11. return Broadcast.sendDown(human, Lang.CHAT_BUG_REPORT_TIME_SHORT)
  12. end
  13. human.bugReportTime = Timer.now
  14. local s2aParam = {}
  15. s2aParam.sid = Config.SVR_INDEX
  16. s2aParam.account_name = human.db.account
  17. s2aParam.role_name = human.db.name
  18. s2aParam.title = title
  19. s2aParam.content = content
  20. s2aParam.type = type
  21. s2aParam.op = "bug"
  22. _G.thread_http.send(REPORT_BUG_PHP,Json.Encode(s2aParam))
  23. Broadcast.sendDown(human, Lang.UNION_SEND_SUCCESS)
  24. Msg.send(Msg.gc.GC_BUG_REPORT, human.fd)
  25. end
  26. function jubao(human, targetUuid, targetName, code)
  27. print("jubao, type", code, targetUuid, targetName)
  28. if human.bugReportTime and human.bugReportTime + 60000 > Timer.now then
  29. return Broadcast.sendDown(human, Lang.CHAT_BUG_REPORT_TIME_SHORT)
  30. end
  31. human.bugReportTime = Timer.now
  32. local s2aParam = {}
  33. s2aParam.sid = Config.SVR_INDEX
  34. s2aParam.account_name = human.db.account
  35. s2aParam.role_name = human.db.name
  36. s2aParam.targetUuid = targetUuid
  37. s2aParam.targetName = targetName
  38. s2aParam.code = code
  39. s2aParam.op = "jubao"
  40. _G.thread_http.send(REPORT_BUG_PHP,Json.Encode(s2aParam))
  41. Broadcast.sendDown(human, Lang.UNION_SEND_SUCCESS)
  42. Msg.send(Msg.gc.GC_PLAYER_JUBAO, human.fd)
  43. end