Gm.lua 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917
  1. local Config = require("Config")
  2. local Util = require("common.Util")
  3. local Log = require("common.Log")
  4. local Msg = require("core.Msg")
  5. local ObjHuman = require("core.ObjHuman")
  6. local BagLogic = require("bag.BagLogic")
  7. local Broadcast = require("broadcast.Broadcast")
  8. local Util = require("common.Util")
  9. local InnerMsg = require("core.InnerMsg")
  10. local CommonDB = require("common.CommonDB")
  11. local JjcDB = require("jjc.JjcDB")
  12. local VipLogic = require("vip.VipLogic")
  13. local VipExcel = require("excel.vip")
  14. local GMExcel = require("excel.gm")
  15. local RoleLogic = require("role.RoleLogic")
  16. local UnionDBLogic = require("union.UnionDBLogic")
  17. local CombatPosLogic = require("combat.CombatPosLogic")
  18. local CombatDefine = require("combat.CombatDefine")
  19. local ItemDefine = require("bag.ItemDefine")
  20. local MiddleConnect = require("middle.MiddleConnect")
  21. local BuyLogic = require("topup.BuyLogic")
  22. local WarOrder = require("shop.WarOrder")
  23. local GiftLogic = require("topup.GiftLogic")
  24. local HeroSkinLogic = require("present.HeroSkinLogic")
  25. local DrawCardLogic = require("drawCard.DrawCardLogic")
  26. d3 = {}
  27. local function send(human, err)
  28. local mm = Msg.gc.GC_CHAT
  29. mm.item.msgType = 3
  30. mm.item.targetUuid = ""
  31. mm.item.sendTime = os.time()
  32. mm.item.msg = tostring(err)
  33. mm.item.vipLv = human.db.vipLv or 0
  34. mm.item.videoUuid = ""
  35. mm.item.isJson = 0
  36. mm.item.unionFrame = 0
  37. local union = {}
  38. if human.db.unionUuid ~= nil then
  39. union = UnionDBLogic.getUnion(human.db.unionUuid)
  40. end
  41. RoleLogic.getRoleBase(human,mm.item.roleBase)
  42. mm.item.label = human.db.throneLabel or 0
  43. Msg.send(mm, human.fd)
  44. end
  45. -- 直接调用gm命令
  46. function execGm(human, cmd,pos)
  47. print("直接调用gm命令",cmd,pos)
  48. Log.write(Log.LOGID_OSS_GM_CODE, human.db._id, human.db.account, human.db.name, cmd, pos)
  49. d3[cmd](human, tonumber(pos) or pos)
  50. return true
  51. end
  52. function checkGm(human, str)
  53. if not Config.IS_USE_GM_CMD and human.db.gm == nil then
  54. return
  55. end
  56. local pos = string.find(str, " ", 1, true)
  57. local cmd = string.sub(str, 1, pos and pos - 1)
  58. if not Config.IS_USE_GM_CMD then
  59. if human.db.gm == 1 and not GmControl[cmd] then -- 一级权限的gm只能使用部分gm命令
  60. send(human, "not permit for this gm cmd!")
  61. return true
  62. end
  63. if human.db.gm == 100 then -- 新手引导员不能使用gm命令
  64. return
  65. end
  66. end
  67. if not d3[cmd] then
  68. return
  69. end
  70. local arg = string.sub(str, #cmd + 2)
  71. Log.write(Log.LOGID_OSS_GM_CODE, human.db._id, human.db.account, human.db.name, cmd, arg)
  72. d3[cmd](human, tonumber(arg) or arg)
  73. return true
  74. end
  75. function d3.addJifen(human,val)
  76. local v = tonumber(val)
  77. if not v then
  78. print("param invalid")
  79. return
  80. end
  81. return DrawCardLogic.getJifen(human,v)
  82. end
  83. function d3.unlockOrder(human,orderType)
  84. local t = tonumber(orderType)
  85. if not t then
  86. print("invalid orderType ",orderType)
  87. return
  88. end
  89. return WarOrder.warOrderUnlock(human,t)
  90. end
  91. function d3.buyGift(human,giftID)
  92. local t = assert(tonumber(giftID),"invalid gift id")
  93. return GiftLogic.buy(human,giftID)
  94. end
  95. function d3.heroSkinActBuy(human,id)
  96. local t = assert(tonumber(id),"invalid skinAct id")
  97. return HeroSkinLogic.buy(human,t)
  98. end
  99. function d3.heroadd(human,val)
  100. if val == nil then return end
  101. local tb = Util.split(val, " ")
  102. local id = tonumber(tb[1])
  103. local cnt = tonumber(tb[2])
  104. local lv = tonumber(tb[3])
  105. local star = tonumber(tb[4])
  106. if not (id and cnt) then return end
  107. for i = 1, cnt do
  108. local heroGrid = require("hero.HeroGrid").createHeroGrid(id , star)
  109. if not heroGrid then break end
  110. local attrConfig = require("hero.HeroDefine").getAttrConfig(id, heroGrid.star)
  111. if not attrConfig then return end
  112. local quality = require("hero.HeroGrid").getMaxQualityByLv(heroGrid.star, lv)
  113. local maxLv = require("hero.HeroGrid").getMaxLv(heroGrid.star, quality)
  114. heroGrid.lv = math.min(maxLv, lv or 0)
  115. heroGrid.quality = math.max(heroGrid.quality, quality or 0)
  116. require("hero.HeroLogic").addHeroByGrid(human, heroGrid, "gm")
  117. end
  118. end
  119. function d3.herodel(human,val)
  120. if val == nil then return end
  121. local pos = string.find(val, " ", 1, true)
  122. if pos == nil then return end
  123. local index = tonumber(string.sub(val, 1, pos - 1))
  124. local cnt= tonumber(string.sub(val,pos+1,#val))
  125. require("hero.HeroLogic").delHeroByIndex(human,index,"gm")
  126. end
  127. function d3.herodelAll(human,val)
  128. for index = 1, human.db.heroBag[0]do
  129. require("hero.HeroLogic").delHeroByIndex(human,index,"gm")
  130. end
  131. end
  132. function d3.itemadd(human,val)
  133. if val == nil then return end
  134. local pos = string.find(val, " ", 1, true)
  135. if pos == nil then return end
  136. local id = tonumber(string.sub(val, 1, pos - 1))
  137. if not id then
  138. local name = string.sub(val, 1, pos - 1)
  139. local ItemExcel = require("excel.item").item
  140. for k,v in pairs(ItemExcel) do
  141. if v.name == name then
  142. id = k
  143. break
  144. end
  145. end
  146. end
  147. if not id then
  148. local name = string.sub(val,1,pos - 1)
  149. local EquipExcel = require("excel.equip").equip
  150. for k,v in pairs(EquipExcel) do
  151. if v.name == name then
  152. id = k
  153. break
  154. end
  155. end
  156. end
  157. if not id then
  158. return
  159. end
  160. local EquipExcel = require("excel.equip").equip
  161. if EquipExcel[id] then
  162. local cnt= tonumber(string.sub(val,pos+1,pos + 2))
  163. local rare= tonumber(string.sub(val,pos+2,#val))
  164. require("bag.BagLogic").addItem(human, id, cnt, "gm", nil, rare)
  165. human.getEquip = nil
  166. else
  167. -- 分开是因为 常规道具 给不了
  168. local cnt= tonumber(string.sub(val,pos+1,#val))
  169. require("bag.BagLogic").addItem(human,id,cnt,"gm")
  170. end
  171. end
  172. -- 删除道具
  173. function d3.itemdel(human,val)
  174. if val == nil then return end
  175. local pos = string.find(val, " ", 1, true)
  176. if pos == nil then return end
  177. local id = tonumber(string.sub(val, 1, pos - 1))
  178. local cnt= tonumber(string.sub(val,pos+1,#val))
  179. require("bag.BagLogic").delItem(human,id,cnt,"gm")
  180. end
  181. function d3.qingbaoMax(human)
  182. require("bar.BarTaskLogic").addBarQingBao(human, 10000)
  183. end
  184. function d3.maxbattle(human, val)
  185. val = val + 0
  186. human.db.battleID = val
  187. human.db.guajiID = val - 1
  188. local BRoleLogic = require("billboard.BRoleLogic")
  189. local BillboardDefine = require("billboard.BillboardDefine")
  190. BRoleLogic.updateData(BillboardDefine.TYPE_BATTLE, human.db)
  191. end
  192. function d3.dbsave(human)
  193. ObjHuman.save(human)
  194. end
  195. -- 设置当前金币
  196. function d3.jinbi(human, val)
  197. val = val + 0
  198. ObjHuman.updateJinbi(human, val - human.db.jinbi, "gm")
  199. end
  200. -- 设置钻石
  201. function d3.zuanshi(human, val)
  202. val = val + 0
  203. if val > human.db.zuanshi then
  204. print("234234234",val)
  205. ObjHuman.addZuanshi(human, val - human.db.zuanshi, "gm")
  206. else
  207. ObjHuman.decZuanshi(human, val - human.db.zuanshi, "gm")
  208. end
  209. end
  210. --添加邮件
  211. function d3.mail(human,val)
  212. local param = Util.split(val, " ")
  213. local mailtype = tonumber(param[1])
  214. local title = param[2]
  215. local content = param[3]
  216. local max = #param
  217. local count = (type(param[max]) == "number") and param[max] or 1
  218. local items
  219. if param[4] then
  220. items = {}
  221. for i = 4,max-1 do
  222. items[#items + 1] = {tonumber(param[i]),math.floor(math.random(1,10))}
  223. end
  224. end
  225. if not (mailtype == 1 or mailtype == 2) or not title or not content then
  226. send(human, "参数错误 "..type.." "..title.." "..content.." "..#items)
  227. end
  228. local MailManager = require("mail.MailManager")
  229. for i= 1,count do
  230. MailManager.add(mailtype,human.db._id,title,content,items,mailtype == 2 and [[测试用户]])
  231. end
  232. end
  233. function d3.clbag(human)
  234. human.db.bag = {}
  235. local msgRet = Msg.gc.GC_BAG_LIST
  236. msgRet.list[0] = 0
  237. Msg.send(msgRet, human.fd)
  238. end
  239. function d3.clhero(human)
  240. local HeroLogic = require("hero.HeroLogic")
  241. for i = 1, human.db.heroBag[0] do
  242. HeroLogic.delHeroByIndex(human, i, "gm")
  243. end
  244. end
  245. function d3.god(human)
  246. local GMExcelConfig = GMExcel.god[1]
  247. BagLogic.addItemList(human, GMExcelConfig.addItem, "gm")
  248. for k, v in ipairs(GMExcelConfig.addHero) do
  249. local id = tonumber(v[1])
  250. local cnt = tonumber(v[2])
  251. local lv = tonumber(v[3])
  252. local star = tonumber(v[4])
  253. local quality = require("hero.HeroGrid").getMaxQualityByLv(star, lv)
  254. for i = 1, cnt do
  255. local heroGrid = require("hero.HeroGrid").createHeroGrid(id, star)
  256. if heroGrid then
  257. heroGrid.lv = math.max(heroGrid.lv, lv or 0)
  258. heroGrid.quality = math.max(heroGrid.quality, quality or 0)
  259. require("hero.HeroLogic").addHeroByGrid(human, heroGrid, "gm")
  260. end
  261. end
  262. end
  263. --d3.viplv(human, 13)
  264. --d3.lv(human, 1)
  265. --d3.noguide(human)
  266. end
  267. function d3.wudi(human)
  268. if wudi then
  269. wudi = false
  270. Broadcast.sendErr(human, "取消无敌状态")
  271. else
  272. wudi = true
  273. Broadcast.sendErr(human, "进入无敌状态")
  274. end
  275. end
  276. -- 清空副本次数和购买次数
  277. function d3.clcopy(human)
  278. human.db.copy = nil
  279. end
  280. -- 设置等级
  281. function d3.lv(human, val)
  282. val = val + 0
  283. local lvOld = human.db.lv
  284. local lvNew = val + 0
  285. human.db.lv = lvNew
  286. ObjHuman.onLvUpCB(human,lvOld , lvNew)
  287. end
  288. -- 加经验
  289. function d3.addexp(human, val)
  290. val = val + 0
  291. ObjHuman.addExp(human, val)
  292. end
  293. -- 设置vip等级
  294. function d3.viplv(human, val)
  295. val = val + 0
  296. local oldVipLv = VipLogic.getVipLv(human)
  297. human.db.vipExp = VipExcel.vip[val] and VipExcel.vip[val].exp or 0
  298. human.db.vipLv = val
  299. VipLogic.addExp(human, 0)
  300. end
  301. -- 增加vip经验
  302. function d3.vipexp(human, val)
  303. val = val + 0
  304. VipLogic.addExp(human, val)
  305. end
  306. function d3.it1(human, value)
  307. value = tonumber(value)
  308. if not value then return end
  309. local ItemExcel = require("excel.item").item
  310. local BagLogic = require("bag.BagLogic")
  311. for itemID, cf in pairs(ItemExcel) do
  312. if cf.subType == value then
  313. BagLogic.addItem(human, itemID, 1, "gm", true)
  314. end
  315. end
  316. BagLogic.sendBagList(human)
  317. end
  318. function d3.equip(human, value)
  319. value = tonumber(value)
  320. if not value then return end
  321. local BagLogic = require("bag.BagLogic")
  322. local EquipExcel = require("excel.equip").equip
  323. for itemID in pairs(EquipExcel) do
  324. BagLogic.addItem(human, itemID, 1, "gm", true)
  325. end
  326. BagLogic.sendBagList(human)
  327. end
  328. function d3.task(human, val)
  329. if val == nil then return end
  330. local task = string.find(val, " ", 1, true)
  331. if task == nil then return end
  332. local id = tonumber(string.sub(val, 1, task - 1))
  333. local cnt= tonumber(string.sub(val,task+1,#val))
  334. local DailyTaskLogic = require("dailyTask.DailyTaskLogic")
  335. DailyTaskLogic.recordDailyTaskFinishCnt(human, id, cnt, nil)
  336. end
  337. function d3.os(human, value)
  338. value = value and tonumber(value)
  339. if value == nil then
  340. local openSvrTime = CommonDB.getServerOpenTime()
  341. if openSvrTime == 0 then
  342. Broadcast.sendErr(human, "未设置开服时间")
  343. else
  344. local tb = os.date("%Y%m%d", openSvrTime)
  345. Broadcast.sendErr(human, "当前开服时间为" .. tb)
  346. end
  347. else
  348. local now = os.time()
  349. local temp = Util.getDayStartTime(now)
  350. temp = temp - (value - 1) * 24 * 3600
  351. CommonDB.setServerOpenTime(temp)
  352. local tb = os.date("%Y%m%d", temp)
  353. Broadcast.sendErr(human, "设置当前开服时间为" .. tb)
  354. --同步中心服开服时间
  355. --[[local msgRet = InnerMsg.lw.LW_OS
  356. msgRet.uuid = human.db._id
  357. msgRet.value = temp
  358. InnerMsg.sendMsg(0, msgRet)]]
  359. end
  360. end
  361. function d3.createtime(human, value)
  362. value = value and tonumber(value)
  363. if not value then return end
  364. local now = os.time()
  365. local temp = Util.getDayStartTime(now)
  366. temp = temp - (value - 1) * 24 * 3600
  367. human.db.createTime = temp
  368. local tb = os.date("%Y%m%d", temp)
  369. Broadcast.sendErr(human, "设置当前创角时间为" .. tb)
  370. end
  371. --设置中心服开服时间
  372. function d3.osw(human, value)
  373. value = value and tonumber(value)
  374. local msgRet = InnerMsg.lw.LW_OS
  375. msgRet.uuid = human.db._id
  376. msgRet.value = value
  377. InnerMsg.sendMsg(0, msgRet)
  378. end
  379. function d3.chengjiu(human,val)
  380. local ChengjiuExcel = require("excel.chengjiu").chengjiu
  381. local ChengjiuLogic = require("chengjiu.ChengjiuLogic")
  382. for k,v in pairs(ChengjiuExcel) do
  383. ChengjiuLogic.onCallback(human,v.type, v.param)
  384. end
  385. end
  386. function d3.jjczero()
  387. local JjcLogic = require("jjc.JjcLogic")
  388. JjcLogic.onZero()
  389. end
  390. function d3.jjcreset()
  391. JjcDB.resetJJCDB()
  392. end
  393. function d3.jpSet(human,val)
  394. local point = tonumber(val)
  395. JjcDB.updatePlayerPoint(human.db._id, point, nil)
  396. end
  397. function d3.billboard(human)
  398. local BillboardDB = require("billboard.BillboardDB")
  399. BillboardDB.sort()
  400. end
  401. function d3.cldjs(human)
  402. human.db.jinbiExchange = nil
  403. end
  404. -- 激活钻石基金
  405. function d3.fund(human, val)
  406. local type = tonumber(val)
  407. local FundLogic = require("present.FundLogic")
  408. FundLogic.fundBuy(human, type)
  409. end
  410. -- 清空钻石基金购买和发放记录
  411. function d3.clfund(human)
  412. human.db.fundFlag = nil
  413. end
  414. function d3.clbuy(human)
  415. human.db.buy = {}
  416. end
  417. --增加好战者计数 仅限竞技场和试炼
  418. function d3.hzzadd(human, val)
  419. if val == nil then return end
  420. local pos = string.find(val, " ", 1, true)
  421. if pos == nil then return end
  422. local type = tonumber(string.sub(val, 1, pos - 1))
  423. local add= tonumber(string.sub(val,pos+1,#val))
  424. local MonthHzz = require("monthAct.MonthHzz")
  425. if type == MonthHzz.MONTHACT_HZZ_TYPE_1 then
  426. MonthHzz.addJjcFight(human, nil, add)
  427. elseif type == MonthHzz.MONTHACT_HZZ_TYPE_2 then
  428. MonthHzz.addTrialCnt(human, nil, add)
  429. end
  430. end
  431. function d3.ydjiuguan(human, val)
  432. if val == nil then return end
  433. local pos = string.find(val, " ", 1, true)
  434. if pos == nil then return end
  435. local star = tonumber(string.sub(val, 1, pos - 1))
  436. local add= tonumber(string.sub(val,pos+1,#val))
  437. local MonthDrunkery = require("monthAct.MonthDrunkery")
  438. MonthDrunkery.addDrunkCntEx(human, star, add)
  439. end
  440. function d3.ydhcjx(human, val)
  441. if val == nil then return end
  442. local param = Util.split(val, " ")
  443. local type = tonumber(param[1])
  444. local heroId= tonumber(param[2])
  445. local add = tonumber(param[3])
  446. local MonthHecJuex = require("monthAct.MonthHecJuex")
  447. MonthHecJuex.addCntByGm(human,type,heroId, add)
  448. end
  449. function d3.clboss(human)
  450. local DB = require("common.DB")
  451. local LuaMongo = _G.lua_mongo
  452. LuaMongo.remove(DB.db_boss)
  453. end
  454. function d3.clwish(human)
  455. human.db.wishCnt = nil
  456. human.db.wishActAlrCnt = nil
  457. end
  458. -- 设置高抽次数
  459. function d3.hsum(human,val)
  460. human.db.summonCnt = val
  461. end
  462. function d3.clhsum(human)
  463. human.db.summonCnt = nil
  464. human.db.sumWinScoCnt = nil
  465. end
  466. function d3.unionquery(human,val)
  467. local name = val
  468. local UnionLogic = require("union.UnionLogic")
  469. UnionLogic.createUnion(human,name)
  470. end
  471. function d3.uniondonate(human, value)
  472. local UnionDBLogic = require("union.UnionDBLogic")
  473. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  474. if union == nil then
  475. return
  476. end
  477. union.donate = union.donate or {}
  478. union.donate[1] = value
  479. union.donate[2] = os.time()
  480. UnionDBLogic.updateUnionData(union)
  481. end
  482. function d3.settower(human,val)
  483. local HuanjingTowerLogic = require("huanjingTower.HuanjingTowerLogic")
  484. HuanjingTowerLogic.setTowerByGm(human, val)
  485. end
  486. function d3.setbattle(human,val)
  487. local BattleLogic = require("battle.BattleLogic")
  488. local param = Util.split(val, " ")
  489. BattleLogic.setBattleByGm(human, param[1], param[2])
  490. end
  491. function d3.overmonth(human, val)
  492. val = math.max(tonumber(val) or 0, 10)
  493. human.db.actMonthEndTime = os.time() + val
  494. end
  495. function d3.zhuanpantime(human,val)
  496. local param = Util.split(val, " ")
  497. local ZhuanpanLogic = require("zhuanpan.ZhuanpanLogic")
  498. ZhuanpanLogic.zhuanpanByGm(human, tonumber(param[1]), tonumber(param[2]) )
  499. end
  500. function d3.signin(human,val)
  501. human.db.signInCnt = val
  502. for i =1,human.db.signInCnt do
  503. human.db.signIn[i] = 1
  504. end
  505. end
  506. function d3.unionLv(human, val)
  507. val = tonumber(val)
  508. if not val then return end
  509. local UnionDBLogic = require("union.UnionDBLogic")
  510. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  511. if not union then return end
  512. UnionDBLogic.upsetUnionData(union._id, "lv", val)
  513. UnionDBLogic.upsetUnionData(union._id, "exp", 0)
  514. end
  515. function d3.unionexp(human, val)
  516. val = tonumber(val)
  517. if not val then return end
  518. local UnionDBLogic = require("union.UnionDBLogic")
  519. local UnionLogic = require("union.UnionLogic")
  520. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  521. if not union then return end
  522. UnionLogic.addUnionExp(union, val)
  523. UnionDBLogic.updateUnionData(union)
  524. end
  525. function d3.gws(human,val)
  526. local LoginSignLogic = require("loginSign.LoginSignLogic")
  527. for i = 1,val do
  528. LoginSignLogic.getReward(human)
  529. end
  530. end
  531. function d3.tsht(human)
  532. local AdminLogic = require("AdminLogic")
  533. local JsonInput = {}
  534. JsonInput.accountName = human.db.account
  535. JsonInput.roleName = human.db.name
  536. AdminLogic.adminFunction.getuserstatus(JsonInput)
  537. end
  538. function d3.bs(human,val)
  539. local param = Util.split(val, " ")
  540. local AdminLogic = require("AdminLogic")
  541. local JsonInput = {}
  542. JsonInput.account = human.db.account
  543. JsonInput.minute = param[1]
  544. JsonInput.reason = param[2]
  545. AdminLogic.adminFunction.banSay(JsonInput)
  546. end
  547. function d3.bl(human,val)
  548. local AdminLogic = require("AdminLogic")
  549. local JsonInput = {}
  550. JsonInput.accountName = human.db.account
  551. JsonInput.minute = val
  552. AdminLogic.adminFunction.banAccount(JsonInput)
  553. end
  554. function d3.bl2(human,val)
  555. local AdminLogic = require("AdminLogic")
  556. local param = Util.split(val, " ")
  557. local JsonInput = {}
  558. JsonInput.accountName = param[1]
  559. JsonInput.minute = tonumber(param[2])
  560. AdminLogic.adminFunction.banAccount(JsonInput)
  561. end
  562. function d3.cbl(human,val)
  563. local param = Util.split(val, " ")
  564. local AdminLogic = require("AdminLogic")
  565. local JsonInput = {}
  566. JsonInput.accountName = param[1]
  567. JsonInput.cancelBanSay = param[2]
  568. AdminLogic.adminFunction.cancelBanAccount(JsonInput)
  569. end
  570. function d3.bip(human,val)
  571. local param = Util.split(val, " ")
  572. local AdminLogic = require("AdminLogic")
  573. local JsonInput = {}
  574. JsonInput.IP = param[1]
  575. JsonInput.banTime = param[2]
  576. AdminLogic.adminFunction.banIp(JsonInput)
  577. end
  578. function d3.ursc(human)
  579. human.db.ectypeCnt = nil
  580. human.db.ectypeFreeTime = nil
  581. end
  582. function d3.sue(human,val)
  583. local newLevel = tonumber(val)
  584. if not newLevel then return end
  585. local UnionDBLogic = require("union.UnionDBLogic")
  586. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  587. if not union then return end
  588. UnionDBLogic.updateBossLv(union,newLevel)
  589. end
  590. function d3.smtp(human,val)
  591. local param = Util.split(val, " ")
  592. local AdminLogic = require("AdminLogic")
  593. local JsonInput = {}
  594. JsonInput.recvType = 3
  595. JsonInput.title = param[1]
  596. JsonInput.content = param[2]
  597. JsonInput.fbAccount = param[3]
  598. JsonInput.senderName = "系统邮件"
  599. JsonInput.fbTime = os.time()
  600. JsonInput.fbContent = "反馈"
  601. JsonInput.startLv =0
  602. JsonInput.endLv = 51
  603. JsonInput.lastLoginTime = os.time() - 60*60
  604. AdminLogic.adminFunction.mail(JsonInput)
  605. end
  606. function d3.clmilltime(human)
  607. human.db.unionTaskGetTime = nil
  608. end
  609. function d3.tstx(human,val)
  610. local RoleHeadLogic = require("role.RoleHeadLogic")
  611. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_1, val)
  612. end
  613. function d3.tstxk(human,val)
  614. local RoleHeadLogic = require("role.RoleHeadLogic")
  615. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_2, val)
  616. end
  617. function d3.buy(human,val)
  618. local AdminLogic = require("AdminLogic")
  619. local PlatformHandler = require("platform.Handler")
  620. local ApiLogic = require("platform.ApiLogic")
  621. local BuyExcel = require("excel.buy")
  622. local buyConf = BuyExcel.buy[val]
  623. if not buyConf then return end
  624. local shopConf = BuyExcel.topup[val]
  625. if shopConf and shopConf.buyID == val then
  626. else
  627. shopConf = nil
  628. end
  629. local checkMoney = buyConf["CN"]
  630. local msg = {}
  631. msg.logintype = 2
  632. msg.openid = "oCD-L5RxAtfRe8-aiezdY-Ccla5U"
  633. msg.openkey = "VsBJf2DKah7QhzU5xuzLNA=="
  634. msg.yuanbao = shopConf and shopConf.cnt or buyConf.CN * 10
  635. msg.buyID = val
  636. msg.account = human.db.account
  637. msg.transaction_id = "transaction_id1"
  638. msg.pf = "android"
  639. msg.money = checkMoney
  640. ApiLogic.CHARGE_CODE_HIS = {}
  641. print("cccc:",val)
  642. BuyLogic.buy(human,val)
  643. --PlatformHandler.CG_TENCENT_BUY(human,msg)
  644. --AdminLogic.adminFunction.tencentPay(msg)
  645. end
  646. function d3.gol(human)
  647. local AdminLogic = require("AdminLogic")
  648. AdminLogic.adminFunction.getonlinelist()
  649. end
  650. function d3.htm(human,val)
  651. local AdminLogic = require("AdminLogic")
  652. local oJsonInput = {}
  653. oJsonInput.recvType = val -- 邮件类型
  654. oJsonInput.title = "111" -- 邮件标题
  655. oJsonInput.content = "222" -- 邮件内容
  656. oJsonInput.items = nil -- 道具列表 可以为空
  657. oJsonInput.accounts = nil -- 指定玩家列表
  658. oJsonInput.startLv = 0
  659. oJsonInput.endLv = 200
  660. AdminLogic.adminFunction.mail(oJsonInput)
  661. end
  662. function d3.cluwar(human)
  663. require("union.UnionWarLogic").cleanUnionWar()
  664. local msg = InnerMsg.lw.LW_GM
  665. msg.gm = "cluwarmiddle"
  666. InnerMsg.sendMsg(0, msg)
  667. end
  668. function d3.cluniontime(human)
  669. human.db.unionJoinTime = nil
  670. end
  671. function d3.cluwarmiddle()
  672. local LuaMongo = _G.lua_mongo
  673. local DB = require("common.DB")
  674. LuaMongo.remove(DB.db_union_war)
  675. end
  676. function d3.uwarstart()
  677. -- 需要周1、3、5使用
  678. local UnionWarLogic = require("union.UnionWarLogic")
  679. UnionWarLogic.cleanUnionWar()
  680. local msg = InnerMsg.lw.LW_GM
  681. msg.gm = "cluwarmiddle"
  682. InnerMsg.sendMsg(0, msg)
  683. UnionWarLogic.onHour(0)
  684. UnionWarLogic.onHour(1)
  685. local msg = InnerMsg.lw.LW_GM
  686. msg.gm = "uwarstartmiddle"
  687. InnerMsg.sendMsg(0, msg)
  688. end
  689. function d3.warMaxtest(human, value)
  690. require("union.UnionWarLogic").auto(value)
  691. end
  692. function d3.uwar(human,state)
  693. local msg = InnerMsg.lw.LW_GM
  694. msg.gm = "muwar "..state
  695. InnerMsg.sendMsg(0, msg)
  696. if state == 1 then
  697. local UnionWarDBLogic = require("union.UnionWarDBLogic")
  698. UnionWarDBLogic.onHour(0, true)
  699. end
  700. end
  701. function d3.uwarshop(human, lv)
  702. require("union.UnionWarLogic").upWarShopLv(human, tonumber(lv))
  703. end
  704. function d3.uwarBuff(human)
  705. local msg = InnerMsg.lw.LW_GM
  706. msg.gm = "muwarBuff ".. human.db.unionUuid
  707. InnerMsg.sendMsg(0, msg)
  708. end
  709. function d3.muwar(human,state)
  710. local UnionWarDBLogic = require("union.UnionWarDBLogic")
  711. if state == 1 then
  712. UnionWarDBLogic.onHour(0, true)
  713. elseif state == 2 then
  714. UnionWarDBLogic.onHour(2, true)
  715. elseif state == 3 then
  716. UnionWarDBLogic.onHour(20, true)
  717. end
  718. end
  719. function d3.muwarBuff(human, unionUuid)
  720. local UnionWarDBLogic = require("union.UnionWarDBLogic")
  721. UnionWarDBLogic.addBuffLvByGm(unionUuid)
  722. end
  723. function d3.uwartask(human, type)
  724. local UnionWarLogic = require("union.UnionWarLogic")
  725. UnionWarLogic.chegnjiuFinishGm(human, tonumber(type))
  726. end
  727. function d3.uwarstartmiddle()
  728. -- 匹配
  729. require("union.UnionWarMiddleLogic").matchUnionStart()
  730. end
  731. function d3.cljjc(human, val)
  732. val = tonumber(val)
  733. local msgRet = InnerMsg.lw.LW_CL_JJC
  734. msgRet.type = val
  735. InnerMsg.sendMsg(0, msgRet)
  736. end
  737. function d3.cluwar(human)
  738. require("union.UnionWarLogic").cleanUnionWar()
  739. local msg = InnerMsg.lw.LW_GM
  740. msg.gm = "cluwarmiddle"
  741. InnerMsg.sendMsg(0, msg)
  742. end
  743. function d3.cluwarmiddle()
  744. local LuaMongo = _G.lua_mongo
  745. local DB = require("common.DB")
  746. LuaMongo.remove(DB.db_union_war)
  747. end
  748. function d3.uwarstart()
  749. -- 需要周1、3、5使用
  750. require("union.UnionWarLogic").onHour(0)
  751. require("union.UnionWarLogic").onHour(1)
  752. local msg = InnerMsg.lw.LW_GM
  753. msg.gm = "uwarstartmiddle"
  754. InnerMsg.sendMsg(0, msg)
  755. end
  756. function d3.uwarstartmiddle()
  757. -- 匹配
  758. require("union.UnionWarMiddleLogic").matchUnionStart()
  759. end
  760. function d3.cxh(human)
  761. d3.tgod(human)
  762. d3.lv(human,200)
  763. end
  764. function d3.drop(human,val)
  765. local BattleLogic = require("battle.BattleLogic")
  766. local param = Util.split(val, " ")
  767. local cnt = tonumber(param[1])
  768. local battleID = tonumber(param[2])
  769. BattleLogic.clacItemCntGM(human,cnt,battleID)
  770. end
  771. function d3.uif(human,val)
  772. local jsonInput = {}
  773. jsonInput.unionName = val
  774. local AdminLogic = require("AdminLogic")
  775. AdminLogic.adminFunction.unionInfo(jsonInput)
  776. end
  777. function d3.ul(human,val)
  778. local jsonInput = {}
  779. jsonInput.start = tonumber(val)
  780. local AdminLogic = require("AdminLogic")
  781. AdminLogic.adminFunction.unionList(jsonInput)
  782. end
  783. function d3.monthgaochou(human, val)
  784. local MonthSummon = require("monthAct.MonthSummon")
  785. MonthSummon.onSummon(human, tonumber(val))
  786. end
  787. function d3.jhtq(human,val)
  788. local TequanLogic = require("qqTequan.TequanLogic")
  789. local param = Util.split(val, " ")
  790. local val1 = tonumber(param[1])
  791. local val2 = tonumber(param[2])
  792. local val3 = tonumber(param[3])
  793. local val4 = tonumber(param[4])
  794. TequanLogic.activateTequan(human,val1,val2,val3,val4)
  795. end
  796. function d3.unionTecLv(human,val)
  797. local UnionTecLogic = require("union.UnionTecLogic")
  798. UnionTecLogic.lvAllUpByGm(human)
  799. end
  800. function d3.auto(human,val)
  801. local param = Util.split(val, " ")
  802. local str = param[1]
  803. local val = param[2]
  804. if not str or not val then
  805. return
  806. end
  807. for i = 1, val do
  808. require("union.UnionWarLogic").auto(str .. string.format("%02d", i))
  809. end
  810. end
  811. function d3.lvAuto(human, val)
  812. val = val + 0
  813. local lvOld = human.db.lv
  814. local lvNew = val + 0
  815. human.db.lv = lvNew
  816. end
  817. function d3.cap(human)
  818. human.db.buyCapCnt = require("hero.HeroDefine").BUY_CAP_CNT
  819. require("hero.HeroLogic").sendHeroBagCap(human)
  820. end
  821. function d3.abscharge(human)
  822. AbsBillboardLogic.charge(human,1000)
  823. end
  824. function d3.jhpt(human)
  825. if human.pf_info.pf == "qqgame" then
  826. human.db.txHall = {}
  827. elseif human.pf_info.pf == "qzone" or human.pf_info.pf == "website" then
  828. human.db.qqZone = {}
  829. end
  830. end
  831. function d3.addfuwen(human)
  832. d3.itemadd(human,"80001 10")
  833. d3.itemadd(human,"80002 10")
  834. d3.itemadd(human,"80003 10")
  835. d3.itemadd(human,"80004 10")
  836. d3.itemadd(human,"80005 10")
  837. end
  838. function d3.addSmelt(human,val)
  839. local num = tonumber(val)
  840. human.db.smeltVal = human.db.smeltVal or 0
  841. human.db.smeltVal = human.db.smeltVal + num
  842. end
  843. function d3.zdfw(human,val)
  844. local param = Util.split(val, " ")
  845. local fuwenID = tonumber(param[1])
  846. local attr1 = tonumber(param[2])
  847. local val1 = tonumber(param[3])
  848. local attr2 = tonumber(param[4])
  849. local val2 = tonumber(param[5])
  850. local skill1 = tonumber(param[6])
  851. local skill2 = tonumber(param[7])
  852. local FuwenGrid = require("fuwen.FuwenGrid")
  853. local FuwenExcel = require("excel.fuwen").skill
  854. if (skill1 ~= nil and FuwenExcel[skill1] == nil) or (skill2 ~= nil and FuwenExcel[skill2] == nil) then
  855. print("fuck! add fuwen skill is notreal")
  856. return
  857. end
  858. FuwenGrid.setFuwenSkillAttrByGM(human,fuwenID,attr1,val1,attr2,val2,skill1,skill2)
  859. end
  860. function d3.t2(human)
  861. local input = [[{"method":"OnTokenReturnForBuy","tencent_ret":{"ret":0,"token":"fC283BD0141D50418B68200972FBEE6A13102","url_params":"\/v1\/r\/1110099166\/mobile_goods_info?token_id=BC283BD0141D50418B68200972FBEE6A13102&transaction_id=BC283BD0141D50418B68200972FBEE6A13102&out_trade_no=&new_cpay=1&offer_type=0","transaction_id":"BC283BD0141D50418B68200972FBEE6A13102","attach":""},"callback_general_param":{"name":"0-15D9C743A68D57FF8B22CC944BAEAD8C","account":"0-a"}}]]
  862. local ret = require("AdminLogic").handleAdminRequest(_, input)
  863. print(ret)
  864. end
  865. function d3.t1(human)
  866. local input = {}
  867. input.token = "fC283BD0141D50418B68200972FBEE6A13102"
  868. input.payitem = "39*60*1"
  869. input.billno = os.time()
  870. local ret = require("platform.QQApi").onDeliverReturnForBuy(input)
  871. print(ret.ret,ret.msg)
  872. end
  873. function d3.skin(human,val)
  874. local tb = Util.split(val, " ")
  875. local id = tonumber(tb[1])
  876. local cnt = tonumber(tb[2])
  877. print(id,tb[1],tb[2])
  878. if not id then
  879. human.db.skinBag = {[0] = 999}
  880. return
  881. end
  882. local SkinLogic = require("skin.SkinLogic")
  883. SkinLogic.addSkin(human,id,cnt)
  884. end
  885. function d3.ff(human,val)
  886. local FriendLogic = require("friend.FriendLogic")
  887. FriendLogic.addFriend(human, val)
  888. end
  889. function d3.chenghao(human,val)
  890. val = tonumber(val)
  891. if not val then
  892. return
  893. end
  894. local RoleHeadLogic = require("role.RoleHeadLogic")
  895. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_4, val)
  896. end
  897. function d3.unionBillboard(human,val)
  898. val = tonumber(val)
  899. if not val then
  900. return
  901. end
  902. local BRoleLogic = require("billboard.BRoleLogic")
  903. BRoleLogic.queryUnionBillboard(human,val)
  904. end
  905. function d3.herotest(human, val)
  906. local tb = Util.split(val, " ")
  907. local combatType = 1
  908. local HeroExcel = require("excel.hero")
  909. local HeroLogic = require("hero.HeroLogic")
  910. local flags = {}
  911. human.db.combatHero = human.db.combatHero or {}
  912. human.db.combatHero[combatType] = {}
  913. for pos = 1, 6 do
  914. local id = tonumber(tb[pos])
  915. local index = nil
  916. if id and HeroExcel.hero[id] then
  917. for i = 1, human.db.heroBag[0] do
  918. local heroGrid = human.db.heroBag[i]
  919. if heroGrid and (heroGrid.id == id) and
  920. (not flags[i]) then
  921. flags[i] = true
  922. index = i
  923. break
  924. end
  925. end
  926. if not index then
  927. index = HeroLogic.getEmptyIndex(human)
  928. d3.heroadd(human, id .. " 1")
  929. end
  930. end
  931. human.db.combatHero[combatType][pos] = index
  932. end
  933. local CombatHandler = require("combat.Handler")
  934. CombatHandler.CG_COMBAT_BEGIN(human,{type = combatType, param = ""})
  935. end
  936. function d3.combat(human, monsterOutID)
  937. local CombatLogic = require("combat.CombatLogic")
  938. local param = {}
  939. param.defender, _, param.defRBase, param.defFormation = CombatLogic.getMonsterObjList(monsterOutID)
  940. require("combat.CombatLogic").combatBegin(human, 1001, param, 1)
  941. end
  942. function d3.combat2(human,id)
  943. local id = tonumber(id)
  944. local combatConf = require("excel.combat").gm[id]
  945. if not combatConf then
  946. assert()
  947. end
  948. local HeroGrid = require("hero.HeroGrid")
  949. local HeroLogic = require("hero.HeroLogic")
  950. local CombatLogic = require("combat.CombatLogic")
  951. local fakeman1 = {}
  952. local account1 = "combatFakeman1"
  953. local fakeman2 = {}
  954. local account2 = "combatFakeman2"
  955. local RoleDBLogic = require("role.RoleDBLogic")
  956. local fakemanDB1 = RoleDBLogic.getDbByAccount(account1)
  957. if not fakemanDB1 then
  958. fakemanDB1 = RoleDBLogic.createDefaultRole(account1)
  959. end
  960. fakeman1.db = fakemanDB1
  961. local fakemanDB2 = RoleDBLogic.getDbByAccount(account2)
  962. if not fakemanDB2 then
  963. fakemanDB2 = RoleDBLogic.createDefaultRole(account2)
  964. end
  965. fakeman2.db = fakemanDB2
  966. local attacker = {}
  967. local defender = {}
  968. for i = 1, fakeman1.db.heroBag[0] do
  969. HeroLogic.delHeroByIndex(fakeman1, i, "gm")
  970. end
  971. for i = 1, fakeman2.db.heroBag[0] do
  972. HeroLogic.delHeroByIndex(fakeman2, i, "gm")
  973. end
  974. for k,v in ipairs(combatConf.atk) do
  975. local heroGrid = HeroGrid.createHeroGrid(v[1], v[4])
  976. heroGrid.lv = math.max(heroGrid.lv, v[3] or 0)
  977. heroGrid.quality = HeroGrid.getMaxQuality(heroGrid.star)
  978. local heroIndex = HeroLogic.addHeroByGrid(fakeman1, heroGrid, "gm")
  979. attacker[v[2]] = CombatLogic.createHumanObj(fakeman1, heroGrid.uuid)
  980. end
  981. for k,v in ipairs(combatConf.def) do
  982. local heroGrid = HeroGrid.createHeroGrid(v[1], v[4])
  983. heroGrid.lv = math.max(heroGrid.lv, v[3] or 0)
  984. heroGrid.quality = HeroGrid.getMaxQuality(heroGrid.star)
  985. local heroIndex = HeroLogic.addHeroByGrid(fakeman2, heroGrid, "gm")
  986. defender[v[2]] = CombatLogic.createHumanObj(fakeman2, heroGrid.uuid)
  987. end
  988. local atkPet = nil
  989. local defPet = nil
  990. CombatLogic.combatGm(human,1001,combatConf.atkF, attacker,combatConf.defF,defender,atkPet,defPet,{{101,1},{102,2},{103,3},{104,4}})
  991. end
  992. function d3.combatEnd(human)
  993. local CombatLogic = require("combat.CombatLogic")
  994. for i = CombatDefine.COMBAT_TYPE1, CombatDefine.COMBAT_TYPE_MAX do
  995. CombatLogic.clientFinish(human, i)
  996. end
  997. end
  998. -- it道具添加(支持中文)
  999. function d3.it(human,value)
  1000. local tb = Util.split(value," ")
  1001. local id = tonumber(tb[1])
  1002. local cnt = tonumber(tb[2])
  1003. if id == nil then id = tb[1] end
  1004. if type(id) == "string" then
  1005. id = ItemDefine.getIdByName(id)
  1006. end
  1007. if type(id) ~= "number" then
  1008. print("err id", tb[1], id, type(id))
  1009. return
  1010. end
  1011. cnt = cnt or 1000
  1012. BagLogic.addItem(human, id, cnt, "gm")
  1013. end
  1014. -- 清除酒馆
  1015. function d3.clbartask(human)
  1016. human.db.bar = nil
  1017. end
  1018. function d3.updaily(human)
  1019. ObjHuman.updateDaily(human, true)
  1020. end
  1021. function d3.clguide(human)
  1022. human.db.noguide = nil
  1023. human.db.guide = nil
  1024. human.guideLoginStep = nil
  1025. require("guide.GuideLogic").refreshGuide(human)
  1026. require("guide.GuideLogic").sendStep(human)
  1027. end
  1028. function d3.nextguide(human)
  1029. local GuideExcel = require("excel.guide")
  1030. local GuideLogic = require("guide.GuideLogic")
  1031. local id = GuideLogic.getGuideID(human)
  1032. local nextstep = GuideLogic.getGuideStep(human) + 1
  1033. local cf = id and GuideExcel.main_guide[id]
  1034. local sid = cf and cf.guideList[nextstep]
  1035. GuideLogic.stepFinish(human, sid)
  1036. end
  1037. function d3.guide(human, id)
  1038. human.db.noguide = nil
  1039. human.guideLoginStep = nil
  1040. local GuideLogic = require("guide.GuideLogic")
  1041. GuideLogic.setGuide(human, id, GuideLogic.STATE_DOING)
  1042. GuideLogic.sendStep(human)
  1043. end
  1044. -- 跳过指引
  1045. function d3.noguide(human)
  1046. human.db.noguide = true
  1047. human.guideLoginStep = nil
  1048. require("guide.GuideLogic").sendStep(human, true)
  1049. end
  1050. function d3.creatunion(human,value)
  1051. d3.lv(human,30)
  1052. d3.viplv(human,2)
  1053. d3.zuanshi(human, 1000)
  1054. local UnionLogic = require("union.UnionLogic")
  1055. UnionLogic.createUnion(human, value)
  1056. end
  1057. function d3.cldraw(human, value)
  1058. human.db.drawCard = {jifen=tonumber(value),list={[1]={},[2]={},[3]={},[4]={}}}
  1059. end
  1060. function d3.cldrill(human)
  1061. require("drill.DrillDB").reset()
  1062. end
  1063. function d3.zhengdian(_, hour)
  1064. hour = tonumber(hour) or 0
  1065. require("core.Timer").doZhengDian(hour)
  1066. end
  1067. function d3.tgod(human)
  1068. local HeroLogic = require("hero.HeroLogic")
  1069. local HeroGrid = require("hero.HeroGrid")
  1070. local HeroExcel = require("excel.hero")
  1071. for heroID, config in pairs(HeroExcel.tujian) do
  1072. local heroConfig = HeroExcel.hero[heroID]
  1073. if heroConfig then
  1074. local star = heroConfig.star
  1075. local maxQuality = HeroGrid.getMaxQuality(star)
  1076. local maxLv = HeroGrid.getMaxLv(star,maxQuality)
  1077. d3.heroadd(human, heroID .. " 1".." "..maxLv.." "..maxQuality)
  1078. end
  1079. end
  1080. end
  1081. function d3.tujian(human, camp)
  1082. local HeroExcel = require("excel.hero")
  1083. camp = tonumber(camp)
  1084. for heroID, config in pairs(HeroExcel.tujian) do
  1085. if config.camp == camp or not camp then
  1086. d3.heroadd(human, heroID .. " 1")
  1087. end
  1088. end
  1089. end
  1090. function d3.cljingcailibao(human)
  1091. human.db.dailyLeiChong = nil
  1092. human.db.leichongHaoli = nil
  1093. human.db.topupAcountDaily = nil
  1094. human.db.topupAccountMonth = nil
  1095. end
  1096. function d3.qijifen(human,value)
  1097. human.db.sevenDayGoal = human.db.sevenDayGoal or {}
  1098. human.db.sevenDayGoal[9] = human.db.sevenDayGoal[8] or {}
  1099. human.db.sevenDayGoal[9].jifen = value
  1100. end
  1101. function d3.clqirimubiao(human)
  1102. human.db.sevenDayGoal = nil
  1103. end
  1104. function d3.throne(human, str)
  1105. if str == nil then return end
  1106. local tb = Util.split(str, " ")
  1107. local id = tonumber(tb[1])
  1108. local lv = tonumber(tb[2])
  1109. if not id or not lv then return end
  1110. local TheStarsDBLogic = require("theStars.TheStarsDBLogic")
  1111. local list = TheStarsDBLogic.getThroneList()
  1112. local throne = list[id]
  1113. if not throne then return end
  1114. throne.lv = lv
  1115. TheStarsDBLogic.updateThroneDB(throne)
  1116. end
  1117. function d3.cltsts(human)
  1118. human.db.throneTime = human.db.throneTime - 14400
  1119. end
  1120. -- 删号
  1121. function d3.delaccount(human, account)
  1122. if not account then return end
  1123. local target = ObjHuman.onlineAccount[account]
  1124. if target then
  1125. return Broadcast.sendErr(human, "can't delete online")
  1126. end
  1127. local RoleDBLogic = require("role.RoleDBLogic")
  1128. if not RoleDBLogic.getDbByAccount(account) then
  1129. return Broadcast.sendErr(human, "account not exist")
  1130. end
  1131. local LuaMongo = _G.lua_mongo
  1132. local DB = require("common.DB")
  1133. local query = {}
  1134. query.account = tostring(account)
  1135. LuaMongo.remove(DB.db_char, query)
  1136. require("core.RoleDel").roleDel()
  1137. Broadcast.sendErr(human, "delete ok, account = " .. account)
  1138. end
  1139. -- 临时开指引
  1140. function d3.openguide()
  1141. require("Config").HAS_GUIDE = true
  1142. end
  1143. function d3.closeguide()
  1144. require("Config").HAS_GUIDE = false
  1145. end
  1146. -- 自动上阵
  1147. function d3.autoteam(human, combatType)
  1148. if tonumber(combatType) == nil then return end
  1149. local CombatPosLogic = require("combat.CombatPosLogic")
  1150. local str = ""
  1151. for i = 1, 6 do
  1152. if not human.db.heroBag[i] then
  1153. local heroID = require("hero.HeroDefine").getRandHeroByIsElite()
  1154. local lv = math.random(50, 100)
  1155. d3.heroadd(human, heroID .. " 1 " .. lv)
  1156. end
  1157. str = str .. i
  1158. if i % 6 == 0 then str = str .. ","
  1159. else str = str .. "|" end
  1160. end
  1161. CombatPosLogic.updatePos(human,combatType,str)
  1162. end
  1163. function d3.fcmstate(human, state)
  1164. human.fcmState = state
  1165. require("fcm.FcmLogic").checkFcm(human)
  1166. end
  1167. function d3.oltimeday(human, time)
  1168. time = tonumber(time)
  1169. if not time then return end
  1170. human.db.onlineTimeDay = time
  1171. require("fcm.FcmLogic").checkFcm(human)
  1172. end
  1173. function d3.dis(human, code)
  1174. ObjHuman.doDisconnect(human, code)
  1175. end
  1176. function d3.project(human)
  1177. local Lang = require("common.Lang")
  1178. Broadcast.sendErr(human, Lang.TEST_MULTY_PROJECT)
  1179. end
  1180. function d3.clextrabattle(human)
  1181. human.db.battleExtraReward = nil
  1182. end
  1183. function d3.clsharepf(human)
  1184. human.db.plShare = nil
  1185. end
  1186. function d3.clshareboard()
  1187. require("present.SharePlatformLogic").resetBoard()
  1188. end
  1189. function d3.sharepfall(human, cnt)
  1190. cnt = tonumber(cnt) or 15
  1191. for i = 1, cnt do
  1192. require("present.SharePlatformLogic").onShareOk(human.db.account, "account" .. i, true)
  1193. end
  1194. end
  1195. function d3.sharepf(human, accountB)
  1196. require("present.SharePlatformLogic").onShareOk(human.db.account, accountB)
  1197. end
  1198. function d3.sharepf2(human, accountA)
  1199. require("present.SharePlatformLogic").onShareOk(accountA, human.db.account)
  1200. end
  1201. function d3.sharegroup(human)
  1202. require("present.SharePlatformLogic").groupShareOK(human)
  1203. end
  1204. function d3.shareinvate(human)
  1205. require("present.SharePlatformLogic").shareInvate(human)
  1206. end
  1207. function d3.cltuisonglibao(human)
  1208. human.db.tuiSongLiBao = nil
  1209. end
  1210. function d3.clmoshou(human)
  1211. human.db.moshou = nil
  1212. end
  1213. function d3.moshoulv(human,lv)
  1214. local MoShouExcel = require("excel.moshou")
  1215. if not lv or lv <= 0 or lv > #MoShouExcel.moshouLv then return end
  1216. local MoshouLogic = require("moshou.MoshouLogic")
  1217. local isAllActive = MoshouLogic.isAllMoshouActive(human)
  1218. if not isAllActive then
  1219. local MoShouExcel = require("excel.moshou")
  1220. local config = MoShouExcel.moshouActive
  1221. for i=1,#config do
  1222. local activeTask = config[i].activeTask
  1223. for j=1,#activeTask do
  1224. human.db.moshou = human.db.moshou or {}
  1225. human.db.moshou[i] = human.db.moshou[i] or {}
  1226. human.db.moshou[i].taskGet = human.db.moshou[i].taskGet or {}
  1227. human.db.moshou[i].taskGet[j] = j
  1228. end
  1229. end
  1230. end
  1231. human.db.moshou.lv = lv
  1232. human.db.moshou.lvExp = MoShouExcel.moshouLv[lv].needJinDu
  1233. human.db.moshou.skillLV = human.db.moshou.skillLV or 1
  1234. MoshouLogic.calMoshouHero(human)
  1235. end
  1236. function d3.activemoshou(human,moshouID)
  1237. if not moshouID or moshouID <= 0 then return end
  1238. local MoShouExcel = require("excel.moshou")
  1239. local config = MoShouExcel.moshouActive
  1240. for i=1,moshouID do
  1241. local activeTask = config[i].activeTask
  1242. for j=1,#activeTask do
  1243. human.db.moshou = human.db.moshou or {}
  1244. human.db.moshou[i] = human.db.moshou[i] or {}
  1245. human.db.moshou[i].taskGet = human.db.moshou[i].taskGet or {}
  1246. human.db.moshou[i].taskGet[j] = j
  1247. end
  1248. end
  1249. if moshouID == #config then
  1250. d3.moshoulv(human,1)
  1251. end
  1252. local MoshouLogic = require("moshou.MoshouLogic")
  1253. MoshouLogic.calMoshouHero(human)
  1254. end
  1255. function d3.moshouupneed(human)
  1256. local MoShouExcel = require("excel.moshou")
  1257. local lvUpNeed1 = MoShouExcel.moshouLv[2].lvUpNeed[1][1]
  1258. local lvUpNeed2 = MoShouExcel.moshouLv[2].lvUpNeed[2][1]
  1259. d3.it(human,lvUpNeed1)
  1260. d3.it(human,lvUpNeed2)
  1261. local jingLianUp1 = MoShouExcel.moshouJingLian[2].lvUpNeed[1][1]
  1262. local jingLianUp2 = MoShouExcel.moshouJingLian[2].lvUpNeed[2][1]
  1263. d3.it(human,jingLianUp1)
  1264. d3.it(human,jingLianUp2)
  1265. local zhuhunUp = MoShouExcel.moshouZhuHun[1].costID
  1266. d3.it(human,zhuhunUp)
  1267. local skillup1 = MoShouExcel.moshouSkillLv[2].upCost[1][1]
  1268. local skillup2 = MoShouExcel.moshouSkillLv[2].upCost[2][1]
  1269. d3.it(human,skillup1)
  1270. d3.it(human,skillup2)
  1271. end
  1272. function d3.moshoujinglian(human,val)
  1273. if not human.db.moshou then return end
  1274. human.db.moshou.jingLian = val
  1275. end
  1276. function d3.clolinereward(human)
  1277. require("onlineReward.OnlineRewardLogic").initDB(human)
  1278. end
  1279. function d3.clonlinerewardget(human)
  1280. human.db.onlineReward.getId = 0
  1281. end
  1282. function d3.bartaskfinish(human)
  1283. local BarTaskLogic = require("bar.BarTaskLogic")
  1284. BarTaskLogic.initDB(human)
  1285. for taskID, taskData in pairs(human.db.bar) do
  1286. if type(taskID) == "number" then
  1287. human.db.bar[taskID].ts = 0
  1288. end
  1289. end
  1290. end
  1291. function d3.test(human)
  1292. local str = Util.format("aa{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}{16}",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)
  1293. Broadcast.sendErr(human, str)
  1294. print(str)
  1295. end
  1296. function d3.clbattle()
  1297. local DB = require("common.DB")
  1298. local LuaMongo = _G.lua_mongo
  1299. LuaMongo.remove(DB.db_battle_shark)
  1300. end
  1301. -- 设置天梯争霸状态
  1302. function d3.jjcladderstart()
  1303. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1304. local JjcLadderExcel = require("excel.jjcLadder")
  1305. local JjcLadderDefine = JjcLadderExcel.define[1]
  1306. JjcLadderLogic.onActReady()
  1307. local week = Util.getWeekDay(os.time()) - 1
  1308. if week == 0 then
  1309. week = 7
  1310. end
  1311. JjcLadderLogic.TEMP_TIMER_STAMPTIME = nil
  1312. JjcLadderDefine.startTime.week = week
  1313. JjcLadderDefine.endTime.week = week + 1
  1314. JjcLadderLogic.onTimer()
  1315. local msg = InnerMsg.lw.LW_GM
  1316. msg.gm = "jjcladderstartmiddle"
  1317. InnerMsg.sendMsg(0, msg)
  1318. end
  1319. function d3.jjcladderstartmiddle()
  1320. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1321. local JjcLadderExcel = require("excel.jjcLadder")
  1322. local JjcLadderDefine = JjcLadderExcel.define[1]
  1323. JjcLadderLogic.onActReady()
  1324. local week = Util.getWeekDay(os.time()) - 1
  1325. if week == 0 then
  1326. week = 7
  1327. end
  1328. JjcLadderLogic.TEMP_TIMER_STAMPTIME = nil
  1329. JjcLadderDefine.startTime.week = week
  1330. JjcLadderDefine.endTime.week = week + 1
  1331. JjcLadderLogic.onTimer()
  1332. end
  1333. -- 天梯争霸报错
  1334. function d3.jjcladdersign(human)
  1335. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1336. if JjcLadderLogic.getState() == JjcLadderLogic.STATE_ACT_START then
  1337. local commonDB = JjcLadderLogic.getCommonDB()
  1338. commonDB.uuid2sign = commonDB.uuid2sign or {}
  1339. commonDB.uuid2sign[human.db._id] = os.time()
  1340. JjcLadderLogic.saveCommonDB(commonDB)
  1341. JjcLadderLogic.onUpdatePos(human)
  1342. end
  1343. end
  1344. -- 天梯争霸结束回调
  1345. function d3.jjcladderend()
  1346. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1347. JjcLadderLogic.onActEnd()
  1348. local msg = InnerMsg.lw.LW_GM
  1349. msg.gm = "jjcladderendmiddle"
  1350. InnerMsg.sendMsg(0, msg)
  1351. end
  1352. function d3.jjcladderendmiddle()
  1353. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1354. JjcLadderLogic.onActEnd()
  1355. end
  1356. -- 重置天梯争霸活动信息
  1357. function d3.cljjcladder()
  1358. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1359. JjcLadderLogic.saveCommonDB()
  1360. JjcLadderLogic.onActEnd()
  1361. local msg = InnerMsg.lw.LW_GM
  1362. msg.gm = "cljjcladdermiddle"
  1363. InnerMsg.sendMsg(0, msg)
  1364. end
  1365. function d3.cljjcladdermiddle()
  1366. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1367. JjcLadderLogic.saveCommonDB()
  1368. JjcLadderLogic.onActEnd()
  1369. end
  1370. function d3.clcombat(human,val)
  1371. human.db.combatHero[val] = nil
  1372. end
  1373. function d3.clshop(human,val)
  1374. human.db.shop[val] = nil
  1375. end
  1376. -- 重置日常礼包
  1377. function d3.clrichanglibao(human)
  1378. human.db.richangLibao = nil
  1379. end
  1380. -- 重置荣耀峡谷(龙族战场)
  1381. function d3.clvalley()
  1382. local ValleyLogic = require("valley.ValleyLogic")
  1383. ValleyLogic.cleanDB()
  1384. local msg = InnerMsg.lw.LW_GM
  1385. msg.gm = "clvalleymiddle"
  1386. InnerMsg.sendMsg(0, msg)
  1387. end
  1388. function d3.clvalleymiddle()
  1389. local ValleyLogic = require("valley.ValleyLogic")
  1390. ValleyLogic.cleanDB()
  1391. end
  1392. -- 重置荣耀峡谷(龙族战场)成就
  1393. function d3.clvalleytask(human)
  1394. human.db.valleyTask = nil
  1395. end
  1396. -- 增加荣耀峡谷(龙族战场)个人成就值
  1397. function d3.valleytask1(human, value)
  1398. require("valley.ValleyTask").updateValue(human.db._id, value, 0)
  1399. end
  1400. -- 增加荣耀峡谷(龙族战场)团队成就值
  1401. function d3.valleytask2(human, value)
  1402. require("valley.ValleyTask").updateValue(human.db._id, 0, value)
  1403. end
  1404. function d3.touchLv(human,val)
  1405. local liveness = val + 0
  1406. require("union.UnionLivenessLogic").touchLv(human, liveness)
  1407. end
  1408. function d3.clyj()
  1409. local DB = require("common.DB")
  1410. local LuaMongo = _G.lua_mongo
  1411. LuaMongo.remove(DB.db_yjTreasure)
  1412. local YjTreasureDBLogic = require("yjTreasure.YjTreasureDB")
  1413. YjTreasureDBLogic.YJ_TREASURE_DB = {}
  1414. end
  1415. function d3.yjlayer(human,val)
  1416. local YjTreasureLogic = require("yjTreasure.YjTreasureLogic")
  1417. local YjTreasureDBLogic = require("yjTreasure.YjTreasureDB")
  1418. local YjTreasureExcel = require("excel.yjTreasure")
  1419. local Lang = require("common.Lang")
  1420. local layerData = YjTreasureDBLogic.getLayerDataByUuid(human.db._id)
  1421. local layCnf = YjTreasureExcel.layer
  1422. local nowLayer = layerData.layer
  1423. if val > #layCnf then return Broadcast.sendErr(human,Lang.YJTREASURE_LAYER_ERR) end
  1424. local roleData = YjTreasureDBLogic.getRoleDataByUuid(human.db._id)
  1425. local layerMax = roleData.layerMax or 0
  1426. if layerMax < val then
  1427. roleData.layerMax = val
  1428. YjTreasureDBLogic.updateRoleDataByUuid(roleData,human.db._id)
  1429. end
  1430. YjTreasureDBLogic.creatLayerDataByUuid(human.db._id,val)
  1431. YjTreasureLogic.CG_YJTREASURE_QUERY(human)
  1432. end
  1433. function d3.towerKing(human)
  1434. local HuanJingTowerLogic = require("huanjingTower.HuanjingTowerLogic")
  1435. HuanJingTowerLogic.unlockTowerKing(human)
  1436. end
  1437. -- 设置炼狱最大通关层
  1438. function d3.lianyu(human, value)
  1439. value = tonumber(value)
  1440. if not value then return end
  1441. if value < 0 then return end
  1442. local LianyuExcel = require("excel.lianyu")
  1443. if value > 0 and not LianyuExcel.gamelevel[value] then
  1444. return
  1445. end
  1446. LianyuLogic = require("lianyu.LianyuLogic")
  1447. LianyuLogic.setMaxLv(human, value)
  1448. end
  1449. function d3.cllianyu(human)
  1450. human.db.lianyu = nil
  1451. end
  1452. function d3.cllianyuhelp()
  1453. local CommonDB = require("common.CommonDB")
  1454. CommonDB.updateValue(CommonDB.KEY_LIANYU, nil)
  1455. end
  1456. -- 清除特权商店相关信息
  1457. function cltequanshop(human)
  1458. human.db.tequanShop = nil
  1459. human.db.tequanMopup = nil
  1460. if human.db.bar then
  1461. human.db.bar.vip = nil
  1462. human.db.bar.surVip = nil
  1463. end
  1464. end
  1465. function d3.addbts(human)
  1466. local now = os.time()
  1467. require("battle.BattleLogic").initBattleOut(human, now)
  1468. human.db.battleOut.expTs1 = now - 7200
  1469. human.db.battleOut.itemTs1 = now - 7200
  1470. human.db.battleOut.expTs2 = now - 7200
  1471. human.db.battleOut.itemTs2 = now - 7200
  1472. end
  1473. function d3.addbsd(human)
  1474. human.db.mopupDoCnt = 0
  1475. human.db.mopupFreeCnt = 0
  1476. end
  1477. function d3.addYjYj(human,type)
  1478. local YjTreasureLogic = require("yjTreasure.YjTreasureLogic")
  1479. YjTreasureLogic.yjYaoJiAdd(human,10,type)
  1480. end
  1481. function d3.ajfc(human,val)
  1482. for i = 1,val do
  1483. human.db.jjcDailyFight = (human.db.jjcDailyFight or 0) + 1
  1484. require("jjc.JjcDB").updateTotalFight(human.db._id)
  1485. end
  1486. end
  1487. function d3.godWartest(human)
  1488. local JjcGodWarLogic = require("jjcGodWar.JjcGodWarLogic")
  1489. JjcGodWarLogic.jjcGodWarFinishGm(human)
  1490. end
  1491. function d3.closeMiddle(human)
  1492. MiddleConnect.stopConnectMiddle()
  1493. end
  1494. function d3.resetMiddle(human)
  1495. MiddleConnect.autoResetMiddle()
  1496. end
  1497. function d3.loginSign(human, value)
  1498. value = tonumber(value)
  1499. local LoginSignLogic = require("loginSign.LoginSignLogic")
  1500. LoginSignLogic.updateGM(human, value)
  1501. end
  1502. function d3.yuanjun(human, value)
  1503. human.db.combatBackup = 1
  1504. end
  1505. function d3.buyItem(human, value)
  1506. require("shop.ShopLogic").buy(human, 9, 405007, 1, 1)
  1507. end
  1508. function d3.testTimeDelay(human,delay)
  1509. delay = assert(tonumber(delay),"invalid param")
  1510. Timer.addLater(delay,function(param)
  1511. print("=======================",param)
  1512. end,"hello world")
  1513. end
  1514. function d3.test2(human,value)
  1515. print("excute gm command test2")
  1516. local buyId = tonumber(value)
  1517. BuyLogic.buy(human,{
  1518. buyID = buyId,
  1519. order = "testetstest112",
  1520. price = 10,
  1521. account = "test322"
  1522. })
  1523. end
  1524. function d3.test1(human)
  1525. --require("absAct.MangHeLogic").draw(human, 1)
  1526. local oJsonInput = {
  1527. type=1,
  1528. id=payParams.id,--商品id
  1529. cnt=payParams.cnt, --数量
  1530. money=payParams.money, -- 金额
  1531. account=payParams.account, --账号
  1532. order=payParams.order,--订单号
  1533. region="cn",
  1534. }
  1535. local buyRet = ApiLogic.deliver(oJsonInput,{})
  1536. --[[BuyLogic.buy(human,{
  1537. buyID = 91001,
  1538. price = 6,
  1539. money = 6
  1540. })]]
  1541. end
  1542. function d3.zbsj(human,val)
  1543. if human.db.zhanbu == nil then
  1544. return
  1545. end
  1546. human.db.zhanbu.money = val
  1547. end
  1548. function d3.tjm(human)
  1549. require("present.RelationGiftLogic").relationBind(human, "017772140001")
  1550. end
  1551. function d3.qcjz(human)
  1552. human.db.unionDonate = nil
  1553. end
  1554. function d3.unionCopyLv(human, val)
  1555. require("union.UnionEctypeLogic").toUnionBossLvGm(human, tonumber(val))
  1556. end
  1557. function d3.fff(human)
  1558. human.db.leaveUnionLimit = nil
  1559. end
  1560. function d3.hgw(args)
  1561. require("absAct.HeroGrowUp").actLoop()
  1562. end
  1563. function d3.hgwlv(human,val)
  1564. require("absAct.HeroGrowUp").addJifen(human,tonumber(val))
  1565. end
  1566. function d3.paoma(human, val)
  1567. require("chat.ChatPaoMaLogic").notice(val)
  1568. end
  1569. -- 设置合服时间
  1570. function d3.merge(human,value)
  1571. value = value and tonumber(value)
  1572. if value == nil then
  1573. local mergeSvrTime = CommonDB.getMergeServerTime()
  1574. if mergeSvrTime == 0 then
  1575. Broadcast.sendErr(human, "未设置合服时间")
  1576. else
  1577. local tb = os.date("%Y%m%d", mergeSvrTime)
  1578. Broadcast.sendErr(human, "当前合服时间为" .. tb)
  1579. end
  1580. else
  1581. local now = os.time()
  1582. local temp = Util.getDayStartTime(now)
  1583. temp = temp - (value - 1) * 24 * 3600
  1584. CommonDB.setMergeTime(temp)
  1585. local tb = os.date("%Y%m%d", temp)
  1586. Broadcast.sendErr(human, "设置当前合服时间为" .. tb)
  1587. --同步中心服开服时间
  1588. --[[local msgRet = InnerMsg.lw.LW_OS
  1589. msgRet.uuid = human.db._id
  1590. msgRet.value = temp
  1591. InnerMsg.sendMsg(0, msgRet)]]
  1592. end
  1593. end
  1594. --重置看广告获取高级召唤卷次数
  1595. function d3.resetad(human)
  1596. human.db.adRewardCnt = 0
  1597. end
  1598. --重置看广告加速孵化次数
  1599. function d3.resetadhatch(human)
  1600. human.db.adHatchRewardCnt = 0
  1601. end